from header_common import *
from header_dialogs import *
from header_operations import *
from header_parties import *
from header_item_modifiers import *
from header_skills import *
from header_triggers import *
from header_items import *
from ID_troops import *
from ID_party_templates import *

from header_game_menus import * #chief tf_male ok

from module_constants import *

# Ruler
# "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"

####################################################################################################################
# During a dialog, the dialog lines are scanned from top to bottom.
# If the dialog-line is spoken by the player, all the matching lines are displayed for the player to pick from.
# If the dialog-line is spoken by another, the first (top-most) matching line is selected.
#
#  Each dialog line contains the following fields:
# 1) Dialogue partner: This should match the person player is talking to.
#    Usually this is a troop-id.
#    You can also use a party-template-id by appending '|party_tpl' to this field.
#    Use the constant 'anyone' if you'd like the line to match anybody.
#    Appending '|plyr' to this field means that the actual line is spoken by the player
#    Appending '|other(troop_id)' means that this line is spoken by a third person on the scene.
#       (You must make sure that this third person is present on the scene)
#
# 2) Starting dialog-state:
#    During a dialog there's always an active Dialog-state.
#    A dialog-line's starting dialog state must be the same as the active dialog state, for the line to be a possible candidate.
#    If the dialog is started by meeting a party on the map, initially, the active dialog state is "start"
#    If the dialog is started by speaking to an NPC in a town, initially, the active dialog state is "start"
#    If the dialog is started by helping a party defeat another party, initially, the active dialog state is "party_relieved"
#    If the dialog is started by liberating a prisoner, initially, the active dialog state is "prisoner_liberated"
#    If the dialog is started by defeating a party led by a hero, initially, the active dialog state is "enemy_defeated"
#    If the dialog is started by a trigger, initially, the active dialog state is "event_triggered"
# 3) Conditions block (list): This must be a valid operation block. See header_operations.py for reference.
# 4) Dialog Text (string):
# 5) Ending dialog-state:
#    If a dialog line is picked, the active dialog-state will become the picked line's ending dialog-state.
# 6) Consequences block (list): This must be a valid operation block. See header_operations.py for reference.
# 7) Voice-over (string): sound filename for the voice over. Leave here empty for no voice over
####################################################################################################################

dialogs = [
  
  [anyone|plyr,"start",[
      (this_or_next|eq,"$talk_context",tc_tavern_talk),
      (this_or_next|eq,"$talk_context",tc_court_talk),
      (eq,"$talk_context",tc_town_talk),
      (store_conversation_agent,"$talk_agent"),
      (agent_slot_ge,"$talk_agent",slot_agent_is_blocked,1)],
    "This person seems busy. Maybe I should move on...","blocked_agent",[]],
  [anyone|plyr,"blocked_agent",[],
    "I'm sorry. I didn't mean to disturb you.","close_window",[(call_script,"script_teleport_talk_agent_to_initial_pos")]],
  [anyone|plyr,"blocked_agent",[],
    "[Just Leave]","close_window",[(call_script,"script_teleport_talk_agent_to_initial_pos")]],
  
  ###################
  
  [anyone ,"start", [
      (store_conversation_troop, "$g_talk_troop"),
      (store_conversation_agent, "$g_talk_agent"),
      #                     (troop_get_slot, "$g_talk_troop_relation", "$g_talk_troop", slot_troop_player_relation),
      (call_script, "script_troop_get_player_relation", "$g_talk_troop"),
      (assign, "$g_talk_troop_relation", reg0),
      #					   (troop_set_slot, "$g_talk_troop", slot_troop_player_relation, "$g_talk_troop_relation"),
      #This may be different way to handle persuasion, which might be a little more transparent to the player in its effects
      #Persuasion will affect the player's relation with the other character -- but only for 1 on 1 conversations
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (assign, "$g_talk_troop_effective_relation", "$g_talk_troop_relation"),
      (val_add, "$g_talk_troop_effective_relation", ":persuasion"),
      (try_begin),
        (gt, "$g_talk_troop_effective_relation", 0),
        (store_add, ":persuasion_modifier", 10, ":persuasion"),
        (val_mul, "$g_talk_troop_effective_relation", ":persuasion_modifier"),
        (val_div, "$g_talk_troop_effective_relation", 10),
      (else_try),
        (lt, "$g_talk_troop_effective_relation", 0),
        (store_sub, ":persuasion_modifier", 20, ":persuasion"),
        (val_mul, "$g_talk_troop_effective_relation", ":persuasion_modifier"),
        (val_div, "$g_talk_troop_effective_relation", 20),
      (try_end),
      (val_clamp, "$g_talk_troop_effective_relation", -100, 101),
      (try_begin),
        (eq, "$cheat_mode", 1),
        (assign, reg3, "$g_talk_troop_effective_relation"),
        (display_message, "str_test_effective_relation_=_reg3"),
      (try_end),
      
      (try_begin),
        (this_or_next|is_between, "$g_talk_troop", village_elders_begin, village_elders_end),
        (this_or_next|is_between, "$g_talk_troop", "trp_castle_1_seneschal", "trp_town_1_arena_master"),
        (is_between, "$g_talk_troop", mayors_begin, mayors_end),
        #phaiak begin
        (this_or_next|neq, "$g_talk_troop", "trp_village_150_elder"),	#show village relation if it isn't Thonkrik
        (neq, "$campaign_type", camp_storyline),						#or if it is Thonkrik but isn't the storyline
        #phaiak end
        (party_get_slot, "$g_talk_troop_relation", "$current_town", slot_center_player_relation),
      (try_end),
      
      (try_begin),
        (troop_slot_ge, "$g_talk_troop", slot_troop_leaded_party, 1),
        (troop_get_slot, "$g_talk_troop_party", "$g_talk_troop", slot_troop_leaded_party),
      (else_try),
        (assign, "$g_talk_troop_party", "$g_encountered_party"),
      (try_end),
      
      (store_troop_faction, "$g_talk_troop_faction", "$g_talk_troop"),
      (store_relation, "$g_talk_troop_faction_relation", "$g_talk_troop_faction", "fac_player_faction"),
      (store_relation, "$g_talk_troop_faction_kingdom_relation", "$g_talk_troop_faction", "$players_kingdom"),
      
      (try_begin),
        (eq, "$players_kingdom", 0),
        (assign, "$g_talk_troop_faction_kingdom_relation", 0),
      (try_end),
      
      (try_begin),
        (eq, "$cheat_mode", 1),
        (str_store_troop_name, s1, "$g_talk_troop"),
        
        (try_begin),
          (party_is_active, "$g_talk_troop_party"),
          (str_store_party_name, s2, "$g_talk_troop_party"),
        (else_try),
          (str_store_string, s2, "str_none"),
        (try_end),
        
        (try_begin),
          (party_is_active, "$g_encountered_party"),
          (str_store_party_name, s3, "$g_encountered_party"),
        (else_try),
          (str_store_string, s3, "str_none"),
        (try_end),
        
        (str_store_faction_name, s4, "$g_talk_troop_faction"),
        (assign, reg1, "$g_talk_troop_relation"),
        (assign, reg2, "$g_talk_troop_faction_relation"),
        (assign, reg3, "$g_talk_troop_faction_kingdom_relation"),
        (display_message, "@{!}DEBUG: Talk troop {s1} party {s2} faction {s4} at {s3}. Relations: personal {reg1} faction/personal {reg2} faction/kingdom {reg3}"),
      (try_end),
      
      (store_current_hours, "$g_current_hours"),
      (troop_get_slot, "$g_talk_troop_last_talk_time", "$g_talk_troop", slot_troop_last_talk_time),
      (troop_set_slot, "$g_talk_troop", slot_troop_last_talk_time, "$g_current_hours"),
      (store_sub, "$g_time_since_last_talk","$g_current_hours","$g_talk_troop_last_talk_time"),
      (troop_get_slot, "$g_talk_troop_met", "$g_talk_troop", slot_troop_met),
      (val_min, "$g_talk_troop_met", 1), #the global variable goes no higher than one
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_troop_met, 0),
        (troop_set_slot, "$g_talk_troop", slot_troop_met, 1),
        
        #Possible later activations of notes
        (try_begin),
          (is_between, "$g_talk_troop", kingdom_ladies_begin, kingdom_ladies_end),
        (try_end),
        
      (try_end),
      
      (try_begin),
        #                       (this_or_next|eq, "$talk_context", tc_party_encounter),
        #                       (this_or_next|eq, "$talk_context", tc_castle_commander),
        (call_script, "script_party_calculate_strength", "p_collective_enemy",0),
        (assign, "$g_enemy_strength", reg0),
        (call_script, "script_party_calculate_strength", "p_main_party",0),
        (assign, "$g_ally_strength", reg0),
        (store_mul, "$g_strength_ratio", "$g_ally_strength", 100),
        (assign, ":enemy_strength", "$g_enemy_strength"), #these two lines added to avoid div by zero error
        (val_max, ":enemy_strength", 1),
        (val_div, "$g_strength_ratio", ":enemy_strength"),
      (try_end),
      
      (assign, "$g_comment_found", 0),
      
      (assign, "$g_comment_has_rejoinder", 0),
      (assign, "$g_romantic_comment_made", 0),
      (assign, "$skip_lord_assumes_argument", 0), #a lord pre-empts a player's issue, ie, when the player is conducting a rebellion
      (assign, "$bypass_female_vassal_explanation", 0),
      (assign, "$g_done_wedding_comment", 0),
      
      #					 (assign, "$g_time_to_spare", 0),
      
      
      (try_begin),
        (troop_is_hero, "$g_talk_troop"),
        (talk_info_show, 1),
        (call_script, "script_setup_talk_info"),
      (try_end),
      
      (assign, "$g_last_comment_copied_to_s42", 0),
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
        (call_script, "script_get_relevant_comment_to_s42"),
        (assign, "$g_comment_found", reg0),
      (try_end),
      
      (troop_get_type, reg65, "$g_talk_troop"),
      (val_mod, reg65, 2),
      (try_begin),
        (faction_slot_eq,"$g_talk_troop_faction",slot_faction_leader,"$g_talk_troop"),
        (str_store_string,s64,"@{reg65?my Lady:my Lord}"), #bug fix
        (str_store_string,s65,"@{reg65?my Lady:my Lord}"),
        (str_store_string,s66,"@{reg65?My Lady:My Lord}"),
        (str_store_string,s67,"@{reg65?My Lady:My Lord}"), #bug fix
      (else_try),
        (str_store_string,s64,"@{reg65?madame:sir}"), #bug fix
        (str_store_string,s65,"@{reg65?madame:sir}"),
        (str_store_string,s66,"@{reg65?Madame:Sir}"),
        (str_store_string,s67,"@{reg65?Madame:Sir}"), #bug fix
      (try_end),
      
      (try_begin),
        (gt, "$cheat_mode", 0),
        (assign, reg4, "$talk_context"),
        (display_message, "@{!}DEBUG -- Talk context: {reg4}"),
      (try_end),
      
      (try_begin),
        (gt, "$cheat_mode", 0),
        (assign, reg4, "$g_time_since_last_talk"),
        (display_message, "@{!}DEBUG -- Time since last talk: {reg4}"),
      (try_end),
      
      
      (try_begin),
        (eq, "$cheat_mode", 0),
        (store_partner_quest, ":quest"),
        (ge, ":quest", 0),
        (str_store_quest_name, s4, ":quest"),
        
      (try_end),
      
      (eq, 1, 0)],
    "{!}Warning: This line is never displayed. It is just for storing conversation variables.", "close_window", []],
  
  [anyone ,"member_chat", [
      (store_conversation_troop, "$g_talk_troop"),
      #phaiak begin
      (call_script, "script_troop_get_player_relation", "$g_talk_troop"),
      (assign, "$g_talk_troop_relation", reg0),
      #phaiak end
      (try_begin),
        #phaiak begin
        (eq, "$campaign_type", camp_storyline),
        (is_between, "$g_talk_troop", companions_begin, companions_end),
        (talk_info_show, 1),
        (call_script, "script_setup_talk_info"),
      (else_try),
        #phaiak end
        (is_between, "$g_talk_troop", companions_begin, companions_end),
        (talk_info_show, 1),
        (call_script, "script_setup_talk_info_companions"),
      (else_try),
        (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
        (talk_info_show, 1),
        (call_script, "script_setup_talk_info"),
      (try_end),
      
      (troop_get_type, reg65, "$g_talk_troop"),
      (val_mod, reg65, 2),
      
      (troop_get_type, reg65, "$g_talk_troop"),
      (val_mod, reg65, 2),
      (try_begin),
        (faction_slot_eq,"$g_talk_troop_faction",slot_faction_leader,"$g_talk_troop"),
        (str_store_string,s64,"@{reg65?my Lady:my Lord}"), #bug fix
        (str_store_string,s65,"@{reg65?my Lady:my Lord}"),
        (str_store_string,s66,"@{reg65?My Lady:My Lord}"),
      (else_try),
        (str_store_string,s64,"@{reg65?madame:sir}"), #bug fix
        (str_store_string,s65,"@{reg65?madame:sir}"),
        (str_store_string,s66,"@{reg65?Madame:Sir}"),
      (try_end),
      
      (store_current_hours, "$g_current_hours"),
      (troop_set_slot, "$g_talk_troop", slot_troop_last_talk_time, "$g_current_hours"),
      
      (eq, 1, 0)],
    "{!}Warning: This line is never displayed. It is just for storing conversation variables.", "close_window", []],
  
  [anyone ,"event_triggered", [(store_conversation_troop, "$g_talk_troop"),
      
      #phaiak begin
      (call_script, "script_troop_get_player_relation", "$g_talk_troop"),
      (assign, "$g_talk_troop_relation", reg0),
      #phaiak end
      
      (try_begin),
        #phaiak begin
        #(display_message, "@{!}TEST in event_triggered A"),
        (eq, "$campaign_type", camp_storyline),
        (is_between, "$g_talk_troop", companions_begin, companions_end),
        (talk_info_show, 1),
        #(display_message, "@{!}TEST in event_triggered B"),
        (call_script, "script_setup_talk_info"),
      (else_try),
        #phaiak end
        (is_between, "$g_talk_troop", companions_begin, companions_end),
        (talk_info_show, 1),
        (call_script, "script_setup_talk_info_companions"),
      (try_end),
      
      (troop_get_type, reg65, "$g_talk_troop"),
      (val_mod, reg65, 2),
      (try_begin),
        (faction_slot_eq,"$g_talk_troop_faction",slot_faction_leader,"$g_talk_troop"),
        (str_store_string,s64,"@{reg65?my Lady:my Lord}"), #bug fix
        (str_store_string,s65,"@{reg65?my Lady:my Lord}"),
        (str_store_string,s66,"@{reg65?My Lady:My Lord}"),
      (else_try),
        (str_store_string,s64,"@{reg65?madame:sir}"), #bug fix
        (str_store_string,s65,"@{reg65?madame:sir}"),
        (str_store_string,s66,"@{reg65?Madame:Sir}"),
      (try_end),
      
      
      (eq, 1, 0)],
    "{!}Warning: This line is never displayed. It is just for storing conversation variables.", "close_window", []],
  
  
  #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> No dialogs should be before this line! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<#
  
  #############################
  ## PHAIAK MOVED THIS BEGIN ##
  #############################
  
  ### PART 1
  
  #dog companion talk #VC-2111
  [trp_dog|plyr, "start",[(str_store_troop_name, s1, "trp_dog"), (eq, "$dog_companion", 1),], "{!}{s1}.", "dog_talk_2", []],
  [trp_dog|plyr, "dog_talk_1",[(str_store_troop_name, s1, "trp_dog"),], "{!}{s1}.", "dog_talk_2", []],
  [anyone|plyr, "dog_talk_2",[],"Heel!", "close_window",[(assign, "$dog_order", 1),(agent_play_sound, "$player_dog_agent_no", "snd_dog_bark"),]],
  [anyone|plyr, "dog_talk_2",[],"Go, {s1}, go!", "close_window",[(assign, "$dog_order", 0),(agent_play_sound, "$player_dog_agent_no", "snd_dog_bark"),]],
  [anyone|plyr, "dog_talk_2",[],"{s1}, stay!", "close_window",[(assign, "$dog_order", -1),(agent_play_sound, "$player_dog_agent_no", "snd_dog_bark"),]],
  [anyone|plyr, "dog_talk_2",[],"Here, I have something for you ...", "dog_talk_pretrain", []],
  [anyone|plyr, "dog_talk_2",[],"I'll call you...", "close_window",[(start_presentation, "prsnt_name_dog"),]],
  [anyone|plyr, "dog_talk_2",[],"Bad dog! Go away! I don't want you any more!", "close_window",
    [(assign, "$dog_companion", 0),
      (agent_clear_scripted_mode, "$player_dog_agent_no"),
      (agent_start_running_away, "$player_dog_agent_no"),
      (agent_play_sound, "$player_dog_agent_no", "snd_dog_whine"),
      (str_store_string, s7, "@Dog"),
      (troop_set_name, "trp_dog", s7),]],
  [anyone|plyr, "dog_talk_2",[],"Drop it!", "close_window",[(agent_play_sound, "$player_dog_agent_no", "snd_dog_growl"),]],
  #[anyone|plyr, "dog_talk_2",[],"You are a good dog!", "close_window",[]],
  # [trp_dog, "dog_talk_happy",[], "Woof woof", "close_window", []],
  # [trp_dog, "dog_talk_angry",[], "Grrr", "close_window", []],
  [trp_dog|plyr, "start",[(agent_play_sound, "$player_dog_agent_no", "snd_dog_growl"),], "___", "dog_talk_recruit", []],
  [anyone|plyr, "dog_talk_recruit", [(player_has_item, "itm_sausages"),],"Here, have a sausage!", "dog_talk_1",
    [(troop_remove_item, "trp_player", "itm_sausages"),
      (agent_play_sound, "$player_dog_agent_no", "snd_dog_bark"),
      (assign, "$dog_companion", 1),
      (assign, "$dog_order", 1),]],
  [anyone|plyr, "dog_talk_recruit",[],"Good dog!", "close_window",[(agent_play_sound, "$player_dog_agent_no", "snd_dog_bark"),]],
  [anyone|plyr, "dog_talk_recruit",[],"Away!", "close_window",[(agent_play_sound, "$player_dog_agent_no", "snd_dog_whine"),]],
  
  
  # Dog training
  [anyone|plyr, "dog_talk_pretrain",[],"Here, I have something for you ...", "dog_talk_train", []],
  [anyone|plyr, "dog_talk_train",
    [
      (store_troop_health, ":health", "trp_dog"),
      (lt, ":health", 90),
      (player_has_item, "itm_sausages"),
      (str_store_item_name, s7, "itm_sausages"),
    ],"You don't look healthy. Here, have a {s7}!", "dog_talk_pretrain",
    [
      (troop_remove_item, "trp_player", "itm_sausages"),
      (troop_set_health, "trp_dog", 100),
      (agent_play_sound, "$player_dog_agent_no", "snd_dog_bark"),
  ]],
  [anyone|plyr, "dog_talk_train",
    [
      #(store_skill_level, ":level", "skl_, "trp_dog"),
      (store_attribute_level, ":level", "trp_dog", ca_strength),
      (lt, ":level", 30),
      (player_has_item, "itm_cattle_meat"),
      (str_store_item_name, s7, "itm_cattle_meat"),
    ],"Here, this {s7} will make you stronger!", "dog_talk_pretrain",
    [
      (troop_remove_item, "trp_player", "itm_cattle_meat"),
      (troop_raise_attribute, "trp_dog", ca_strength, 1),
      (agent_play_sound, "$player_dog_agent_no", "snd_dog_bark"),
  ]],
  [anyone|plyr, "dog_talk_train",
    [
      (store_skill_level, ":level", "skl_power_strike", "trp_dog"),
      (lt, ":level", 10),
      (player_has_item, "itm_venison"),
      (str_store_item_name, s7, "itm_venison"),
    ],"I want you to be tougher. Here is some {s7}. It's good for you!", "dog_talk_pretrain",
    [
      (troop_remove_item, "trp_player", "itm_venison"),
      (troop_raise_skill, "trp_dog", "skl_power_strike", 1),
      (agent_play_sound, "$player_dog_agent_no", "snd_dog_bark"),
  ]],
  [anyone|plyr, "dog_talk_train",
    [
      (store_skill_level, ":level", "skl_ironflesh", "trp_dog"),
      (lt, ":level", 10),
      (player_has_item, "itm_pork"),
      (str_store_item_name, s7, "itm_pork"),
    ],"You are too thin. Here, have some {s7}!", "dog_talk_pretrain",
    [
      (troop_remove_item, "trp_player", "itm_pork"),
      (troop_raise_skill, "trp_dog", "skl_ironflesh", 1),
      (agent_play_sound, "$player_dog_agent_no", "snd_dog_bark"),
  ]],
  [anyone|plyr, "dog_talk_train",
    [
      (store_skill_level, ":level", "skl_riding", "trp_dog"),
      (lt, ":level", 10),
      (player_has_item, "itm_chicken"),
      (str_store_item_name, s7, "itm_chicken"),
    ],"You could be faster, my friend. Here is some {s7} for you!", "dog_talk_pretrain",
    [
      (troop_remove_item, "trp_player", "itm_chicken"),
      (troop_raise_skill, "trp_dog", "skl_riding", 1),
      (agent_play_sound, "$player_dog_agent_no", "snd_dog_bark"),
  ]],
  [anyone|plyr, "dog_talk_train",
    [
      (store_proficiency_level, ":level", "trp_dog", wpt_polearm),
      (lt, ":level", 360),
      (player_has_item, "itm_dried_meat"),
      (str_store_item_name, s7, "itm_dried_meat"),
    ],"Here is some {s7} for your teeth!", "dog_talk_pretrain",
    [
      (troop_remove_item, "trp_player", "itm_dried_meat"),
      (troop_raise_proficiency_linear, "trp_dog", wpt_polearm, 30),
      (agent_play_sound, "$player_dog_agent_no", "snd_dog_bark"),
  ]],
  [anyone|plyr, "dog_talk_train",[(ge, "$cheat_mode", 1),],"{!}CHEAT: See stats.", "dog_talk_pretrain",[[change_screen_view_character]]],
  [anyone|plyr, "dog_talk_train",[],"I have no more food for you.", "dog_talk_1",[]],
  [anyone|plyr, "dog_talk_train",[],"That's all for today.", "dog_talk_1",[]],
  
  #funeral npc dialog
  [trp_pagano, "start",
    [],
    "You should go down to your mother and drop off something she can use on her way to Walhalla.", "close_window",
    [
      (try_begin),
        (get_player_agent_no, ":player_agent"),
        (agent_get_item_slot, ":item", ":player_agent", 0),
        (try_begin),
          (le, ":item", 0),
          (agent_equip_item, ":player_agent", "itm_spatha", 1),
          #(agent_set_wielded_item, ":player_agent", "itm_spatha"),
        (else_try),
          #(agent_set_wielded_item, ":player_agent", ":item"),
        (end_try),
      (end_try),
  ]],
  
  #Shipwright Begin chief puertos
  [trp_town_11_shipwright, "start",
    [(eq, "$g_encountered_party", "p_frisa_beach"),(check_quest_active,"qst_getting_ship"),(quest_slot_eq,"qst_getting_ship",slot_quest_current_state, 1),],
    # "Thonkrik was clear: the girl should go with you.", "close_window",
    "I'm waiting for somebody who is coming with a girl. Have you seen them?", "close_window",
    []],
  # [trp_town_11_shipwright, "start",
  # [(eq, "$g_encountered_party", "p_frisa_beach"),(check_quest_active,"qst_getting_ship"),(quest_slot_eq,"qst_getting_ship",slot_quest_current_state, 2),],
  # "The ship is yours. Good travels!", "close_window",
  # [
  # (assign, "$beda_story_1", 2), #beda story se activa.
  # (quest_set_slot,"qst_getting_ship", slot_quest_current_state, 3),
  # #  (call_script, "script_end_quest", "qst_getting_ship"),
  # (add_xp_as_reward,50),
  # (disable_party, "p_frisa_beach"), #esconde la playa
  # ]],
  
  [trp_town_11_shipwright, "start",
    [(check_quest_active,"qst_getting_ship"),(quest_slot_eq,"qst_getting_ship",slot_quest_current_state, 2),],
    "Ah, you are {playername}. Thonkrik told me you would come here. Get on the ship. My men and I will show you how easily she sails.", "close_window",
    [
      (assign, "$beda_story_1", 2), #beda story se activa.
      (quest_set_slot,"qst_getting_ship", slot_quest_current_state, 3),
      (add_xp_as_reward,100),
  ]],
  
  [anyone, "start",	#Auto travel from menu
    [
      (eq, "$curr_menu_slot", slot_quest_menu_auto_sea_travel),
      (store_conversation_troop, "$g_talk_troop"),
      (is_between,"$g_talk_troop",shipwrights_begin, shipwrights_end),
    ],
    "Heill! Are you looking to travel to another town?", "port_chief_travel",
    []],
  
  # [anyone, "start",
  # [(store_conversation_troop, "$g_talk_troop"),
  # (this_or_next|is_between,"$g_talk_troop",shipwrights_begin, shipwrights_end),
  # (eq, "$g_talk_troop", "trp_town_11_shipwright"),
  # (troop_slot_eq, "$g_talk_troop", slot_troop_met_previously, 0),],
  # "Welcome, {reg59?lady:sir}.", "port_chief",
  # []],
  
  [trp_town_11_shipwright, "start",
    [(check_quest_active,"qst_getting_ship"),(quest_slot_eq,"qst_getting_ship",slot_quest_current_state, 3),],
    "Please wait for everybody to board the ship.", "close_window",
    [
      (call_script, "script_give_agent_position_on_ship", 10, "$dyn_ship1"),
      (agent_set_position, "$talk_agent", pos4),#VC-3092
  ]],
  
  [anyone, "start",
    [
      (store_conversation_troop, "$g_talk_troop"),
      (is_between,"$g_talk_troop",shipwrights_begin, shipwrights_end),
      (try_begin),
        (party_slot_eq, "$current_town", slot_party_1_ship_type, 0),
        #(str_store_string, s1, "@Welcome, {reg59?lady:sir}.I am the shipwright here. "),
        (str_store_string, s1, "@Welcome, landlubber. I am the shipwright here."),
      (else_try),
        (party_get_slot, ":curr_ship_type", "$current_town", slot_party_1_ship_type),
        (party_get_slot, ":curr_ship_name", "$current_town", slot_party_1_ship_name),
        (try_begin),
          (is_between, ":curr_ship_name", "trp_pseudo_troop_01", "trp_pseudo_troop_end"),
          (str_store_troop_name, s7, ":curr_ship_name"),
        (else_try),
          (str_store_string, s7, ":curr_ship_name"),
        (end_try),
        (party_get_slot, ":curr_ship_quality", "$current_town", slot_party_1_ship_quality),
        (party_get_slot, ":curr_ship_propertys", "$current_town", slot_party_1_ship_propertys),
        (call_script, "script_decode_value", ":curr_ship_propertys"),
        #(assign, ":current_ship_dragon", reg4),# ship dragon head
        (assign, ":curr_ship_paint", reg3),
        #(assign, ":curr_ship_sail", reg2),
        (assign, ":curr_ship_wood", reg1),
        (try_begin),
          (is_between, ":curr_ship_type", 1, 3),
          (str_store_string, s2, "@Welcome, {reg59?lady:lord} {playername}."),
        (else_try),
          (is_between, ":curr_ship_type", 3, 5),
          (str_store_string, s2, "@Welcome, {reg59?madame:sir}."),
        (else_try),
          #(is_between, ":curr_ship_type", 5, 7),
          (str_store_string, s2, "@Welcome."),
        (end_try),
        
        (try_begin),
          (le, ":curr_ship_quality", 40),
          (str_store_string, s3, "@Your ship is in a bad condition. You should consider repairing it here in my shipyard."),
        (else_try),
          (is_between, ":curr_ship_type", 1, 3),
          (eq, ":curr_ship_wood", 1),
          (neq, ":curr_ship_paint", 0),
          (str_store_string, s3, "@The {s7} is the most glorious ship I have ever seen. It is a great honour, my {reg59?lady:lord}, to have her here in our port."),
        (else_try),
          (eq, ":curr_ship_wood", 3),
          (str_store_string, s3, "@Your ship is of poor quality. You may want to consider buying a better ship from me."),
        (else_try),
          (eq, ":curr_ship_wood", 2),
          (str_store_string, s3, "@That's a decent ship you have there."),
        (else_try),
          (eq, ":curr_ship_wood", 1),
          (eq, ":curr_ship_paint", 0),
          (str_store_string, s3, "@Your ship, the {s7}, is marvellous. My workers could apply some fresh varnish and paint if you like."),
        (else_try),
          (eq, ":curr_ship_wood", 1),
          (str_store_string, s3, "@The {s7} is a wonderful ship. I'm happy to see her in my port."),
        (else_try),
          (str_clear, s3),
        (end_try),
        (str_store_string, s1, "@{s2} {s3}"),
      (end_try),
      
    ],
    "{!}{s1}", "port_chief2",
    []],
  
  # [anyone|plyr, "port_chief",
  # [(troop_slot_eq, "$g_talk_troop", slot_troop_met_previously, 0),],
  # "Good day, my name is {playername}. What are you?", "port_chief2",
  # []],
  [anyone, "port_chief2",[],
    "What do you need?", "port_chief3",
    []],
  
  #quest flota chief fleet
  [anyone|plyr, "port_chief3",[      (eq, "$g_encountered_party", "p_town_4"),(check_quest_active,"qst_the_fleet"),(quest_slot_eq,"qst_the_fleet",slot_quest_current_state, 3),
      ],"Greetings. I have come to join the fleet of Sven Bull Neck and Harald Haraldsson that will travel to Englaland.", "port_chief_fleet1",[]],
  ###quest bodo letter chief
  [anyone|plyr, "port_chief3",[      (eq, "$g_encountered_party", "p_town_4"),
      (neg|check_quest_active,"qst_entregando_pieles"),
      (neg|check_quest_succeeded,"qst_entregando_pieles"),
      (check_quest_active,"qst_bodo_letter"),(quest_slot_eq,"qst_bodo_letter",slot_quest_current_state, 1),
      ],"A man named Atli Eiriksson left this port some time ago. Do you know where he was going?", "port_chief_bodoletter1",[]],
  [anyone|plyr, "port_chief3",[      (eq, "$g_encountered_party", "p_town_4"),
      (check_quest_succeeded,"qst_entregando_pieles"),(quest_slot_eq,"qst_entregando_pieles",slot_quest_current_state, 2),
      ],"I have given the skins to Hogni, now it's your turn. Where is Atli Eiriksson?", "port_chief_pieles",[
      (quest_set_slot,"qst_entregando_pieles",slot_quest_current_state, 3),
      (call_script, "script_end_quest", "qst_entregando_pieles"),
      (add_xp_as_reward,300),
      (call_script, "script_change_troop_renown", "trp_player", 10),
      (call_script, "script_change_player_relation_with_center", "p_town_4", 5),
      #   (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
  ]],
  
  ###quest descubrir guarida de sven bull neck chief
  [anyone|plyr, "port_chief3",[      (eq, "$g_encountered_party", "p_town_4"),
      (check_quest_active,"qst_cathach_colum"),(quest_slot_eq,"qst_cathach_colum",slot_quest_current_state, 4),
      ],"I was at Gleann Da Loch and took 'The Cathach of Colum Cille.'", "port_chief_catach",[]],
  [anyone|plyr, "port_chief3",[      (eq, "$g_encountered_party", "p_town_4"),
      (check_quest_active,"qst_cathach_colum"),#(quest_slot_lt,"qst_cathach_colum",slot_quest_current_state, 4),
      (quest_get_slot,":stage","qst_cathach_colum",slot_quest_current_state),
      (lt, ":stage", 4),
      ],"Unfortunately, Gleann Da Loch is too far. Would you take money instead?", "port_chief_catach32",[]],
  
  [anyone|plyr, "port_chief3",[      (eq, "$g_encountered_party", "p_town_4"),
      (check_quest_active,"qst_sven_lair"),(quest_slot_eq,"qst_sven_lair",slot_quest_current_state, 1),
      ],"You know what I want. Where is the hideout of Sven Bull Neck?", "port_chief_svenlair",[]],
  ###
  
  ###Port chief non quest dialogs begin
  
  # 1. BUY SHIP
  [anyone|plyr, "port_chief3",[(neq, "$g_encountered_party", "p_frisa_beach"), ],"I want to buy a ship.", "port_chief_buy_ship",[]],
  
  [anyone, "port_chief_buy_ship",[],"Follow me!", "close_window",
    [
      (change_screen_return),
      (assign, "$ship_menu_state", 8),
      (assign, "$vc_menu_active", "prsnt_vc_submenu_ships"),
      #(finish_mission, 0),
  ]],
  
  # 2. INFO
  [anyone|plyr, "port_chief3",[(neq, "$g_encountered_party", "p_frisa_beach"),],"I have some questions about ships and sea travel.", "port_chief_info_main",[]],
  
  [anyone, "port_chief_info_main",[],"What do you want to know?", "port_chief_info_main_1",[]],
  [anyone|plyr, "port_chief_info_main_1",[],"Why do people go to sea?", "port_chief_info_a_1",[]],
  [anyone|plyr, "port_chief_info_main_1",[],"How do I find my way at sea?", "port_chief_info_b_1",[]],
  [anyone|plyr, "port_chief_info_main_1",[],"What do I need to know if I want to buy a ship?", "port_chief_info_c_1",[]],
  [anyone|plyr, "port_chief_info_main_1",[],"What makes a ship fast?", "port_chief_info_d_1",[]],
  [anyone|plyr, "port_chief_info_main_1",[],"That's all I wanted to know. Thanks!", "port_chief2",[]],
  
  [anyone, "port_chief_info_a_1",[],"You can earn a lot of money if you trade goods or slaves across the sea. Others use it for raiding settlements. Finally, no Viking will respect you as a leader if you don't have a good ship.", "port_chief_info_main",[]],
  [anyone, "port_chief_info_b_1",[],"Look at the sun at day. Rest at night. The better you are at finding your way, the faster you travel.", "port_chief_info_main",[]],
  [anyone, "port_chief_info_c_1",[],"First, you need to know what type of ship you want. If you want to trade, then a Knorr may be a good choice. They have much room for cargo, but they are not very fast. The Snekkja, the Skei and the Busse are fast warships and are able to carry many troops. The Karvi is something in-between. If you only have a few men, then a small ship like a Byrding would perhaps suit you better.", "port_chief_info_c_2",[]],
  [anyone, "port_chief_info_c_2",[],"The second important factor is the type of wood the ship is made from. Ships made out of oak wood are the best ships, but are also expensive. Beech is cheaper, but it rots faster.", "port_chief_info_main",[]],
  [anyone, "port_chief_info_d_1",[],"The wind -- if you place your sails in a position to catch it best. If there is no wind at all, then your crew has to row. More rowers will make the ship faster. If you have more than one ship in your fleet, then your fleet will only be as fast as your slowest ship. A skilled Navigator can also make your fleet faster.", "port_chief_info_main",[]],
  
  # 3.1 TRAVEL
  [anyone|plyr, "port_chief3",[],"I want to travel to another port.", "port_chief_travel",[]],
  
  [anyone, "port_chief_travel",#VC-2874
    [
      (is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
      (faction_slot_eq,  "$players_kingdom", slot_faction_marshal, "trp_player"),
      ],"I'm sorry. There are currently no passenger ships in this port that can transport a marshal and his whole army.", "close_window",[]],
  
  [anyone, "port_chief_travel",#VC-2497
    [
      (check_quest_active, "qst_escort_merchant_caravan"),
      (quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
      (party_is_active, ":quest_target_party"),
      (eq, "$escort_merchant_caravan_mode", 0),
      ],"I'm sorry. There are currently no passenger ships in this port that can transport your party and the trader with his whole cargo.", "close_window",[]],
  
  [anyone, "port_chief_travel",
    [
      (call_script, "script_cf_party_is_eastern_port", "$current_town"),
      ],"From here, one may travel to ports in Friese, Danmark, Northvegr and Englaland. Where do you want to go?", "port_chief_travel_2",[]],
  
  [anyone, "port_chief_travel",
    [
      (call_script, "script_cf_party_is_western_port", "$current_town"),
      ],"From here, one may travel to ports in Englaland and Eriuland. Where do you want to go?", "port_chief_travel_2",[]],
  
  [anyone, "port_chief_travel", [],"I am sorry. There are currently no passenger ships in this port.", "close_window",[]],
  
  
  [anyone|plyr|repeat_for_parties,"port_chief_travel_2",
    [
      (store_repeat_object, ":party_no"),
      (try_begin),
        (call_script, "script_cf_party_is_eastern_port", "$current_town"),
        (assign, ":script", "script_cf_party_is_eastern_port"),
      (else_try),
        (assign, ":script", "script_cf_party_is_western_port"),
      (end_try),
      (call_script, ":script", ":party_no"),
      (neq, ":party_no", "$current_town"),
      (str_store_party_name, s1, ":party_no"),
    ],
    "{!}{s1}", "port_chief_travel_3",[(store_repeat_object, "$travel_town")]],
  
  # [anyone|plyr|repeat_for_parties,"port_chief_travel_2_west",
  # [
  # (store_repeat_object, ":party_no"),
  # (call_script, "script_cf_party_is_western_port", ":party_no"),
  # (neq, ":party_no", "$current_town"),
  # #
  # (assign, ":block", 0),
  # (try_begin),
  # (eq, "$current_town", "p_town_12"),	#lundenwic
  # (neq, ":party_no", "p_town_11"),	#Dorestad
  # (assign, ":block", 1),
  # (else_try),
  # (eq, ":party_no", "p_town_12"),	#lundenwic
  # (neq, "$current_town", "p_town_11"),	#Dorestad
  # (assign, ":block", 1),
  # (end_try),
  # (eq, ":block", 0),
  # #
  # (str_store_party_name, s1, ":party_no"),
  # ],
  # "{!}{s1}", "port_chief_travel_3",[(store_repeat_object, "$travel_town")]],
  
  [anyone|plyr, "port_chief_travel_2",
    [
      (eq, "$curr_menu_slot", slot_quest_menu_auto_sea_travel),				#in menu
    ],
    "I changed my mind.", "close_window",[]],
  
  
  [anyone, "port_chief_travel_3",
    [
      (str_store_party_name, s1, "$travel_town"),
      (try_begin),
        (eq, "$travel_town", "$current_town"),
        (str_store_string, s2, "@You are already in {s1}."),
      (else_try),
        (party_get_position, pos1, "$current_town"),
        (party_get_position, pos2, "$travel_town"),
        (get_distance_between_positions, "$current_dialog_cost", pos1, pos2),
        (val_div, "$current_dialog_cost", 100),
        (party_get_num_companions, ":num_companions", "p_main_party"),
        (store_mul, ":companions_cost", "$current_dialog_cost", ":num_companions"),
        (val_div, ":companions_cost", 5),
        #(val_mul, "$current_dialog_cost", 3),	#= player cost
        (val_add, "$current_dialog_cost", ":companions_cost"),	#= total cost
        (assign, reg1, "$current_dialog_cost"),
        (try_begin),
          (str_clear, s3),
          (gt, ":num_companions", 1),
          (str_store_string, s3, "@ and your troops"),
        (end_try),
        (str_store_string, s2, "@There is a ship that can bring you{s3} to the port of {s1} for {reg1} peningas."),
      (end_try),
      ],"You want to travel to {s1}? {s2}", "port_chief_travel_4",[]],
  
  [anyone|plyr, "port_chief_travel_4",
    [
      (store_troop_gold, reg7, "trp_player"),
      (ge, reg7, "$current_dialog_cost"),
    ],
    "Let's start!", "port_chief_travel_5",
    [
      (troop_remove_gold, "trp_player", "$current_dialog_cost"),
  ]],
  
  [anyone|plyr, "port_chief_travel_4",
    [
      (neq, "$curr_menu_slot", slot_quest_menu_auto_sea_travel),				#in scene
      (str_store_string, s1, "@I changed my mind."),
      (store_troop_gold, reg7, "trp_player"),
      (try_begin),
        (lt, reg7, "$current_dialog_cost"),
        (str_store_string, s1, "str_i_dont_have_enough_money"),
      (end_try),
    ],
    "{!}{s1}", "port_chief2",[]],
  
  [anyone|plyr, "port_chief_travel_4",
    [
      (eq, "$curr_menu_slot", slot_quest_menu_auto_sea_travel),				#in menu
      (str_store_string, s1, "@I changed my mind."),
      (try_begin),
        (store_troop_gold, reg7, "trp_player"),
        (lt, reg7, "$current_dialog_cost"),
        (str_store_string, s1, "str_i_dont_have_enough_money"),
      (end_try),
    ],
    "{!}{s1}", "close_window",[]],
  
  [anyone, "port_chief_travel_5",[],"Follow me!", "close_window",
    [
      (party_get_slot, ":current_port", "$current_town", slot_party_port_party),
      (party_get_slot, ":target_port", "$travel_town", slot_party_port_party),
      
      (enable_party, "p_transporter"),
      (party_get_position, pos1, ":current_port"),
      (party_set_position, "p_transporter", pos1),
      
      (party_get_position, pos2, ":target_port"),
      (party_set_slot, "p_transporter", slot_party_on_water, 1),
      (party_set_flags, "p_transporter", pf_is_ship, 1),	#maybe necessary for old savegames
      (party_set_ai_behavior, "p_transporter", ai_bhvr_travel_to_point),
      (party_set_ai_target_position, "p_transporter", pos2),
      
      #(party_set_flags, "p_transporter", pf_is_ship, 1),	# This doesnt work...
      
      # (assign, "$travel_town_port", ":target_port"),
      # (party_set_slot, "p_transporter", slot_party_ai_object, ":target_port"),
      # (party_set_ai_behavior, "p_transporter", ai_bhvr_travel_to_party),
      # (party_set_ai_object, "p_transporter", ":target_port"),
      
      
      # SEA TRAVEL
      (assign, "$auto_menu", "mnu_start_sea_travel"),
      # (rest_for_hours, 10 * 24, 5, 0),
      # (set_camera_follow_party, "p_transporter"),
      # (assign, "$g_player_is_captive", 1),
      (assign, "$vc_menu_result", slot_quest_menu_leave),	# = Leave
      (try_begin),
        (eq, "$curr_menu_slot", slot_quest_menu_auto_sea_travel),	#  if travel is started in menu
        (assign,  "$vc_menu_result", 0),
      (end_try),
      (change_screen_return),
      (finish_mission, 0),
      
  ]],
  
  # 3.2 BUILD SHIP
  
  # 3.2.1 ship in construction
  [anyone|plyr, "port_chief3",
    [
      (party_slot_ge, "$current_town", slot_party_shipyard_ship_type, 1),
      ],"Is my ship ready yet?", "port_chief_pick_up_ship1",[]],
  
  [anyone, "port_chief_pick_up_ship1",
    [
      (party_get_slot, ":left_days", "$current_town", slot_party_shipyard_ship_time),
      (gt, ":left_days", 0),
      (assign, reg1, ":left_days"),
      ],"My men and I are still working on it. Come back in {reg1} days.", "port_chief2",[]],
  
  [anyone, "port_chief_pick_up_ship1",
    [
      (party_get_slot, ":left_days", "$current_town", slot_party_shipyard_ship_time),
      (le, ":left_days", 0),
      ],"The ship is ready! Do you want us to launch it?", "port_chief_pick_up_ship2",[]],
  
  [anyone|plyr, "port_chief_pick_up_ship2",[],"Yes!", "port_chief_pick_up_ship3",[]],
  [anyone|plyr, "port_chief_pick_up_ship2",[],"No, not yet.", "port_chief2",[]],
  
  [anyone, "port_chief_pick_up_ship3",
    [
      (assign, ":num_port_ships", 0),
      (try_for_range, ":cur_slot", slot_party_player_ships_type_begin, slot_party_player_ships_type_end),
        (party_slot_ge, "$current_town", ":cur_slot", 1),
        (val_add, ":num_port_ships", 1),
      (end_try),
      (store_skill_level, ":cur_sea_king_skill", "skl_sea_king", "trp_player"),
      (val_mul, ":cur_sea_king_skill", 2),	#new skill adjust
      (val_min, ":cur_sea_king_skill", 7),	#new skill adjust
      (le, ":cur_sea_king_skill", ":num_port_ships"),
      
      ],"Sorry, your sea-king skill isn't high enough to add an additional ship to your current fleet in this port.", "port_chief2", []],
  
  [anyone, "port_chief_pick_up_ship3",
    [
      (assign, ":slot_for_new_ship", 0),
      (try_for_range, ":current_ship_type_slot", slot_party_player_ships_type_begin, slot_party_player_ships_type_end),
        (eq, ":slot_for_new_ship", 0),
        (party_slot_eq, "$current_town", ":current_ship_type_slot", 0),
        (assign, ":slot_for_new_ship", ":current_ship_type_slot"),
      (end_try),
      (neq, ":slot_for_new_ship", 0),
      (party_get_slot, ":ship_type", "$current_town", slot_party_shipyard_ship_type),
      (party_get_slot, ":ship_prop", "$current_town", slot_party_shipyard_ship_prop),
      #name
      (try_begin),
        (eq, "$curr_pseudo_troop", 0),
        (assign, "$curr_pseudo_troop", "trp_pseudo_troop_01"),#VC-3545
      (else_try),
        (val_add, "$curr_pseudo_troop", 1),
      (try_end),
        
      (try_begin),
        (neg|is_between, "$curr_pseudo_troop", "trp_pseudo_troop_01", "trp_pseudo_troop_end"),
        #(assign, "$curr_pseudo_troop", "trp_pseudo_troop_01"),
        (store_random_in_range, "$curr_pseudo_troop", "str_ship_name_1", "str_ship_names_end"),#VC-3493
      (else_try),
        (str_clear, s0),
        (troop_set_name, "$curr_pseudo_troop", s0),
      (try_end),
      # give to destination
      (store_add, ":current_ship_name_slot", ":slot_for_new_ship", 10),
      (store_add, ":current_ship_qual_slot", ":slot_for_new_ship", 20),
      (store_add, ":current_ship_prop_slot", ":slot_for_new_ship", 30),
      (party_set_slot, "$current_town", ":slot_for_new_ship", ":ship_type"),
      (party_set_slot, "$current_town", ":current_ship_name_slot", "$curr_pseudo_troop"),
      (party_set_slot, "$current_town", ":current_ship_qual_slot", 100),
      (party_set_slot, "$current_town", ":current_ship_prop_slot", ":ship_prop"),
      # delete from origin
      (party_set_slot, "$current_town", slot_party_shipyard_ship_type, 0),
      (party_set_slot, "$current_town", slot_party_shipyard_ship_prop, 0),
      
      (store_sub, "$ship_menu_state", ":slot_for_new_ship", slot_party_player_ships_type_begin - 1),
      
    ],"Well, take a look at it and give it a name.", "close_window",
    [
      (change_screen_return),
      #(assign, "$ship_menu_state", 8),
      (assign, "$vc_menu_active", "prsnt_vc_submenu_ships"),
      (finish_mission, 0),
  ]],
  
  [anyone, "port_chief_pick_up_ship3",[],"There is not enough room left in the port for another ship.", "port_chief2", []],	#Player shoudnt see this in theory
  
  
  # 3.2.2 Request
  [anyone|plyr, "port_chief3",
    [
      (party_slot_eq, "$current_town", slot_party_shipyard_ship_type, 0),
      ],"I want you to build me a ship.", "port_chief_build_ship_main",[]],
  
  [anyone, "port_chief_build_ship_main",[],"What kind of ship do you want to have?", "port_chief_build_ship_main_1",[]],
  [anyone|plyr, "port_chief_build_ship_main_1",[],"I just need a little Byrding.", "port_chief_build_ship_main_2",[(assign, "$build_ship_type", 6),]],
  [anyone|plyr, "port_chief_build_ship_main_1",[],"I want a Knorr for trading.", "port_chief_build_ship_main_2",[(assign, "$build_ship_type", 5),]],
  [anyone|plyr, "port_chief_build_ship_main_1",[],"A good attack Snekkja!", "port_chief_build_ship_main_2",[(assign, "$build_ship_type", 4),]],
  [anyone|plyr, "port_chief_build_ship_main_1",[],"I'm interested in a double-sized warship. A Skeid, please.", "port_chief_build_ship_main_2",[(assign, "$build_ship_type", 2),]],
  [anyone|plyr, "port_chief_build_ship_main_1",[],"I have many warriors. Can you build a Busse for me?", "port_chief_build_ship_main_2",[(assign, "$build_ship_type", 1),]],
  [anyone|plyr, "port_chief_build_ship_main_1",[],"I need a good, all-around ship. I want a Karvi.", "port_chief_build_ship_main_2",[(assign, "$build_ship_type", 3),]],
  [anyone|plyr, "port_chief_build_ship_main_1",[],"I changed my mind.", "port_chief2",[]],
  
  [anyone, "port_chief_build_ship_main_2",
    [
      (le, "$build_ship_type", 2),
      (store_faction_of_party, ":faction", "$current_town"),
      (neg|faction_slot_eq, ":faction", slot_faction_culture, "fac_culture_norse"),
      (store_add, ":ship_type_name", "str_busse", "$build_ship_type"),
      (val_sub, ":ship_type_name", 1),
      (str_store_string, s11, ":ship_type_name"),
    ],
    "Sorry, I'm not skilled enough. Only the Norse are able to build a {s11}.", "port_chief_build_ship_main",[]],
  
  [anyone, "port_chief_build_ship_main_2",[],"What kind of wood would you like to use?", "port_chief_info_main_3",[]],
  [anyone|plyr, "port_chief_info_main_3",[],"Oak wood. I want quality.", "port_chief_build_ship_main_4",[(assign, "$build_ship_wood", 1),]],
  [anyone|plyr, "port_chief_info_main_3",[],"Pine would be fine.", "port_chief_build_ship_main_4",[(assign, "$build_ship_wood", 2),]],
  [anyone|plyr, "port_chief_info_main_3",[],"I don't want to spend so much money. I want ash wood.", "port_chief_build_ship_main_4",[(assign, "$build_ship_wood", 3),]],
  [anyone|plyr, "port_chief_info_main_3",[],"I changed my mind.", "port_chief2",[]],
  
  [anyone, "port_chief_build_ship_main_4",
    [
      (store_add, ":ship_type_name", "str_busse", "$build_ship_type"),
      (val_sub, ":ship_type_name", 1),
      (str_store_string, s11, ":ship_type_name"),
      (store_add, ":ship_wood_name", "str_ship_wood_1", "$build_ship_wood"),
      (val_sub, ":ship_wood_name", 1),
      (str_store_string, s12, ":ship_wood_name"),
      
      (call_script, "script_calculate_ship_value", "$build_ship_type", 100, "$build_ship_wood"),
      (assign, "$current_dialog_cost", reg0),
      
      #trade skill influence
      (party_get_skill_level, ":trade_skill", "p_main_party", "skl_trade"),
      (store_sub, ":price_in_percent_plus_calculated_trade_penalty", 120, ":trade_skill"),
      (val_mul, "$ship_menu_current_ship_price", ":price_in_percent_plus_calculated_trade_penalty"),
      (val_div, "$ship_menu_current_ship_price", 100),
      
      (try_begin),
        (le, "$build_ship_type", 3),
        (store_item_value, ":items_cost", "itm_tar"),
        (store_item_value, reg7, "itm_timber"),
        (val_add, ":items_cost", reg7),
        (store_item_value, reg7, "itm_wool"),
        (val_add, ":items_cost", reg7),
        (val_sub, "$current_dialog_cost", ":items_cost"),
        (val_div, "$current_dialog_cost", 100), # make price look better
        (val_mul, "$current_dialog_cost", 100),
        (str_store_string, s2, "@For a ship of this size, I don't have enough timber, tar and wool, so I need you to bring these extra items. "),
      (else_try),
        (str_clear, s2),
      (end_try),
      
      (store_div, "$build_ship_days", "$current_dialog_cost", 1500),
      (val_add, "$build_ship_days", "$build_ship_type"),
      
      (assign, reg11, "$current_dialog_cost"),
      (assign, reg12, "$build_ship_days"),
      
      ],"To build your {s11} out of {s12} wood I ask {reg11} peningas for my work. {s2}It will take {reg12} days to build this ship.", "port_chief_build_ship_main_5",[]],
  
  [anyone|plyr, "port_chief_build_ship_main_5",
    [
      (store_troop_gold, reg7, "trp_player"),
      (ge, reg7, "$current_dialog_cost"),
      (try_begin),
        (assign, ":block", 0),
        (le, "$build_ship_type", 3),
        (assign, ":block", 1),
        (player_has_item, "itm_tar"),
        (player_has_item, "itm_timber"),
        (player_has_item, "itm_wool"),
        (assign, ":block", 0),
      (try_end),
      (eq, ":block", 0),
    ]
    ,"Build this ship for me!", "port_chief_build_ship_main_6",
    [
      (troop_remove_gold, "trp_player", "$current_dialog_cost"),
      
      (try_begin),
        (le, "$build_ship_type", 3),
        (troop_remove_item, "trp_player", "itm_timber"),
        (troop_remove_item, "trp_player", "itm_tar"),
        (troop_remove_item, "trp_player", "itm_wool"),
      (end_try),
      (party_set_slot, "$current_town", slot_party_shipyard_ship_type, "$build_ship_type"),
      (party_set_slot, "$current_town", slot_party_shipyard_ship_prop, "$build_ship_wood"),
      (party_set_slot, "$current_town", slot_party_shipyard_ship_time, "$build_ship_days"),
    ]
  ],
  
  [anyone|plyr, "port_chief_build_ship_main_5",
    [
      (ge, "$cheat_mode", 1),
    ]
    ,"{!}Cheat: Instant build", "port_chief_build_ship_main_6",
    [
      (party_set_slot, "$current_town", slot_party_shipyard_ship_type, "$build_ship_type"),
      (party_set_slot, "$current_town", slot_party_shipyard_ship_prop, "$build_ship_wood"),
      (party_set_slot, "$current_town", slot_party_shipyard_ship_time, 0),
    ]
  ],
  
  [anyone|plyr, "port_chief_build_ship_main_5",
    [
      (store_troop_gold, reg7, "trp_player"),
      (ge, reg7, "$current_dialog_cost"),	#money ok
      (try_begin),
        (assign, ":block", 0),
        (le, "$build_ship_type", 3),
        (assign, ":block", 1),
        (player_has_item, "itm_tar"),
        (player_has_item, "itm_timber"),
        (player_has_item, "itm_wool"),
        (assign, ":block", 0),
      (try_end),
      (eq, ":block", 1),					#items not ok
    ]
    ,"Err, does it look like I am a merchant? I don't have these things with me.", "port_chief_build_ship_missing_1",[]],
  [anyone, "port_chief_build_ship_missing_1",[],"Sorry, but I can't finish your ship without these materials. Buy them and come back once you have everything ready.", "port_chief2",[]],
  
  [anyone|plyr, "port_chief_build_ship_main_5",
    [
      (store_troop_gold, reg7, "trp_player"),
      (lt, reg7, "$current_dialog_cost"),
    ]
    ,"I don't have enough peningas right now.", "port_chief_build_ship_missing_2",[]],
  [anyone, "port_chief_build_ship_missing_2",[],"Sorry, but I need to feed my family and pay the workers. When you get the money, then come back and see me.", "port_chief2",[]],
  
  [anyone|plyr, "port_chief_build_ship_main_5",
    [
      (store_troop_gold, reg7, "trp_player"),
      (ge, reg7, "$current_dialog_cost"),
      (try_begin),
        (assign, ":block", 0),
        (le, "$build_ship_type", 3),
        (assign, ":block", 1),
        (player_has_item, "itm_tar"),
        (player_has_item, "itm_timber"),
        (player_has_item, "itm_wool"),
        (assign, ":block", 0),
      (try_end),
      (eq, ":block", 0),
      ],"I will consider this and may come back later.", "port_chief_build_ship_missing_3",[]],
  [anyone, "port_chief_build_ship_missing_3",[],"Take your time, but trust me. My ships are worth every pening.", "port_chief2",[]],
  
  [anyone, "port_chief_build_ship_main_6",[],"Very well! Come back in {reg12} days.", "port_chief2",[]],
  
  # 4. Farewell
  
  [anyone|plyr, "port_chief3",[],"Nothing, for now. Farewell.", "close_window",[]],
  
  #Shipwright Ends
  
  ###fleet mission
  [anyone, "port_chief_fleet1",[
      (str_clear, s2),
    ],"{s2}^^Heill, {playername}. I see you have made a name for yourself in this land. It makes me happy to think that my business with you has helped in this. That should deserve a line or two in any saga about you! " +
    "The fleet of Sven and Harald is across the bay. It numbers fifty boats, many of them war ships, totalling over 800 men. Have you finished your affairs in Danmark? Are you ready to leave? I warrant you won't be back soon!", "port_chief_fleet2",[
      (str_store_string, s2, "@--He indicates the far side of the bay with his arm.--", color_good_news),
      #(auto_save), ###autosavegame
  ]],
  
  [anyone|plyr, "port_chief_fleet2",[
      ],"Yes, let's get started. Let's board my men.", "the_fleetmt1",[
      (add_xp_as_reward,100),
      (str_store_string, s2, "@Now you must join the fleet led by Sven Bull Neck and Harald Haraldsson, which soon leaves Ribe for Englaland. Your destiny once again leads you to other lands."),
      (add_quest_note_from_sreg, "qst_the_fleet", 6, s2, 0),
      (quest_set_slot,"qst_the_fleet",slot_quest_current_state, 4),
      #phaiak begin
      # (party_get_position, pos1, "p_town_4"),
      # (call_script, "script_get_next_water_position", 10),
      (set_fixed_point_multiplier, 100),
      (position_set_x, pos2,  22000),
      (position_set_y, pos2, -14000),
      (party_set_position, "p_the_fleet", pos2),
      (enable_party, "p_the_fleet"),
      (party_set_flags, "p_the_fleet", pf_is_static, 1),
      #phaiak end
  ]],
  
  [anyone, "the_fleetmt1",[
      ],"Well, good luck Vinr. Although you can see many boats here, most of the fleet is anchored over in the bay, outside the city. Join them as soon as you feel ready!", "close_window",[
      #     (jump_to_menu, "mnu_partida_ribe_fleet"),	#testing
  ]],
  
  [anyone|plyr, "port_chief_fleet2",[
      ],"No, I need to finish some things. I will be back.", "port_chief2",[
  ]],
  
  ###catach mision
  [anyone, "port_chief_catach",[],"{s2}^^Well, give me the book, and I will tell you what you asked about.", "port_chief_catach2",[
      (str_clear, s2),
      (str_store_string, s2, "@--His eyes shine.--", color_good_news),
  ]],
  [anyone|plyr, "port_chief_catach2",[(player_has_item,"itm_relic")],"Here, take it. Now, Sven's hideout?", "port_chief_catach31",[]],
  [anyone|plyr, "port_chief_catach2",[],"Unfortunately, I lost the book. Would you take money instead?", "port_chief_catach32",[]],
  
  [anyone, "port_chief_catach32",[],"My client will not be happy, and people will know you're not reliable. My client would've paid me 10,000 peningas for the book. Do you have that kind of money?", "port_chief_catach4",[
  ]],
  
  [anyone|plyr, "port_chief_catach4",[(store_troop_gold,":money","trp_player"),(ge,":money",10000),],"I've got the money. Here, take it, and tell me where Sven is!", "port_chief_catach5",[]],
  [anyone|plyr, "port_chief_catach4",[],"Unfortunately, no. I will be back as soon as I have it.", "port_chief2",[]],
  
  [anyone, "port_chief_catach5",[],"Oh my, you're a rich {reg59?woman:man}! The hideout is here, in Danmark, southeast of Ribe, up the river. Far thu vel.", "port_chief_catach5_1",[
      (add_xp_as_reward,200),
      (troop_remove_gold,"trp_player",10000),
      (call_script, "script_change_troop_renown", "trp_player", -50),
      (str_store_party_name_link, s3, "p_town_4"),
      (str_store_string, s2, "@The port master of Ribe gave you the location of Sven's hideout: southeast of {s3}. Go there to rescue the Woden Ric prisoners."),
      (add_quest_note_from_sreg, "qst_sven_lair", 4, s2, 0),
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 2),
      (quest_set_slot,"qst_cathach_colum",slot_quest_current_state, 5),
      (call_script, "script_end_quest", "qst_cathach_colum"),
  ]],
  [anyone|plyr, "port_chief_catach5_1",[],"Thank you.", "port_chief2",[
      (set_spawn_radius, 1),
      (spawn_around_party,"p_destroy2","pt_sven_lair_deffense"),
      #(assign, "$sven_lair_deffense", reg0),
  ]],
  ##
  [anyone, "port_chief_catach31",[],"Well, thank you. The hideout is here, in Danmark, southeast of Ribe, up the river. Far thu vel.", "port_chief_catach31_1",[
      (troop_remove_item, "trp_player", "itm_relic"),
      (add_xp_as_reward,600),
      (call_script, "script_change_troop_renown", "trp_player", 10),
      (str_store_party_name_link, s3, "p_town_4"),
      (str_store_string, s2, "@The port master of Ribe gave you the location of Sven's hideout: southeast of {s3}. Go there to rescue the Woden Ric prisoners."),
      (add_quest_note_from_sreg, "qst_sven_lair", 4, s2, 0),
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 2),
      (quest_set_slot,"qst_cathach_colum",slot_quest_current_state, 5),
      (call_script, "script_end_quest", "qst_cathach_colum"),
  ]],
  [anyone|plyr, "port_chief_catach31_1",[],"Thank you.", "port_chief2",[
      (set_spawn_radius, 1),
      (spawn_around_party,"p_destroy2","pt_sven_lair_deffense"),
      #(assign, "$sven_lair_deffense", reg0),
  ]],
  
  ###quest descubrir guarida de sven bull neck chief
  [anyone, "port_chief_svenlair",[],"{s2}^^Why so loud, friend? Nobody in port needs to know what we are talking about. I see someone has told you about me. That's fine. It's how businesses thrive.^^" +
    "Well, you want to know the location. It is not hard to get, but it has a cost, of course, and not a cheap one. Bull Neck Sven is a dangerous man.", "port_chief_svenlair2",[
      (str_clear, s2),
      (str_store_string, s2, "@--He approaches you until you can smell the cheap beer on his breath.--", color_good_news),
  ]],
  
  [anyone, "port_chief_svenlair2",[],"{s2}^^Listen carefully. Fortunately, I need someone like you. I need you to become, hmm, a 'raider' of sort, and go to Eriuland. " +
    "I have a client who wants a book kept in a monastery there as a relic. The monastery is called Gleann Da Loch. The name of the book is the 'The Cathach of Colum Cille.' " +
    "I am really only interested in the book. Anything else you take is yours. Bring me that book, and you will know where Sven Bull Neck is hiding.", "port_chief_svenlair3",[
      (str_clear, s2),
      (str_store_string, s2, "@--He looks with a perverse look.--", color_good_news),
  ]],
  
  [anyone|plyr, "port_chief_svenlair3",[],"Sounds good! I'll bring you the book. I will see you soon.", "port_chief_svenlair31",[]],
  [anyone|plyr, "port_chief_svenlair3",[],"I neither plunder monasteries nor kill monks.", "port_chief_svenlair32",[]],
  [anyone|plyr, "port_chief_svenlair3",[],"I prefer to forget about that book and offer peningas for the information.", "port_chief_svenlair33",[]],
  
  [anyone, "port_chief_svenlair31",[],"Well, I'll be here. I suggest you repair and provision your ship. The trip to Eriuland is long. And bring enough men, for the Eriu war enough on each other to have become quite good at it. Far thu vel.", "close_window",[
      (str_store_party_name_link, s3, "p_town_21"),
      (str_store_string, s2, "@The port master of Ribe wants a book called 'The Cathach of Colum Cille,' which is in Gleann Da Loch, a monastery near {s3}, in Eriu, Hibernia."),
      (call_script, "script_start_quest", "qst_cathach_colum", "$g_talk_troop"),
      (quest_set_slot,"qst_cathach_colum",slot_quest_current_state, 1),
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 2),
  ]],
  
  [anyone, "port_chief_svenlair32",[],"Then buy the book. I do not care how you get it. Just bring it. And I suggest you repair and provision your ship. The trip to Eriuland is long. And bring enough men, for the Godelic war enough on each other to have become quite good at it. Far thu vel.", "close_window",[
      (str_store_party_name_link, s3, "p_town_21"),
      (str_store_string, s2, "@The port master of Ribe wants a book called 'The Cathach of Colum Cille,' which is in Gleann Da Loch, a monastery near {s3}, in Eriu, Hibernia."),
      (call_script, "script_start_quest", "qst_cathach_colum", "$g_talk_troop"),
      (quest_set_slot,"qst_cathach_colum",slot_quest_current_state, 1),
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 2),
  ]],
  
  [anyone, "port_chief_svenlair33",[],"Well, isn't that an interesting option? My client offers me 10,000 peningas for the book. Do you have that kind of money?", "port_chief_svenlair4",[
  ]],
  
  [anyone|plyr, "port_chief_svenlair4",[(store_troop_gold,":money","trp_player"),(ge,":money",10000),],"I've got the money. Take it, and tell me where Sven is hiding.", "port_chief_svenlair5",[]],
  [anyone|plyr, "port_chief_svenlair4",[],"Unfortunately, not that kind of money. I'll bring the book. I will see you soon.", "port_chief_svenlair31",[]],
  
  [anyone, "port_chief_svenlair5",[],"Oh, my, you're a rich man! The hideout is here, in Danmark, southeast of Ribe, up the river. Far thu vel.", "port_chief_svenlair5_1",[
      (troop_remove_gold,"trp_player",10000),
      (str_store_party_name_link, s3, "p_town_4"),
      (str_store_string, s2, "@The port master from Ribe gave you the location of Sven's hideout: southeast of {s3}. Go there to rescue the Woden Ric prisoners."),
      (add_quest_note_from_sreg, "qst_sven_lair", 4, s2, 0),
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 2),
  ]],
  
  [anyone|plyr, "port_chief_svenlair5_1",[],"Thank you.", "port_chief2",[
      (set_spawn_radius, 1),
      (spawn_around_party,"p_destroy2","pt_sven_lair_deffense"),
      # (assign, "$sven_lair_deffense", reg0),
  ]],
  
  #pormaster bodo letter chief
  [anyone, "port_chief_bodoletter1",[],"{s2}^^Why do you always talk so loudly? Well, you know me, I'm a good source of information, but everything has a price.", "port_chief_bodoletter2",[
      (str_clear, s2),
      (str_store_string, s2, "@--He approaches you until you can smell the cheap beer on his breath.--", color_good_news),
  ]],
  
  [anyone, "port_chief_bodoletter2",[],"{s2}^^Listen carefully. This info is especially valuable. We are talking about the number two man in Danmark, Sigurd 'Snake in the Eye.' How about 12,000 peningas? Do you have this kind of money? " +
    "If not, perhaps you could do me a little favor instead. I have a client who needs to move some furs to Dubh Linn, in Eriuland. Why wouldn't you take the furs for me? In return, I will give you the information.", "port_chief_bodoletter3",[
      (str_clear, s2),
      (str_store_string, s2, "@--He gives you a strange look.--", color_good_news),
  ]],
  
  [anyone|plyr, "port_chief_bodoletter3",[],"Well, deal. I will take the skins for you.", "port_chief_bodoletter_pieles",[]],
  [anyone|plyr, "port_chief_bodoletter3",[(store_troop_gold,":money","trp_player"),(ge,":money",12000),],"Oh, I've got the money. Here it is. Where is he now?", "port_chief_bodoletter4",[]],
  [anyone|plyr, "port_chief_bodoletter3",[	(store_troop_gold,":money","trp_player"),(store_skill_level, ":trade", "skl_trade", "trp_player"),
      (ge,":trade",3),(ge,":money",8000),],"But we're old friends, man. For old business associates, would you not offer a discount?", "port_chief_bodoletter7",[]],
  [anyone|plyr, "port_chief_bodoletter3",[],"Unfortunately, no. I'll return soon with the money.", "port_chief_bodoletter3_1",[]],
  
  [anyone, "port_chief_bodoletter_pieles",[],"Glad to hear that. Go to Dubh Linn and deliver the furs to a man named Hogni. He is the merchant there. You will find him easily. " +
    "I would suggest carrying other goods, to sell in those distant lands. Once you return here with the receipt, you will get your information.", "close_window",[
      
      (str_clear, s3),
      (str_clear, s4),
      (str_store_party_name_link, s4, "p_town_4"),
      (str_store_party_name_link, s3, "p_town_7"),
      (str_store_string, s2, "@The port master of {s4} wants you to deliver a pack of furs to {s3} in Eriu, to the local merchant, called Hogni."),
      (call_script, "script_start_quest", "qst_entregando_pieles", "$g_talk_troop"),
      (quest_set_slot,"qst_entregando_pieles",slot_quest_current_state, 1),
      (troop_add_item, "$g_player_troop","itm_vc_furs",0),
  ]],
  
  [anyone, "port_chief_bodoletter3_1",[],"Then come back when you have the money. I have no time for beggars.", "port_chief2",[
  ]],
  
  [anyone, "port_chief_bodoletter4",[],"Aren't you a rich man! Well, Atli Eiriksson is in Northvegr. At least, that's what one of his men told a whore here. " +
    "Apparently, Atli carries something important that needs to be hidden...for now. He is hiding in a cave on the north coast of Northvegr, near Hordaland. Far thu vel.", "port_chief_bodoletter5",[
      (troop_remove_gold,"trp_player",12000),
      (str_clear, s3),
      (str_clear, s4),
      (str_store_party_name_link, s4, "p_town_4"),
      (str_store_party_name_link, s3, "p_castle_54"),
      (str_store_string, s2, "@The port master from {s4} gave you the location of Odin's cave: near {s3}. Go there to recover Bodo's letter."),
      (add_quest_note_from_sreg, "qst_bodo_letter", 4, s2, 0),
      (quest_set_slot,"qst_bodo_letter",slot_quest_current_state, 2),
      (enable_party, "p_odin_cave"), #odin cave
  ]],
  
  [anyone|plyr, "port_chief_bodoletter5",[],"Thank you.", "port_chief2",[
  ]],
  [anyone, "port_chief_bodoletter7",[],"Hmm, well, just this one time, but do not tell anyone, I have my reputation to uphold. Eight thousand peningas, and this info is yours. Got the money?", "port_chief_bodoletter8",[
  ]],
  [anyone|plyr, "port_chief_bodoletter8",[(store_troop_gold,":money","trp_player"),(ge,":money",8000),],"Yes, I sure do. Take it. Where is he?", "port_chief_bodoletter9",[]],
  [anyone|plyr, "port_chief_bodoletter8",[],"Unfortunately, no. I'll return soon with the money.", "port_chief_bodoletter3_1",[]],
  
  [anyone, "port_chief_bodoletter9",[],"Well, but remember, no more discounts. Well, Atli Eiriksson is in Northvegr. At least, that's what one of his men told a whore here. " +
    "Apparently, Atli carries something important that needs to be hidden...for now. He has gone to hide in a cave on the north coast of Northvegr, near Hordaland. Far thu vel.", "port_chief_bodoletter5",[
      (troop_remove_gold,"trp_player",8000),
      (str_store_party_name_link, s3, "p_castle_54"),
      (str_store_string, s2, "@The port master from Ribe gave you the location of Odin's cave: near {s3}. Go there to recover Bodo's letter."),
      (add_quest_note_from_sreg, "qst_bodo_letter", 4, s2, 0),
      (quest_set_slot,"qst_bodo_letter",slot_quest_current_state, 2),
      (enable_party, "p_odin_cave"), #odin cave
  ]],
  #con pieles
  [anyone, "port_chief_pieles",[],"I like doing business with you. Well, Atli Eiriksson is in Northvegr. At least, that's what one of his men told a whore here. " +
    "Apparently, Atli carries something important that needs to be hidden...for now. He has gone to hide in a cave on the north coast of Northvegr, near Hordaland. Far thu vel.", "port_chief_bodoletter5",[
      (str_store_party_name_link, s3, "p_castle_54"),
      (str_store_string, s2, "@The port master from Ribe gave you the location of Odin's cave: near {s3}. Go there to recover Bodo's letter."),
      (add_quest_note_from_sreg, "qst_bodo_letter", 4, s2, 0),
      (quest_set_slot,"qst_bodo_letter",slot_quest_current_state, 2),
      (enable_party, "p_odin_cave"), #odin cave
  ]],
  ###################
  
  #Slave Trader
  [trp_port_pirate|plyr, "start",
    [],
    "Who are you?", "port_prisoners",
    []],
  [trp_port_pirate, "port_prisoners",
    [(str_store_party_name, s9, "$current_town"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_met_previously, 0),
    ],
    "Are you looking for a slave trader? {s9} wouldn't prosper without my slaves, so if you have any prisoners of war, I'd be willing to buy them.", "port_prisoners_2",
    []],
  [trp_port_pirate|plyr,"port_prisoners_2",
    [[store_num_regular_prisoners,reg(0)],[ge,reg(0),1]],
    "I've brought some prisoners.", "port_prisoners_3",[]],
  [trp_port_pirate|plyr,"port_prisoners_2",[],
    "Farewell.", "close_window",[]],
  
  [trp_port_pirate,"port_prisoners_3", [],
    "Nice to hear. Let's go.", "port_prisoners_4",
    [[change_screen_trade_prisoners]]],
  
  [trp_port_pirate, "port_prisoners_4", [],
    "A pleasure doing business with you.", "close_window",
    []],
  
  #Old captain in port
  [trp_port_crew, "start",
    [(str_store_party_name, s9, "$current_town"),],
    "Greetings. I'm a veteran captain who monitors activity at the port of {s9}. If you are interested in hiring unemployed sailors, let me know.", "port_r_2",
    []],
  
  [trp_port_crew, "port_crew_talk",
    [],
    "Is there anything else I can do for you?", "port_r_2",
    []],
  
  ###reclutar
  [trp_port_crew|plyr, "port_r_2",
    [],
    "I want to recruit sailors.", "port_recruitsl",
    []],
  [anyone ,"port_recruitsl", [ (party_get_slot, ":num_volunteers", "$current_town", slot_center_sailors_troop_amount),
      (lt, ":num_volunteers", 0),
    ],
    "There are no available sailors in the port at this time. Come back later, {reg59?madam:sir}.", "port_crew_talk",[]],
  
  [anyone ,"port_recruitsl", [ (assign, ":num_volunteers", 10),
      (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
      (le, ":free_capacity", ":num_volunteers"),
      (store_troop_gold, ":gold", "trp_player"),
      (store_div, ":gold_capacity", ":gold", 40),#40 peningas per man
      
      (le, ":gold_capacity", ":num_volunteers"),
    ],
    "I don't think anyone would be interested, {reg59?madam:sir}. You need to have more room in your party.", "port_crew_talk",[]],
  
  [anyone ,"port_recruitsl", [            (store_random_in_range, ":num_volunteers", 1, 10),
      (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
      (val_min, ":num_volunteers", ":free_capacity"),
      (store_troop_gold, ":gold", "trp_player"),
      (store_div, ":gold_capacity", ":gold", 40),#40 scillingas per man
      (val_min, ":num_volunteers", ":gold_capacity"),
      (assign, "$temp",  ":num_volunteers"),
      (assign, reg5, ":num_volunteers"),
      (store_add, reg7, ":num_volunteers", -1),
    ],
    "I can think of {reg5} who I suspect would jump at the chance if you could pay 40 peningas {reg7?each for their equipment:for his equipment}. " +
    "Does that suit you?", "port_recruits2",[]],
  
  [anyone|plyr,"port_recruits2", [(assign, ":num_volunteers", "$temp"),
      (ge, ":num_volunteers", 1),
      (store_add, reg7, ":num_volunteers", -1)],
    "Tell {reg7?them:him} to get ready.", "port_crew_talk",[
      (assign, ":num_volunteers", "$temp"),
      (store_troop_gold, ":gold", "trp_player"),
      (assign, ":recruit_cost", 40),
      (store_div, ":gold_capacity", ":gold", ":recruit_cost"),#40 peningas per man
      (val_min, ":num_volunteers", ":gold_capacity"),
      (party_add_members, "p_main_party", "trp_regular_sailors", ":num_volunteers"),
      (party_set_slot, "$current_town", slot_center_sailors_troop_amount, -1),
      (store_mul, ":cost", ":num_volunteers", ":recruit_cost"),#40 peningas per man
      (troop_remove_gold, "trp_player", ":cost"),
  ]],
  
  [anyone|plyr,"port_recruits2", [],
    "No, not now.", "port_crew_talk",[
      (party_set_slot, "$current_town", slot_center_sailors_troop_amount, -1),
  ]],
  #
  [anyone|plyr, "port_r_2",[    ###no ha hablado con beda, no hay flota chief
      (this_or_next|eq, "$g_encountered_party", "p_town_12"),
      (eq, "$g_encountered_party", "p_town_27"),
      (check_quest_active,"qst_douar_an_enez"),
      (quest_get_slot,":stage","qst_douar_an_enez",slot_quest_current_state),
      (le,":stage",6),
      ],"My name is {playername}...", "port_crew_fleetpr",[]],
  
  [anyone, "port_crew_fleetpr",[
      ],"Sorry, I'm busy preparing the boats and supplies for a fleet. If you do not need sailors, please leave me alone and come back later.", "close_window",[
  ]],
  
  [anyone|plyr, "port_r_2",[    (le, "$player_side", 1), #wessex
      (eq, "$g_encountered_party", "p_town_12"),
      (check_quest_active,"qst_douar_an_enez"),
      (quest_slot_eq,"qst_douar_an_enez",slot_quest_current_state, 7),
      ],"My name is {playername}. Aetheling Aelfred sent me.", "port_crew_fleet1",[]],
  
  [anyone|plyr, "port_r_2",[    (ge, "$player_side", 2), #danish
      (eq, "$g_encountered_party", "p_town_27"),
      (check_quest_active,"qst_douar_an_enez"),
      (quest_slot_eq,"qst_douar_an_enez",slot_quest_current_state, 7),
      ],"My name is {playername}. Jarl Rathbarth send me.", "port_crew_fleet1",[]],
  
  [anyone, "port_crew_fleet1",[
      (str_clear, s2),
      (call_script, "script_cf_party_is_valid", "p_the_fleet"),#VC-3134
      ],"^^Greetings, {playername}. I was notified about your arrival. You are in charge of a fleet bound for Frankia. There are men, guides and boats waiting for you to join them out of port.", "port_crew_fleet2",[
      #(auto_save), ###autosavegame
  ]],
  
  [anyone|plyr, "port_crew_fleet2",[
      ],"Yes, the time has come. Douar-an-Enez awaits me.", "the_fleetcrew1",[
      (add_xp_as_reward,50),
      (str_store_string, s2, "@Embark on your boat, join the fleet, and lead it to Douar-an-Enez."),
      (add_quest_note_from_sreg, "qst_douar_an_enez", 6, s2, 0),
      (quest_set_slot,"qst_douar_an_enez",slot_quest_current_state, 8),
      #phaiak begin
      (party_get_position, pos1, "$g_encountered_party"),
      (call_script, "script_get_next_water_position", 7),
      (party_set_position, "p_the_fleet", pos2),
      (enable_party, "p_the_fleet"),
      #phaiak end
  ]],
  
  [anyone, "port_crew_fleet1",[],#VC-3134
    "{!}For some reason your savegame got corrupted. Try to load a previous savegame or start new game. You can always check your savegame with activated cheat mode in 'camp menu' > 'Options' > 'More' > 'CHEAT: Check savegame for errors'.", "close_window",[]],
  
  [anyone, "the_fleetcrew1",[
      ],"I was told it would be weeks, even months out, so good luck. Your fleet is waiting for you at the exit of the port. Take your boat and go with them.", "close_window",[
  ]],
  
  [anyone|plyr, "port_crew_fleet2",[
      ],"No, I need to finish some things. I will be back.", "close_window",[
  ]],
  
  #
  
  
  [trp_port_crew|plyr, "port_r_2",
    [],
    "I want to go. Farewell.", "close_window",
    []],
  
  
  ######################puerto acaba chief
  
  ### PART 2
  
  ###lords and kings mainquest
  ####sigurd dont want to talk to player now mainquest chief
  [trp_knight_1_5,"start", [ #Sigurd enemy
      (check_quest_active,"qst_revenge_sigurd"),
      (quest_slot_eq,"qst_revenge_sigurd",slot_quest_current_state, 4),
    ],
    "Why are you bothering me? I'm busy! I have no time for people like you. Come back another day. Or better yet, don't.^^" +
    "--It seems that Sigurd is not willing to receive you now. You'll need to look for another way to find out information about Sven.--", "close_window",[
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),   ]],
  
  ###
  ###rey horik in grove mainquest chief
  [trp_kingdom_1_lord,"start", [ #king horik escucha
      (eq, "$arboleda_conrey", 1),
      ##           (check_quest_active,"qst_danmork_protection"),
      ##       (quest_slot_eq,"qst_danmork_protection",slot_quest_current_state, 15), #2
    ],
    "This is a good place away from prying ears. Now, talk.", "kinghorik_quest_danmarkprot",[
      (assign, "$arboleda_conrey", 0),
  ]],
  
  [trp_kingdom_1_lord,"start", [ #king horik escucha
      (neg|check_quest_active,"qst_danmork_protection"),
      (check_quest_active,"qst_revenge_sigurd"),
      (quest_slot_eq,"qst_revenge_sigurd",slot_quest_current_state, 6), #1
    ],
    "This is a good place away from prying ears. Now, talk.", "kinghorik_quest_revenge4",[
  ]],
  
  [trp_kingdom_1_lord,"start", [ #king horik The Assembly
      (check_quest_active,"qst_the_thing"),
      (quest_slot_eq,"qst_the_thing",slot_quest_current_state, 7),
    ],
    "Heill, {playername}.", "kinghorik_quest_thething1",[
  ]],
  ####
  [trp_kingdom_8_lord,"start", [ #Jarl halfdan after Aescesdun battle
      (check_quest_active,"qst_aescesdun"),
      (quest_slot_eq,"qst_aescesdun",slot_quest_current_state, 20), #conversation where Sven bull neck is
    ],
    "Heill, {playername}, vinr. Thanks to you, today we have won this battle! West Seaxe is now ours! But I guess you care more about Sven Bull Neck's location, right? " +
    "Well, he got away, but not far. He has taken Readingum and has made a stronghold there, but my men have followed. I have put a hersir in my confidence, Arnvid, in charge of the mission. " +
    "Meet him at Readingum. His men are at your disposal if you decide to assault the place.", "svenbn_hunting1_1",[
  ]],
  
  [trp_knight_5_1,"start", [ #Aelfred after Aescesdun battle
      (check_quest_active,"qst_aescesdun"),
      (quest_slot_eq,"qst_aescesdun",slot_quest_current_state, 20), #conversation where Sven bull neck is
    ],
    "Salve, {playername}! The Danish are on the run and have lost many jarls in this battle. Although there are still many of them left, we have achieved an important victory, and they will not be so bold in the future.^^" +
    "I have some news for you. Sven Bull Neck has fled back to Readingum and has fortified himself in there. My men, led by a man named Eadric, have followed him. They will be at your disposal when you arrive. " +
    "The moment is yours! Go to Readingum and settle your accounts with Sven Bull Neck.", "svenbn_hunting1_1",[
  ]],
  
  ##  [anyone ,"start", [(store_conversation_troop, "$g_talk_troop"),
  ##		(assign, ":continue", 0),
  ##                   (eq, "$g_encountered_party", "p_farmland"),
  ##                    (check_quest_active,"qst_revenge_exchange"),
  ##					(party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
  ##					(try_for_range, ":stack_no", 0, ":num_stacks"),
  ##					(party_stack_get_troop_id, ":stack_troop", "p_main_party", ":stack_no"),
  ##					(neq, ":stack_troop", "trp_player"),
  ##                                        (eq, ":stack_troop", "$g_talk_troop"),
  ##					(assign, ":continue", 1),
  ##					(try_end),
  ##		(ge, ":continue", 1),
  
  [anyone,"start", [(store_conversation_troop, "$g_talk_troop"),(neq, "$g_talk_troop", "trp_npc2"), #The Assembly
      # (neg|is_between, "$g_talk_troop", "trp_town_1_armorer", "trp_town_29_merchant"),
      #(neq, "trp_npc2", "$g_talk_troop"),
      (store_current_scene,":current_scene"),(eq,":current_scene","scn_the_thing"),
      #  (eq, "$g_encountered_party", "p_the_thing"),
      ], "Sorry, this is not a good time to talk.", "close_window",[]],
  
  [anyone,"start", [(store_conversation_troop, "$g_talk_troop"), #bjorn camp
      (store_current_scene,":current_scene"),(eq,":current_scene","scn_viking_camp"),
      # (eq, "$g_encountered_party", "p_bjorn_camp"),
      (neq, "$g_talk_troop", "trp_npc6"),
      (neq, "$g_talk_troop", "trp_knight_8_7"),
      (neg|is_between, "$g_talk_troop", "trp_town_1_armorer", "trp_town_29_horse_merchant"),
      ], "Sorry, this is not a good time to talk.", "close_window",[]],
  [anyone,"start", [(store_conversation_troop, "$g_talk_troop"), #readingum camp
      (store_current_scene,":current_scene"),(eq,":current_scene","scn_redingum_camp"),
      #  (eq, "$g_encountered_party", "p_readingum"),
      (neq, "$g_talk_troop", "trp_kingdom_8_lord"),
      (neq, "$g_talk_troop", "trp_knight_5_1"),
      (neg|is_between, "$g_talk_troop", "trp_town_1_armorer", "trp_town_29_horse_merchant"),
      ], "Sorry, this is not a good time to talk.", "close_window",[]],
  [anyone,"start", [(store_conversation_troop, "$g_talk_troop"), #aescesdun camp
      (store_current_scene,":current_scene"),(eq,":current_scene","scn_aescendun_camp"),
      #(eq, "$g_encountered_party", "p_aescesdun"),
      (neq, "$g_talk_troop", "trp_kingdom_8_lord"),
      (neq, "$g_talk_troop", "trp_knight_5_1"),
      (neg|is_between, "$g_talk_troop", "trp_town_1_armorer", "trp_town_29_horse_merchant"),
      ], "Sorry, this is not a good time to talk.", "close_window",[]],
  ###
  [anyone,"start", [(store_conversation_troop, "$g_talk_troop"),(neq, "$g_talk_troop", "trp_norse_priest"), #The Assembly
      (neg|is_between, "$g_talk_troop", "trp_sea_raider_leader", "trp_bandit_leaders_end"),
      (store_current_scene,":current_scene"),
      (this_or_next|eq,":current_scene","scn_pagan_holy_site_norway"),
      (eq,":current_scene","scn_pagan_holy_site_danmark"),
      ], "Sorry, this is not a good time to talk.", "close_window",[]],
  [anyone,"start", [(store_conversation_troop, "$g_talk_troop"),
      (is_between, "$g_talk_troop", "trp_sea_raider_leader", "trp_bandit_leaders_end"),
      (store_current_scene,":current_scene"),
      (this_or_next|eq,":current_scene","scn_pagan_holy_site_norway"),
      (eq,":current_scene","scn_pagan_holy_site_danmark"),
      ], "What do you want? I do not have time for you! Get yourself a priest!", "close_window",[]],
  ############
  ###add-ons mael bresail's fort
  [anyone,"start", [(store_conversation_troop, "$g_talk_troop"),(neq, "$g_talk_troop", "trp_town_25_seneschal"), #The end
      #(neq, "trp_npc2", "$g_talk_troop"),
      (store_current_scene,":current_scene"),(eq,":current_scene","scn_mael_bresail_end"),
      ], "Mael Bresail wants to talk to you.", "close_window",[]],
  [anyone,"start", [(store_conversation_troop, "$g_talk_troop"),(neq, "$g_talk_troop", "trp_maelbresail_man"), #The end
      #(neq, "trp_npc2", "$g_talk_troop"),
      (store_current_scene,":current_scene"),(eq,":current_scene","scn_mael_bresail_farm_meeting"),
      ], "Sorry, this is not a good time to talk.", "close_window",[]],
  
  #######camp companions conversations
  #start camp conversartion
  [anyone,"start", [(store_current_scene,":current_scene"),
      (this_or_next|eq,":current_scene","scn_player_camp"),
      (eq,":current_scene","scn_player_camp_fortified"),
      #(store_conversation_agent,"$talk_agent"),
      (store_conversation_troop, "$g_talk_troop"),
      (is_between, "$g_talk_troop", companions_begin,companions_end),
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      ], "--You find your companion in his usual part of the camp.--", "conversation_companioncamp",[]],
  ###no conversation but active
  [anyone,"start", [(store_current_scene,":current_scene"),
      (this_or_next|eq,":current_scene","scn_player_camp"),
      (eq,":current_scene","scn_player_camp_fortified"),
      #(store_conversation_agent,"$talk_agent"),
      ##                        (store_conversation_troop, "$g_talk_troop"),
      (is_between, "$g_talk_troop", companions_begin,companions_end),
      ##                        (troop_slot_ge,"$g_talk_troop",slot_troop_companion_camp_conversation,0),
      ], "I'm busy right now, {playername}. We'll talk later.", "close_window",[]],
  [anyone,"start", [(store_current_scene,":current_scene"),
      (this_or_next|eq,":current_scene","scn_player_camp"),
      (eq,":current_scene","scn_player_camp_fortified"),
      #(store_conversation_agent,"$talk_agent"),
      ##                        (store_conversation_troop, "$g_talk_troop"),
      ##                        (is_between, "$g_talk_troop", companions_begin,companions_end),
      ##                        (troop_slot_ge,"$g_talk_troop",slot_troop_companion_camp_conversation,0),
      ], "{reg59?Lady:Sir}, everything is in order in the camp.", "close_window",[]],
  
  #########Charlas de campamento chief
  
  ####beda1
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc16"), #Beda
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 0), #si no es 0 no continua
    ],
    "My {reg59?lady:lord}, sometimes I think, as we travel along the northern lands, what a dismal world we live in. " +
    "I have read many books, but none of them talks about the violence and many dangers that we go through daily. ", "beda_conversationcamp1", [
  ]],
  [anyone, "beda_conversationcamp1", [
    ],
    "Well, I think the Danish are the hordes of Gog and Magog that will come at the last hour of the world and that the Kingdom of West Seaxe is the last human kingdom trying to fight the inevitable before the Second Coming.", "beda_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone|plyr, "beda_conversationcamp2", [
      ], "Err...can you explain that Gog and Magog thing?", "beda_conversationcamp3", []],
  [anyone|plyr, "beda_conversationcamp2", [
      ], "Very interesting, but I don't have time for this right now.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  [anyone, "beda_conversationcamp3", [
    ],
    "Oh, well, the Bible mentions Gog as a leader of the horde coming from the land of Magog in the far north. In Ezekiel's prophecy, Gog leads a great army of skilled warriors from many different nations. They will attack the nation of men chosen by God, " +
    "and there will be a great battle that will affect the whole world. I think that this is what is happening now, with all these pagans advancing over Englaland.", "beda_conversationcamp4", [
  ]],
  
  [anyone|plyr,"beda_conversationcamp4", [
      (str_clear, s10),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@Perhaps there is a little time left until the end of the world. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@You're right! The coming of the Vikings shows that it's truly the End! (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@The Bible also says that a king will unite all the earth. I am that king. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@A change in the world just makes more opportunity for the bold, that's all. (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "beda_conversationcamp5",[
  ]],
  [anyone|plyr, "beda_conversationcamp4", [
      ], "We need to focus on the here and now. When the End comes, I assure you we won't miss it.", "beda_conversationcamp6", [
  ]],
  [anyone|plyr, "beda_conversationcamp4", [
      ], "You worry too much, and I do not have time for this.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone,"beda_conversationcamp5", [
    ],
    "{!}{s4}", "close_window",[
      (str_clear, s4),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s4, "@I appreciate your reassuring words, but I'm afraid that the end of the world has already been set, and nothing that we do or say will alter it. " +
        "All we can do is wait and fight until the armies of God come."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s4, "@Exactly! West Seaxe is the last bastion of the faithful, but it will succumb to the hordes despite all its efforts. We're all going to die! Leave me alone, I do not want to talk any more."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s4, "@Your self-confidence comforts me, but I must inform you that the king will be defeated by the army of evil. Only the arrival of the army of God will save the world. " +
        "However, if you ever become the king, it will be a pleasure to fight and die beside you."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s4, "@I'm surprised that you can see any benefit in the misfortunes of others. You're definitely more ruthless than I had thought."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (try_end),
  ]],
  
  [anyone, "beda_conversationcamp6", [
    ],
    "Yes, that's true. I tend to worry too much about things. I will enjoy the day.", "close_window", [
  ]],
  ######
  #egil
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc2"), #egil
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1)
    ],
    "{playername}, I like you, but sometimes I think you're too naive as a leader. Allow me to give you some advice.", "egil_conversationcamp1", [
  ]],
  [anyone, "egil_conversationcamp1", [
    ],
    "I don't want to offend you, but I think you should take advantage of my experience. As you know, I grew up in the court of the king. I spend a lot of time in Ribe, where I meet the greatest warlords and their commanders.", "egil_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone|plyr,"egil_conversationcamp2", [
      (str_clear, s10),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@You need to rid yourself of arrogance. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@I am always willing to learn. Thanks, Egil. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@I think it's clear that Fate is more favorable to me than to you. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Silence! You shall not disrespect my authority! (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "egil_conversationcamp3",[
  ]],
  
  [anyone|plyr, "egil_conversationcamp2", [
      ], "I do not need your lessons.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone,"egil_conversationcamp3", [
    ],
    "{!}{s4}", "close_window",[
      (str_clear, s4),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s4, "@Yes, I pretended to be modest. Well, it's something that comes naturally to me, but arrogance is good for a leader. " +
          "You should learn to be a bit arrogant when needed -- that is part of my advice -- and men should see your confidence. Your orders must be sharp, and anyone who does not follow them has to be punished. " +
        "This is what I value in a leader, and I'm glad you listened. But enough talking."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s4, "@I understand. Someone like you does not have my experience and my knowledge. It is important that you try to learn from me, {playername}. " +
          "Try to be like me, someone whom people admire and respect. I would also suggest that you be the first into battle, setting an example for your men, and share silver with your men without greed. " +
        "Those are my tips. Now I have things to do."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
        (call_script, "script_change_troop_renown", "trp_player", -18),
        (display_message, "@Your men see the way Egil treats you, and you lose authority."),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s4, "@And people say that I'm arrogant! But what can I say? Well, I like it. That's what I value most in a leader: his ability to demonstrate self-confidence and to convince others with his charisma. " +
        "You're right. I have nothing to teach you."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s4, "@I only pretended to give advice, but it is clear you do not wish to listen. " +
        "Well, you gave an order, demonstrating your authority, but that doesn't mean you're a good leader. I'll comply, shut up and return to my chores."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (try_end),
  ]],
  
  ######
  ###Donnachdh
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc4"), #Donnachdh
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 0),
    ],
    "Salve warlord, you should know that I'm from Eriu and descend directly from ancient warriors. Even my mother came from the old clan that the hero Cu Chulainn belonged to.", "donnachdh_conversationcamp1", [
  ]],
  [anyone, "donnachdh_conversationcamp1", [
    ],
    "Eriu is divided into small clans that are grouped under the ones that are more powerful. These form kingdoms, for ages five in number. It is very important for each clan to show its power, and they often fight small wars. " +
    "We mostly fight against neighboring clans, where rivalry tends to flourish, but many times larger clans lead others to wars between kingdoms, because the most important men of the island aspire to the throne of Tara. " +
    "Being the master of Tara means you are the high king, Ard Ruire, of all Eriu, and that brings much glory for your clan.", "donnachdh_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone|plyr, "donnachdh_conversationcamp2", [
      ], "So many rivalries make things easy for the Vikings.", "donnachdh_conversationcamp3", []],
  [anyone|plyr, "donnachdh_conversationcamp2", [
      ], "So many wars produce very tough warriors.", "donnachdh_conversationcamp3_2", []],
  [anyone|plyr, "donnachdh_conversationcamp2", [
      ], "Someone should unite all the clans.", "donnachdh_conversationcamp3_3", []],
  [anyone|plyr, "donnachdh_conversationcamp2", [
      ], "I'm interested very little in this.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  
  [anyone, "donnachdh_conversationcamp3", [
    ],
    "I admit that the Vikings have managed to become strong in some parts of the island, but they are as divided as we are. In fact, I dare say that they are already part of the way we do things in Eriu. " +
    "It is not uncommon to see Vikings fighting alongside Goidels against other Vikings. " +
    "The kings of Eriu have taken to hiring them as mercenaries, and Vikings often serve rival clans who face each other.", "donnachdh_conversationcamp4", [
  ]],
  [anyone, "donnachdh_conversationcamp3_2", [
    ],
    "Yes, that's true. War eliminates the weakest and forces men to learn how fight. It is definitely a good place to get warriors for your army. " +
    "On the other hand, if you let yourself be entangled by Goidelic politics or you try to become king of Tara, you will realize that the island has certain political traditions and that nothing you do will ever change Eriu.", "donnachdh_conversationcamp4", [
  ]],
  [anyone, "donnachdh_conversationcamp3_3", [
    ],
    "All men and clans covet the throne of Tara, but really hardly anyone is capable of sitting in it. Those who try tend to have short lives, " +
    "but always another man and another clan come along, and the cycle continues. If the throne of Tara is ever yours, may you enjoy it as long as possible. Your clan will be famous and respected, but your life will be very short.", "donnachdh_conversationcamp4", [
  ]],
  
  [anyone, "donnachdh_conversationcamp4", [
    ],
    "Surely, Eriu, or Hibernia, as the Romans called it, is a different land. Forget everything you know, Eriu is different!", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  #################
  ###########Donnachdh and Dwywei
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc4"), #donnachdh
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 1),
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
    ],
    "Every time I give an order in your name, Dwywei questions my authority among your men. Now she is gathering with some warriors to mutter against me. " +
    "I do not understand this hate, as we both are from the same kingdom.", "donnachdh_dwywei_conv1", [
      (talk_info_show, 0), ]],
  [anyone|other(trp_npc7), "donnachdh_dwywei_conv1", [
    ],
    "The Scots of Dal Riata are bloody traitors. They came from Eriu to take our western lands. Some years ago, we lost our beloved king Bridei fighting against the Norsemen, and most of the Pictish nobility died with him. " +
    "Then Cinaed mac Ailpin, the king of Dal Riata, disputed the Pictish crown with the surviving members of the seven royal houses of the Picts.", "donnachdh_dwywei_conv2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 2), #assign 2, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone|other(trp_npc7), "donnachdh_dwywei_conv2", [
    ],
    "-- She grits her teeth --^^Cinaed defeated us in battle and later met all claimants to the Pictish crown at Scone. They feasted while mead and ale flowed freely. " +
    "What happened next is known as Mac Ailpin's treason: 'the Conqueror' killed all our nobles and became the only claimant for the Pictish Crown. Now his successor, the king of Alban, rules over both the Picts and the Scots. " +
    "Who can trust in this traitor's race? Me? No!", "donnachdh_dwywei_conv3", [
  ]],
  
  [anyone, "donnachdh_dwywei_conv3", [
    ],
    "Stupid and stubborn Picts...", "donnachdh_dwywei_conv4", [
  ]],
  
  [anyone|plyr, "donnachdh_dwywei_conv4", [
      ], "Forget this old enmity. Now you have a common enemy. Together you must face the Norsemen.", "donnachdh_dwywei_conv5", []],
  [anyone|plyr, "donnachdh_dwywei_conv4", [
      ], "I understand your concern about the Scots, but Donnachdh has proven to be a man of honor.", "donnachdh_dwywei_conv6", []],
  [anyone|plyr, "donnachdh_dwywei_conv4", [
      ], "Is this how Scots are? Then I hate them, too. Dirty traitors!", "donnachdh_dwywei_conv7", []],
  
  [anyone|other(trp_npc7), "donnachdh_dwywei_conv5", [
    ],
    "As you wish.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 8),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -2),
  ]],
  [anyone|other(trp_npc7), "donnachdh_dwywei_conv6", [
    ],
    "I understand that Donnachdh is not guilty of what happened. I'll try being nicer to him.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
  ]],
  
  [anyone, "donnachdh_dwywei_conv7", [
    ],
    "I hope, for your sake, that you are kidding, but I don't find you so funny.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 6),
  ]],
  
  ###Morgant
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc5"), #Morgant
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1)
    ],
    "{reg59?My lady:Sir}, in Cornubia men with guts are a dying breed. In the past, we were a proud people, and our holdings stretched across southern Britannia. Then the Saxons came, and we lost the land.", "morgant_conversationcamp1", [
  ]],
  [anyone, "morgant_conversationcamp1", [
    ],
    "Now the sea brings the Danish, as previously it did the Angles and the Saxons. Now, the Saxons fear losing this land they took from us to the Danish. " +
    "Isn't fate ironic?", "morgant_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone|plyr, "morgant_conversationcamp2", [
      ], "Sure, but don't bother me about Saxons. They will lose what they stole.", "morgant_conversationcamp3", []],
  [anyone|plyr, "morgant_conversationcamp2", [
      ], "The Saxons are strong. They will resist the Danish.", "morgant_conversationcamp3_2", []],
  [anyone|plyr, "morgant_conversationcamp2", [
      ], "I have very little interest in this.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone, "morgant_conversationcamp3", [
    ],
    "It is possible. Maybe God has a sense of humor or our prayers have brought the Danish to punish the Saxons. But who cares? Britannia is lost to the Britons.", "morgant_conversationcamp4", [
  ]],
  [anyone, "morgant_conversationcamp3_2", [
    ],
    "You mean we were weak? I think not! It is true that we were disunited and unlucky with our kings, but Arthur showed that it was possible to defeat the Saxons. We can only regret that there was no one to pick up his legacy. Britannia is now lost for us.", "morgant_conversationcamp4", [
  ]],
  
  [anyone|plyr, "morgant_conversationcamp4", [
      ], "Britannia will be returned to the Britons. I swear I will do it.", "morgant_conversationcamp5", []],
  [anyone|plyr, "morgant_conversationcamp4", [
      ], "Forget the past and focus on the present.", "morgant_conversationcamp5_1", []],
  
  
  [anyone, "morgant_conversationcamp5", [
    ],
    "I appreciate your words, but both of us know that, even if you conquer the whole island, Britannia of today has nothing in common with Britannia of yore. It will not be the same.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  [anyone, "morgant_conversationcamp5_1", [
    ],
    "Yes, you're right. There is little sense in mourning the past. Let us return to the present.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  #################
  
  ###Dwywei
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc7"), #Dwywei
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 0),
    ],
    "{playername}, my parents were important people in Pictland, and their grandparents before them, and all my ancestors. They were descendants on the maternal side -- the one that matters to Picts -- of royal blood.", "dwywei_conversationcamp1", [
  ]],
  [anyone, "dwywei_conversationcamp1", [
    ],
    "However, there have been many changes in the kingdom known as Alban. Our people are mixing with our old enemies, the Goidels of Dal Riata, and my family was disgraced. " +
    "I tried to recover our prestige as a warrior, but since the Picts embraced Christ, women have been excluded from this profession more and more each day. Ultimately, I failed, and my family paid with their lives for my failure.", "dwywei_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  
  [anyone, "dwywei_conversationcamp2", [
    ],
    "I do not normally talk about this, but I would like to say I have found a new family while traveling with you. This helps me to ease the burden of my past. " +
    "For years, I hated the current kings of Alban. Now I don't care any more. My failure and the new laws of our land brought about the end of my family. I just pray that you don't judge me harshly for my past.", "dwywei_conversationcamp3", [
  ]],
  
  [anyone|plyr, "dwywei_conversationcamp3", [
      ], "What happened is in the past. You are very important to me.", "dwywei_conversationcamp4", []],
  [anyone|plyr, "dwywei_conversationcamp3", [
      ], "Thanks for sharing your story with me. I'm glad you found peace with yourself.", "dwywei_conversationcamp4_2", []],
  [anyone|plyr, "dwywei_conversationcamp3", [
      ], "You caused the death of your family, and you do not want to be judged harshly? Nonsense!", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -15),
  ]],
  
  [anyone, "dwywei_conversationcamp4", [
    ],
    "--She looks down shyly--^^You are also very important to me. Oh, well, I have things to do.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
  ]],
  [anyone, "dwywei_conversationcamp4_2", [
    ],
    "Thank you for your understanding.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  #################
  ###Dwywei 2, romance 1
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc7"), #Dwywei
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 1),
    ],
    "{playername}, although you see me fight hard in battles, mark my body with war paint, and scream while I stab our enemies...", "dwyweiromance_conversationcamp1", [
  ]],
  [anyone, "dwyweiromance_conversationcamp1", [
    ],
    "You know I'm a shy person, right?", "dwyweiromance_conversationcamp3", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 2), #assign 2, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  
  [anyone|plyr, "dwyweiromance_conversationcamp3", [
      ], "I did not know that.", "dwyweiromance_conversationcamp4", []],
  [anyone|plyr, "dwyweiromance_conversationcamp3", [
      ], "Yes, I know.", "dwyweiromance_conversationcamp4_2", []],
  [anyone|plyr, "dwyweiromance_conversationcamp3", [
      ], "I have little time now to hear about this. We'll talk later.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -15),
  ]],
  
  [anyone, "dwyweiromance_conversationcamp4", [
    ],
    "Oh, I see. Well, well, I... we'll talk another day...", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone, "dwyweiromance_conversationcamp4_2", [
    ],
    "What I mean is that I can say things, but I want you to know that I admire and appreciate you very much. Well, I do not want to talk more about this. It is cumbersome. We'll talk another day.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  #################
  ###Dwywei 2, romance 1
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc7"), #Dwywei
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1)
    ],
    "I need to talk to you, {playername}. It is a very serious issue for me, but I will raise it only once.", "dwyweiromance2_conversationcamp1", [
  ]],
  [anyone, "dwyweiromance2_conversationcamp1", [
    ],
    "You know I'm interested in you, appreciate you and like you. I think you feel the same way when you look at me, but I'm not sure. Can it be...?", "dwyweiromance2_conversationcamp3", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 3), #assign 3, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  
  [anyone|plyr, "dwyweiromance2_conversationcamp3", [
      ], "Yes, Dwywei, I like you a lot.", "dwyweiromance2_conversationcamp4", []],
  [anyone|plyr, "dwyweiromance2_conversationcamp3", [
      ], "Sorry, but I'm not interested in you.", "dwyweiromance2_conversationcamp4_2", []],
  
  [anyone, "dwyweiromance2_conversationcamp4", [
    ],
    "I am happy to hear you say that! I guess this means we're together, yes?", "dwyweiromance2_conversationcamp5", [
  ]],
  [anyone, "dwyweiromance2_conversationcamp4_2", [
    ],
    "I'm sorry, I'm sorry, I feel embarrassed. I thought... I was wrong. Sorry, I will not bother you any more. Now, I have things to do.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  
  [anyone|plyr, "dwyweiromance2_conversationcamp5", [
      ], "Yes, Dwywei, you are my woman now.", "dwyweiromance2_conversationcamp6", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 40),
      (assign,"$romance_target","trp_npc7"), #romance variable
  ]],
  [anyone|plyr, "dwyweiromance2_conversationcamp5", [
      ], "No. It was just a joke. I'm not interested in you at all.", "dwyweiromance2_conversationcamp7", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
  ]],
  
  [anyone, "dwyweiromance2_conversationcamp6", [
    ],
    "I am so happy! I love you. I am going to put my things in your tent!", "close_window", [
  ]],
  
  [anyone, "dwyweiromance2_conversationcamp7", [
    ],
    "A joke? You're a jerk! What kind of person kids about things like that? Leave me alone. I do not want to see you any more.", "close_window", [
  ]],
  
  ############## Reginhard
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc8"), #
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1)
    ],
    "My friend, some of your men are muttering because the food is disgusting. Do you want their names?", "reginhard1_conversationcamp1", [
  ]],
  [anyone|plyr, "reginhard1_conversationcamp1", [
    ],
    "I really appreciate your concern, Reginhard.", "reginhard1_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone, "reginhard1_conversationcamp2", [
    ],
    "Well, err... I know you are a generous man. I'm sure you will reward my fidelity someway... You know what I mean, right?", "reginhard1_conversationcamp3", [
      #   (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  
  
  
  [anyone|plyr, "reginhard1_conversationcamp3", [ (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 300),
      ], "Sure. Take this money and keep me informed.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 8),
      (call_script, "script_change_troop_renown", "trp_player", -6),
      (troop_remove_gold, "trp_player", 300),
  ]],
  [anyone|plyr, "reginhard1_conversationcamp3", [
      ], "Shut up, you greedy scum. Don't try to cheat me again.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -8),
      (call_script, "script_change_troop_renown", "trp_player", 3),
  ]],
  [anyone|plyr, "reginhard1_conversationcamp3", [
      ], "I always reward every man as he deserves. Don't forget that.", "close_window", [
  ]],
  [anyone|plyr, "reginhard1_conversationcamp3", [
      ], "It won't be necessary. Tomorrow the food will be better.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -4),
  ]],
  ############## Clovis
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc9"), #
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 0),
    ],
    "Warlord, I think it's necessary to train our men more. Haven't you read Vegetius? The ancients knew how to convert simple farmers into great soldiers in just a few days.", "clovis1_conversationcamp1", [
  ]],
  [anyone, "clovis1_conversationcamp1", [
    ],
    "I can force them to practice harder. Trust me. You will see how I transform them into veteran warriors.", "clovis1_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  
  [anyone|plyr, "clovis1_conversationcamp2", [ (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 1000),
      ], "Alright, let them sweat, but I want good results. Take these 1000 peningas to reward the best.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 8),
      (party_add_xp, "p_main_party", 199000),
      (call_script, "script_change_player_party_morale", -5),
      (troop_remove_gold, "trp_player", 1000),
  ]],
  [anyone|plyr, "clovis1_conversationcamp2", [
      ], "That is a good idea. I appoint you weapon master.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
      (party_add_xp, "p_main_party", 99000),
      (call_script, "script_change_player_party_morale", -12),
  ]],
  [anyone|plyr, "clovis1_conversationcamp2", [
      ], "They are tired; I don't want to force them... for now. But I appreciate your offer.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -4),
  ]],
  ############## Ceawlin
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc10"), #
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 0),
    ],
    "I want to tell you something important. A war band has to be led by a man of honor, but these times are too hard for mercy. " +
    "The warriors need a strong leader, someone able to make hard decisions when they are needed.", "ceawlin1_conversationcamp1", [
  ]],
  [anyone|plyr, "ceawlin1_conversationcamp1", [
    ],
    "--You realize some of your men hear the conversation--^^Only a fool can consider mercifulness as weakness.", "ceawlin1_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone, "ceawlin1_conversationcamp2", [
    ],
    "Just so, but fear converts men into fools. Don't be weak, {playername}. They smell fear, like dogs.", "ceawlin1_conversationcamp3", [
  ]],
  
  [anyone|plyr, "ceawlin1_conversationcamp3", [
      ], "I appreciate your concern, but I know how to manage my people.", "close_window", [
  ]],
  [anyone|plyr, "ceawlin1_conversationcamp3", [
      ], "Maybe you are right, my friend. I will follow your advice.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 6),
      (call_script, "script_change_player_party_morale", -2),
  ]],
  ############## Ailchu
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc14"), #
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 0),
    ],
    "I have reconsidered my opinion about Brunhild. Maybe she can be a good warrior after all. Do you know why?", "ailchu1_conversationcamp1", [
  ]],
  [anyone|plyr, "ailchu1_conversationcamp1", [
    ],
    "I am listening.", "ailchu1_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone, "ailchu1_conversationcamp2", [
    ],
    "Because she can bleed for a week and not die! Ha, ha, ha... Seriously, is she really necessary here? Her constant gossiping gives me headaches.", "ailchu1_conversationcamp3", [
  ]],
  
  [anyone|plyr, "ailchu1_conversationcamp3", [
      ], "Seriously, you give me headaches. Yet I keep you...", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -8),
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", 10),
  ]],
  [anyone|plyr, "ailchu1_conversationcamp3", [
      ], "If you are not comfortable here, you are free to go.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", 5),
  ]],
  [anyone|plyr, "ailchu1_conversationcamp3", [
      ], "Maybe a war band is not a good place for her. I'll think about it.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", -5),
  ]],
  ############## Caio
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc1"), #Caio
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 0),
    ],
    "In your army, I visit so many places and meet so many people. I didn't realize the world was so big!", "caio_conversationcamp1", [
  ]],
  [anyone, "caio_conversationcamp1", [
    ],
    "Honestly, my family and I lived in the cave all this time, only going to the Wall to sell goods. Once I visited Bebbanburh, and I thought that was the greatest and most wonderful place. That was nothing compared to the places you take me now.", "caio_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone|plyr, "caio_conversationcamp2", [
      ], "And there are still many more places for you to visit.", "caio_conversationcamp3", []],
  [anyone|plyr, "caio_conversationcamp2", [
      ], "Why are you bothering me with this?", "caio_conversationcamp4", [
  ]],
  [anyone, "caio_conversationcamp3", [
    ],
    "I'm sure there are plenty of places to visit. I can only say that joining you was the best decision of my life. I will never return to the cave of my parents.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  
  [anyone, "caio_conversationcamp4", [
    ],
    "Ah, excuse me, sorry. I understand that for someone like you, this is very trivial, but for me it's so new. I will not bother you with my silly talk any longer. Farewell.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
  ]],
  ###########Caio and Morgant
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc1"), #Caio
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 1),
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
    ],
    "I want to ask to you about...", "caio_morgant_conv1", [
      (talk_info_show, 0), ]],
  [anyone|other(trp_npc5), "caio_morgant_conv1", [
    ],
    "Caio is the stupidest man I have ever met. He is always asking about the most basic things. He knows nothing about tactics, and his ignorance puts all of us in danger.", "caio_morgant_conv2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 2), #assign 2, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  
  [anyone, "caio_morgant_conv2", [
    ],
    "Excuse me if I have offended you. I just wanted to know what a cuenus is.", "caio_morgant_conv3", [
  ]],
  
  [anyone|other(trp_npc5), "caio_morgant_conv3", [
    ],
    "--He is angrier and begins to speak louder--^^Don't you know?", "caio_morgant_conv4", [
  ]],
  
  [anyone|plyr, "caio_morgant_conv4", [
      ], "You have to be patient with Caio. He is a valuable man and learns fast.", "caio_morgant_conv5", []],
  [anyone|plyr, "caio_morgant_conv4", [
      ], "Caio, if you don't come up to scratch soon, you should consider leaving us.", "caio_morgant_conv6", []],
  [anyone|plyr, "caio_morgant_conv4", [
      ], "Don't bother me with this foolishness again.", "close_window", []],
  
  [anyone, "caio_morgant_conv5", [
    ],
    "Thank you for your confidence.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  [anyone, "caio_morgant_conv6", [
    ],
    "I... understand.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc5", 4),
  ]],
  
  ####################
  
  ###############Brunhild
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc3"), #Brunhild
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 0),
    ],
    "Sometimes when I sleep, I dream of my past life in Doccinga and Kennemer. These nightmares remind me of my time of servitude.", "brunhild_conversationcamp1", [
  ]],
  [anyone, "brunhild_conversationcamp1", [
    ],
    "I am glad that I have left all that behind. In fact, I hate Friese, and treading its soil brings back dark memories. " +
    "When we visit Friese on our travels, I only ask you to have patience with me. I will spend most of the time in my tent when we are not walking or fighting, sulking and not wanting to talk to anyone.", "brunhild_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone, "brunhild_conversationcamp2", [
    ],
    "Now, forgive me, but just talking about it has upset my stomach. I think all these memories make me so depressed that I may never fully heal.", "close_window", [
  ]],
  
  ########################Bodo
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc6"), #Bodo
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 0),
    ],
    "--You note that he is impatient, nervous.--^^Hi {playername}. We've been traveling together for a while, and our friendship, at least for me, is sincere. In fact, I have not trusted anyone like this for years.", "bodo_conversationcamp1", [
  ]],
  [anyone, "bodo_conversationcamp1", [
    ],
    "Actually, I'm surprised that our relationship is so good. My life has not been easy, especially here in the north, and I find it hard to trust people, but you're winning my trust so easily, it scares me.", "bodo_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone|plyr, "bodo_conversationcamp2", [
      ], "It's good to trust others, Bodo.", "bodo_conversationcamp3", []],
  [anyone|plyr, "bodo_conversationcamp2", [
      ], "That has happened to me as well.", "bodo_conversationcamp3_2", []],
  [anyone|plyr, "bodo_conversationcamp2", [
      ], "Keep your distance. You're just a soldier to me.", "bodo_conversationcamp4", [
  ]],
  [anyone, "bodo_conversationcamp3", [
    ],
    "Yes, you're right. I should trust myself more. Friendship is normal, not a dangerous shackle. Thanks my friend!", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  [anyone, "bodo_conversationcamp3_2", [
    ],
    "You feel it, too? You see? We are suspicious people, too used to danger and to being deceived. I'll think about it! Thanks for your time.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone, "bodo_conversationcamp4", [
    ],
    "Yes, sorry. I was confused, but you've certainly cleared it up for me.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  ############
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc6"), #Bodo
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
    ],
    "{playername}, we have to talk! It is complicated. I do not know how to say this, but it needs to be said.", "bodo_2conversationcamp1", [
  ]],
  [anyone, "bodo_2conversationcamp1", [
    ],
    "Let me be clear, I've noticed how you look at me, and I fear that you're falling for me. I completely understand. I am an attractive man with warrior skills and leadership, but I must warn you that I am a married. I have a woman there in Cantabria and sixteen children.", "bodo_2conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 2), #assign 2, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone|plyr, "bodo_2conversationcamp2", [
      ], "I think you should stop experimenting with mushrooms, Bodo. I have no interest in you.", "bodo_2conversationcamp3", []],
  [anyone|plyr, "bodo_2conversationcamp2", [
      ], "It's true. I really like you.", "bodo_2conversationcamp3_2", []],
  [anyone|plyr, "bodo_2conversationcamp2", [
      ], "Keep your distance, sir. You're a lowly soldier! I hardly even notice your presence.", "bodo_2conversationcamp4", [
  ]],
  [anyone, "bodo_2conversationcamp3", [
    ],
    "Are you sure? That surprises me, I'm a real man, really macho, who attracts a lot of women. Well, luckily, now I can breathe easier.", "close_window", [
  ]],
  [anyone, "bodo_2conversationcamp3_2", [
    ],
    "That worries me. You're an attractive woman, but you must know that I'm a married man and I owe it to my wife. I must make it clear that nothing will ever happen between us.", "bodo_2conversationcamp5", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone, "bodo_2conversationcamp4", [
    ],
    "Yes, sorry. I was confused, but you've certainly cleared it up for me.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone|plyr, "bodo_2conversationcamp5", [
      ], "I was joking. I do not really like you. You're an ugly pig.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  [anyone|plyr, "bodo_2conversationcamp5", [
      ], "Do not worry. From now on, our relationship will strictly be that of warlord and soldier.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
  ]],
  [anyone|plyr, "bodo_2conversationcamp5", [
      ], "No problem, but I will keep your name on my wish list.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  ########################
  ########################Solveig
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc11"), #Solveig
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 0),
    ],
    "For the first time in my life, I feel like I am in a real army. Being a warrior and being beautiful have never made it easy for me to be part of a large group of men, but here you know how to maintain order, and people respect me.", "solveig_conversationcamp1", [
  ]],
  [anyone, "solveig_conversationcamp1", [
    ],
    "The Danish and Norwegians, and the world in general, do not have a good opinion of a woman who leaves home armed and ready to fight. Exactly for this reason, the skjaldmo are more legend than reality. There are very few like me, and soon there will be none, believe me.", "solveig_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone|plyr, "solveig_conversationcamp2", [
      ], "In my army, we do not distinguish between men and women, only between good and bad warriors.", "solveig_conversationcamp3", []],
  [anyone|plyr, "solveig_conversationcamp2", [
      ], "You will always be well treated here.", "solveig_conversationcamp3_2", []],
  [anyone|plyr, "solveig_conversationcamp2", [
      ], "Woman, your place is at home with a husband.", "solveig_conversationcamp4", [
  ]],
  [anyone, "solveig_conversationcamp3", [
    ],
    "I know, and I like it here. You must know that you have a loyal follower in me. I am committed to your cause.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  [anyone, "solveig_conversationcamp3_2", [
    ],
    "Thanks, {playername}. I hope to stay with you for a long time.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone, "solveig_conversationcamp4", [
    ],
    "I am confused. On the one hand, you accept me in your army, but on the other hand, you say I should get married and go home. You must be joking. Hah! Good one on old Solveig.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
  ]],
  ############
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc11"), #Solveig
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
    ],
    "{playername}, I like you a lot. I must admit that I am drawn to you.", "solveig_2conversationcamp1", [
  ]],
  [anyone, "solveig_2conversationcamp1", [
    ],
    "As you know, I chose the path of war. I keep my virginity in order to protect myself from love and men. " +
    "It is not an easy way; it's not a comfortable way, but it has its laws, and if I break these, my life will become meaningless. " +
    "My arms are my only husbands, and my shield is my home. I need you to respect that or I'll have to leave your company.", "solveig_2conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 2), #assign 2, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone|plyr, "solveig_2conversationcamp2", [
      ], "I respect that, Solveig, and I am not really attracted to you.", "solveig_2conversationcamp3", []],
  [anyone|plyr, "solveig_2conversationcamp2", [
      ], "Sorry, Solveig, but I'm in love with you.", "solveig_2conversationcamp4", [
  ]],
  [anyone, "solveig_2conversationcamp3", [
    ],
    "Well, part of me regrets that my feelings are not reciprocated, but the other part is happy to continue serving under your banner. I need to analyze these feelings. Good luck, friend.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone, "solveig_2conversationcamp4", [
    ],
    "I understand. We love each other, but we can't be together. If I give in to this, I will end up locked away on a farm looking after 10 kids, and I could not bear that. " +
    "I was born to be free and live an intense life. I want to enjoy the same freedoms as a man. I think it would be the best if I leave.", "solveig_2conversationcamp5", [
  ]],
  [anyone|plyr, "solveig_2conversationcamp5", [
      ], "Don't leave, Solveig. We will never discuss this again, and I shall restrain myself.", "solveig_2conversationcamp6", []],
  [anyone|plyr, "solveig_2conversationcamp5", [ (neq, "$campaign_type", camp_storyline), #chief only in sandbox
      ], "Yes, it is best that you leave.", "solveig_2conversationcamp7", [
  ]],
  
  [anyone, "solveig_2conversationcamp6", [
    ],
    "I also want to stay. Let's not talk about it and keep our distance. From now on, I will put my tent as far away from yours as possible. Farewell.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone, "solveig_2conversationcamp7", [
    ],
    "Yes, I think that is most appropriate. Good luck, friend. May the fates accept you.", "close_window", [
      (troop_set_slot, "trp_npc11", slot_troop_occupation, 0), #bye bye solveig
      (troop_set_slot, "trp_npc11", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc11"),
  ]],
  
  ###############Asbjorn
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc12"), #Asbjorn
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1)
    ],
    "It's interesting how Christian priests speak about the end of the world. It is very similar to what the Danish think. In both cases, we do not know when it will come, but we're sure it will. In both cases, it will be a catastrophe of epic proportions and of huge armies fighting in a devastated world.", "asbjorn_conversationcamp1", [
  ]],
  [anyone, "asbjorn_conversationcamp1", [
    ],
    "But they think differently about other things. For the Danish, a large tree, called Yggdrasil, holds the nine worlds. " +
    "The principal world is Asgard, where the gods live and which is governed by Odin and his wife Frigg. It can only be reached by the Rainbow Bridge, named Bifrost and guarded by Heimdal.", "asbjorn_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone|plyr, "asbjorn_conversationcamp2", [
      ], "Tell me more.", "asbjorn_conversationcamp3", []],
  [anyone|plyr, "asbjorn_conversationcamp2", [
      ], "Very interesting, but I have no time to listen. Farewell.", "close_window", [
  ]],
  [anyone, "asbjorn_conversationcamp3", [
    ],
    "Another world is the ice land of Jotunheim, where a giant lives, banished there by our gods, the Aesir. There are also Alfheim, home of the elves, and Svartalfaheim, inhabited by dark elves and dwarves. " +
    "We are in Midgard, the Middle Earth, inhabited by men. Below is the dark world of Niflheim, inhabited by the dragon Nidhogg, who has been gnawing at the roots of Yggdrasil from the beginning of time. " +
    "Someday the roots will all be eaten and Yggdrasil will fall, starting Ragnarok. ", "asbjorn_conversationcamp4", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone|plyr, "asbjorn_conversationcamp4", [
      ], "Tell me more.", "asbjorn_conversationcamp5", []],
  [anyone|plyr, "asbjorn_conversationcamp4", [
      ], "Very interesting, but I have no time to listen. Farewell.", "close_window", [
  ]],
  
  [anyone, "asbjorn_conversationcamp5", [
    ],
    "At the end of time, Loki, his monsters and the dead will advance on the other worlds. Heimdall will sound his horn from the Rainbow Bridge, and gods and men will tremble with fear, for they will know that their time has come. " +
    "A battle of gigantic proportions, the Ragnarok, will occur in which the gods and men will clash against the hosts of evil. The gods will lose, because it is well predicted, and their world will be destroyed by chaos. " +
    "Odin will be swallowed up by the wolf Fenrir. ", "asbjorn_conversationcamp6", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone, "asbjorn_conversationcamp6", [
    ],
    "Well, {playername}, I guess it's not a very promising fate, but it teaches us that, no matter what we do, we are doomed. Therefore, it is best to enjoy each new day thoroughly.", "asbjorn_conversationcamp7", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone|plyr, "asbjorn_conversationcamp7", [
      ], "Fate is inexorable, Asbjorn.", "close_window", []],
  [anyone|plyr, "asbjorn_conversationcamp7", [
      ], "I make my own destiny, Asbjorn.", "close_window", [
  ]],
  
  ##############helgi romance
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc13"), #helgi
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 0),
    ],
    "{playername}, as you know, a long time ago I was in the land of Rus in the east. I travelled all through the far lands of the Slavs. I had good boots and became rich, until fate twisted things and brought me west.", "helgi_conversationcamp1", [
  ]],
  [anyone, "helgi_conversationcamp1", [
    ],
    "What I didn't tell you is that I suffered for love. I fell in love with the wife of a jarl, and she fell in love with me. We kept our love a secret, but someone betrayed us. " +
    "The jarl killed his wife and put a price on my head, but I did not flee...", "helgi_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  
  
  [anyone|plyr, "helgi_conversationcamp2", [
      ], "I am listening.", "helgi_conversationcamp4", []],
  [anyone|plyr, "helgi_conversationcamp2", [
      ], "No more talking. You have to keep your hands off other people's wives.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  
  [anyone, "helgi_conversationcamp4", [
    ],
    "I painted my face black and dressed in dark clothes. That night, I broke into his farm and killed him in his sleep. Then I fled to the west, where nobody knew me. " +
    "Although everything I told you before was true, this is the real reason I'm here with you today. However, I have discovered that you are a great leader that I like to follow.", "helgi_conversationcamp5", [
  ]],
  
  [anyone|plyr, "helgi_conversationcamp5", [
      ], "Thank you for your honesty.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  [anyone|plyr, "helgi_conversationcamp5", [
      ], "Nice story, but you have to keep your hands off other people's wives.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
  ]],
  #################
  ###helgi 2, romance 1
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc13"), #Helgi
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #si no es 0 no continua
    ],
    "After the death of Helgi, the woman I was in love with, I thought it was impossible to fall in love again, {playername}.", "helgiromance_conversationcamp1", [
  ]],
  [anyone, "helgiromance_conversationcamp1", [
    ],
    "I think the old wound has finally healed, and I'm ready for a new relationship.", "helgiromance_conversationcamp3", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 2), #assign 2, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  
  [anyone|plyr, "helgiromance_conversationcamp3", [
      ], "I am happy to hear that.", "helgiromance_conversationcamp4", []],
  [anyone|plyr, "helgiromance_conversationcamp3", [
      ], "Well, we will see if your fight better in the shield wall now.", "close_window", [
  ]],
  
  [anyone, "helgiromance_conversationcamp4", [
    ],
    "I'm glad to hear that you are happy about it.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  #################
  ##helgi 2, romance 1
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc13"), #helgi
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
    ],
    "I need to talk, {playername}. It is a very serious issue for me, but I will only raise it once.", "helgiromance2_conversationcamp1", [
  ]],
  [anyone, "helgiromance2_conversationcamp1", [
    ],
    "You know, I'm interested in you, appreciate you and like you. I think you feel the same way when you look at me, but I'm not sure.", "helgiromance2_conversationcamp3", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 3), #assign 3, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  
  [anyone|plyr, "helgiromance2_conversationcamp3", [
      ], "Yes, Helgi, I like you a lot.", "helgiromance2_conversationcamp4", []],
  [anyone|plyr, "helgiromance2_conversationcamp3", [
      ], "Sorry, but I'm not interested in you.", "helgiromance2_conversationcamp4_2", []],
  
  [anyone, "helgiromance2_conversationcamp4", [
    ],
    "I am happy to hear you say that! After Helgi's death, I did not think I could fall in love again, but here we are. I think we will be fine.", "helgiromance2_conversationcamp5", [
  ]],
  [anyone, "helgiromance2_conversationcamp4_2", [
    ],
    "I'm sorry! I'm sorry! I feel embarrassed. I thought... I was wrong. Sorry, I will not bother you any more about this. I have better things to do.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  
  [anyone|plyr, "helgiromance2_conversationcamp5", [
      ], "Yes, we can be together, but please stop mentioning Helgi.", "helgiromance2_conversationcamp6", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
      (assign,"$romance_target","trp_npc7"), #romance variable
  ]],
  [anyone|plyr, "helgiromance2_conversationcamp5", [
      ], "No. It was just a joke. I'm not interested in you at all.", "helgiromance2_conversationcamp7", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
  ]],
  
  [anyone, "helgiromance2_conversationcamp6", [
    ],
    "I am so happy. I love you. Let me go and move my things to your tent!", "close_window", [
  ]],
  [anyone, "helgiromance2_conversationcamp7", [
    ],
    "Save your stupid jokes for yourself, you bitch! Get lost!", "close_window", [
  ]],
  ################
  #agathinos
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc15"), #Agathinos
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
    ],
    "Salve {playername}! My friend and I were just talking about you. We were discussing whether you're just a warlord or if you have ambitions of being Brytenwalda. Oh, sorry to be rude. Here, please meet Heraclio.", "agathinos_conversationcamp1", [
  ]],
  [anyone, "agathinos_conversationcamp1", [
    ],
    "--Agathinos changes his voice, making it sharp--^^Salve {playername}, I am Heraclio from Nicea.", "agathinos_conversationcamp2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 1), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone|plyr, "agathinos_conversationcamp2", [
      ], "Agathinos, what does this mean?", "agathinos_conversationcamp3", []],
  [anyone|plyr, "agathinos_conversationcamp2", [
      ], "Salve Heraclio.", "agathinos_conversationcamp3", []],
  [anyone|plyr, "agathinos_conversationcamp2", [
      ], "Have you been eating mushrooms again? Maybe you need some sleep.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone, "agathinos_conversationcamp3", [
    ],
    "Heraclio is spending a few days with us before returning to Nicea. I haven't seen him for a very long time -- not since those painful, torturous days as slaves of the Norwegians. He will leave soon, but he wanted to meet you before he goes.", "agathinos_conversationcamp4", [
  ]],
  
  [anyone|plyr, "agathinos_conversationcamp4", [
      ], "It's high time I finally met you, Heraclio.", "agathinos_conversationcamp5", []],
  [anyone|plyr, "agathinos_conversationcamp4", [
      ], "I have no time for this. Farewell.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone, "agathinos_conversationcamp5", [
    ],
    "--Agathinos changes his voice, making it sharp--^^My brother from another mother, the illustrious engineer Agathinos, has told me a lot about you. He thinks you'll be Brytenwalda, but I think that you're just a warlord.", "agathinos_conversationcamp6", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone|plyr, "agathinos_conversationcamp6", [
      ], "Agathinos is right. I will be Brytenwalda someday.", "agathinos_conversationcamp7", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone|plyr, "agathinos_conversationcamp6", [
      ], "You are right. I am simply a man of war.", "agathinos_conversationcamp7", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone, "agathinos_conversationcamp7", [
    ],
    "--Before your eyes, Agathinos starts arguing with himself, changing his voice and without paying much attention to you.--", "close_window", [
  ]],
  
  ###########Brunhild and Egil discussion
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc3"), #Brunhild
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
    ],
    "Are you serious, Egil? Did you really make out with a camp follower? I thought you were different and that you really cared about us, but now I see I was wrong. You are just a bastard in every meaning.", "brunhildvsegil_conv1", [
      (talk_info_show, 0), ]],
  [anyone|other(trp_npc2), "brunhildvsegil_conv1", [
    ],
    "Brunhild, Honey, you are just a slave and I'm the son of the king. Our story can't be real. We were just having fun, nothing else. I thought you knew that. You would have to be an idiot to think you can have a king's son just like that. You will always be my favourite, but I have and I will always have my good times with others... Who knows? Maybe someday I will find a lady to marry.", "brunhildvsegil_conv2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 2), #assign 2, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  [anyone|plyr, "brunhildvsegil_conv2", [
      ], "Calm down!", "brunhildvsegil_conv3", []],
  [anyone|plyr, "brunhildvsegil_conv2", [
      ], "(Say nothing)", "brunhildvsegil_conv3", []],
  
  [anyone, "brunhildvsegil_conv3", [
    ],
    "Do you really think that? You are not so superior to me. Your father might be a king, but your mother was nothing but a slave, like me. You will never get anyone better than me, and you will lose me if your attitude doesn't change.", "brunhildvsegil_conv4", [
  ]],
  
  [anyone|other(trp_npc2), "brunhildvsegil_conv4", [
    ],
    "I don't need to be officially recognised as an heir. Everyone knows that I'm the son of the king of Danmark. Every single lady in the kingdom sighs for me. Don't get me wrong, I love you and I really like what we have, but I can have so much more.", "brunhildvsegil_conv5", [
  ]],
  
  [anyone|plyr, "brunhildvsegil_conv5", [
      ], "...^^--Nothing to do here. You run while you can.--", "close_window", [
  ]],
  ####################
  ###########clovis vs Helgi
  [anyone, "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc9"), #Clovis
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_companion_camp_conversed, 1),
    ],
    "You people think that strong arms can win any battle, but it's not always the case. A good formation or a smart strategy is much more important than bold warriors. " +
    "Even in a duel, the strength of a soldier is not the key factor that makes him win or lose.", "clovisvshegil_conv1", [
      (talk_info_show, 0),       ]],
  [anyone|other(trp_npc13), "clovisvshegil_conv1", [
    ],
    "That is what you weak people always think, and that's why we, the bravest soldiers of all Svia, or even just simple Danes, pillage your lands. If you spent more time training and becoming good warriors instead of dancing around one another, you would have a real kingdom instead of those tiny lands you have in Frankia... for now.", "clovisvshegil_conv2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 2), #assign 1, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  
  [anyone, "clovisvshegil_conv2", [
    ],
    "Try to come openly, without any surprises, and we'll see what happens. I swear that your undisciplined men will fall in a few moments and that none of you would survive, because you don't know when one needs to retreat.", "clovisvshegil_conv3", [
  ]],
  
  [anyone|other(trp_npc13), "clovisvshegil_conv3", [
    ],
    "Ha! Cowards! We prefer to be brave and dead instead of being shamed as losers. Victory or death!", "clovisvshegil_conv4", [
  ]],
  
  [anyone|plyr, "clovisvshegil_conv4", [
      ], "Frankia makes better warriors than Svia.", "clovisvshegil_conv5", [
  ]],
  [anyone|plyr, "clovisvshegil_conv4", [
      ], "Svia makes better warriors than Frankia.", "clovisvshegil_conv5_2", [
  ]],
  [anyone|plyr, "clovisvshegil_conv4", [
      ], "I think you both are wrong. A good army needs both strict discipline and strong warriors.", "clovisvshegil_conv5_3", [
  ]],
  [anyone, "clovisvshegil_conv5", [
    ],
    "Ha! The Warlord thinks like me.", "clovisvshegil_conv6", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  [anyone|other(trp_npc13), "clovisvshegil_conv6", [
    ],
    "I'll spare further words.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc13", -10),
  ]],
  
  [anyone|other(trp_npc13), "clovisvshegil_conv5_2", [
    ],
    "Exactly. Ha!", "clovisvshegil_conv6_2", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc13", 10),
  ]],
  [anyone, "clovisvshegil_conv6_2", [
    ],
    "Who was asking? I thought this was a private discussion.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  
  [anyone|other(trp_npc13), "clovisvshegil_conv5_3", [
    ],
    "{!}...", "clovisvshegil_conv6_3", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc13", -5),
  ]],
  [anyone, "clovisvshegil_conv6_3", [
    ],
    "{!}...", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  ####################
  
  ###########agathinos vs beda
  [anyone|other(trp_npc15), "conversation_companioncamp", [
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "trp_npc16"), #Clovis
      (troop_slot_eq,"$g_talk_troop",slot_troop_companion_camp_conversation,1),
    ],
    "--Agathinos stares with great interest at one of the women from the camp...--", "bedavsagathinos_conv1", [
      (talk_info_show, 0),      ]],
  [anyone|other(trp_npc3), "bedavsagathinos_conv1", [
    ],
    "--...Brunhild.--", "bedavsagathinos_conv2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversed, 2), #assign 2, no more this conversation
      (troop_set_slot, "$g_talk_troop", slot_troop_companion_camp_conversation, 0), #back to 0
  ]],
  
  [anyone, "bedavsagathinos_conv2", [
    ],
    "--Spits on the ground.--^^The Greeks are lustful people.", "bedavsagathinos_conv3", [
  ]],
  
  [anyone|other(trp_npc15), "bedavsagathinos_conv3", [
    ],
    "What makes you think so?", "bedavsagathinos_conv4", [
  ]],
  
  [anyone, "bedavsagathinos_conv4", [
    ],
    "Even your priests live in sin. The Council of Elvira forbade clerics to cohabit with their wives. " +
    "Otherwise, how can they celebrate the daily Eucharist? If they yield to the temptation of the flesh, what you can expect from their flock?", "bedavsagathinos_conv5", [
  ]],
  
  [anyone|other(trp_npc15), "bedavsagathinos_conv5", [
    ],
    "Do not confuse celibacy with continence. The Council of Elvira did not forbid marriage to the clergy, just the sharing of a bed before sacred offices.", "bedavsagathinos_conv6", [
  ]],
  
  [anyone, "bedavsagathinos_conv6", [
    ],
    "Sex is a carnal act. That takes us away from the path of Christ. Virginity is an obligation for any true man of God. Am I not right, {playername}?", "bedavsagathinos_conv7", [
  ]],
  
  [anyone|plyr, "bedavsagathinos_conv7", [
      ], "I agree with you, Bede. These people have to be perverts.", "bedavsagathinos_conv8", [
  ]],
  [anyone|plyr, "bedavsagathinos_conv7", [
      ], "And what's wrong with sex? I know priests with more children than Noah.", "bedavsagathinos_conv9", [
  ]],
  [anyone|plyr, "bedavsagathinos_conv7", [
      ], "I don't want to get involved. This is an argument between you and Agathinos.", "bedavsagathinos_conv10", [
  ]],
  
  [anyone, "bedavsagathinos_conv8", [
    ],
    "Well said. You step fully and still in the kingdom of heaven.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc15", -5),
  ]],
  
  [anyone|other(trp_npc15), "bedavsagathinos_conv9", [
    ],
    "Ha! That was good!", "bedavsagathinos_conv9_2", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc15", 10),
  ]],
  [anyone, "bedavsagathinos_conv9_2", [
    ],
    "Why do I even bother? I'm surrounded by lust.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  
  [anyone, "bedavsagathinos_conv10", [
    ],
    "I asked you because I thought you were a brave man and not a coward who evades a straight answer. Farewell.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  ####################
  
  #####################
  ###Jarl Halfdan Ragnarsson chief
  [trp_kingdom_8_lord|other(trp_norse_level0_companion),"start", [
      (check_quest_active,"qst_the_messengersn"),
      (quest_slot_eq,"qst_the_messengersn",slot_quest_current_state, 3),
    ],
    "I have sent a notice of your arrival to the sons of Ragnar. You are bold to come through all these Mercians. Who sent you?", "ragnarssons_1",[
  ]],
  [trp_knight_5_1|other(trp_saxon_level2_landed),"start", [ #####primer encuentro alfredo de wessex mainquest
      (check_quest_active,"qst_the_messengersn"),
      (quest_slot_eq,"qst_the_messengersn",slot_quest_current_state, 6),
    ],
    "Emissary of the Danish, I present you to Aelfred of West Seaxe, son of Aethelwulf, Aetheling, Ealdorman, God loved, and brother of and designated successor to the great Athelred, king of West Seaxe and Brytenwalda. " +
    "Bow to someone who is above you.", "alfredthegreat1",[
  ]],
  
  ###
  [anyone,"start", [(store_current_scene,":current_scene"),(eq,":current_scene","scn_douar_an_enez"),
      (store_conversation_troop, "$g_talk_troop"),
      (neq, "$g_talk_troop", "trp_petrus_didaz"), #the douaranenez
      ], "Sorry, this is not a good time to talk. The leaders are up in the center of the village.", "close_window",[]],
  ####
  
  ###companions in framstead
  [trp_npc2,"start", [(store_current_scene,":current_scene"),(eq,":current_scene","scn_danish_farmstead"),
      #(troop_is_hero,"$g_talk_troop"),
      #(is_between, "$g_talk_troop", companions_begin, companions_end),
      # (eq, "$g_encountered_party", "p_farmland"),
      ], "I am keeping watch.", "close_window",[]],
  [trp_npc3,"start", [(store_current_scene,":current_scene"),(eq,":current_scene","scn_danish_farmstead"),
      #(troop_is_hero,"$g_talk_troop"),
      #(is_between, "$g_talk_troop", companions_begin, companions_end),
      # (eq, "$g_encountered_party", "p_farmland"),
      ], "I am keeping watch.", "close_window",[]],
  [trp_npc6,"start", [(store_current_scene,":current_scene"),(eq,":current_scene","scn_danish_farmstead"),
      #(troop_is_hero,"$g_talk_troop"),
      #(is_between, "$g_talk_troop", companions_begin, companions_end),
      #(eq, "$g_encountered_party", "p_farmland"),
      ], "I am keeping watch.", "close_window",[]],
  [trp_npc8,"start", [(store_current_scene,":current_scene"),(eq,":current_scene","scn_danish_farmstead"),
      #(troop_is_hero,"$g_talk_troop"),
      #(is_between, "$g_talk_troop", companions_begin, companions_end),
      # (eq, "$g_encountered_party", "p_farmland"),
      ], "I am keeping watch.", "close_window",[]],
  [anyone,"start", [(eq, "$g_talk_troop", "trp_norse_slave"),
      (eq, "$g_encountered_party", "p_farmland"),
      ], "I am just a servant. You must talk to Ulf, my {reg59?lady:lord}.", "close_window",[]],
  ###global farmstead
  [anyone,"start", [(store_current_scene,":current_scene"),(eq,":current_scene","scn_farmstead_special"),
      (neq, "$g_talk_troop", "trp_farmstead_boss"),
      (str_clear, s44),
      (try_begin),
        (eq, "$g_talk_troop", "trp_farmer"),
        (str_store_string, s44, "@I am just a poor farmer here. Talk to the farmstead reeve over there."),
      (else_try),
        (eq, "$g_talk_troop", "trp_peasant_woman"),
        (str_store_string, s44, "@I just work the fields here. Talk to the farmstead reeve over there."),
      (else_try),
        (eq, "$g_talk_troop", "trp_manhunterdruid"),
        (str_store_string, s44, "@Stranger, go talk to the farmstead reeve over there if you want to do business here."),
      (try_end),
      ], "{!}{s44}", "close_window",[]],
  
  
  
  ############################
  ## PHAIAK MOVED THIS ENDS ##
  ############################
  
  
  
  [anyone, "event_triggered",
    [
      (eq, "$talk_context", tc_give_center_to_fief),
      
      (assign, ":there_are_vassals", 0),
      (assign, ":end_cond", active_npcs_end),
      (try_for_range, ":troop_no", active_npcs_begin, ":end_cond"),
        (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
        (neq, "trp_player", ":troop_no"),
        (store_troop_faction, ":faction_no", ":troop_no"),
        (eq, ":faction_no", "fac_player_supporters_faction"),
        (val_add, ":there_are_vassals", 1),
        (assign, ":end_cond", 0),
      (try_end),
      
      (try_begin),
        (gt, ":there_are_vassals", 0),
        (str_store_string, s2, "str_do_you_wish_to_award_it_to_one_of_your_vassals"),
      (else_try),
        (str_store_string, s2, "str_who_do_you_wish_to_give_it_to"),
      (try_end),
      
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
      (str_store_string, s5, "str_sire_my_lady_we_have_taken_s1_s2"),
    ],
    "{!}{s5}", "award_fief_to_vassal",
    []],
  
  [anyone|plyr, "award_fief_to_vassal",
    [
      (is_between, "$g_player_court", centers_begin, centers_end),
      (store_faction_of_party, ":player_court_faction", "$g_player_court"),
      (eq, ":player_court_faction", "fac_player_supporters_faction"),
    ],
    "I wish to defer the appointment of a lord until I take the counsel of my subjects there.", "award_fief_to_vassal_defer",
    [
      (assign, "$loot_option", 0),	#new
  ]],
  
  [anyone|plyr, "award_fief_to_vassal",
    [
      (is_between, "$g_player_court", centers_begin, centers_end),
      (store_faction_of_party, ":player_court_faction", "$g_player_court"),
      (eq, ":player_court_faction", "fac_player_supporters_faction"),
    ],
    "I wish to defer the appointment of a lord until I have finished... determining its value.", "award_fief_to_vassal_defer",
    [
      (assign, "$loot_option", 3),	#new
  ]],
  
  
  [anyone, "award_fief_to_vassal_defer",
    [
    ],
    "As you wish, {reg59?my lady:my lord}. You may decide this matter at a later date.", "close_window",
    [
      (try_begin),
        (neg|faction_slot_ge, "$players_kingdom", slot_faction_political_issue, 1),
        (faction_set_slot, "$players_kingdom", slot_faction_political_issue, "$g_center_taken_by_player_faction"),
      (try_end),
      (call_script, "script_give_center_to_lord", "$g_center_taken_by_player_faction", -1, 0), #-1 for the faction lord in this script is used exclusively in this context
      #It is only used because script_give_center_to_faction does not reset the town lord if fac_player_supporters_faction is the attacker
      
      (assign, "$g_center_taken_by_player_faction", -1),
      
      #new start
      (try_begin),
        (eq, "$g_next_menu", "mnu_castle_taken"),
        (jump_to_menu, "$g_next_menu"),
      (try_end),
      #new end
      
  ]],
  
  ####siege warfare chief saqueo
  [anyone|plyr, "award_fief_to_vassal",
    [
      #(call_script, "script_print_troop_owned_centers_in_numbers_to_s0", "trp_player"),
      #(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
      
      (try_begin),
        (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
        (str_store_string, s12, "str_please_s65_"),
      (else_try),
        (str_clear, s12),
      (try_end),
      
      (str_store_string, s5, "str_s12i_want_to_have_s1_for_myself"),
    ],
    "My idea is just to sack the place and leave.", "award_fief_to_vassal_2",
    [
      (assign, "$loot_option", 1),
  ]],
  
  [anyone|plyr, "award_fief_to_vassal",
    [
      #(call_script, "script_print_troop_owned_centers_in_numbers_to_s0", "trp_player"),
      #(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
      
      (try_begin),
        (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
        (str_store_string, s12, "str_please_s65_"),
      (else_try),
        (str_clear, s12),
      (try_end),
      
      (str_store_string, s5, "str_s12i_want_to_have_s1_for_myself"),
    ],
    "My idea is to devastate the place completely and leave.", "award_fief_to_vassal_2",
    [
      (assign, "$loot_option", 2),
  ]],
  ##################################
  
  [anyone|plyr|repeat_for_troops,"award_fief_to_vassal",
    [
      (store_repeat_object, ":troop_no"),
      (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (neq, "trp_player", ":troop_no"),
      (store_troop_faction, ":faction_no", ":troop_no"),
      (eq, ":faction_no", "fac_player_supporters_faction"),
      (str_store_troop_name, s11, ":troop_no"),
      
      (call_script, "script_troop_get_player_relation", ":troop_no"),
      (str_store_string, s12, "@ Relation: {reg0}"),
      
      ##	 (try_begin),
      ##	   (troop_slot_eq, ":troop_no", slot_lord_recruitment_argument, argument_benefit),
      ##	   (str_store_string, s12, "str__promised_fief"),
      ##	 (else_try),
      ##	   (str_clear, s12),
      ##	 (try_end),
      
      (call_script, "script_print_troop_owned_centers_in_numbers_to_s0", ":troop_no"),
      (try_begin),
        (eq, reg0, 0),
        (str_store_string, s1, "str_no_fiefss12"),
      (else_try),
        (str_store_string, s1, "str_fiefs_s0s12"),
      (try_end),
    ],
    "{!}{s11} {s1}.", "award_fief_to_vassal_2",[(store_repeat_object, "$temp"),
      (assign, "$loot_option", 0),]],	#new
  
  [anyone|plyr, "award_fief_to_vassal",
    [
      (call_script, "script_print_troop_owned_centers_in_numbers_to_s0", "trp_player"),
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
      
      (try_begin),
        (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
        (str_store_string, s12, "str_please_s65_"),
      (else_try),
        (str_clear, s12),
      (try_end),
      
      (assign, ":there_are_vassals", 0),
      (assign, ":end_cond", active_npcs_end),
      (try_for_range, ":troop_no", active_npcs_begin, ":end_cond"),
        (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
        (neq, "trp_player", ":troop_no"),
        (store_troop_faction, ":faction_no", ":troop_no"),
        (eq, ":faction_no", "fac_player_supporters_faction"),
        (val_add, ":there_are_vassals", 1),
        (assign, ":end_cond", 0),
      (try_end),
      
      (try_begin),
        (gt, ":there_are_vassals", 0),
        (str_store_string, s2, "str_fiefs_s0"),
      (else_try),
        (str_clear, s2),
      (try_end),
      
      (str_store_string, s5, "str_s12i_want_to_have_s1_for_myself"),
    ],
    "{!}{s5}", "award_fief_to_vassal_2",
    [
      (assign, "$temp", "trp_player"),
      (assign, "$loot_option", 0),	#new
  ]],
  
  [anyone|plyr, "award_fief_to_vassal",
    [(neq, "$campaign_type", camp_storyline),
      (call_script, "script_print_troop_owned_centers_in_numbers_to_s0", "trp_player"),
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
      
      (try_begin),
        (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
        (str_store_string, s12, "str_please_s65_"),
      (else_try),
        (str_clear, s12),
      (try_end),
      
      (assign, ":there_are_vassals", 0),
      (assign, ":end_cond", active_npcs_end),
      (try_for_range, ":troop_no", active_npcs_begin, ":end_cond"),
        (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
        (neq, "trp_player", ":troop_no"),
        (store_troop_faction, ":faction_no", ":troop_no"),
        (eq, ":faction_no", "fac_player_supporters_faction"),
        (val_add, ":there_are_vassals", 1),
        (assign, ":end_cond", 0),
      (try_end),
      
      (try_begin),
        (gt, ":there_are_vassals", 0),
        (str_store_string, s2, "str_fiefs_s0"),
      (else_try),
        (str_clear, s2),
      (try_end),
      
      (str_store_string, s5, "@{s12}I want to plunder and retain {s1} for myself. {s2}"),
    ],
    "{!}{s5}", "award_fief_to_vassal_2",
    [
      (assign, "$temp", "trp_player"),
      (assign, "$loot_option", 3),	#new
  ]],
  
  
  # vc new: loot towns
  [anyone, "award_fief_to_vassal_2",
    [
      (ge, "$loot_option", 1),
    ],
    "As you wish, {reg59?my lady:my lord}.", "close_window",
    [
      (try_begin),
        (eq, "$g_next_menu", "mnu_castle_taken"),
        (jump_to_menu, "$g_next_menu"),
        (assign, "$talk_context", 0),
      (try_end),
  ]],
  # end loot towns
  
  [anyone, "award_fief_to_vassal_2",
    [(neq, "$campaign_type", camp_storyline),
    ],
    "As you wish, {reg59?my lady:my lord}. {reg6?I:{reg7?You:{s11}}} will be the new {reg3?lady:lord} of {s1}.", "close_window",
    [
      (assign, ":new_owner", "$temp"),
      
      (call_script, "script_give_center_to_lord", "$g_center_taken_by_player_faction", ":new_owner", 0),
      (try_begin),
        (faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$g_center_taken_by_player_faction"),
        (faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
      (try_end),
      
      (assign, reg6, 0),
      (assign, reg7, 0),
      (try_begin),
        (eq, ":new_owner", "$g_talk_troop"),
        (assign, reg6, 1),
      (else_try),
        (eq, ":new_owner", "trp_player"),
        (assign, reg7, 1),
        (party_set_slot,"$g_center_taken_by_player_faction",recruit_permission_need, 0),
      (else_try),
        (str_store_troop_name, s11, ":new_owner"),
      (try_end),
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
      (troop_get_type, reg3, ":new_owner"),
      (val_mod, reg3, 2),
      
      (assign, "$g_center_taken_by_player_faction", -1),
      
      #new start
      (try_begin),
        (eq, "$g_next_menu", "mnu_castle_taken"),
        (jump_to_menu, "$g_next_menu"),
      (try_end),
      #new end
  ]],
  
  [anyone, "award_fief_to_vassal_2", #storyline vc-3318
    [(eq, "$campaign_type", camp_storyline), #storyline, mission conquest part, in order to avoid player kingdoms. Except after join to kingdom.
      (this_or_next|check_quest_active,"qst_welsh_and_pictish"),
      (this_or_next|check_quest_active,"qst_douar_an_enez"),
      (this_or_next|check_quest_active,"qst_aescesdun"),
      (check_quest_active,"qst_svenbn_final"),
    ],
    "As you wish, {reg59?my lady:my lord}. {reg6?I:{reg7?You:{s11}}} will be the new {reg3?lady:lord} of {s1}.", "close_window",
    [
      (assign, ":new_owner", "$temp"),
      
      (call_script, "script_give_center_to_lord", "$g_center_taken_by_player_faction", ":new_owner", 0),
      (try_begin),
        (faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$g_center_taken_by_player_faction"),
        (faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
      (try_end),
      
      (assign, reg6, 0),
      (assign, reg7, 0),
      (try_begin),
        (eq, ":new_owner", "$g_talk_troop"),
        (assign, reg6, 1),
      (else_try),
        (eq, ":new_owner", "trp_player"),
        (assign, reg7, 1),
        (party_set_slot,"$g_center_taken_by_player_faction",recruit_permission_need, 0),
      (else_try),
        (str_store_troop_name, s11, ":new_owner"),
      (try_end),
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
      (troop_get_type, reg3, ":new_owner"),
      (val_mod, reg3, 2),
      
      (assign, "$g_center_taken_by_player_faction", -1),
      
      #new start
      (try_begin),
        (eq, "$g_next_menu", "mnu_castle_taken"),
        (jump_to_menu, "$g_next_menu"),
      (try_end),
      #new end
  ]],
  [anyone, "award_fief_to_vassal_2", #rest cases or no ready to be lord/king
    [
    ],
    "We have no possibility of doing this. The men insist that we devastate this site and leave, {reg59?my lady:my lord}.", "close_window",
    [
      (assign, "$loot_option", 2),
      (try_begin),
        (eq, "$g_next_menu", "mnu_castle_taken"),
        (jump_to_menu, "$g_next_menu"),
        (assign, "$talk_context", 0),
      (try_end),
  ]],
  # Awarding fiefs in rebellion...
  
  [anyone, "event_triggered",
    [
      (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "$g_talk_troop"),
      (ge, "$g_center_taken_by_player_faction", 0),
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
    ],
    "{s1} is not being managed by anyone. Whom shall I put in charge?", "center_captured_rebellion",
    []],
  
  [anyone|plyr|repeat_for_troops, "center_captured_rebellion",
    [
      (store_repeat_object, ":troop_no"),
      (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (neq, "$g_talk_troop", ":troop_no"),
      (neq, "trp_player", ":troop_no"),
      (store_troop_faction, ":faction_no", ":troop_no"),
      (eq, ":faction_no", "fac_player_supporters_faction"),
      (str_store_troop_name, s11, ":troop_no"),
      (call_script, "script_print_troop_owned_centers_in_numbers_to_s0", ":troop_no"),
      (try_begin),
        (eq, reg0, 0),
        (str_store_string, s1, "@(no fiefs)"),
      (else_try),
        (str_store_string, s1, "@(fiefs: {s0})"),
      (try_end),
    ],
    "{!}{s11}. {s1}", "center_captured_rebellion_2",
    [
      (store_repeat_object, "$temp"),
  ]],
  
  [anyone|plyr, "center_captured_rebellion",
    [
      (call_script, "script_print_troop_owned_centers_in_numbers_to_s0", "trp_player"),
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
    ],
    "Please {s65}, I want to have {s1} for myself. (fiefs: {s0})", "center_captured_rebellion_2",
    [
      (assign, "$temp", "trp_player"),
  ]],
  
  [anyone|plyr, "center_captured_rebellion",
    [
      (call_script, "script_print_troop_owned_centers_in_numbers_to_s0", "$g_talk_troop"),
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
    ],
    "{s66}, you should have {s1} for yourself. (fiefs: {s0})", "center_captured_rebellion_2",
    [
      (assign, "$temp", "$g_talk_troop"),
  ]],
  
  [anyone, "center_captured_rebellion_2",
    [
      #     (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "$g_talk_troop"),
      #     (ge, "$g_center_taken_by_player_faction", 0),
    ],
    "Hmmm. All right, {playername}. I value your counsel highly. {reg6?I:{reg7?You:{s11}}} will be the new {reg3?lady:lord} of {s1}.", "close_window",
    [
      (assign, ":new_owner", "$temp"),
      (call_script, "script_calculate_troop_score_for_center", ":new_owner", "$g_center_taken_by_player_faction"),
      (assign, ":new_owner_score", reg0),
      (assign, ":total_negative_effect"),
      (try_for_range, ":cur_troop", active_npcs_begin, active_npcs_end),
        (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
        (store_troop_faction, ":cur_faction", ":cur_troop"),
        (eq, ":cur_faction", "fac_player_supporters_faction"),
        (neq, ":cur_troop", ":new_owner"),
        (neg|troop_slot_eq, ":cur_troop", slot_troop_stance_on_faction_issue, ":new_owner"),
        (call_script, "script_troop_get_relation_with_troop", ":cur_troop", ":new_owner"),
        (lt, reg0, 25),
        
        
        (call_script, "script_calculate_troop_score_for_center", ":cur_troop", "$g_center_taken_by_player_faction"),
        (assign, ":cur_troop_score", reg0),
        (gt, ":cur_troop_score", ":new_owner_score"),
        (store_sub, ":difference", ":cur_troop_score", ":new_owner_score"),
        (store_random_in_range, ":random_dif", 0, ":difference"),
        (val_div, ":random_dif", 1000),
        (gt, ":random_dif", 0),
        (val_add, ":total_negative_effect", ":random_dif"),
        (val_mul, ":random_dif", -1),
        (call_script, "script_change_player_relation_with_troop", ":cur_troop", ":random_dif"),
      (try_end),
      (val_mul, ":total_negative_effect", 2),
      (val_div, ":total_negative_effect", 3),
      (val_add, ":total_negative_effect", 5),
      (try_begin),
        (neq, ":new_owner", "trp_player"),
        (val_min, ":total_negative_effect", 30),
        (call_script, "script_change_player_relation_with_troop", ":new_owner", ":total_negative_effect"),
      (try_end),
      
      (call_script, "script_give_center_to_lord", "$g_center_taken_by_player_faction", ":new_owner", 0),
      (try_begin),
        (faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$g_center_taken_by_player_faction"),
        (faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
      (try_end),
      
      (assign, reg6, 0),
      (assign, reg7, 0),
      (try_begin),
        (eq, ":new_owner", "$g_talk_troop"),
        (assign, reg6, 1),
      (else_try),
        (eq, ":new_owner", "trp_player"),
        (assign, reg7, 1),
        (party_set_slot,"$g_center_taken_by_player_faction",recruit_permission_need, 0),
      (else_try),
        (str_store_troop_name, s11, ":new_owner"),
      (try_end),
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
      (troop_get_type, reg3, ":new_owner"),
      (val_mod, reg3, 2),
      
      (assign, "$g_center_taken_by_player_faction", -1),
      
      #new start
      (try_begin),
        (eq, "$g_next_menu", "mnu_castle_taken"),
        (jump_to_menu, "$g_next_menu"),
      (try_end),
      #new end
  ]],
  
  #TUTORIAL START
  [anyone, "start",
    [
      (is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
      (eq, "$g_tutorial_training_ground_conversation_state", 0),
      (eq, "$g_tutorial_fighter_talk_before", 0)],
    "Hello there. We are polishing off our combat skills here with a bit of sparring practice. " +
    "You look like you could use a bit of training. Why don't you join us, and we can show you a few tricks. " +
    "If you need explanation of any combat concepts, just ask, and I will do my best to fill you in.", "fighter_talk",
    [
      (try_begin),
        (eq, "$g_tutorial_training_ground_intro_message_being_displayed", 1),
        (assign, "$g_tutorial_training_ground_intro_message_being_displayed", 0),
        (tutorial_message, -1), #remove tutorial intro immediately before a conversation
      (try_end),
      (assign, "$g_tutorial_fighter_talk_before", 1)]],
  
  [anyone, "start",
    [(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
      (eq, "$g_tutorial_training_ground_conversation_state", 0)],
    "What do you want to practice?", "fighter_talk", []],
  
  [anyone, "fighter_pretalk", [],
    "Tell me what kind of practice you want.", "fighter_talk", []],
  
  [anyone|plyr, "fighter_talk",
    [          (neq, "$current_town", "p_village_150"), #chief mainquest
    ],
    "I want to practice attacking.", "fighter_talk_train_attack", []],
  
  [anyone|plyr, "fighter_talk",
    [          (neq, "$current_town", "p_village_150"), #chief mainquest
    ],
    "I want to practice blocking with my weapon.", "fighter_talk_train_parry", []],
  
  [anyone|plyr, "fighter_talk",
    [
    ],
    "Let's do some sparring practice.", "fighter_talk_train_combat", []],
  
  # [anyone|plyr, "fighter_talk",
    # [(eq,1,0)],
    # "{!}TODO: Let's train chamber blocking.", "fighter_talk_train_chamber", []],
  
  [anyone|plyr, "fighter_talk",
    [],
    "[Leave]", "close_window", []],
  
  [anyone, "fighter_talk_train_attack",
    [
      (neq, "$current_town", "p_village_150"),
      (get_player_agent_no, ":player_agent"),
      (agent_has_item_equipped, ":player_agent", "itm_practice_sword"), #TODO: add other melee weapons
    ],
    "All right. There are four principle directions for attacking. These are overhead swing, right swing, left swing and thrust. " +
    "Now, I will tell you which direction to attack from and you must try to do the correct attack. " +
    "^^(Move your mouse while you press the left mouse button to specify attack direction. For example, to execute an overhead attack, move the mouse up at the instant you press the left mouse button. " +
    "The icons on your screen will help you do the correct action.)" , "fighter_talk_train_attack_2",
    []],
  
  [anyone|plyr, "fighter_talk_train_attack_2",  [],
    "Let's begin then. I am ready.", "close_window",
    [
      (assign, "$g_tutorial_training_ground_melee_trainer_attack", "$g_talk_troop"),
      (assign, "$g_tutorial_training_ground_melee_state", 0),
      (assign, "$g_tutorial_training_ground_melee_trainer_action_state", 0),
      (assign, "$g_tutorial_training_ground_current_score", 0),
      (assign, "$g_tutorial_training_ground_current_score_2", 0),
      (assign, "$g_tutorial_update_mouse_presentation", 0),
  ]],
  
  [anyone|plyr, "fighter_talk_train_attack_2",  [],
    "Actually, I want to do something else.", "fighter_pretalk", []],
  
  [anyone, "fighter_talk_train_attack",
    [(str_store_string, s3, "str_tutorial_training_ground_warning_no_weapon")],
    "{!}{s3}", "close_window",
    []],
  
  [anyone, "fighter_talk_train_parry",
    [
      (get_player_agent_no, ":player_agent"),
      (agent_has_item_equipped, ":player_agent", "itm_practice_sword"), #TODO: add other melee weapons
    ],
    "Unlike a shield, blocking with a weapon can only stop attacks coming from one direction. " +
    "For example if you block up, you'll deflect overhead attacks, but you can still be hit by side swings or thrust attacks. " +
    "^^(You must press and hold down the right mouse button to block.)", "fighter_talk_train_parry_2", [ ]],
  
  [anyone, "fighter_talk_train_parry_2", [],
    "I'll now attack you with different types of strokes, and I will wait until you do the correct block before attacking. " +
    "Try to do the correct block as soon as you can. " +
    "^^(This practice is easy to do with the 'automatic block direction' setting, which is the default. " +
      "If you go to the Options menu and change the defend direction control to 'mouse movement' or 'keyboard,' you'll need to manually choose block direction. This is much more challenging, but makes the game much more interesting. " +
    "This practice can be very useful if you use manual blocking.)", "fighter_talk_train_parry_3",
    []],
  
  [anyone|plyr, "fighter_talk_train_parry_3",  [],
    "Let's begin then. I am ready.", "close_window",
    [
      (assign, "$g_tutorial_training_ground_melee_trainer_parry", "$g_talk_troop"),
      (assign, "$g_tutorial_training_ground_melee_state", 0),
      (assign, "$g_tutorial_training_ground_melee_trainer_action_state", 0),
      (assign, "$g_tutorial_training_ground_current_score", 0),
  ]],
  
  [anyone|plyr, "fighter_talk_train_parry_3",  [],
    "Actually, I want to do something else.", "fighter_pretalk", []],
  
  
  
  [anyone, "fighter_talk_train_parry",
    [(str_store_string, s3, "str_tutorial_training_ground_warning_no_weapon")],
    "{!}{s3}", "close_window",
    []],
  
  # [anyone, "fighter_talk_train_chamber",
    # [
      # (get_player_agent_no, ":player_agent"),
      # (agent_has_item_equipped, ":player_agent", "itm_practice_sword"), #TODO: add other melee weapons
    # ],
    # "{!}TODO: OK.", "close_window",
    # [
      # (assign, "$g_tutorial_training_ground_melee_trainer_chamber", "$g_talk_troop"),
      # (assign, "$g_tutorial_training_ground_melee_state", 0),
      # (assign, "$g_tutorial_training_ground_melee_trainer_action_state", 0),
      # (assign, "$g_tutorial_training_ground_current_score", 0),
  # ]],
  
  # [anyone, "fighter_talk_train_chamber",
    # [(str_store_string, s3, "str_tutorial_training_ground_warning_no_weapon")],
    # "{!}{s3}", "close_window",
    # []],
  
  ###chief doccinga mainquest
  [anyone, "fighter_talk_train_combat",
    [
      (eq, "$current_town", "p_village_150"),
      (get_player_agent_no, ":player_agent"),
      (this_or_next|agent_has_item_equipped, ":player_agent", "itm_seax_1"), #TODO: add other melee weapons
      (agent_has_item_equipped, ":player_agent", "itm_practice_sword"), #TODO: add other melee weapons
    ],
    "Sparring is an excellent way to prepare for actual combat. " +
    "We'll fight each other with non-lethal weapons now, until one of us falls to the ground. " +
    "You can get some bruises of course, but better that than being cut down in the real thing.", "fighter_talk_train_combat_2a",
    []],
  ###
  
  
  [anyone, "fighter_talk_train_combat",
    [     (neq, "$current_town", "p_village_150"),
      (get_player_agent_no, ":player_agent"),
      (agent_has_item_equipped, ":player_agent", "itm_practice_sword"), #TODO: add other melee weapons
    ],
    "Sparring is an excellent way to prepare for actual combat. " +
    "We'll fight each other with non-lethal weapons now, until one of us falls to the ground. " +
    "You can get some bruises of course, but better that than being cut down in the real thing.", "fighter_talk_train_combat_2",
    []],
  
  [anyone|plyr, "fighter_talk_train_combat_2",  [
    ],
    "Let's begin then. I am ready.", "close_window", [
      (assign, "$g_tutorial_training_ground_melee_trainer_combat", "$g_talk_troop"),
      (assign, "$g_tutorial_training_ground_melee_state", 0),
      (assign, "$g_tutorial_training_ground_melee_trainer_action_state", 0),
  ]],
  
  [anyone|plyr, "fighter_talk_train_combat_2a",  [],
    "Let's begin then. I am ready.", "fighter_talk_train_combat_2b", [
      (assign, "$g_tutorial_training_ground_melee_trainer_combat", "$g_talk_troop"),
      (assign, "$g_tutorial_training_ground_melee_state", 0),
      (assign, "$g_tutorial_training_ground_melee_trainer_action_state", 0),
      (get_player_agent_no, ":player_agent"),
      (agent_unequip_item, ":player_agent","itm_seax_1"),
      (agent_equip_item, ":player_agent", "itm_practice_sword"),
      (agent_set_wielded_item, ":player_agent", "itm_practice_sword"),
  ]],
  
  [anyone, "fighter_talk_train_combat_2b",[],
    "Good luck.", "close_window",[]],
  
  [anyone|plyr, "fighter_talk_train_combat_2",  [],
    "Actually, I want to do something else.", "fighter_pretalk", []],
  
  [anyone|plyr, "fighter_talk_train_combat_2a",  [],
    "Actually, I want to do something else.", "fighter_pretalk", []],
  
  [anyone, "fighter_talk_train_combat",
    [(str_store_string, s3, "str_tutorial_training_ground_warning_no_weapon")],
    "{!}{s3}", "close_window",
    []],
  
  [anyone, "start",
    [(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
      (eq, "$g_tutorial_training_ground_conversation_state", 1)], #parry complete
    "Good. You were able to block my attacks successfully. You may repeat this practice and try to get faster each time, until you are confident of your defense skills. Do you want to have another go?", "fighter_parry_try_again",
    [
      (assign, "$g_tutorial_training_ground_conversation_state", 0),
  ]],
  
  [anyone, "start",
    [(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
      (eq, "$g_tutorial_training_ground_conversation_state", 2)], #player knocked down in parry
    "Well that didn't go too well, did it? (Remember, you must press and hold down the right mouse button to keep your block effective.) Do you want to try again?", "fighter_parry_try_again",
    [
      (assign, "$g_tutorial_training_ground_conversation_state", 0),
  ]],
  
  [anyone|plyr, "fighter_parry_try_again",
    [],
    "Yes. Let's try again.", "fighter_talk_train_parry", []],
  
  [anyone|plyr, "fighter_parry_try_again",
    [],
    "No, I think I am done for now.", "fighter_talk_leave_parry", []],
  
  [anyone, "start",
    [(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
      (eq, "$g_tutorial_training_ground_conversation_state", 3)], #trainer knocked down in parry
    "Hey! We are practicing blocking, mate! You are supposed to block my attacks, not attack me back.", "fighter_parry_warn",
    [
      (assign, "$g_tutorial_training_ground_conversation_state", 0),
  ]],
  
  [anyone|plyr, "fighter_parry_warn",
    [],
    "I am sorry. Let's try once again.", "fighter_talk_train_parry", []],
  
  [anyone|plyr, "fighter_parry_warn",
    [],
    "Sorry. I must leave this practice now.", "fighter_talk_leave_parry", []],
  
  [anyone, "fighter_talk_leave_parry",
    [],
    "All right. As you wish.", "close_window", []],
  
  [anyone, "start",
    [(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
      (eq, "$g_tutorial_training_ground_conversation_state", 4)], #player knocked down in combat
    "Well that didn't go too well, did it?  Don't feel bad, and try not to do same mistakes next time. Do you want to have a go again?", "fighter_combat_try_again",
    [
      (assign, "$g_tutorial_training_ground_conversation_state", 0),
  ]],
  
  [anyone|plyr, "fighter_combat_try_again",
    [],
    "Yes. Let's do another round.", "fighter_talk_train_combat", []],
  
  [anyone|plyr, "fighter_combat_try_again",
    [],
    "No. That was enough for me.", "fighter_talk_leave_combat", []],
  
  [anyone, "fighter_talk_leave_combat",
    [],
    "Well, all right. Talk to me again if you change your mind.", "close_window", []],
  
  [anyone, "start",
    [(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
      (eq, "$g_tutorial_training_ground_conversation_state", 5)], #trainer knocked down in combat
    "Hey, that was good sparring. You defeated me, but next time I'll be more careful. Do you want to have a go again?", "fighter_combat_try_again",
    [
      (assign, "$g_tutorial_training_ground_conversation_state", 0),
  ]],
  
  # [anyone, "start",
  # [(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
  # (eq, "$g_tutorial_training_ground_conversation_state", 6)], #chamber complete
  # "{!}TODO: Congratulations. Anything else?", "fighter_talk",
  # [
  # (assign, "$g_tutorial_training_ground_conversation_state", 0),
  # ]],
  
  # [anyone, "start",
  # [(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
  # (eq, "$g_tutorial_training_ground_conversation_state", 7)], #player knocked down in chamber
  # "{!}TODO: Want to try again?", "fighter_chamber_try_again",
  # [
  # (assign, "$g_tutorial_training_ground_conversation_state", 0),
  # ]],
  
  # [anyone|plyr, "fighter_chamber_try_again",
  # [],
  # "{!}TODO: OK let's try again.", "fighter_talk_train_chamber", []],
  
  # [anyone|plyr, "fighter_chamber_try_again",
  # [],
  # "TODO: No, let's leave it there.", "fighter_talk_leave_chamber", []],
  
  # [anyone, "fighter_talk_leave_chamber",
  # [],
  # "{!}TODO: OK. Bye.", "close_window", []],
  
  # [anyone, "start",
    # [(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
      # (eq, "$g_tutorial_training_ground_conversation_state", 8)], #trainer knocked down in chamber
    # "{!}TODO: What are you doing? Don't attack me except while chambering!", "fighter_chamber_warn",
    # [
      # (assign, "$g_tutorial_training_ground_conversation_state", 0),
  # ]],
  
  [anyone, "start",
    [(is_between, "$g_talk_troop", tutorial_fighters_begin, tutorial_fighters_end),
      (eq, "$g_tutorial_training_ground_conversation_state", 9)], #attack complete
    "Very good. You have learned how to attack from any direction you want. If you like, we can try this again or move to a different exercise.", "fighter_talk",
    [
      (assign, "$g_tutorial_training_ground_conversation_state", 0),
  ]],
  
  
  # [anyone|plyr, "fighter_chamber_warn", # unused
    # [],
    # "{!}TODO: Sorry, let's try once again.", "fighter_talk_train_chamber", []],
  
  # [anyone|plyr, "fighter_chamber_warn", # unused
    # [],
    # "{!}TODO: Sorry. I want to leave the exercise.", "close_window", []],
  
  [trp_tutorial_archer_1|auto_proceed, "start",
    [],
    "{!}.", "tutorial_troop_default",
    []],
  
  [trp_tutorial_master_archer, "start",
    [
      (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 1),
    ],
    "Not bad. Not bad at all! You seem to have grasped the basics of archery. Now, try to do the same thing with a sling. " +
    "Take the sling and the sling rocks over there and shoot those three targets. The sling is much easier to use with compared with the bow, " +
    "but you need to reload it after each shot.", "archer_challenge_2", []],
  
  [trp_tutorial_master_archer, "start",
    [
      (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 2),
    ],
    "Good. You didn't have too much difficulty using the sling either. Next, you will learn to use throwing weapons. " +
    "Pick up the javelins you see over there and try to hit those three targets. ",
    "archer_challenge_2", []],
  
  ###mainquest chief
  [trp_tutorial_master_archer, "start",
    [
      (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 3),
      (eq, "$current_town", "p_village_150"),
    ],
    "Train every day, and in time, you will be as good as the best marksmen.",
    "ranged_end2", []],
  
  [trp_tutorial_master_archer, "ranged_end2", [],
    "You can go talk with the melee fighters or the horsemanship trainer if you haven't already done so. They can teach you important skills too.",
    "close_window", []],
  ##mainquest chief acaba
  [trp_tutorial_master_archer, "start",
    [
      (neq, "$current_town", "p_village_150"),
      (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 3),
    ],
    "Well, with that you have received the basic skills to use all three types of ranged weapons. The rest will come with practice. Train every day, and in time, you will be as good as the best marksmen.",
    "ranged_end", []],
  
  [trp_tutorial_master_archer, "ranged_end", [],
    "Now you can go talk with the melee fighters or the horsemanship trainer if you haven't already done so. They can teach you important skills too.",
    "close_window", []],
  
  ###mainquest doccinga
  [trp_tutorial_master_archer, "start",
    [
      (eq, "$current_town", "p_village_150"),
      (try_begin),
        (eq, "$g_tutorial_training_ground_intro_message_being_displayed", 1),
        (assign, "$g_tutorial_training_ground_intro_message_being_displayed", 0),
        #       (tutorial_message, -1), #remove tutorial intro immediately before a conversation
      (try_end),
      (eq, "$g_tutorial_training_ground_archer_trainer_state", 0),
    ],
    "Good day to you, young fellow. I spend my days training the men of the jarl of Kennemer in the art of archery. " +
    "If you need a bow and javelins to practice, let me know, and I'll rent them to you both for 10 peningas.", "archer_talk2",
    []],
  [anyone|plyr, "archer_talk2",
    [
      (store_troop_gold,":money","trp_player"),(ge,":money",10),
      (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
    ],
    "Yes, I wish to practice my archery with your men (pay 10 peningas).", "archer_challenge2", []],
  
  [anyone|plyr, "archer_talk2",
    [],
    "No, not now.", "close_window", []],
  
  [trp_tutorial_master_archer, "archer_challenge2",
    [
      (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
    ],
    "Nice to do business with you.", "close_window",
    [
      (troop_remove_gold,"trp_player",10),
      (troop_add_item, "$g_player_troop", "itm_practice_bow", 0),
      (troop_add_item, "$g_player_troop", "itm_practice_arrows", 0),
      (troop_add_item, "$g_player_troop", "itm_practice_javelin", 0),
      (troop_equip_items, "$g_player_troop"),
      
      (get_player_agent_no, ":player_agent"),
      (try_for_range, ":weapon_slot", ek_item_0, ek_head),
        (troop_get_inventory_slot, ":item", "$g_player_troop", ":weapon_slot"),
        (ge, ":item", "itm_no_item"),
        (agent_equip_item, ":player_agent", ":item", ":weapon_slot"),
      (try_end),
      
      (assign, "$g_tutorial_training_ground_archer_trainer_state", 1),
    ]
  ],
  ## mainquest acaba
  
  [trp_tutorial_master_archer, "start",
    [
      (neq, "$current_town", "p_village_150"), #chief mainquest
      (try_begin),
        (eq, "$g_tutorial_training_ground_intro_message_being_displayed", 1),
        (assign, "$g_tutorial_training_ground_intro_message_being_displayed", 0),
        (tutorial_message, -1), #remove tutorial intro immediately before a conversation
      (try_end),
      
    ],
    "Good day to you, young fellow. I spend my days teaching about ranged weapons to anyone that is willing to learn. " +
    "If you need a tutor, let me know and I'll teach you how to use the bow, the sling and the javelin.", "archer_talk",
    []],
  
  [anyone|plyr, "archer_talk",
    [
      (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
    ],
    "Yes, show me how to use ranged weapons.", "archer_challenge", []],
  
  # [anyone|plyr, "archer_talk",
  # [
  # (gt, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
  # ],
  # "{!}TODO: I want to move to the next stage.", "archer_challenge", []],
  
  [anyone|plyr, "archer_talk",
    [],
    "No, not now.", "close_window", []],
  
  [trp_tutorial_master_archer, "archer_challenge",
    [
      (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
    ],
    "All right. Your first training will be in archery. The bow is a difficult weapon to master, but once you are sufficiently good at it, you will be able to shoot quickly and with great power. " +
    "Go pick up the bow and arrows you see over there now and shoot those targets.", "archer_challenge_2",
    []],
  
  # [trp_tutorial_master_archer, "archer_challenge",
  # [
  # (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 1),
  # ],
  # "{!}TODO: Make 3 shots with crossbow.", "archer_challenge_2",
  # []],
  
  # [trp_tutorial_master_archer, "archer_challenge",
  # [],
  # "{!}TODO: Make 3 shots with javelin.", "archer_challenge_2",
  # []],
  
  [anyone|plyr, "archer_challenge_2",
    [],
    "All right, I am ready.", "close_window",
    [
      (assign, "$g_tutorial_training_ground_archer_trainer_state", 1),
      (try_begin),
        (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
        (assign, "$g_tutorial_training_ground_archer_trainer_item_1", "itm_practice_bow"),
        (assign, "$g_tutorial_training_ground_archer_trainer_item_2", "itm_practice_arrows"),
      (else_try),
        (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 1),
        (assign, "$g_tutorial_training_ground_archer_trainer_item_1", "itm_practice_crossbow"),
        (assign, "$g_tutorial_training_ground_archer_trainer_item_2", "itm_practice_bolts"),
      (else_try),
        (assign, "$g_tutorial_training_ground_archer_trainer_item_1", "itm_practice_javelin"),
        (assign, "$g_tutorial_training_ground_archer_trainer_item_2", -1),
      (try_end),
  ]],
  
  [anyone|plyr, "archer_challenge_2",
    [],
    "Wait just a moment. I want to do something else first.", "close_window",
    []],
  
  
  [trp_tutorial_master_horseman, "start",
    [
      (eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 1),
    ],
    "I hope you enjoyed the ride. Now we move on to something a bit more difficult. Grab the lance you see over there and ride around the course hitting each target at least once.",
    "horseman_melee_challenge_2", []],
  
  [trp_tutorial_master_horseman, "start",
    [
      (eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 2),
    ],
    "Good! You have been able to hit all targets on horseback. That's no easy feat for a starter. Your next challenge will be using a bow and arrows to shoot at the archery targets by the road. You need to put an arrow to each target to consider yourself successful.",
    "horseman_melee_challenge_2", []],
  
  ###chief mauinquest acaba horseman
  [trp_tutorial_master_horseman, "start",
    [
      (eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 3),
      (eq, "$current_town", "p_village_150"),
      #  (this_or_next|eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 3),
    ],
    "You were good. Keep riding and practicing each day, and in time, you will be an expert horseman.", "horsemanship_end2",
    [
  ]],
  
  [trp_tutorial_master_horseman, "horsemanship_end2",
    [
    ],
    "Now, you can go talk with the melee fighters or the archery trainer, if you haven't already done so. You need to learn everything you can to be prepared when you have to defend yourself.", "close_window",
    []],
  ####
  
  
  [trp_tutorial_master_horseman, "start",
    [
      #(neq, "$current_town", "p_village_150"),
      (eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 3),
    ],
    "Keep riding and practicing each day, and in time, you will be an expert horseman.", "horsemanship_end",
    [
  ]],
  
  [trp_tutorial_master_horseman, "horsemanship_end",
    [
    ],
    "You can also go talk with the melee fighters or the archery trainer, if you haven't already done so. You need to learn everything you can to be prepared when you have to defend yourself.", "close_window",
    []],
  
  
  ###mainquest dialog chief
  [trp_tutorial_master_horseman, "start",
    [
      (eq, "$current_town", "p_village_150"),
      (try_begin),
        (eq, "$g_tutorial_training_ground_intro_message_being_displayed", 1),
        (assign, "$g_tutorial_training_ground_intro_message_being_displayed", 0),
        #       (tutorial_message, -1), #remove tutorial intro immediately before a conversation
      (try_end),
      
    ],
    "Good day! I have come here for some riding practice, but my old bones are aching badly, so I decided to give myself a rest today. " +
    "If you would like to practice your horsemanship, you can take my horse here. The exercise would be good for her.", "horseman_talk2",
    []],
  [anyone|plyr, "horseman_talk2",
    [
      (eq, "$g_tutorial_training_ground_archer_trainer_completed_chapters", 0),
    ],
    "Yes, thank you for lending me your horse.", "horseman_challenge2", []],
  
  [anyone|plyr, "horseman_talk2",
    [],
    "No, not now.", "close_window", []],
  
  [trp_tutorial_master_horseman, "horseman_challenge2",
    [
      (assign, "$g_tutorial_training_ground_horseman_trainer_state", 1),
    ],
    "No problem. Good luck.", "close_window",
    [
  ]],
  
  ###mainquest acaba
  [trp_tutorial_master_horseman, "start",
    [
      (neq, "$current_town", "p_village_150"), #chief
      (try_begin),
        (eq, "$g_tutorial_training_ground_intro_message_being_displayed", 1),
        (assign, "$g_tutorial_training_ground_intro_message_being_displayed", 0),
        (tutorial_message, -1), #remove tutorial intro immediately before a conversation
      (try_end),
    ],
    "Good day! I have come here for some riding practice, but my old bones are aching badly so I decided to give myself a rest today. " +
    "If you would like to practice your horsemanship, you can take my horse here. The exercise would be good for her.", "horseman_talk",
    []],
  
  [anyone|plyr, "horseman_talk",
    [],
    "Yes, I would like to practice riding.", "horseman_challenge", []],
  
  [anyone|plyr, "horseman_talk",
    [],
    "Um, maybe later.", "close_window", []],
  
  [trp_tutorial_master_horseman, "horseman_challenge",
    [
      (eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 0),
    ],
    "Good. Now, I will give you a few exercises that'll teach you riding and horseback weapon use. " +
    "Your first assignment is simple. Just take your horse for a ride around the course. " +
    "Go as slow or as fast as you like. " +
    "Come back when you feel confident as a rider and I'll give you some tougher exercises.", "horseman_melee_challenge_2",
    []],
  
  [anyone|plyr, "horseman_melee_challenge_2",
    [],
    "All right, I am ready.", "close_window",
    [
      (assign, "$g_tutorial_training_ground_horseman_trainer_state", 1),
      (try_begin),
        (eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 0),
        (assign, "$g_tutorial_training_ground_horseman_trainer_item_1", -1),
        (assign, "$g_tutorial_training_ground_horseman_trainer_item_2", -1),
      (else_try),
        (eq, "$g_tutorial_training_ground_horseman_trainer_completed_chapters", 1),
        (assign, "$g_tutorial_training_ground_horseman_trainer_item_1", "itm_arena_lance"),
        (assign, "$g_tutorial_training_ground_horseman_trainer_item_2", -1),
      (else_try),
        (assign, "$g_tutorial_training_ground_horseman_trainer_item_1", "itm_practice_bow_2"),
        (assign, "$g_tutorial_training_ground_horseman_trainer_item_2", "itm_practice_arrows_2"),
      (try_end),
  ]],
  
  [anyone|plyr, "horseman_melee_challenge_2",
    [],
    "Just a moment. I need to do something else first.", "close_window", []],
  
  [trp_tutorial_rider_1|auto_proceed, "start",
    [],
    "{!}Warning: This line is never displayed.", "tutorial_troop_default",
    []],
  
  [trp_tutorial_rider_2|auto_proceed, "start",
    [],
    "{!}Warning: This line is never displayed.", "tutorial_troop_default",
    []],
  
  [anyone, "tutorial_troop_default",
    [
      (try_begin),
        (eq, "$g_tutorial_training_ground_intro_message_being_displayed", 1),
        (assign, "$g_tutorial_training_ground_intro_message_being_displayed", 0),
        (tutorial_message, -1), #remove tutorial intro immediately before a conversation
      (try_end),
    ],
    "Hey, I am trying to practice here. Go and talk with the archery trainer if you need guidance about ranged weapons.", "close_window", []],
  
  
  #PRISON BREAK START
  [anyone,"start",
    [
      (eq, "$talk_context", tc_prison_break),
      (troop_slot_eq, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
      (troop_slot_ge, "$g_talk_troop", slot_troop_mission_participation, mp_stay_out),
    ],
    "Is there a change of plans?", "lord_prison_break_confirm_3",[]],
  
  [anyone,"start",
    [
      (eq, "$talk_context", tc_prison_break),
      (try_begin),
        (eq, "$cheat_mode", 1),
        (assign, reg0, "$g_talk_troop"),
        (assign, reg1, "$g_encountered_party"),
        (troop_get_slot, reg2, "$g_talk_troop", slot_troop_prisoner_of_party),
        (display_message, "@{!}g_talk_troop = {reg0} , g_encountered_party = {reg1} , slot value = {reg2}"),
      (try_end),
      (troop_slot_eq, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
    ],
    "What's going on?", "lord_prison_break",[]],
  
  [anyone,"start",
    [
      (troop_get_slot, ":prison_location", "$g_talk_troop", slot_troop_prisoner_of_party),
      (is_between, ":prison_location", centers_begin, centers_end),
      (is_between, "$g_talk_troop",companions_begin, companions_end),
      (troop_slot_eq,"$g_talk_troop", slot_troop_occupation, slto_player_companion),
      (troop_slot_eq, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
      (neq, "$talk_context", tc_prison_break),
    ],
    "What's going on?", "comp_prison_break",[]],
  
  [anyone|plyr,"comp_prison_break",
    [
      (troop_get_slot, ":prison_location", "$g_talk_troop", slot_troop_prisoner_of_party),
      (is_between, ":prison_location", centers_begin, centers_end),
      (neg|party_slot_eq, ":prison_location", slot_town_lord, "trp_player"),
      (neq, "$talk_context", tc_prison_break),
    ],
    "I've come to break you out of here.", "comp_prison_break1",[]],
  
  [anyone|plyr,"comp_prison_break",
    [
      (troop_get_slot, ":prison_location", "$g_talk_troop", slot_troop_prisoner_of_party),
      (is_between, ":prison_location", centers_begin, centers_end),
      (party_slot_eq, ":prison_location", slot_town_lord, "trp_player"),
      (is_between, "$g_talk_troop",companions_begin, companions_end),
      (troop_slot_eq,"$g_talk_troop", slot_troop_occupation, slto_player_companion),
      (neq, "$talk_context", tc_prison_break),
    ],
    "You are free to rejoin my party, friend.", "comp_prison_break1a",[]],
  
  
  [anyone,"comp_prison_break1", [],
    "Thank the heavens you came! However, I'm not going anywhere with these chains on my legs. You'll need to get the key away from the guard somehow.", "close_window",[]],
  
  [anyone,"comp_prison_break1a", [],
    "Thank the heavens you came! Let me get my things collected, and I will rejoin you as soon as I can.", "close_window",[
      (troop_set_slot, "$g_talk_troop", slot_troop_current_mission, npc_mission_rejoin_when_possible),
      (troop_set_slot, "$g_talk_troop", slot_troop_days_on_mission, 1),
      (party_remove_prisoners, "$current_town", "$g_talk_troop",1),
      (call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
      (call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle"),
  ]],
  
  #TAVERN DRUNK DIALOGS
  [anyone, "start",
    [
      (eq, "$g_talk_troop", "trp_belligerent_drunk"),
    ],
    "What are you looking at?", "drunk_response",
    [
      (try_begin),
        (eq, "$g_main_attacker_agent", 0),
        (call_script, "script_activate_tavern_attackers"),
      (try_end),
      (mission_disable_talk),
  ]],
  
  [anyone, "start",
    [
      (eq, "$g_talk_troop", "trp_hired_assassin"),
    ],
    "Are you looking at me?", "drunk_response",
    [
      (try_begin),
        (eq, "$g_main_attacker_agent", 0),
        (call_script, "script_activate_tavern_attackers"),
      (try_end),
      (mission_disable_talk),
  ]],
  
  [anyone, "start",
    [
      (eq, "$g_talk_troop", "trp_hired_assassin"),
      (eq,1,0),
    ],
    "{!}Added to match dialog ids with translations.", "close_window",
    []],
  
  
  [anyone, "start", [
      (is_between, "$g_talk_troop", tavernkeepers_begin, tavernkeepers_end),
      (gt, "$g_main_attacker_agent", 0),
      (neg|agent_is_alive, "$g_main_attacker_agent"),
      
      (try_begin),
        (neg|agent_is_alive, "$g_main_attacker_agent"),
        (agent_get_troop_id, ":type", "$g_main_attacker_agent"),
        (eq, ":type", "trp_hired_assassin"),
        
        (str_store_string, s9, "str_strange_that_one_didnt_seem_like_your_ordenary_troublemaker_he_didnt_drink_all_that_much__he_just_stood_there_quietly_and_watched_the_door_you_may_wish_to_consider_whether_you_have_any_enemies_who_know_you_are_in_town_a_pity_that_blood_had_to_be_spilled_in_my_establishment"),
        
        (assign, "$g_main_attacker_agent", 0),
        (troop_add_gold, "trp_player", 150),
        (troop_add_item, "trp_player", "itm_seax_1", 0),
        
      (else_try),
        #(display_message, "str_wielded_item_reg3"),
        
        (lt, "$g_attacker_drawn_weapon", "itm_tutorial_spear"),
        (str_store_string, s9, "str_you_never_let_him_draw_his_weapon_still_it_looked_like_he_was_going_to_kill_you_take_his_sword_and_purse_i_suppose_he_was_trouble_but_its_not_good_for_an_establishment_to_get_a_name_as_a_place_where_men_are_killed"),
        
        (assign, "$g_main_attacker_agent", 0),
        (troop_add_gold, "trp_player", 150),
        (troop_add_item, "trp_player", "itm_seax_1", 0),
        (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -1),
      (else_try),
        (neg|agent_is_alive, "$g_main_attacker_agent"),
        (str_store_string, s9, "str_well_id_say_that_he_started_it_that_entitles_you_to_his_sword_and_purse_i_suppose_have_a_drink_on_the_house_as_i_daresay_youve_saved_a_patron_or_two_a_broken_skull_still_i_hope_he_still_has_a_pulse_its_not_good_for_an_establishment_to_get_a_name_as_a_place_where_men_are_killed"),
        (assign, "$g_main_attacker_agent", 0),
        (troop_add_gold, "trp_player", 150),
        (troop_add_item, "trp_player", "itm_seax_1", 0),
        (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 1),
      (try_end),
      (troop_set_slot, "trp_hired_assassin", slot_troop_cur_center, -1),
      
      #VC-3713 reblock ambiance agents after fight
      (try_for_agents, ":agent"),
        (agent_slot_ge,":agent",slot_agent_prop,1),
        (agent_set_slot,":agent",slot_agent_is_blocked,2),#block agent (no walking/dialogs/no sounds)
      (try_end),
    ],
    "{!}{s9}", "player_duel_response", [
  ]],
  
  
  [anyone, "start", [
      (is_between, "$g_talk_troop", tavernkeepers_begin, tavernkeepers_end),
      (gt, "$g_main_attacker_agent", 0),
      (try_begin),
        (get_player_agent_no, ":player_agent"),
        (agent_get_wielded_item, ":wielded_item", ":player_agent", 0),
        (is_between, ":wielded_item", "itm_darts", "itm_torch"),
        (neq, ":wielded_item", "itm_javelin_melee"),
        (neq, ":wielded_item", "itm_throwing_spear_melee"),
        (neq, ":wielded_item", "itm_throwing_spear2_melee"),
        (neq, ":wielded_item", "itm_javelin_jinetes_melee"),
        (str_store_string, s9, "str_stop_no_shooting_no_shooting"),
        
        (assign, ":default_item", -1),
        (troop_get_inventory_capacity, ":end_cond", "trp_player"),
        (try_for_range, ":i_slot", 0, ":end_cond"),
          (troop_get_inventory_slot, ":item_id", "trp_player", ":i_slot"),
          
          (is_between, ":item_id", weapons_begin, weapons_end),
          (neg|is_between, ":item_id", ranged_weapons_begin, ranged_weapons_end),
          
          (assign, ":default_item", ":item_id"),
          (assign, ":end_cond", 0), #break
        (try_end),
        
        (agent_set_wielded_item, ":player_agent", ":default_item"),
      (else_try),
        (str_store_string, s9, "str_em_ill_stay_out_of_this"),
      (try_end),
    ],
    "{!}{s9}", "close_window", [
  ]],
  
  [anyone|plyr, "player_duel_response", [],
    "Such a waste...", "close_window", [
  ]],
  
  [anyone|plyr, "player_duel_response", [],
    "Better him than me", "close_window", [
  ]],
  
  
  [anyone|plyr, "drunk_response", [],
    "I'm not sure... Some sort of animal, clearly", "drunk_fight_start", [
  ]],
  
  [anyone|plyr, "drunk_response", [],
    "Excuse me. Please accept my apologies", "drunk_fight_start", [
  ]],
  
  [anyone, "drunk_fight_start", [],
    "I'll wipe that smirk right off your face!", "close_window", [
      (troop_set_slot, "trp_belligerent_drunk", slot_troop_cur_center, 0),
  ]],
  
  [anyone|plyr, "drunk_response",
    [
      (troop_slot_ge, "trp_player", slot_troop_renown, 150),
    ],
    "Do you have any idea who I am?", "drunk_player_high_renown", [
  ]],
  
  [anyone, "drunk_player_high_renown", [
      (eq, "$g_talk_troop", "trp_hired_assassin"),
    ],
    "Do I care?", "drunk_fight_start", [
  ]],
  
  [anyone, "drunk_player_high_renown", [],
    "Emmm... Actually... Yes, yes, I do know who you are, my {reg59?lady:lord}. Please forgive me, your grace -- it must be the drink. I'll be leaving, now...", "drunk_player_high_renown", [
  ]],
  
  [anyone|plyr, "drunk_player_high_renown", [],
    "Why, if you want a fight, you shall have one!", "drunk_fight_start", [
  ]],
  
  [anyone|plyr, "drunk_player_high_renown", [],
    "I thought as much. Now, remove yourself from here.", "close_window",
    [
      (assign, "$drunks_dont_pick_fights", 1),
      (troop_set_slot, "trp_belligerent_drunk", slot_troop_cur_center, 0),
      
      (call_script, "script_deactivate_tavern_attackers"),
      
      (assign, "$g_belligerent_drunk_leaving", "$g_main_attacker_agent"),
      
      (mission_enable_talk),
      
      (try_for_agents, ":agent"),
        (agent_is_alive, ":agent"),
        (agent_get_position, pos4, ":agent"),
        (agent_set_scripted_destination, ":agent", pos4),
      (try_end),
      
      (entry_point_get_position, pos1, 0),
      (agent_set_scripted_destination, "$g_main_attacker_agent", pos1),
      
      (assign, "$g_main_attacker_agent", 0),
  ]],
  
  
  [anyone, "start",
    [
      (eq, "$g_talk_troop", "trp_fight_promoter"),
    ],
    "You look like a {reg59?lady:fellow} who can take a few hard knocks -- and deal them out, too. I have a business proposition for you.", "fistfight_response", [
  ]],
  
  [anyone|plyr, "fistfight_response", [],
    "How's that?", "fistfight_response_2", [
  ]],
  
  [anyone, "fistfight_response_2", [
    ],
    "Good -- I'm glad you're interested. Here's the plan... It's a little complicated, so listen well. ", "fistfight_response_2a", [
  ]],
  
  [anyone, "fistfight_response_2a", [
    ],
    "You and this other fellow will start up a fight here. No weapons, no armor -- I'll sit back and take bets, and split the profits with the winner. If we make a loss, then I'll cover it. You have nothing to lose -- except a bit of blood, of course.", "fistfight_response_3", [
  ]],
  
  [anyone, "fistfight_response_3", [
    ],
    "However, we can't organize this like one of those nice arena bouts, where everyone places their bets beforehand. People will walk in, drawn by the noise, and put a pening or two on whichever one of your two they think is winning. I'll give 'em even odds -- anything else is going to be too tricky for someone who's already on his third flagon of ale.", "fistfight_response_4", [
  ]],
  
  [anyone, "fistfight_response_4", [
    ],
    "So, as you can see, the trick is to stretch things out for as long as possible where it looks like you're losing, and people bet against you -- and then come back fast, and win, before the betting can turn. The best way to make money is for you to be battered almost to the floor, and then jump back off your feet and take your opponent down. However, you have to win in the end, in order for me, and you, to make money. ", "fistfight_response_4a", [
  ]],
  
  [anyone, "fistfight_response_4a", [
    ],
    "Moreover, you can't stretch the fight out too long, or people will suspect a fix. So, one of you has to take a punch every so often. I don't care whose blood is spilled, but there has to be some blood.", "fistfight_response_5", [
  ]],
  
  [anyone, "fistfight_response_5", [
    ],
    "One more thing. My mate, your opponent, doesn't take to well to complexity, so he's just going to come straight at you. It's up to you to supply the artistry.", "fistfight_response_5a", [
  ]],
  
  [anyone, "fistfight_response_5a", [
    ],
    "So, what do you think?", "fistfight_response_confirm", [
  ]],
  
  [anyone|plyr, "fistfight_response_confirm", [
    ],
    "{!}[Yes -- not yet implemented]", "close_window", [
  ]],
  
  [anyone|plyr, "fistfight_response_confirm", [
    ],
    "I have better things to do", "close_window", [
  ]],
  
  ####childs
  
  [anyone|auto_proceed,"start", [(is_between, "$g_talk_troop", "trp_nino_varon", "trp_monk_walker"),
      ], "{!}Warning: This line should never be displayed.", "childsdialog_1",[
      (str_store_string, s11, "@--The child looks at you with funny eyes and laughs.--"),
      (str_store_string, s12, "@My mother told me not to talk to strangers. Bye!"),
      (str_store_string, s13, "@Running is fun! I can run faster than you can! Do you want to race me?"),
      (store_random_in_range, ":random", 11, 14),
      (str_store_string_reg, s4, ":random"),
  ]],
  [anyone,"childsdialog_1", [], "{!}{s4}", "close_window",[]],
  ##############
  
  [trp_ramun_the_slave_trader, "start", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_met_previously, 0),
      ], "Good day to you, {reg59?lassie:young man}.", "ramun_introduce_1",[]],
  [trp_ramun_the_slave_trader|plyr, "ramun_introduce_1", [], "Forgive me. You look like a trader, but I see no merchandise.", "ramun_introduce_2",[
      (troop_set_slot, "$g_talk_troop", slot_troop_met_previously, 1),
  ]],
  [trp_ramun_the_slave_trader|plyr, "ramun_introduce_1", [], "Never mind.", "close_window",[]],
  [trp_ramun_the_slave_trader, "ramun_introduce_2", [], "A trader? Oh, aye, I certainly am that. " +
    "My merchandise is a bit different from most, however. It has to be fed and watered twice a day and tries to run away if I turn my back.", "ramun_introduce_3",[]],
  [trp_ramun_the_slave_trader|plyr, "ramun_introduce_3", [], "Livestock?", "ramun_introduce_4",[]],
  [trp_ramun_the_slave_trader, "ramun_introduce_4", [], "Close enough. I like to call myself the man who keeps every boat on this ocean moving. " +
    "Boats are driven by oars, you see, and oars need men to pull them or they stop. That's where I come in.", "ramun_introduce_5",[]],
  [trp_ramun_the_slave_trader|plyr, "ramun_introduce_5", [], "Galley slaves.", "ramun_introduce_6",[]],
  [trp_ramun_the_slave_trader, "ramun_introduce_6", [], "Now you're catching on! A trading port like this couldn't survive without them. " +
    "The ships lose a few hands on every voyage, so there's always a high demand. The captains come to me and they pay well.", "ramun_introduce_7",[]],
  [trp_ramun_the_slave_trader|plyr, "ramun_introduce_7", [], "Where do the slaves come from?", "ramun_introduce_8",[]],
  [trp_ramun_the_slave_trader, "ramun_introduce_8", [], "Mostly I deal in convicted criminals bought from the authorities. " +
    "Others are prisoners of war from various nations, or people unable to pay their debts, brought to me because I offer the best prices. " +
    "However, on occasion I'll buy from privateers and other... 'individuals.' You can't be picky about your suppliers in this line of work. " +
    "You wouldn't happen to have any prisoners with you, would you?", "ramun_introduce_9",[]],
  [trp_ramun_the_slave_trader|plyr, "ramun_introduce_9", [], "Me? ", "ramun_introduce_10",[]],
  [trp_ramun_the_slave_trader, "ramun_introduce_10", [], "Why not? If you intend to set foot outside this town, " +
    "you're going to cross swords with someone sooner or later. And, God willing, you'll come out on top. " +
    "Why not make some extra money off the whole thing? Take them alive, bring them back to me, and I'll pay you fifty peningas for each head. " +
    "Don't much care who they are or where they come from.", "ramun_introduce_11",[]],
  [trp_ramun_the_slave_trader|plyr, "ramun_introduce_11", [], "Hmm. I'll think about it.", "ramun_introduce_12",[]],
  [trp_ramun_the_slave_trader, "ramun_introduce_12", [], "Do think about it! " +
    "There's a lot of silver to be made, no mistake. More than enough for the both of us.", "close_window",[]],
  
  [trp_ramun_the_slave_trader,"start", [], "Hello, {playername}.", "ramun_talk",[]],
  [trp_ramun_the_slave_trader,"ramun_pre_talk", [], "Anything else?", "ramun_talk",[]],
  
  [trp_ramun_the_slave_trader|plyr,"ramun_talk",
    [[store_num_regular_prisoners,reg(0)],[ge,reg(0),1]],
    "I've brought you some prisoners. Would you like a look?", "ramun_sell_prisoners",[]],
  [trp_ramun_the_slave_trader,"ramun_sell_prisoners", [],
    "Let me see what you have...", "ramun_sell_prisoners_2",
    [[change_screen_trade_prisoners]]],
  [trp_ramun_the_slave_trader, "ramun_sell_prisoners_2", [], "A pleasure doing business with you.", "close_window",[]],
  
  [trp_ramun_the_slave_trader|plyr,"ramun_talk", [(neg|troop_slot_ge,"$g_talk_troop",slot_troop_met_previously,1)], "How do I take somebody as prisoner?", "ramun_ask_about_capturing",[]],
  [trp_ramun_the_slave_trader|plyr,"ramun_talk", [(troop_slot_ge,"$g_talk_troop", slot_troop_met_previously, 1)], "Can you tell me again about capturing prisoners?", "ramun_ask_about_capturing",[(troop_set_slot,"$g_talk_troop", slot_troop_met_previously, 2)]],
  
  [trp_ramun_the_slave_trader,"ramun_ask_about_capturing", [(neg|troop_slot_ge,"$g_talk_troop",slot_troop_met_previously,1)],
    "You're new to this, aren't you? Let me explain it in simple terms. " +
    "The basic rule of taking someone prisoner is knocking him down with a blunt weapon, like a mace or a club, " +
    "rather than cutting him open with a sword. That way he goes to sleep for a little while rather than bleeding to death, you see? " +
    "I'm assuming you have a blunt weapon with you...", "ramun_have_blunt_weapon",[]],
  [trp_ramun_the_slave_trader|plyr,"ramun_have_blunt_weapon", [],
    "Of course.", "ramun_have_blunt_weapon_yes",[]],
  [trp_ramun_the_slave_trader|plyr,"ramun_have_blunt_weapon", [],
    "As a matter of fact, I don't.", "ramun_have_blunt_weapon_no",[]],
  [trp_ramun_the_slave_trader,"ramun_have_blunt_weapon_yes", [],
    "Good. Then all you need to do is beat the bugger down with your weapon, and when the fighting's over you clap him in irons. " +
    "It's a bit different for nobles and such, they tend to be protected enough that it won't matter what kind of weapon you use, " +
    "but your average rabble-rouser will bleed like a stuck pig if you get him with something sharp. I don't have many requirements in my merchandise, " +
    "but I do insist they be breathing when I buy them.", "ramun_ask_about_capturing_2",[]],
  [trp_ramun_the_slave_trader,"ramun_have_blunt_weapon_no", [],
    "No? Heh, well, this must be your lucky day. I have an old club lying around that I was going to throw away. " +
    "It's a bit battered, but still good enough to bash someone until he stops moving. " +
    "Here, have it.","ramun_have_blunt_weapon_no_2",[(troop_add_item, "trp_player","itm_wooden_stick",imod_cracked)]],
  [trp_ramun_the_slave_trader|plyr,"ramun_have_blunt_weapon_no_2", [],
    "Thanks, man. Perhaps I may try my hand at it.", "ramun_have_blunt_weapon_yes",[]],
  [trp_ramun_the_slave_trader,"ramun_ask_about_capturing", [],
    "Alright, I'll try and explain it again in simple terms. The basic rule of taking someone prisoner is knocking him down with a blunt weapon, like a mace or a club, " +
    "rather than cutting him open with a sword. That way he goes to sleep for a little while rather than bleeding to death, you see? " +
    "It's a bit different for nobles and such, they tend to be protected enough that it won't matter what kind of weapon you use, " +
    "but your average rabble-rouser will bleed like a stuck pig if you get him with something sharp.", "ramun_ask_about_capturing_2",[]],
  [trp_ramun_the_slave_trader|plyr,"ramun_ask_about_capturing_2", [], "Alright, I think I understand. Anything else?", "ramun_ask_about_capturing_3",[]],
  [trp_ramun_the_slave_trader,"ramun_ask_about_capturing_3", [],
    "Well, it's not as simple as all that. Blunt weapons don't do as much damage as sharp ones, so they won't bring your enemies down as quickly. " +
    "And trust me, given the chance, most of the scum you run across would just as soon kill you as look at you, so don't expect any courtesy when you pull out a club instead of a sword. " +
    "Moreover, having to drag prisoners to and fro will slow down your party, which is why some people simply set their prisoners free after the fighting's done. " +
    "It's madness. How could anyone turn down all that silver, eh?", "ramun_ask_about_capturing_4",[]],
  [trp_ramun_the_slave_trader|plyr,"ramun_ask_about_capturing_4", [],
    "Are you done?", "ramun_ask_about_capturing_5",[]],
  [trp_ramun_the_slave_trader,"ramun_ask_about_capturing_5", [],
    "Just one final thing. Managing prisoners safely is not an easy thing to do, you could call it a skill in itself. " +
    "If you want to capture a lot of prisoners, you should try and learn the tricks of it yourself, " +
    "or you won't be able to hang on to a single man you catch.", "ramun_ask_about_capturing_7",[]],
  [trp_ramun_the_slave_trader|plyr,"ramun_ask_about_capturing_7", [],
    "Thanks, I'll keep it in mind.", "ramun_pre_talk",[]],
  
  
  [trp_ramun_the_slave_trader|plyr,"ramun_talk",[], "Is there anything else I can do with my prisoners?","ramun_ask_prisoners",[]],
  [trp_ramun_the_slave_trader,"ramun_ask_prisoners", [], "If you are so inclined, you can interrogate your prisoners while camping, and offer them a chance to join your army. That of course " +
    "will lower the morale of your army, and some prisoners will agree to join you just to run away back to their families. If you have a figure of authority among your prisoners, such as a Bandit Leader " +
    "you can ask him to form a band out of your prisoners (you must have more than 50), and send them to raid one of your enemy's villages, or attack them directly in exchange for freedom. But the " +
    "best way is always for you to sell your prisoners to me.", "ramun_pre_talk",[]],
  
  [trp_ramun_the_slave_trader|plyr,"ramun_talk", [], "I'd better be going.", "ramun_leave",[]],
  [trp_ramun_the_slave_trader,"ramun_leave", [], "Remember, any prisoners you've got, bring them to me. I'll pay you good silver for every one.", "close_window",[]],
  
  
  
  
  
  
  [trp_nurse_for_lady, "start", [
      #  (eq, "$talk_context", tc_garden),
      ], "I humbly request that your lordship keep his hands where I can see them.", "nurse_talk",[]],
  
  [trp_nurse_for_lady|plyr, "nurse_talk", [
      ], "No problem.", "close_window",[]], #no pockets in dark ages
  
  [trp_nurse_for_lady|plyr, "nurse_talk", [
      ], "Can you tell me what it takes to convince your lady to marry me?", "nurse_talk1",[]],
  
  [trp_nurse_for_lady, "nurse_talk1", [
      ], "I would gladly tell your lordship, if he finds 25 peningas in his pock..., purse.", "nurse_talk2",[]],
  
  [trp_nurse_for_lady|plyr, "nurse_talk2", [
      ], "Don't think I want to pay you.", "close_window",[]],
  
  [trp_nurse_for_lady|plyr, "nurse_talk2", [	  (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 25),
      ], "Here you are. Now, speak!", "nurse_talk3",[ (troop_remove_gold, "trp_player", 25),]],
  
  [trp_nurse_for_lady, "nurse_talk3", [
    ], "Thank you, your lordship. To be considered as a potential groom, you have to be a person of stature, a pledged vassal or a renowned warrior. " +
    "At the very least, you should have as much renown as junior lords. Secondly, you must have good relations with the lady, and her father or guardian. Lastly, the most important " +
    "component is chemistry. The chemistry between you and the lady will largely depend on your charisma, so being ugly, fat, or having a cheap beer or pickle breath would " +
    "hardly come handy. If you get refused the first time, don't despair, their ladyships are known for playing hard to get, wait a few days and try again. With high persuasion, and " +
    "charisma, you will eventually prevail, and the lady will agree to get married. Then go and talk to her father or guardian, and get an official blessing from him.", "close_window",[]],
  
  
  
  ##  [trp_tutorial_trainer, "start", [(eq, "$tutorial_1_state", 1),], "TODO: Watch me.", "tutorial_1_1_1",[]],
  ##  [trp_tutorial_trainer, "tutorial_1_1_1", [], "TODO: This is up.", "tutorial_1_1_2",[(agent_set_attack_action, "$g_talk_agent", 3),]],
  ##  [trp_tutorial_trainer, "tutorial_1_1_2", [], "TODO: This is left.", "tutorial_1_1_3",[(agent_set_attack_action, "$g_talk_agent", 2),]],
  ##  [trp_tutorial_trainer, "tutorial_1_1_3", [], "TODO: This is right.", "tutorial_1_1_4",[(agent_set_attack_action, "$g_talk_agent", 1),]],
  ##  [trp_tutorial_trainer|plyr, "tutorial_1_1_4", [], "TODO: OK.", "close_window",[]],
  
  [party_tpl|pt_manhunters,"start", [(eq,"$talk_context",tc_party_encounter),
      (encountered_party_is_attacker),
    ],
    "We have not come to talk, {reg59?girlie:mate}. It's time for swords.", "manhunter_talk_b",[]],
  
  [party_tpl|pt_manhunters,"start", [(eq,"$talk_context",tc_party_encounter),], "Hey, you there! Have you seen any outlaws around here?", "manhunter_talk_b",[]],
  [party_tpl|pt_manhunters|plyr,"manhunter_talk_b", [(neg|encountered_party_is_attacker),], "Yes, they went this way some time ago.", "manhunter_talk_b1",[]],
  [party_tpl|pt_manhunters,"manhunter_talk_b1", [], "I knew it! Come on, lads! Let's go get these bastards! Thanks a lot, friend.", "close_window",[(assign, "$g_leave_encounter",1)]],
  [party_tpl|pt_manhunters|plyr,"manhunter_talk_b", [(neg|encountered_party_is_attacker),], "No, haven't seen any outlaws lately.", "manhunter_talk_b2",[]],
  [party_tpl|pt_manhunters,"manhunter_talk_b2", [], "Bah. They're holed up in this country like rats, but we'll smoke them out sooner or later.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  [party_tpl|pt_manhunters|plyr,"manhunter_talk_b", [(neg|encountered_party_is_attacker),], "I wish to collect on the bounties of some criminals I have captured.", "manhunter_talk_b3",
    [[change_screen_trade_prisoners]]],
  [party_tpl|pt_manhunters,"manhunter_talk_b3", [], "There's your bounty. Now me and the lads are going to hunt down more criminals.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  [party_tpl|pt_manhunters|plyr,"manhunter_talk_b", [], "You scum pillage and enslave people. You deserve death.", "manhunter_talk_b4",[
      (store_relation, ":bandit_relation", "fac_player_faction", "$g_encountered_party_faction"),
      (val_min, ":bandit_relation", 0),
      (val_sub, ":bandit_relation", 3),
      (val_max, ":bandit_relation", -100),
      (set_relation, "fac_player_faction", "$g_encountered_party_faction", ":bandit_relation"),
      (party_ignore_player, "$g_encountered_party", 0),
      (party_set_slot,"$g_encountered_party",slot_party_ignore_player_until, 0),
  ]],
  [party_tpl|pt_manhunters,"manhunter_talk_b4", [], "How dare you! Prepare to die.", "close_window",
    [
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  [party_tpl|pt_manhunters|plyr,"manhunter_talk_b", [(neg|encountered_party_is_attacker),], "Good luck. Farewell.", "manhunter_talk_b1close",[]],
  [party_tpl|pt_manhunters,"manhunter_talk_b1close", [], "Farewell.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  ####dialogo acaba chief
  
  [party_tpl|pt_looters|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter),
      #(encountered_party_is_attacker),
      ], "{!}Warning: This line should never be displayed.", "looters_1",[
      (str_store_string, s11, "@We are landless, poor and persecuted. Life has led us to this, {reg59?girlie:mate}. No sudden moves or we'll run you through."),
      (str_store_string, s12, "@Luckily for you, you caught me in a good mood. Give us all your coin and I might just let you live."),
      (str_store_string, s13, "@This a robbery, eh? I'm givin' you one chance to hand over everythin' you got, or me and my mates'll kill you. Understand?"),
      (store_random_in_range, ":random", 11, 14),
      (str_store_string_reg, s4, ":random"),
      (play_sound, "snd_encounter_looters")
  ]],
  [party_tpl|pt_looters,"looters_1", [], "{!}{s4}", "looters_2",[]],
  [party_tpl|pt_looters|plyr,"looters_2", [[store_character_level,reg(1),"trp_player"],[lt,reg(1),4]], "I'm not afraid of you lot. Fight me if you dare!", "close_window",
    [
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  [party_tpl|pt_looters|plyr,"looters_2", [[store_character_level,reg(1),"trp_player"],[ge,reg(1),4]], "You'll have nothing of mine but cold steel, scum.", "close_window",
    [
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  #bandit bribery chief#############
  [party_tpl|pt_looters|plyr,"looters_2", [], "Do you have any idea whom you are talking to? I will not kill you if you join me.", "looters_2bribe",
    []],
  
  [anyone,"looters_2bribe", [
      (store_random_in_range,":rand",0,20),
      (gt,":rand",12),
    ], "I care very little who you are. It is time for you to die.","close_window",
    [
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  [anyone,"looters_2bribe", [
      (party_slot_eq, "$g_encountered_party", slot_party_bribed, 0),
      (store_random_in_range,":rand",0,20),
      (gt,":rand",12),
      (lt, "$player_honor", -10),
      ], "Yes, I've heard of you. They say the men of your party enjoy the best loot. Forgive us, and we will be delighted to join such a fierce leader.","looters_2bribeg",[]],
  
  [anyone,"looters_2bribe",[
      (store_encountered_party,":party"),
      (store_party_size,":size",":party"),
      (store_mul,":size",":size",50),
      (assign, reg0, ":size"),
      (assign, "$temp", reg0),
      ],"Yes, I've heard of you. They say you pay well. We would consider your offer to sign up for {reg0} peningas.","looters_2bribere",[]],
  
  [anyone|plyr,"looters_2bribere",
    [
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", "$temp"),
      (party_can_join),
    ],"I cannot imagine fighting without warriors of such fine quality by my side. Welcome to my army.","close_window",
    [
      (troop_remove_gold, "trp_player", "$temp"),
      (party_join),
      (call_script, "script_change_player_honor", -2),
      (call_script, "script_change_player_party_morale", -4),
      (assign, "$g_leave_encounter", 1)
  ]],
  [anyone|plyr,"looters_2bribere",[        (store_troop_gold, ":gold", "trp_player"),
      (le, ":gold", "$temp"),
      ],"I don't have enough money...","looters_bribe12",[]],
  [anyone|plyr,"looters_2bribere",[],"Oho! The way I see it, you should be paying me for such an opportunity. Forget it!","looters_bribe12",[]],
  
  [anyone|plyr,"looters_2bribeg",
    [
      (party_can_join),
    ],"Why, you're just the sort of company I have been seeking so hard to find!","close_window",
    [
      (party_join),
      (call_script, "script_change_player_honor", -2),
      (call_script, "script_change_player_party_morale", -4),
      (assign, "$g_leave_encounter", 1)
  ]],
  
  [anyone|plyr,"looters_2bribeg",[],"Never mind. It was just the mead talking.","looters_bribe13",[]],
  
  [anyone,"looters_bribe12", [
    ], "Oh, we've got plenty of payment for you, buttercup.","close_window",
    [(party_set_slot, "$g_encountered_party", slot_party_bribed, 1),
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  [anyone,"looters_bribe13", [
    ], "That's funny. Now my spear has something to say to you.","close_window",
    [(party_set_slot, "$g_encountered_party", slot_party_bribed, 1),
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  #bandit bribery end########
  ##se puede ir si no es atacante
  [party_tpl|pt_looters|plyr,"looters_2", [(eq,"$talk_context",tc_party_encounter),
      (neg|encountered_party_is_attacker),
    ],
    "We'll leave you in peace.", "close_window", [(assign, "$g_leave_encounter",1)]],
  ###
  
  [party_tpl|pt_village_farmers,"start", [(eq,"$talk_context",tc_party_encounter),
      (agent_play_sound, "$g_talk_agent", "snd_encounter_farmers"),
    ],
    "My {reg59?lady:lord}, we're only poor farmers from the village of {s11}. {reg1?We are taking our products to the market at {s12}.:We are returning from the market at {s12} back to our village.}", "village_farmer_talk",
    [(party_get_slot, ":target_center", "$g_encountered_party", slot_party_ai_object),
      (party_get_slot, ":home_center", "$g_encountered_party", slot_party_home_center),
      (party_get_slot, ":market_town", ":home_center", slot_village_market_town),
      (str_store_party_name, s11, ":home_center"),
      (str_store_party_name, s12, ":market_town"),
      (assign, reg1, 1),
      (try_begin),
        (party_slot_eq, ":target_center", slot_party_type, spt_village),
        (assign, reg1, 0),
      (try_end),
  ]],
  
  [anyone|plyr,"village_farmer_talk",
    [(check_quest_active, "qst_track_down_bandits"),
      (neg|check_quest_succeeded, "qst_track_down_bandits"),
      
      ], "I am hunting a group of bandits with the following description... Have you seen them?", "farmer_bandit_information",[]],
  
  [anyone,"farmer_bandit_information", [
      (call_script, "script_get_manhunt_information_to_s15", "qst_track_down_bandits"),
      ], "{!}{s15}", "village_farmer_talk",[]],
  
  
  [anyone|plyr,"village_farmer_talk",
    [
      (store_faction_of_party, ":faction_of_villager", "$g_encountered_party"),
      
      (neq, ":faction_of_villager", "$players_kingdom"),
      (neq, ":faction_of_villager", "fac_player_supporters_faction"),
    ],
    "We'll see how poor you are after I take what you've got!", "close_window",
    [(party_get_slot, ":home_center", "$g_encountered_party", slot_party_home_center),
      (party_get_slot, ":market_town", ":home_center", slot_village_market_town),
      (party_get_slot, ":village_owner", ":home_center", slot_town_lord),
      (call_script, "script_change_player_relation_with_center", ":home_center", -4),
      (call_script, "script_change_player_relation_with_center", ":market_town", -2),
      (call_script, "script_change_player_relation_with_troop", ":village_owner", -2),
      (call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
      
      (store_relation,":rel", "$g_encountered_party_faction","fac_player_faction"),
      (try_begin),
        (gt, ":rel", 0),
        (call_script, "script_change_player_relation_with_faction", "$g_encountered_party_faction", -8),
      (else_try),
        (call_script, "script_change_player_relation_with_faction", "$g_encountered_party_faction", -3),
      (try_end),
      
      (assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),
  ]],
  [anyone|plyr,"village_farmer_talk", [], "Carry on, then. Farewell.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  ### sea king
  [party_tpl|pt_sea_king_danish,"start", [
    (eq,"$talk_context",tc_party_encounter),
    (neg|encountered_party_is_attacker),
    (str_store_faction_name, s1, "$g_encountered_party_faction"),
  ], "Ahoy! I'm a lord from {s1}, but my only fief is the sea. What do you want?", "sea_king_talk", []],
  
  [party_tpl|pt_sea_king_norweg,"start", [
    (eq,"$talk_context",tc_party_encounter),
    (neg|encountered_party_is_attacker),
    (str_store_faction_name, s1, "$g_encountered_party_faction"),
  ], "Ahoy! I'm a lord from {s1}, but my only fief is the sea. What do you want?", "sea_king_talk", []],
  
  [party_tpl|pt_sea_king_danish,"start", [
    (eq,"$talk_context",tc_party_encounter),
    (encountered_party_is_attacker),
    (str_store_faction_name, s1, "$g_encountered_party_faction"),
  ], "Ahoy there! I'm a lord from {s1}, but my only fief is the sea. Seeing how that is, I reckon you're tresspassing on it!", "sea_king_talk", []],
  
  [party_tpl|pt_sea_king_norweg,"start", [
    (eq,"$talk_context",tc_party_encounter),
    (encountered_party_is_attacker),
    (str_store_faction_name, s1, "$g_encountered_party_faction"),
  ], "Ahoy there! I'm a lord from {s1}, but my only fief is the sea. Seeing how that is, I reckon you're tresspassing on it!", "sea_king_talk", []],
  
  [anyone|plyr,"sea_king_talk",
    [
      (store_relation,":rel", "$g_encountered_party_faction","fac_player_faction"),
      (lt, ":rel", 0),
    ],
    "Prepare your crew! We will fight!", "close_window",
    [
      (call_script, "script_change_player_relation_with_faction", "$g_encountered_party_faction", -8),
      (assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),
  ]],
  
  [anyone|plyr,"sea_king_talk", [
    (neg|encountered_party_is_attacker),
    (gt,"$g_encountered_party_relation",0),
  ], "I give you greeting, since I'm a friend of your kingdom.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  [anyone|plyr,"sea_king_talk", [
    (neg|encountered_party_is_attacker),
    (le,"$g_encountered_party_relation",0),
  ], "Nothing, I take my leave now.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  
  ### vc fishers
  
  [party_tpl|pt_fisher_ship,"start", [(eq,"$talk_context",tc_party_encounter),
      (agent_play_sound, "$g_talk_agent", "snd_encounter_farmers"),
    ],
    "My {reg59?lady:lord}, we're only poor fishermen from {s11}.", "fisher_talk",
    [
      (party_get_slot, ":home_port", "$g_encountered_party", slot_party_home_center),
      (party_get_slot, ":home_town", ":home_port", slot_party_port_party),
      (str_store_party_name, s11, ":home_town"),
  ]],
  
  # [anyone|plyr,"fisher_talk",
  # [(check_quest_active, "qst_track_down_bandits"),
  # (neg|check_quest_succeeded, "qst_track_down_bandits"),
  # ], "I am hunting a group of bandits with the following description... Have you seen them?", "farmer_bandit_information",[]],
  # [anyone,"farmer_bandit_information", [
  # (call_script, "script_get_manhunt_information_to_s15", "qst_track_down_bandits"),
  # ], "{!}{s15}", "fisher_talk",[]],
  
  
  [anyone|plyr,"fisher_talk",
    [
      (store_faction_of_party, ":faction_of_fisher", "$g_encountered_party"),
      (neq, ":faction_of_fisher", "$players_kingdom"),
      (neq, ":faction_of_fisher", "fac_player_supporters_faction"),
    ],
    "We'll see how poor you are after I take what you've got!", "close_window",
    [
      # (party_get_slot, ":home_center", "$g_encountered_party", slot_party_home_center),
      # (party_get_slot, ":market_town", ":home_center", slot_village_market_town),
      # (party_get_slot, ":village_owner", ":home_center", slot_town_lord),
      # (call_script, "script_change_player_relation_with_center", ":home_center", -4),
      # (call_script, "script_change_player_relation_with_center", ":market_town", -2),
      # (call_script, "script_change_player_relation_with_troop", ":village_owner", -2),
      (call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
      
      (store_relation,":rel", "$g_encountered_party_faction","fac_player_faction"),
      (try_begin),
        (gt, ":rel", 0),
        (call_script, "script_change_player_relation_with_faction", "$g_encountered_party_faction", -8),
      (else_try),
        (call_script, "script_change_player_relation_with_faction", "$g_encountered_party_faction", -3),
      (try_end),
      
      (assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),
  ]],
  
  [anyone|plyr,"fisher_talk",
    [
      (party_get_slot, ":home_port", "$g_encountered_party", slot_party_home_center),
      (party_get_slot, ":home_town", ":home_port", slot_party_port_party),
      (str_store_party_name, s11, ":home_town"),
    ],
    "Is fishing important for {s11}?", "fisher_talk_1", []],
  
  [anyone|plyr,"fisher_talk", [], "Carry on, then. Farewell.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  [anyone,"fisher_talk_1",
    [
      (party_get_slot, ":home_port", "$g_encountered_party", slot_party_home_center),
      (party_get_slot, ":home_town", ":home_port", slot_party_port_party),
      (str_store_party_name, s11, ":home_town"),
      (party_get_slot, ":fishing_fleet", ":home_town", slot_center_fishing_fleet),
      (party_get_slot, ":salt_pans", ":home_town", slot_center_salt_pans),
      (try_begin),
        (gt, ":fishing_fleet", 20),
        (str_store_string, s21, "@big"),
      (else_try),
        (gt, ":fishing_fleet", 10),
        (str_store_string, s21, "@medium sized"),
      (else_try),
        (str_store_string, s21, "@small"),
      (end_try),
      (val_div, ":fishing_fleet", 5),
      (try_begin),
        (ge, ":salt_pans", ":fishing_fleet"),
        (str_clear, s22),
      (else_try),
        (str_store_string, s22, "@don't "),
      (end_try),
    ],
    "{s11} has a {s21} fishing fleet. Usually we {s22}produce enough salt to preserve the fish the fleet brings to port.", "fisher_talk_2", []],
  
  [anyone|plyr,"fisher_talk_2", [], "Very well. That's all I wanted to know.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  ### vc traveller on ship
  
  [party_tpl|pt_traveller_ship,"start", [(eq,"$talk_context",tc_party_encounter),],
    "Good day, my {reg59?lady:lord}. We're sailing from {s11} to {s12}.", "traveller_ship_talk",
    [
      # (party_get_slot, ":home_port", "$g_encountered_party", slot_party_home_center),
      # (party_get_slot, ":home_town", ":home_port", slot_party_port_party),
      (party_get_slot, ":home_town", "$g_encountered_party", slot_party_home_center),
      (str_store_party_name, s11, ":home_town"),
      (party_get_slot, ":target_port", "$g_encountered_party", slot_party_ai_object),
      (party_get_slot, ":target_town", ":target_port", slot_party_port_party),
      (str_store_party_name, s12, ":target_town"),
  ]],
  
  [anyone|plyr,"traveller_ship_talk",
    [],
    "I will board your ship and take all you've got!", "close_window",
    [
      (call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
      
      (party_get_slot, ":home_town", "$g_encountered_party", slot_party_home_center),
      (party_get_slot, ":target_port", "$g_encountered_party", slot_party_ai_object),
      (party_get_slot, ":target_town", ":target_port", slot_party_port_party),
      (call_script, "script_change_player_relation_with_center", ":home_town", -2),
      (call_script, "script_change_player_relation_with_center", ":target_town", -1),
      #
      (store_relation,":rel", "$g_encountered_party_faction","fac_player_faction"),
      (try_begin),
        (gt, ":rel", 0),
        (call_script, "script_change_player_relation_with_faction", "$g_encountered_party_faction", -8),
      (else_try),
        (call_script, "script_change_player_relation_with_faction", "$g_encountered_party_faction", -3),
      (try_end),
      #
      (assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),
  ]],
  
  [anyone|plyr,"traveller_ship_talk", [], "Very well. That's all I wanted to know.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  ### vc slave trader on ship
  [party_tpl|pt_slave_trader_ship,"start", [(eq,"$talk_context",tc_party_encounter),],
    "Good day, my {reg59?lady:lord}. We're trading slaves from {s11} to {s12}.", "traveller_ship_talk",
    [
      # (party_get_slot, ":home_port", "$g_encountered_party", slot_party_home_center),
      # (party_get_slot, ":home_town", ":home_port", slot_party_port_party),
      (party_get_slot, ":home_town", "$g_encountered_party", slot_party_home_center),
      (str_store_party_name, s11, ":home_town"),
      (party_get_slot, ":target_port", "$g_encountered_party", slot_party_ai_object),
      (party_get_slot, ":target_town", ":target_port", slot_party_port_party),
      (str_store_party_name, s12, ":target_town"),
  ]],
  
  ####mainquest party chief
  [party_tpl|pt_kennemer_revenge,"start", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker),], "{playername}, the jarl of Kennemer sends greetings! As does Death!", "close_window",[
      (play_sound, "snd_encounter_looters"),
      # (assign, "$g_campaign_death", 1), #no death for player in this mission.
      (str_clear, s9),
      (str_store_troop_name_link, s9, "trp_knight_4_3"),
      (str_store_string, s2, "@Note 4: {s9} has sent men to kill you. They ambushed you by the river, and although you have survived their attack, you sleep less calmly now."),
      (add_quest_note_from_sreg, "qst_kennemer_jarl_missions", 7, s2, 0),
      #(quest_set_slot,"qst_kennemer_jarl_missions",slot_quest_current_state, 3), ##ya aplicado en tigger
      [encounter_attack]
  ]],
  ####
  [party_tpl|pt_wessex_patrol,"start", [       (str_clear, s2),
      ], "{s2}^^Stop!", "wessex_patrol1",[
      (str_store_string, s2, "@--A large group of Saxons gets in your way. Their leader steps forward and raises a hand.--", color_good_news),
      (play_sound, "snd_encounter_looters"),
  ]],
  [anyone|plyr,"wessex_patrol1",
    [], "Let us through. We are emissaries. We come to meet with Aelfred of West Seaxe.", "wessex_patrol2",[]],
  [anyone|plyr,"wessex_patrol1",
    [], "(Attack the Saxon patrol)", "wessex_patrol3",[]],
  [anyone|plyr,"wessex_patrol1",
    [], "(Continue on your way, dodging the Saxon patrol)", "wessex_patrol2",[]],
  
  [anyone,"wessex_patrol2", [               (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (ge, ":player_renown", 700),
      ], "--The Saxons move out of your way, allowing you to proceed.--", "close_window",[
      (call_script, "script_set_parties_around_player_ignore_player", 8, 12), #it was radius:2 and hours:4, but players make lots of complains about consequent battle losses after releases from captivity then I changed this.
      # (quest_set_slot,"qst_the_messengersn",slot_quest_current_state, 6), #Jarl enemigo fase 3
      (assign, "$g_leave_encounter",1),  ]],
  #michael this cause bug when player attack patrol.
  #    [anyone,"wessex_patrol2", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker),], "I know who you are, {playername}. My brother was among foragers that you attacked. I do not care if you're emissary or not, you're going to pay for killing my brother.", "close_window",[
  [anyone,"wessex_patrol2", [], "I know who you are, {playername}. My brother was among those foragers that you attacked. I do not care if you're an emissary or not, you're going to pay for killing my brother.", "close_window",[
      (assign, "$g_campaign_death", 1),
      #(quest_set_slot,"qst_the_messengersn",slot_quest_current_state, 6), #Jarl enemigo fase 3
      [encounter_attack]
  ]],
  [anyone,"wessex_patrol3", [(eq,"$talk_context",tc_party_encounter),], "To arms, they attack!", "close_window",[
      (assign, "$g_campaign_death", 1),
      #(quest_set_slot,"qst_the_messengersn",slot_quest_current_state, 6), #Jarl enemigo fase 3
      [encounter_attack]
  ]],
  ####
  ####mainquest dialogs chief
  #foragers encounter chief
  [party_tpl|pt_wessex_foragers,"start", [(eq,"$talk_context",tc_party_encounter),],
    "Stop! Who are you and what do you want?", "foragers_mission_talk",
    [
  ]],
  
  [party_tpl|pt_wessex_foragers|plyr,"foragers_mission_talk", [], "Today is a good day to die, scum!", "close_window",
    [
      (call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
      # (store_relation,":rel", "$g_encountered_party_faction","fac_player_faction"),
      # (try_begin),
      # (gt, ":rel", 0),
      # (val_sub, ":rel", 5),
      # (try_end),
      # (val_sub, ":rel", 3),
      # (call_script, "script_set_player_relation_with_faction", "$g_encountered_party_faction", ":rel"),
      (assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),
  ]],
  [party_tpl|pt_wessex_foragers|plyr,"foragers_mission_talk", [], "Listen, the sons of Ragnar want you dead. Turn back to your camp.", "foragers_mission_talk2",[]],
  
  [party_tpl|pt_wessex_foragers,"foragers_mission_talk2", [],
    "To arms! It's a trap! The Danish attack us! To arms, West Seaxe!", "foragers_mission_talk3",
    [
  ]],
  [party_tpl|pt_wessex_foragers|plyr,"foragers_mission_talk3", [], "But...", "close_window",
    [
      (call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
      # (store_relation,":rel", "$g_encountered_party_faction","fac_player_faction"),
      # (try_begin),
      # (gt, ":rel", 0),
      # (val_sub, ":rel", 5),
      # (try_end),
      # (val_sub, ":rel", 3),
      # (call_script, "script_set_player_relation_with_faction", "$g_encountered_party_faction", ":rel"),
      (assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),
  ]],
  #####
  
  #farmstead sigurd's men dialog
  [party_tpl|pt_sigurd_farm_men,"start", [ (quest_get_slot, ":quest_current_state", "qst_danmork_protection", slot_quest_current_state),
      (le, ":quest_current_state", 10),
      ], "Heill! Men in the farm, we have a prisoner for you!", "close_window",[]], #sven party doccinga_ca
  
  #mainquest chief parties
  [party_tpl|pt_sven_doccinga_ca,"start", [], "{playername}, Thank goodness you came! You do not remember me, but I'm one of the king's men who are defending the village. We are few. Thonkrik promised us that you were coming, but we did not believe him. Nobody else has come to our aid. " +
    "I have been ordered to travel to the king, to urge him to send troops. However, I fear that I won't be in time, because the Viking ships are already approaching.", "sven_party1",[]], #sven party doccinga_ca
  [anyone|plyr, "sven_party1", [], "Continue on your way and tell the king it is I that defend Doccinga, not his jarl.","close_window",[
      (faction_get_slot, ":leader_no", "fac_kingdom_4", slot_faction_leader),
      (call_script, "script_change_player_relation_with_troop", ":leader_no", 6),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_4", 4),
  ]],
  [anyone|plyr, "sven_party1", [], "Forget your task. All men are needed in Doccinga.","close_window",[]],
  
  #chief quest Thiaderd
  #
  [trp_thiaderd, "start", [(eq, "$g_talk_troop_met", 0),(quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 4),], "I do not know who you are, traveler, but my men are around you and will not hesitate to kill you if you keep moving. This is our land. Now go back the way you came.","thiaderd2",
    []],
  [trp_thiaderd, "start", [(quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 4),], "To arms, my men. Kill them all!","thiader_battle",[
  ]],
  
  [anyone|plyr, "thiaderd2", [], "Are you Thiaderd? My name is {playername}. I want to talk.","thiaderd_reginhard1",[]],
  [anyone|plyr, "thiaderd2", [
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (str_store_troop_name,s4,":town_lord"),
      ], "Thiaderd the Rebel? {s4} sends you his greetings. It is time to die.","thiaderd_reginhard2",[]],
  [anyone|plyr, "thiaderd2", [], "Well, I do not want to face you. I'm leaving.","thiaderd_reginhard3",[]],
  #camara 3 tercera persona en dialogo, 3rd person in dialogs
  [anyone|other(trp_npc8), "thiaderd_reginhard1", [
      ], "Thiaderd, I am here, your faithful Reginhard. {playername} offered to escort me so I can explain what happened with your brother.","thiaderd_reginhard31",[
  ]],
  [anyone|plyr|other(trp_npc8), "thiaderd_reginhard2", [
      ], "No, stop! I need to talk to Thiaderd!","thiaderd_reginhard21",[
  ]],
  [anyone|other(trp_npc8), "thiaderd_reginhard3", [
      ], "Stop, Thiaderd! I am here, your faithful Reginhard. {playername} offered to escort me so I can explain what happened with your brother.","thiaderd_reginhard31",[
  ]],
  ####
  
  [anyone, "thiaderd_reginhard31", [
      ], "That man with you is Reginhard? Damn traitor! You are rather too bold to come here after what you did to my brother. First, we will kill your friends and then cut the blood eagle on you, as did your jarl to my brother! To arms my men! Kill them all!", "thiader_battle",[
  ]],
  
  [anyone, "thiaderd_reginhard21", [
      ], "Damn! Reginhard the Betrayer is with you! Reginhard, you will pay dearly for bringing the jarl's men here! To arms my men! Kill them all!", "thiader_battle",[
  ]],
  ##
  [anyone|plyr, "thiader_battle", [], "What?","close_window",[
      (jump_to_menu, "mnu_thiaderd_battle"),
  ]],
  
  ### COMPANIONS
  
  [anyone,"start", [(gt,"$g_talk_troop", 0),
      (eq, "$g_talk_troop", "$g_player_minister"),
      (neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop")],
    "I am at your service, {reg59?my lady:my lord}", "minister_issues",[]],
  
  [anyone,"start", [(eq,"$g_talk_troop", "trp_temporary_minister"),
      (neq, "$g_talk_troop", "$g_player_minister")],
    "It has been an honor to serve you, {reg59?my lady:my lord}", "close_window",[]],
  
  
  [anyone,"start", [(troop_slot_eq,"$g_talk_troop", slot_troop_occupation, slto_player_companion),
      (party_is_active, "$g_encountered_party"),
      (party_slot_eq, "$g_encountered_party", slot_party_type, spt_castle),
      (party_get_num_companion_stacks, ":num_stacks", "$g_encountered_party"),
      (ge, ":num_stacks", 1),
      (party_stack_get_troop_id, ":castle_leader", "$g_encountered_party", 0),
      (eq, ":castle_leader", "$g_talk_troop"),
      (eq, "$talk_context", 0)],
    "Yes, {playername}? What can I do for you?", "member_castellan_talk",[]],
  
  [anyone,"member_castellan_pretalk", [], "Anything else?", "member_castellan_talk",[]],
  
  [anyone|plyr,"member_castellan_talk", [],
    "I want to review the castle garrison.", "member_review_castle_garrison",[]],
  [anyone,"member_review_castle_garrison", [], "Of course. Here are our lists. Let me know of any changes you require...", "member_castellan_pretalk",[(change_screen_exchange_members,0)]],
  [anyone|plyr,"member_castellan_talk", [],
    "Let me see your equipment.", "member_review_castellan_equipment",[]],
  [anyone,"member_review_castellan_equipment", [], "Very well, it's all here...", "member_castellan_pretalk",[(change_screen_equip_other)]],
  [anyone|plyr,"member_castellan_talk", [],
    "I want you to abandon the castle and join my party.", "member_castellan_join",[]],
  [anyone,"member_castellan_join", [(party_can_join_party,"$g_encountered_party","p_main_party")],
    "I've grown quite fond of the place, but if it is your wish, {playername}, I'll come with you.", "close_window", [
      (assign, "$g_move_heroes", 1),
      (call_script, "script_party_add_party", "p_main_party", "$g_encountered_party"),
      (party_clear, "$g_encountered_party"),
  ]],
  [anyone,"member_castellan_join", [],
    "Where would we sleep? You're dragging a whole army with you, {playername}! There's not room for all of us.", "member_castellan_pretalk",[]],
  
  [anyone|plyr,"member_castellan_talk", [], "[Leave]", "close_window",[]],
  
  
  # [anyone,"start", [(troop_slot_eq,"$g_talk_troop", slot_troop_occupation, slto_player_companion),
      # (neg|main_party_has_troop,"$g_talk_troop"),
      # (eq, "$talk_context", tc_party_encounter)],
    # "Do you want me to rejoin you?", "close_window",[]], # unused
  # [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
  #  [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",
  #  [anyone,"member_separate_inn", [], "All right then. I'll meet you at the four ways inn. Good luck.", "close_window",
  #   [(remove_member_from_party,"$g_talk_troop", "p_main_party"),(add_troop_to_site, "$g_talk_troop", "scn_four_ways_inn", borcha_inn_entry)]],
  #########quest chief
  #ashdown battle
  [trp_kingdom_8_lord,"start", [(check_quest_active,"qst_aescesdun"),
      (quest_slot_eq,"qst_aescesdun",slot_quest_current_state, 14),], "[Enemies take positions against your army. The battle starts.]", "close_window",[
      [encounter_attack]
  ]],
  [trp_kingdom_5_lord,"start", [(check_quest_active,"qst_aescesdun"),
      (quest_slot_eq,"qst_aescesdun",slot_quest_current_state, 14),], "[Enemies take positions against your army. The battle starts.]", "close_window",[
      [encounter_attack]
  ]],
  
  #Quest heroes member chats
  
  [trp_kidnapped_girl,"member_chat", [], "Are we home yet?", "kidnapped_girl_chat_1",[]],
  [trp_kidnapped_girl|plyr,"kidnapped_girl_chat_1", [], "Not yet.", "kidnapped_girl_chat_2",[]],
  [trp_kidnapped_girl,"kidnapped_girl_chat_2", [], "I can't wait to get back. I've missed my family so much. I'd give anything to see them again.", "close_window",[]],
  
  [anyone,"member_chat",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      ], "{playername}, when do you think we can reach our destination?", "member_lady_1",[]],
  [anyone|plyr, "member_lady_1", [],  "We still have a long way ahead of us.", "member_lady_2a", []],
  [anyone|plyr, "member_lady_1", [],  "Very soon. We're almost there.", "member_lady_2b", []],
  
  [anyone ,"member_lady_2a", [],  "Ah, I am going to enjoy the road for a while longer then. I won't complain. " +
    "I find riding out in the open so much more pleasant than sitting in the castle all day. " +
    "You know, I envy you. You can live like this all the time.", "close_window", []],
  [anyone ,"member_lady_2b", [],  "That's good news. Not that I don't like your company, but I did miss my little luxuries. " +
    "Still I am sorry that I'll leave you soon. You must promise me, you'll come visit me when you can.", "close_window", []],
  
  [anyone ,"member_chat", [(is_between, "$g_talk_troop", pretenders_begin, pretenders_end),],
    "Greetings, {playername}, my first and foremost vassal. I await your counsel.", "supported_pretender_talk", []],
  [anyone ,"supported_pretender_pretalk", [],
    "Anything else?", "supported_pretender_talk", []],
  
  [anyone|plyr,"supported_pretender_talk", [],
    "What do you think about our progress so far?", "pretender_progress",[]],
  
  [anyone,"pretender_progress", [
      (assign, reg11, 0),(assign, reg13, 0),(assign, reg14, 0),(assign, reg15, 0),
      (assign, reg21, 0),(assign, reg23, 0),(assign, reg24, 0),(assign, reg25, 0),
      
      (try_for_range, ":troop_no", active_npcs_begin, active_npcs_end),
        (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
        (store_troop_faction, ":troop_faction", ":troop_no"),
        (try_begin),
          (eq, ":troop_faction", "fac_player_supporters_faction"),
          (neq, ":troop_no", "trp_player"),
          (neq, ":troop_no", "$supported_pretender"),
          (val_add, reg11, 1),
        (else_try),
          (eq, ":troop_faction", "$supported_pretender_old_faction"),
          (neg|faction_slot_eq, "$supported_pretender_old_faction", slot_faction_leader, ":troop_no"),
          (val_add, reg21, 1),
        (try_end),
      (try_end),
      (try_for_range, ":center_no", centers_begin, centers_end),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (try_begin),
          (eq, ":center_faction", "fac_player_supporters_faction"),
          (try_begin),
            (party_slot_eq, ":center_no", slot_party_type, spt_town),
            (val_add, reg13, 1),
          (else_try),
            (party_slot_eq, ":center_no", slot_party_type, spt_castle),
            (val_add, reg14, 1),
          (else_try),
            (party_slot_eq, ":center_no", slot_party_type, spt_village),
            (val_add, reg15, 1),
          (try_end),
        (else_try),
          (eq, ":center_faction", "$supported_pretender_old_faction"),
          (try_begin),
            (party_slot_eq, ":center_no", slot_party_type, spt_town),
            (val_add, reg23, 1),
          (else_try),
            (party_slot_eq, ":center_no", slot_party_type, spt_castle),
            (val_add, reg24, 1),
          (else_try),
            (party_slot_eq, ":center_no", slot_party_type, spt_village),
            (val_add, reg25, 1),
          (try_end),
        (try_end),
      (try_end),
      (store_add, reg19, reg13, reg14),
      (val_add, reg19, reg15),
      (store_add, reg29, reg23, reg24),
      (val_add, reg29, reg25),
      (store_add, ":our_score", reg13, reg14),
      (val_add, ":our_score", reg11),
      (store_add, ":their_score", reg23, reg24),
      (val_add, ":their_score", reg21),
      (store_add, ":total_score", ":our_score", ":their_score"),
      (val_mul, ":our_score", 100),
      (store_div, ":our_ratio", ":our_score", ":total_score"),
      (try_begin),
        (lt, ":our_ratio", 10),
        (str_store_string, s30, "@we have made very little progress so far"),
      (else_try),
        (lt, ":our_ratio", 30),
        (str_store_string, s30, "@we have succeeded in gaining some ground, but we still have a long way to go"),
      (else_try),
        (lt, ":our_ratio", 50),
        (str_store_string, s30, "@we have become a significant force, and we have an even chance of victory"),
      (else_try),
        (lt, ":our_ratio", 75),
        (str_store_string, s30, "@we are winning the war, but our enemies are still holding on."),
      (else_try),
        (str_store_string, s30, "@we are on the verge of victory. The remaining enemies pose no threat, but we still need to hunt them down."),
      (try_end),
      (faction_get_slot, ":enemy_king", "$supported_pretender_old_faction", slot_faction_leader),
      (str_store_troop_name, s9, ":enemy_king"),
    ],
    "{reg11?We have {reg11} lords on our side:We have no lord with us yet}, " +
    "whereas {reg21?{s9} still has {reg21} lords supporting him:{s9} has no loyal lords left}. " +
    "{reg19?We control {reg13?{reg13} towns:} {reg14?{reg14} castles:} {reg15?and {reg15} villages:}:We don't control any settlements}, " +
    "while {reg29?they have {reg23?{reg23} towns:} {reg24?{reg24} castles:} {reg25?and {reg25} villages:}:they have no remaining settlements}. " +
    "Overall, {s30}.", "pretender_progress_2",[]],
  
  [anyone|plyr,"pretender_progress_2", [],
    "Then, we must keep fighting and rally our supporters!", "supported_pretender_pretalk",[]],
  
  [anyone|plyr,"pretender_progress_2", [],
    "It seems this rebellion is not going anywhere. We must give up.", "pretender_quit_rebel_confirm",[]],
  
  [anyone,"pretender_quit_rebel_confirm", [],
    "{playername}, you can't abandon me now. Are you serious?", "pretender_quit_rebel_confirm_2",[]],
  
  [anyone|plyr,"pretender_quit_rebel_confirm_2", [],
    "Indeed, I am. I can't support you any longer.", "pretender_quit_rebel_confirm_3",[]],
  
  [anyone|plyr,"pretender_quit_rebel_confirm_2", [],
    "I was jesting. I will fight for you until we succeed.", "supported_pretender_pretalk",[]],
  
  [anyone,"pretender_quit_rebel_confirm_3", [],
    "Are you absolutely sure? I will never forgive you if you abandon my cause.", "pretender_quit_rebel_confirm_4",[]],
  
  [anyone|plyr,"pretender_quit_rebel_confirm_4", [],
    "I am sure.", "pretender_quit_rebel",[]],
  
  [anyone|plyr,"pretender_quit_rebel_confirm_4", [],
    "Let me think about this some more.", "supported_pretender_pretalk",[]],
  
  [anyone,"pretender_quit_rebel", [],
    "So be it. Then my cause is lost. There is only one thing to do for me now. I will travel away from these islands to continental Europe, never to come back. With me gone, you may try to make your peace with {s4}.", "close_window",
    [
      (troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
      (faction_get_slot, ":original_faction_leader", ":original_faction", slot_faction_leader),
      (str_store_troop_name, s4, ":original_faction_leader"),
      
      (try_for_range, ":cur_troop", active_npcs_begin, active_npcs_end),
        (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
        (neq, "$supported_pretender", ":cur_troop"),
        (store_troop_faction, ":cur_faction", ":cur_troop"),
        (eq, ":cur_faction", "fac_player_supporters_faction"),
        (call_script, "script_change_troop_faction", ":cur_troop", ":original_faction"),
      (try_end),
      (troop_set_faction, "$g_talk_troop", "fac_neutral"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
      (assign, ":has_center", 0),
      (try_for_range, ":cur_center", centers_begin, centers_end),
        (store_faction_of_party, ":cur_faction", ":cur_center"),
        (eq, ":cur_faction", "fac_player_supporters_faction"),
        (assign, ":has_center", 1),
        (neg|party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
        (call_script, "script_give_center_to_lord", ":cur_center", "trp_player", 0),
      (try_end),
      (party_remove_members, "p_main_party", "$supported_pretender", 1),
      (faction_set_slot, ":original_faction", slot_faction_has_rebellion_chance, 0),
      (assign, "$supported_pretender", 0),
      (try_begin), #Still has center
        (eq, ":has_center", 1),
        (faction_set_color, "fac_player_supporters_faction", "$current_color"),
        (assign, "$players_kingdom_name_set", 1),
        (try_begin), #added to prevent no minister if player gives up rebellion
          (eq, "$g_player_minister", 0),
          (assign, "$g_player_minister", "trp_temporary_minister"),
        (try_end),
      (else_try), #No center
        (call_script, "script_deactivate_player_faction", 1),
      (try_end),
      (call_script, "script_change_player_honor", -20),
      (call_script, "script_fail_quest", "qst_rebel_against_kingdom"),
      (set_show_messages, 0),
      (call_script, "script_end_quest", "qst_rebel_against_kingdom"),
      (set_show_messages, 1),
      (eq, ":has_center", 1),
      (assign, ":court", -1),
      (assign, ":end", centers_end),
      (try_for_range, ":cur_center", centers_begin, ":end"),
        (store_faction_of_party, ":cur_faction", ":cur_center"),
        (eq, ":cur_faction", "fac_player_supporters_faction"),
        (party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
        (try_begin),
          (is_between,":cur_center", towns_begin, towns_end),
          (eq, ":court", -1),
          (assign, ":court", ":cur_center"),
          (assign, ":end", -1),
        (else_try),
          (is_between,":cur_center", castles_begin, castles_end),
          (eq, ":court", -1),
          (assign, ":court", ":cur_center"),
          (assign, ":end", -1),
        (else_try),
          (eq, ":court", -1),
          (assign, ":court", ":cur_center"),
          (assign, ":end", -1),
        (try_end),
      (try_end),
      (gt, ":court", -1),
      (assign, "$g_player_court", ":court"),
  ]],
  
  
  [anyone|plyr,"supported_pretender_talk", [],
    "{reg65?My lady:My lord}, would you allow me to check out your equipment?", "supported_pretender_equip",[]],
  [anyone,"supported_pretender_equip", [], "Very well, it's all here...", "supported_pretender_pretalk",[
      (change_screen_equip_other),
  ]],
  
  [anyone|plyr,"supported_pretender_talk", [], "If it would please you, can you tell me about your skills?", "pretneder_view_char_requested",[]],
  [anyone,"pretneder_view_char_requested", [], "Well, all right.", "supported_pretender_pretalk",[(change_screen_view_character)]],
  
  
  [anyone|plyr,"supported_pretender_talk", [
      
      (assign, ":center_found", 0),
      (try_for_range, ":fief_to_grant", centers_begin, centers_end),
        (store_faction_of_party, ":fief_faction", ":fief_to_grant"),
        (eq, ":fief_faction", "fac_player_supporters_faction"),
        (party_slot_eq, ":fief_to_grant", slot_town_lord, -1),
        (assign, ":center_found", 1),
      (try_end),
      (eq, ":center_found", 1),
      
    ],
    "I suggest that you decide who should hold a fief that does not have a lord.", "supported_pretender_grant_fief",[]],
  
  [anyone,"supported_pretender_grant_fief", [
    ],
    "Which fief did you have in mind?", "supported_pretender_grant_fief_select",[]],
  
  [anyone|plyr|repeat_for_parties,"supported_pretender_grant_fief_select", [
      (store_repeat_object, ":fief_to_grant"),
      (is_between, ":fief_to_grant", centers_begin, centers_end),
      (store_faction_of_party, ":fief_faction", ":fief_to_grant"),
      (eq, ":fief_faction", "fac_player_supporters_faction"),
      (party_slot_eq, ":fief_to_grant", slot_town_lord, -1),
      (str_store_party_name, s4, ":fief_to_grant"),
    ],
    "{!}{s4}", "supported_pretender_grant_fief_choose_recipient",[
      (store_repeat_object, "$g_center_taken_by_player_faction"),
  ]],
  
  [anyone,"supported_pretender_grant_fief_choose_recipient", [
    ],
    "Who should receive it?", "center_captured_rebellion",[
      (str_store_party_name, s4, "$g_center_taken_by_player_faction"),
  ]],
  
  [anyone|plyr,"supported_pretender_grant_fief_select", [
    ],
    "Never mind.", "supported_pretender_pretalk",[]],
  
  
  
  
  [anyone|plyr,"supported_pretender_talk", [],
    "Let us keep going, {reg65?my lady:sir}.", "close_window",[]],
  
  
  [anyone,"do_member_trade", [], "Anything else?", "member_talk",[]],
  
  [anyone,"member_pretalk", [], "Anything else?", "member_talk",[]],
  
  
  
  
  [anyone,"member_chat",
    [
      (store_conversation_troop,"$g_talk_troop"),
      (troop_is_hero,"$g_talk_troop"),
      (troop_get_slot, ":honorific", "$g_talk_troop", slot_troop_honorific),
      
      (try_begin),
        (eq, "$g_talk_troop", "trp_morrigan_npc"),
        (str_store_string, s5, "@Warlord"),
      (else_try),
        (str_store_string, s5, ":honorific"),
      (try_end),
      
    ], "Yes, {s5}?", "member_talk",
    [
      (try_begin),
        (is_between, "$g_talk_troop", companions_begin, companions_end),
        (unlock_achievement, ACHIEVEMENT_TALKING_HELPS),
      (try_end),
  ]],
  
  [anyone|plyr,"member_talk", [
      (is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
      (faction_slot_eq,  "$players_kingdom", slot_faction_marshal, "trp_player"),
      ], "As marshal, I wish you to send a message to the vassals of the realm", "member_direct_campaign",[]],
  
  
  [anyone|plyr,"member_talk", [],
    
    "Let me see your equipment.", "member_trade",[]],
  [anyone,"member_trade", [], "Very well, it's all here...", "do_member_trade",[
      #      (change_screen_trade)
      (change_screen_equip_other),
  ]],
  ###Morrigan in party dialogs add-ons
  [trp_morrigan_npc|plyr,"member_talk", [
      ], "Tell me about Morrigan.", "morrigan_namegodness",[]],
  [anyone,"morrigan_namegodness", [], "--She smiles weakly.--^^I'm the Phantom Queen. I'm the one who selects the fallen in battle. In the shape of a crow, flying above the warriors, I take joy in bodies bathed in blood " +
    "but scorn the corpses wounded in their backs.^^I'm a goddess of the ancient peoples, the same that built the cromlechs long before the sea began to vomit black sails. And I will prevail long after all of you fall into darkness.", "member_talk",[]],
  
  [trp_morrigan_npc|plyr,"member_talk", [
      ], "Sing for me. I want to hear your song again.", "morrigan_songplayer",[            (play_track, "track_morrigan_song", 1),
  ]],
  [anyone,"morrigan_songplayer", [], "--She smiles.--^^Very well.", "member_talk",[]],
  
  [trp_morrigan_npc|plyr,"member_talk", [
      ], "How did you end up leading a band of bears and wolves?", "morrigan_storytoplayer",[
  ]],
  [anyone,"morrigan_storytoplayer", [], "When I was alone and desperate, they came to me. It may seem strange, but without the protection of those men that you destroyed, I would have been dead by now. " +
    "They were my father's men. They took on the skins of beasts and gave me the name of the old goddess, Morrigan, to cause our enemies to fear.", "morrigan_storytoplayer2",[]],
  [anyone,"morrigan_storytoplayer2", [], "Away from civilization, after I had left everything behind to save myself, they had to kill to survive. That hard life made them crazy and turned them into true beasts. " +
    "There were times when even I was afraid.^^" +
    "I loved those men, and for that alone, I hate you for killing them. At the same time, I appreciate you for freeing me from becoming what they became.", "morrigan_storytoplayer3",[]],
  [anyone,"morrigan_storytoplayer3", [], "Anything else?", "member_talk",[]],
  
  [trp_morrigan_npc|plyr,"member_talk", [
      ], "I want to talk about Flaithbertach's grandchildren.", "morrigan_storygrandchildren",[
  ]],
  [anyone,"morrigan_storygrandchildren", [], "The children of my brother? I heard he had died, but I cannot believe it.", "morrigan_storygrandchildren2",[]],
  
  [trp_morrigan_npc|plyr,"morrigan_storygrandchildren2", [(quest_slot_eq, "qst_blank_quest_25",slot_quest_current_state, 2), #evil ch
      ], "It is not a rumor. I discovered where they were hiding and told Mael Bresail.", "morrigan_storygrandchildren3",[
  ]],
  [trp_morrigan_npc|plyr,"morrigan_storygrandchildren2", [(quest_slot_eq, "qst_blank_quest_25",slot_quest_current_state, 3), #evil ch
      ], "It is a rumor. I gave orders to hide them. They are safe.", "morrigan_storygrandchildren4",[
  ]],
  [trp_morrigan_npc|plyr,"morrigan_storygrandchildren2", [(quest_slot_eq, "qst_blank_quest_25",slot_quest_current_state, 4), #evil ch
      ], "It is a rumor. I gave orders to hide them. They are safe.", "morrigan_storygrandchildren4",[
  ]],
  [trp_morrigan_npc|plyr,"morrigan_storygrandchildren2", [
      ], "We ought to talk about this another time.", "morrigan_storygrandchildren2_ter",[
  ]],
  [anyone,"morrigan_storygrandchildren2_ter", [], "Very well.", "member_talk",[
  ]],
  
  [anyone,"morrigan_storygrandchildren3", [], "You did what? I should have suspected. You killed my brother and left his children at the mercy of murderers. " +
    "You're nothing but scum like Mael Bresail. Why not kill me too?", "morrigan_storygrandchildren3_1",[]],
  [trp_morrigan_npc|plyr,"morrigan_storygrandchildren3_1", [
      ], "Maybe I shall.", "morrigan_storygrandchildren3_2",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -40),
  ]],
  [trp_morrigan_npc|plyr,"morrigan_storygrandchildren3_1", [
      ], "I... I was cheated by Mael Bresail.", "morrigan_storygrandchildren3_2",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  [anyone,"morrigan_storygrandchildren3_2", [], "Leave me alone. I want to mourn my loss. Soon you will discover what sort of man you've been helping.", "member_talk",[
  ]],
  
  [anyone,"morrigan_storygrandchildren4", [], "You cannot understand how happy I am to hear those words. The children of my brother are still alive! Thank you so much. " +
    "You're a better person than I expected.", "member_talk",[]],
  
  [trp_morrigan_npc|plyr,"member_talk", [              (check_quest_active,"qst_blank_quest_27"), #add dialog post flirt minigame
      (quest_slot_eq,"qst_blank_quest_27",slot_quest_current_state,1),
      ], "[Kiss her.]", "morrigan_romanceoptions_f1",[ (assign, "$current_dialog_cost", 16),]],
  
  [trp_morrigan_npc|plyr,"member_talk", [              (check_quest_active,"qst_blank_quest_27"), #add dialog post flirt minigame
      (quest_slot_eq,"qst_blank_quest_27",slot_quest_current_state,1),
      ], "My lady, my tent makes a poor palace without you. I pray you would find me worthy to exalt it.", "morrigan_romanceoptions_f2",[ (assign, "$current_dialog_cost", 16),]],
  
  [anyone, "morrigan_romanceoptions_f1", [], "[Her lips are to yours.]", "member_talk",[
  ]],
  
  [anyone, "morrigan_romanceoptions_f2", [], "[Morrigan winks while she smiles at you knowingly.]^^ Wait for me when the whole camp is quiet. I'll be there, my love.", "member_talk",[  (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  #
  [trp_morrigan_npc|plyr,"member_talk", [  (neg|quest_slot_eq,"qst_blank_quest_27",slot_quest_current_state,1),
      (troop_get_slot, ":relation", "$g_talk_troop", slot_troop_player_relation),
      (ge, ":relation", 0), #romance
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (neq, ":is_female", 1), #no female romance
      
      ], "You are a remarkable woman. I could fall in love with you.", "morrigan_romanceoptions",[ (assign, "$current_dialog_cost", 16),]],
  
  [anyone, "morrigan_romanceoptions", [
      (store_sub, ":needed_for_success", 100, "$current_dialog_cost"),
      (assign, reg0, ":needed_for_success"),
    ], "--Morrigan looks at you with curiosity, as if waiting for you to take the next step.--^^" +
    "[ Current Morrigan reluctance: {reg0} ]", "morrigan_flirt1",[]],
  #basic
  [anyone|plyr, "morrigan_flirt1", [(le, "$current_dialog_cost",20),], "You are a beauty, Morrigan.", "morrigan_flirt1_1",[]],
  [anyone|plyr, "morrigan_flirt1", [(le, "$current_dialog_cost",30),], "Your parents were wrong to leave you orphaned.", "morrigan_flirt1_2",[]], #trampa
  [anyone|plyr, "morrigan_flirt1", [(le, "$current_dialog_cost",25),], "[Take her hand and smile.]", "morrigan_flirt1_3",[]],
  [anyone|plyr, "morrigan_flirt1", [(le, "$current_dialog_cost",20),], "[You look deeply into her eyes.]", "morrigan_flirt1_1",[]],
  [anyone|plyr, "morrigan_flirt1", [(le, "$current_dialog_cost",25),], "I'm glad to have you with us.", "morrigan_flirt1_3",[]],
  
  [anyone, "morrigan_flirt1_2", [], "You are either crazy or simply stupid. Forget me.", "morrigan_storytoplayer3",[  (val_sub, "$current_dialog_cost", 20),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -6),
  ]],
  [anyone, "morrigan_flirt1_1", [], "[She looks at you and smiles. It looks that you've made a good impression.]", "morrigan_flirt1",[  (val_add, "$current_dialog_cost", 10),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
  ]],
  [anyone, "morrigan_flirt1_3", [], "[She smiles]", "morrigan_flirt1",[  (val_add, "$current_dialog_cost", 10),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
  ]],
  #second phase
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",20),(le, "$current_dialog_cost",45),], "What do you think about me?", "morrigan_flirt2_3",[]],#trampa
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",20),(le, "$current_dialog_cost",45),], "I have a precious ring in my possession. Would you like it?", "morrigan_flirt2_2",[]],
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",20),(le, "$current_dialog_cost",45),], "I was only joking about being afraid to enter your lair.", "morrigan_flirt2_1",[]],
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",25),(le, "$current_dialog_cost",80),], "Why not come by my tent tonight?", "morrigan_flirt1_2",[]], #trampa
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",30),(le, "$current_dialog_cost",50),], "So... Do you like to hunt?", "morrigan_flirt2_4",[]],
  
  
  [anyone, "morrigan_flirt2_1", [], "--She laughs.--^^ I usually cause that feeling.", "morrigan_flirtreluctanceupdate",[  (val_add, "$current_dialog_cost", 10),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
  ]],
  [anyone, "morrigan_flirt2_2", [], "Thank you. It's a pretty gift. I love rings.", "morrigan_flirtreluctanceupdate",[ (val_add, "$current_dialog_cost", 10),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
  ]],
  [anyone, "morrigan_flirt2_3", [], "Why do you ask that? Are you so insecure? I prefer bold people!", "morrigan_flirtreluctanceupdate",[ (val_sub, "$current_dialog_cost", 15),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -2),
  ]],
  [anyone, "morrigan_flirt2_4", [], "Years ago, I would have said no, but since then, it was the hunt that allowed me to eat many days. I love hunting now.", "morrigan_flirtreluctanceupdate",[  (val_add, "$current_dialog_cost", 10),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -2),
  ]],
  #reluctance control
  [anyone, "morrigan_flirtreluctanceupdate", [                            (troop_get_slot, ":relation", "$g_talk_troop", slot_troop_player_relation),
      (lt, ":relation", 0), #no romance
      ], "We have nothing more to say.", "morrigan_storytoplayer3",[
  ]],
  
  [anyone, "morrigan_flirtreluctanceupdate", [                            (store_sub, ":needed_for_success", 100, "$current_dialog_cost"),
      (assign, reg0, ":needed_for_success"),
      ], "[ Current Morrigan reluctance: {reg0} ]", "morrigan_flirt1",[
  ]],
  
  #third phase, more difficult.
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",40),(le, "$current_dialog_cost",75),], "So just how did your parents die?", "morrigan_flirt3_1",[]],#trampa
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",40),(le, "$current_dialog_cost",65),], "[Gently touch her face.]", "morrigan_flirt3_2",[]],
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",40),(le, "$current_dialog_cost",65),], "[Kiss her.]", "morrigan_flirt3_3",[]], #trampa
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",40),(le, "$current_dialog_cost",65),], "I have a valuable bracelet in my possession. Would you like it?", "morrigan_flirt3_4",[]],#trampa
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",40),(le, "$current_dialog_cost",65),], "What do you like to do for fun?", "morrigan_flirt3_5",[]],
  
  [anyone, "morrigan_flirt3_1", [], "I do not want to talk about it.", "morrigan_storytoplayer3",[  (val_add, "$current_dialog_cost", -40),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -8),
  ]],
  [anyone, "morrigan_flirt3_2", [], "[She smiles and looks at you.]", "morrigan_flirtreluctanceupdate",[  (val_add, "$current_dialog_cost", 15),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
  ]],
  [anyone, "morrigan_flirt3_3", [], "Warlord, much as I like you, I do not want to kiss you.", "morrigan_flirtreluctanceupdate",[  (val_sub, "$current_dialog_cost", 25),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -3),
  ]],
  [anyone, "morrigan_flirt3_4", [], "I am not just one of your warriors. Keep this for your men.", "morrigan_flirtreluctanceupdate",[  (val_sub, "$current_dialog_cost", 25),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -3),
  ]],
  [anyone, "morrigan_flirt3_5", [], "Right now, I am having fun being with you.", "morrigan_flirtreluctanceupdate",[  (val_add, "$current_dialog_cost", 15),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
  ]],
  
  #four, more difficult
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",60),(le, "$current_dialog_cost",85),], "So, a beautiful woman like you must be married.", "morrigan_flirt4_1",[]], #trampa
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",55),(le, "$current_dialog_cost",80),], "You're the most beautiful woman I've ever seen.", "morrigan_flirt4_2",[]], #trampa
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",60),(le, "$current_dialog_cost",85),], "[Touch her face and kiss her.]", "morrigan_flirt4_3",[]],
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",65),(le, "$current_dialog_cost",90),], "[Smell her hair.]", "morrigan_flirt4_4",[]],
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",60),(le, "$current_dialog_cost",85),], "[Hold her hands.]", "morrigan_flirt4_5",[]],
  
  [anyone, "morrigan_flirt4_1", [], "That would have been nice, but how could I be married if I spent my life fleeing?", "morrigan_flirtreluctanceupdate",[  (val_sub, "$current_dialog_cost", 30),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -4),
  ]],
  [anyone, "morrigan_flirt4_2", [], "I do not think so. I know there are women who are more beautiful.", "morrigan_flirtreluctanceupdate",[  (val_sub, "$current_dialog_cost", 40),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -4),
  ]],
  [anyone, "morrigan_flirt4_3", [], "[Her lips are to yours.]", "morrigan_flirtreluctanceupdate",[  (val_add, "$current_dialog_cost", 20),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 4),
  ]],
  [anyone, "morrigan_flirt4_4", [], "What are you doing? Behaving like a wolf! Get away from me!", "morrigan_flirtreluctanceupdate",[  (val_sub, "$current_dialog_cost", 40),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -4),
  ]],
  [anyone, "morrigan_flirt4_5", [], "[She smiles at you and blushes.]", "morrigan_flirtreluctanceupdate",[  (val_add, "$current_dialog_cost", 20),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 4),
  ]],
  
  #success
  [anyone|plyr, "morrigan_flirt1", [(ge, "$current_dialog_cost",90),], "My lady, my tent makes a poor palace without you. I pray you would find me worthy to exalt it.", "morrigan_flirtsuccess",[]],
  
  [anyone, "morrigan_flirtsuccess", [], "Wait for me when the whole camp is quiet. I'll be there, my love.", "morrigan_flirtsuccess2",[  (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  [anyone, "morrigan_flirtsuccess2", [], "[Morrigan winks while she smiles at you knowingly. You realize she is in love with you.]", "morrigan_storytoplayer3",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 70),
      (add_xp_as_reward, 1000),
      (assign, "$current_dialog_cost", 0),
      (str_store_string, s2, "@Note 5: You fell in love with Morrigan."),
      (add_quest_note_from_sreg, "qst_blank_quest_27", 8, s2, 0),
      (quest_set_slot,"qst_blank_quest_27",slot_quest_current_state, 1), #status 0
  ]],
  #
  [anyone|plyr, "morrigan_flirt1", [], "Sorry, I have other things to do.", "morrigan_storytoplayer3",[]],
  
  ##########
  
  [anyone,"do_member_trade", [], "Anything else?", "member_talk",[]],
  
  [anyone|plyr,"member_talk", [], "What can you tell me about your skills?", "view_member_char_requested",[]],
  [anyone,"view_member_char_requested", [], "All right, let me tell you...", "do_member_view_char",[(change_screen_view_character)]],
  
  [anyone|plyr,"member_talk", [(neq, "$campaign_type", camp_storyline), #only in sandbox mode is possible dismiss companions
      (neq, "$g_talk_troop", "trp_morrigan_npc"),
      #   (neg|check_quest_active, "qst_kennemer_mission_2"), #chief mainquest no separate for Reginhard
      ], "We need to separate for a while.", "member_separate",[
      (call_script, "script_npc_morale", "$g_talk_troop"),
      (assign, "$npc_quit_morale", reg0),
  ]],
  
  #Regalo a companeros chief
  [anyone|plyr,"member_talk",  [(store_troop_gold,":money","trp_player"),(gt,":money",2999),],
    "(Give warrior rings and bracelets valued at 3000 peningas)", "com_regalo6",[
      (troop_remove_gold, "trp_player", 3000),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 4),
      (try_begin),
        (troop_get_slot, ":morality", "$g_talk_troop", slot_troop_morality_penalties),
        (gt, ":morality", 1),
        (val_sub, ":morality", 1),
        (troop_set_slot, "$g_talk_troop", slot_troop_morality_penalties, ":morality"),
      (try_end),
      (str_store_string, s20, "@{s21} seems happy. {s21} looks pleased."),
  ]],
  
  [anyone, "com_regalo6", [], "Thank you, I am proud to receive these rewards.", "do_member_trade",[]],
  ####
  
  [anyone|plyr,"member_talk", [(eq, "$cheat_mode", 1),
      #   (neg|check_quest_active, "qst_kennemer_mission_2"), #chief mainquest no separate for Reginhard
      ], "Leave now.", "member_separate",[
      (call_script, "script_npc_morale", "$g_talk_troop"),
      (assign, "$npc_quit_morale", reg0),
  ]],
  
  [anyone,"member_separate", [
      (this_or_next|eq, "$campaign_type", camp_storyline), #only in sandbox mode is possible dismiss companions
      (eq, "$g_talk_troop", "trp_morrigan_npc"),
    ], "Oh really? Then this game will probably fail at some point. Is that what you want? **warning**", "member_separate_confirm",
    []],
  
  [anyone,"member_separate", [
      (gt, "$npc_quit_morale", 30),
    ], "Oh really? Well, I'm not just going to wait around here. I'm going to go to the towns to look for other work. Is that what you want?", "member_separate_confirm",
    []],
  
  [anyone,"member_separate", [
    ], "Actually, there is something I need to tell you.", "companion_quitting",
    [
      (assign, "$player_can_refuse_npc_quitting", 0),
      (assign, "$player_can_persuade_npc", 0),
  ]],
  
  
  [anyone|plyr,"member_separate_confirm", [], "That's right. We need to part ways.", "member_separate_yes",[]],
  [anyone|plyr,"member_separate_confirm", [], "No, I'd rather have you at my side.", "do_member_trade",[]],
  
  [anyone,"member_separate_yes", [
    ], "Well. I'll be off, then. Look me up if you need me.", "close_window",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -15),
      (troop_set_slot, "$g_talk_troop", slot_troop_occupation, 0),
      (troop_set_slot, "$g_talk_troop", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "$g_talk_troop"),
  ]],
  
  
  [anyone|plyr,"member_talk", [(neq, "$g_talk_troop", "trp_morrigan_npc"),], "I'd like to ask you something.", "member_question",[]],
  
  [anyone|plyr,"member_talk", [], "Never mind.", "close_window",[]],
  
  [anyone,"member_question", [], "Very well. What did you want to ask?", "member_question_2",[]],
  
  [anyone|plyr,"member_question_2", [], "How do you feel about the way things are going in this company?", "member_morale",[]],
  [anyone|plyr,"member_question_2", [(is_between, "$g_talk_troop", companions_begin, companions_end),], "Tell me your story again.", "member_background_recap",[]],
  [anyone|plyr,"member_question_2", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_kingsupport_state, 0),
      ], "I suppose you know that I aspire to be {reg59?queen:king} of this land?", "member_kingsupport_1",[]],
  
  [anyone|plyr,"member_question_2", [(is_between, "$g_talk_troop", companions_begin, companions_end), (neq, "$campaign_type", camp_storyline),
      ], "Do you have any connections that we could use to our advantage?", "member_intelgathering_1",[]],
  
  [anyone|plyr,"member_question_2", [(is_between, "$g_talk_troop", companions_begin, companions_end),
      (neq, "$campaign_type", camp_storyline),
      ], "I would like to improve my relations with a settlement.", "member_improverels_1",[]],
  
  [anyone|plyr,"member_question_2", [
      (faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
      (neq, "$campaign_type", camp_storyline),
      ], "Would you be interested in holding a fief?", "member_fief_grant_1",[]],
  
  #chief anade farewell
  [anyone|plyr,"member_question_2", [], "Never mind.", "close_window",[]],
  ##
  [anyone,"member_morale", [
      (call_script, "script_npc_morale", "$g_talk_troop"),
      ], "{!}{s21}", "do_member_trade",[]],
  
  [anyone,"member_background_recap", [
      (troop_get_slot, ":first_met", "$g_talk_troop", slot_troop_first_encountered),
      (str_store_party_name, 20, ":first_met"),
      (troop_get_slot, ":home", "$g_talk_troop", slot_troop_home),
      (str_store_party_name, 21, ":home"),
      (troop_get_slot, ":recap", "$g_talk_troop", slot_troop_home_recap),
      (str_store_string, 5, ":recap"),
      ], "{!}{s5}", "member_background_recap_2",[]],
  
  [anyone,"member_background_recap_2", [
      (str_clear, 19),
      (troop_get_slot, ":background", "$g_talk_troop", slot_troop_backstory_b),
      (str_store_string, 5, ":background"),
      ], "{!}{s5}", "member_background_recap_3",[]],
  
  [anyone,"member_background_recap_3", [
      ], "Then shortly after, I joined up with you.", "do_member_trade",[]],
  
  [anyone,"do_member_view_char", [], "Anything else?", "member_talk",[]],
  
  
  [anyone,"member_kingsupport_1", [
      (troop_get_slot, ":morality_grievances", "$g_talk_troop", slot_troop_morality_penalties),
      (gt, ":morality_grievances", 10),
      ], "Um... Yes. I had heard.", "do_member_trade",[]],
  
  [anyone,"member_kingsupport_1", [
      (store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
      (store_add, ":string", "str_npc1_kingsupport_1", ":npc_no"),
      #		 (troop_get_slot, ":string", "$g_talk_troop", slot_troop_kingsupport_string_1),
      (str_store_string, s21, ":string"),
      ], "{!}{s21}", "member_kingsupport_1a",[]],
  
  [anyone|plyr,"member_kingsupport_1a", [ (neq, "$campaign_type", camp_storyline),
      ], "Would you then support my cause?", "member_kingsupport_2",[]],
  
  [anyone|plyr,"member_kingsupport_1a", [
      ], "Very good. I shall keep that in mind.", "do_member_trade",[]],
  
  
  [anyone,"member_kingsupport_2", [
      (assign, ":companion_already_on_mission", -1),
      (try_for_range, ":companion", companions_begin, companions_end),
        (troop_slot_eq, ":companion", slot_troop_occupation, slto_player_companion),
        (troop_get_slot, ":days_on_mission", ":companion", slot_troop_days_on_mission),
        (gt, ":days_on_mission", 17),
        (neg|main_party_has_troop, ":companion"),
        (assign, ":companion_already_on_mission", ":companion"),
      (try_end),
      
      (gt, ":companion_already_on_mission", -1),
      (troop_get_slot, ":honorific", "$g_talk_troop", slot_troop_honorific),
      (str_store_string, s21, ":honorific"),
      (str_store_troop_name, s22, ":companion_already_on_mission"),
      
      ], "I would, {s21}. Moreover, I have a proposal on how I might help you attain your throne. However, you recently sent {s22} off on a similar mission. Perhaps we should wait for a couple of weeks to avoid drawing too much attention to ourselves.", "do_member_trade",[]],
  
  
  [anyone,"member_kingsupport_2", [
      (store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
      (store_add, ":string", "str_npc1_kingsupport_2", ":npc_no"),
      #		 (troop_get_slot, ":string", "$g_talk_troop", slot_troop_kingsupport_string_2),
      (str_store_string, s21, ":string"),
      ], "{!}{s21}", "member_kingsupport_2a",[]],
  
  [anyone|plyr,"member_kingsupport_2a", [
      (store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
      (store_add, ":string", "str_npc1_kingsupport_2a", ":npc_no"),
      #  		 (troop_get_slot, ":string", "$g_talk_troop", slot_troop_kingsupport_string_2a),
      (str_store_string, s21, ":string"),
      ], "{!}{s21}", "member_kingsupport_3",[]],
  
  [anyone|plyr,"member_kingsupport_2a", [
      (store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
      (store_add, ":string", "str_npc1_kingsupport_2b", ":npc_no"),
      #    	 (troop_get_slot, ":string", "$g_talk_troop", slot_troop_kingsupport_string_2b),
      (str_store_string, s21, ":string"),
      
      ], "{!}{s21}", "do_member_trade",[]],
  
  [anyone,"member_kingsupport_3", [
      (store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
      (store_add, ":string", "str_npc1_kingsupport_3", ":npc_no"),
      #		 (troop_get_slot, ":string", "$g_talk_troop", slot_troop_kingsupport_string_3),
      (str_store_string, s21, ":string"),
      ], "{!}{s21}", "member_kingsupport_3a",[]],
  
  
  [anyone|plyr,"member_kingsupport_3a", [
      ], "Very good. You do that", "member_kingsupport_4",[
  ]],
  
  [anyone|plyr,"member_kingsupport_3a", [
      ], "On second thought, stay with me for a while", "do_member_trade",[]],
  
  [anyone,"member_kingsupport_4", [
      (troop_set_slot, "$g_talk_troop", slot_troop_days_on_mission, 21),
      (troop_set_slot, "$g_talk_troop", slot_troop_current_mission, npc_mission_kingsupport),
      
      (remove_member_from_party, "$g_talk_troop", "p_main_party"),
      
      (troop_get_slot, ":string", "$g_talk_troop", slot_troop_honorific),
      (str_store_string, s21, ":string"),
      
      ], "Farewell then, {s21}, for a little while", "close_window",[]],
  
  [anyone,"member_intelgathering_1", [
      (troop_get_slot, ":town_with_contacts", "$g_talk_troop", slot_troop_town_with_contacts),
      (str_store_party_name, s17, ":town_with_contacts"),
      (store_faction_of_party, ":contact_town_faction", ":town_with_contacts"),
      (str_store_faction_name, s18, ":contact_town_faction"),
      
      (store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
      (store_add, ":connections_string", "str_npc1_intel_mission", ":npc_no"),
      (str_store_string, s21, ":connections_string"),
      ], "{!}{s21}", "member_intelgathering_3",[]],
  
  [anyone,"member_improverels_1", [], "What settlement do you have in mind?","member_improverels_2", []],
  
  [anyone|plyr|repeat_for_parties,"member_improverels_2", [
      (store_repeat_object, ":center"),
      (is_between, ":center", walled_centers_begin, walled_centers_end),
      (neg|party_slot_eq, ":center", slot_town_lord, "trp_player"),
      (party_get_slot, ":center_relation", ":center", slot_center_player_relation),
      (lt, ":center_relation", 0),
      (store_distance_to_party_from_party, ":cur_distance", ":center", "p_main_party"),
      (le, ":cur_distance", 50),
      (str_store_party_name, s4, ":center"),],"{!}{s4}", "member_improverels_3",[(store_repeat_object, "$temp")]],
  
  [anyone|plyr, "member_improverels_2",
    [],"Actually, forget about this, maybe later.", "do_member_trade",
    []],
  
  
  [anyone, "member_improverels_3",
    [
      (str_store_party_name, s4, "$temp"),
    ],
    "Very well. I will travel there and try to improve your relations with {s4}, {s21}.", "close_window",[
      (troop_set_slot, "$g_talk_troop", slot_troop_days_on_mission, 10),
      (troop_set_slot, "$g_talk_troop", slot_troop_current_mission, npc_mission_improve_relations),
      (troop_set_slot, "$g_talk_troop", slot_troop_mission_object, "$temp"),
      (remove_member_from_party, "$g_talk_troop", "p_main_party"),
      (troop_get_slot, ":string", "$g_talk_troop", slot_troop_honorific),
      (str_store_string, s21, ":string"),
  ]],
  
  # [anyone,"member_intelgathering_3", [ #change back to member_intelgathering_2 if this will be used
      # (eq, 1, 0),
      # ], "Of course, as few people as possible should know of this. If you want to collect the information, or pull me out, then don't send a messenger. Come and get me yourself -- even if that means you have to sneak through the gates.", "member_intelgathering_3",[]],
  
  [anyone|plyr,"member_intelgathering_3", [
      ], "Splendid idea -- you do that.", "member_intelgathering_4",[]],
  
  [anyone|plyr,"member_intelgathering_3", [
      ], "Actually, hold off for now.", "do_member_trade",[]],
  
  [anyone,"member_intelgathering_4", [
      (troop_set_slot, "$g_talk_troop", slot_troop_days_on_mission, 5),
      (troop_set_slot, "$g_talk_troop", slot_troop_current_mission, npc_mission_gather_intel),
      
      (remove_member_from_party, "$g_talk_troop", "p_main_party"),
      
      (troop_get_slot, ":string", "$g_talk_troop", slot_troop_honorific),
      (str_store_string, s21, ":string"),
      
      ], "Good. I should be ready to report in about five days. Farewell then, {s21}, for a little while.", "close_window",[]],
  
  
  
  [anyone|auto_proceed, "start",
    [
      (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      (eq, "$talk_context", tc_town_talk),
    ],
    "{!}.", "merchant_quest_4_start",
    [
  ]],
  
  [anyone, "merchant_quest_4_start",
    [
    ],
    "It's time, lads! Up and at them!", "close_window",
    [
      (try_for_agents, ":agent_no"),
        (agent_get_troop_id, ":agent_troop_id", ":agent_no"),
        (ge, ":agent_troop_id", "trp_looter"),
        (le, ":agent_troop_id", "trp_desert_bandit"),
        (agent_set_team, ":agent_no", 1),
      (try_end),
      
      (get_player_agent_no, ":player_agent"),
      
      (assign, ":minimum_distance", 1000),
      (try_for_agents, ":agent_id_1"),
        (neq, ":agent_id_1", ":player_agent"),
        (agent_get_team, ":agent_team_1", ":agent_id_1"),
        (eq, ":agent_team_1", 0),
        (agent_get_position, pos0, ":agent_id_1"),
        
        (try_for_agents, ":agent_id_2"),
          (agent_get_team, ":agent_team_2", ":agent_id_2"),
          (eq, ":agent_team_2", 1),
          (agent_get_position, pos1, ":agent_id_2"),
          
          (get_distance_between_positions, ":dist", pos0, pos1),
          
          (le, ":dist", ":minimum_distance"),
          (assign, ":minimum_distance", ":dist"),
          (copy_position, pos2, pos1),
        (try_end),
        
        (agent_set_scripted_destination, ":agent_id_1", pos2, 0),
        (agent_set_speed_limit, ":agent_id_1", 10),
      (try_end),
  ]],
  
  #####################mainquest astur captain
  [anyone, "start",
    [
      (is_between, "$g_talk_troop", "trp_relative_of_merchant", "trp_relative_of_merchants_end"),
      
      ##    (try_begin),
      ##      (check_quest_active, "qst_save_relative_of_merchant"),
      ##      (call_script, "script_succeed_quest", "qst_save_relative_of_merchant"),
      ##    (try_end),
      ##
      ##    (str_store_party_name, s9, "$g_starting_town"),
      ##
      ##    (assign, "$relative_of_merchant_is_found", 1),
    ],
    "Stop! You bring many boats with you. Who are you, and what do you want?", "relative_saved_1a",
    [
  ]],
  
  [anyone|plyr, "relative_saved_1a",
    [],
    "My name is {playername}. Are you the army from the Kingdom of Asturias?", "relative_saved_1b1",
    [
  ]],
  [anyone|plyr, "relative_saved_1a",
    [(eq, "$player_side", 1), ],  #wessex
    "My name is {playername}. I come in accordance with the agreements with West Seaxe.", "relative_saved_1b2",
    [
  ]],
  [anyone|plyr, "relative_saved_1a",
    [(eq, "$player_side", 2), ],  #danish
    "My name is {playername}. I come to negotiate on behalf of the sons of Ragnar.", "relative_saved_1b2",
    [
  ]],
  
  [anyone, "relative_saved_1b1",
    [
    ],
    "Yes, and if you know who we are, you can only come from West Seaxe.", "relative_saved_1b2",
    [
  ]],
  
  [anyone, "relative_saved_1b2",
    [
    ],
    "I see. Well, my job is not to trust anyone, but stay alert. If your fleet moves, we will attack you. You'll go with two or three men to our ship, and we will take you to the village to talk to our leaders. " +
    "Five of our men will go to your ship as hostages to guarantee your safety.", "relative_saved_1b3",
    [
  ]],
  [anyone, "relative_saved_1b3",
    [
    ],
    "Let's go!", "close_window",
    [
      (quest_set_slot,"qst_douar_an_enez",slot_quest_current_state, 12),
      (jump_to_menu, "mnu_way_to_douaranenez2"),
      (finish_mission, 2),
  ]],
  
  
  
  ################################
  
  
  [anyone, "start",
    [
      (is_between, "$g_talk_troop", "trp_sea_raider_leader", "trp_bandit_leaders_end"),
      (eq,"$talk_context",tc_hero_defeated),
    ],
    "Ay! Spare me! Spare my life! Let me go, and I'll go far away from here, and learn an honest trade, and you'll never hear of me again!", "bandit_leader_1a",
    []],
  
  [anyone|plyr, "bandit_leader_1a",
    [
      (is_between, "$g_talk_troop", "trp_sea_raider_leader", "trp_bandit_leaders_end"),
    ],
    "I'll spare your life -- but in exchange, I want information. Either you or your mates kidnapped the brother of a prominent merchant in town. Tell me where you're hiding him, and give me your word that you'll stop troubling the people of these parts, and you can go free.", "bandit_leader_1b",
    []],
  
  
  
  
  
  [anyone,"start",
    [
      (eq,"$talk_context",tc_party_encounter),
      (is_between, "$g_talk_troop", "trp_bandit_leaders_end", "trp_relative_of_merchant"), #no in use.
    ],
    "What do you want?", "looter_leader_1",
    []],
  
  [anyone|plyr,"looter_leader_1",
    [
      (store_faction_of_party, ":starting_town_faction", "$g_starting_town"),
      (try_begin),
        (eq, ":starting_town_faction", "fac_kingdom_1"),
        (assign, ":troop_of_merchant", "trp_swadian_merchant"),
      (else_try),
        (eq, ":starting_town_faction", "fac_kingdom_2"),
        (assign, ":troop_of_merchant", "trp_vaegir_merchant"),
      (else_try),
        (eq, ":starting_town_faction", "fac_kingdom_3"),
        (assign, ":troop_of_merchant", "trp_khergit_merchant"),
      (else_try),
        (eq, ":starting_town_faction", "fac_kingdom_4"),
        (assign, ":troop_of_merchant", "trp_nord_merchant"),
      (else_try),
        (eq, ":starting_town_faction", "fac_kingdom_5"),
        (assign, ":troop_of_merchant", "trp_rhodok_merchant"),
      (else_try),
        #(eq, ":starting_town_faction", "fac_kingdom_6"),#fixing VC-2754
        (assign, ":troop_of_merchant", "trp_sarranid_merchant"),
      (try_end),
      
      (str_store_troop_name, s9, ":troop_of_merchant"),
    ],
    "I've been looking for you. Tell me where you keep your prisoners, and I'll let you go.", "looter_leader_2",
    []],
  
  [anyone|plyr,"looter_leader_1",
    [],
    "Nothing. We'll leave you in peace.", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"looter_leader_2",
    [],
    "Hah! Those prisoners are only going free if you pay their ransom. Did you bring any silver?", "looter_leader_3",
    []],
  
  [anyone|plyr,"looter_leader_3",
    [],
    "No, but I brought steel.", "close_window",
    []],
  
  
  
  [anyone, "bandit_leader_1b",
    [
      (is_between, "$g_talk_troop", "trp_sea_raider_leader", "trp_bandit_leaders_end"),
      
      (assign, ":possible_villages", 0),
      (try_for_range, ":village_no", villages_begin, villages_end),
        (party_slot_eq, ":village_no", slot_village_bound_center, "$g_starting_town"),
        (val_add, ":possible_villages", 1),
      (try_end),
      
      (store_random_in_range, ":random_village", 0, ":possible_villages"),
      (val_add, ":random_village", 1),
      
      (try_for_range, ":village_no", villages_begin, villages_end),
        (party_slot_eq, ":village_no", slot_village_bound_center, "$g_starting_town"),
        (val_sub, ":random_village", 1),
        (eq, ":random_village", 0),
        (assign, "$lair_neighboor_village", ":village_no"),
      (try_end),
      
      (str_store_party_name_link, s9, "$lair_neighboor_village"),
      
      (set_spawn_radius, 4),
      (spawn_around_party, "$lair_neighboor_village", "pt_looter_lair"),
      (party_set_flags, reg0, pf_always_visible, 1),
    ],
    "Oh bless you, {reg59?my lady:my lord}. Bless you. We've done the lad no harm. We've been keeping him in our hideout near {s9}. I'll describe the area nearby in detail, so there's no mistaking it...", "close_window",
    [
      (call_script, "script_succeed_quest", "qst_learn_where_merchant_brother_is"),
      (call_script, "script_end_quest", "qst_learn_where_merchant_brother_is"),
      
      (store_faction_of_party, ":starting_town_faction", "$g_starting_town"),
      (try_begin),
        (eq, ":starting_town_faction", "fac_kingdom_1"),
        (assign, ":troop_of_merchant", "trp_swadian_merchant"),
      (else_try),
        (eq, ":starting_town_faction", "fac_kingdom_2"),
        (assign, ":troop_of_merchant", "trp_vaegir_merchant"),
      (else_try),
        (eq, ":starting_town_faction", "fac_kingdom_3"),
        (assign, ":troop_of_merchant", "trp_khergit_merchant"),
      (else_try),
        (eq, ":starting_town_faction", "fac_kingdom_4"),
        (assign, ":troop_of_merchant", "trp_nord_merchant"),
      (else_try),
        (eq, ":starting_town_faction", "fac_kingdom_5"),
        (assign, ":troop_of_merchant", "trp_rhodok_merchant"),
      (else_try),
        #(eq, ":starting_town_faction", "fac_kingdom_6"),
        (assign, ":troop_of_merchant", "trp_sarranid_merchant"),
      (try_end),
      (str_store_troop_name, s10, ":troop_of_merchant"),
      
      (str_store_string, s2, "str_find_the_lair_near_s9_and_free_the_brother_of_the_prominent_s10_merchant"),
      (call_script, "script_start_quest", "qst_save_relative_of_merchant", ":troop_of_merchant"),
  ]],
  
  [anyone|auto_proceed,"start",[
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (check_quest_active, "qst_blank_quest_3"),
      (check_quest_succeeded, "qst_blank_quest_3"),
      (quest_slot_eq, "qst_blank_quest_3", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":target", "qst_blank_quest_3", slot_quest_target_center),
      (quest_get_slot, ":amount", "qst_blank_quest_3", slot_quest_target_amount),
      (assign, reg33, ":amount"),
      (str_store_party_name, s33, ":target"),
      ], "Beautiful work, {playername}! Let me have my {reg33} peningas. I hope you got your fair share from the weeping men of {s33}.","close_window",[
      (troop_remove_gold, "trp_player", reg33),
      (troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (val_add, ":wealth", reg33),
      (troop_set_slot, "$g_talk_troop", slot_troop_wealth, ":wealth"),
      (call_script, "script_finish_quest", "qst_blank_quest_3", 100),]],
  
  [anyone|auto_proceed,"start",[
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (check_quest_active, "qst_blank_quest_3"),
      (check_quest_failed, "qst_blank_quest_3"),
      (quest_slot_eq, "qst_blank_quest_3", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":target", "qst_blank_quest_3", slot_quest_target_center),
      (quest_get_slot, ":amount", "qst_blank_quest_3", slot_quest_target_amount),
      (assign, reg33, ":amount"),
      (str_store_party_name, s33, ":target"),
      ], "Shame on you, {playername}! You are a miserable failure. You couldn't even defeat those weeping men of {s33}.","close_window",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (call_script, "script_change_troop_renown", "trp_player", -20),
      (troop_remove_gold, "trp_player", reg33),
      (troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (val_add, ":wealth", reg33),
      (troop_set_slot, "$g_talk_troop", slot_troop_wealth, ":wealth"),
      (call_script, "script_end_quest", "qst_blank_quest_3"),]],
  
  [anyone,"start", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (check_quest_active, "qst_rescue_prisoner"),
      (check_quest_succeeded, "qst_rescue_prisoner"),
      (quest_slot_eq, "qst_rescue_prisoner", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":cur_lord", "qst_rescue_prisoner", slot_quest_target_troop),
      (call_script, "script_troop_get_family_relation_to_troop", ":cur_lord", "$g_talk_troop"),
    ],
    "{playername}, you saved him! Thank you ever so much for rescuing my {s11}. " +
    "Please, take this as some small repayment for your noble deed.", "rescue_prisoner_succeed_2",
    [
      (call_script, "script_finish_quest", "qst_rescue_prisoner", 100),
  ]],#rescuerescue
  [anyone|plyr,"rescue_prisoner_succeed_2", [], "Always an honour to serve, {s65}.", "lord_pretalk",[]],
  
  
  
  #Quest 0 - Alley talk
  [anyone|auto_proceed, "start",
    [
      (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      (eq, "$talk_context", tc_back_alley),
      (eq, "$talked_with_merchant", 0),
    ],
    "{!}.", "start_up_quest_1_next",
    []],
  
  [anyone, "start_up_quest_1_next",
    [],
    "Are you all right? Well... I guess you're alive, at any rate. I'm not sure that we can say the same for the other fellow. That's one less thief to trouble our streets at night, although Heaven knows he won't be the last... Anyway, maybe you can help me with something. Let's talk more inside. Out here, we don't know who is listening.", "close_window",
    [
      (assign, "$talked_with_merchant", 1),
      (mission_disable_talk),
  ]],
  
  
  #Quest 1 - Repeating dialog sentence
  [anyone|auto_proceed, "start",
    [
      (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      (eq, "$talk_context", tc_tavern_talk),
      
      (call_script, "script_party_count_members_with_full_health", "p_main_party"),
      (assign, ":total_party_size", reg0),
      
      (assign, ":continue", 0),
      (try_begin),
        (check_quest_active, "qst_collect_men"),
        (neg|check_quest_succeeded, "qst_collect_men"),
        
        (le, ":total_party_size", 5),
        
        (try_begin),
          (le, ":total_party_size", 1),
          (str_store_string, s11, "str_please_sir_my_lady_go_find_some_volunteers_i_do_not_know_how_much_time_we_have"),
        (else_try),
          (str_store_string, s11, "str_you_need_more_men_sir_my_lady"),
        (try_end),
        (assign, ":continue", 1),
      (else_try),
        (check_quest_active, "qst_learn_where_merchant_brother_is"),
        (neg|check_quest_succeeded, "qst_learn_where_merchant_brother_is"),
        (str_store_string, s11, "str_do_not_waste_time_go_and_learn_where_my_brother_is"),
        (assign, ":continue", 1),
      (try_end),
      (eq, ":continue", 1),
    ],
    "{!}.", "start_up_quest_2_next",
    []],
  
  [anyone, "start_up_quest_2_next",
    [],
    "{!}{s11}", "close_window",
    []],
  
  #Quest 2 - First dialog sentence
  [anyone, "start",
    [
      (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      (eq, "$talk_context", tc_tavern_talk),
      
      (check_quest_active, "qst_collect_men"),
      (neg|check_quest_succeeded, "qst_duel_for_lady"),
      (call_script, "script_party_count_members_with_full_health", "p_main_party"),
      (ge, reg0, 6),
      
      (str_store_party_name, s9, "$current_town"),
    ],
    "Splendid work. You have hired enough men to take on the bandits. Now -- travellers entering {s9} have told us that there is a small group of robbers lurking on the outside of town. I suspect that they are all from the same band, the one that took my brother. Hunt them down and defeat them, and make them disclose the location of their lair!", "merchant_quest_2a",
    [
      (call_script, "script_succeed_quest", "qst_collect_men"),
      (call_script, "script_end_quest", "qst_collect_men"),
  ]],
  
  #Quest 3 - First dialog sentence/Repeating dialog sentence
  [anyone, "start",
    [
      (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      (eq, "$talk_context", tc_tavern_talk),
      
      (check_quest_active, "qst_save_relative_of_merchant"),
      (neg|check_quest_succeeded, "qst_save_relative_of_merchant"),
      
      (str_store_party_name, s9, "$current_town"),
    ],
    "So, you've found out where they hid my brother? Splendid work. I flatter myself that I'm a fine judge of character, and you look to be a {reg59?woman:man} who can get things done. Now, go out and save his unworthy hide!", "merchant_quest_3a",
    [
  ]],
  
  #Quest 3 - All succeeded - First dialog sentence
  [anyone, "start",
    [
      (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      (eq, "$talk_context", tc_tavern_talk),
      
      (check_quest_active, "qst_save_relative_of_merchant"),
      (check_quest_succeeded, "qst_save_relative_of_merchant"),
    ],
    "Well... My brother is home safe. I'm not sure what to do with him -- maybe pack him off to a university outside the Northlands. That way, if he gets knocked on the head in a street brawl, no one can say it's my fault. But that's not your problem. Here's the rest of your reward. It was well earned.", "merchant_quest_3b",
    [
      (call_script, "script_finish_quest", "qst_save_relative_of_merchant", 100),
      (troop_add_gold, "trp_player", 200),
  ]],
  
  [anyone|plyr, "merchant_quest_3b", #was startup
    [
    ],
    "The money is most welcome, and I am glad to have been of service", "merchant_quest_4a",
    [
  ]],
  
  [anyone, "merchant_quest_4a", #was startup
    [
    ],
    "Good! Now... Are you interested in making some more?", "merchant_quest_4b",
    [
  ]],
  
  [anyone|plyr, "merchant_quest_4b",
    [
    ],
    "Possibly. What do you need?", "merchant_quest_4b1",
    [
  ]],
  
  
  [anyone, "merchant_quest_4b1",
    [],
    "Remember how I told you that the bandits had an ally inside the walls? I think I know who it is -- the captain of the watch, no less. Some months ago, this captain, seeing the amount of profit we merchants were making from trade across the frontiers, decided to borrow some money to sponsor a caravan. Unfortunately, like many who are new to commerce, he failed to realize that great profit only comes with great risk. So he sank all his money into the most expensive commodities, and of course, his caravan was captured and looted, and he lost everything.", "merchant_quest_4b2",
    []],
  
  [anyone, "merchant_quest_4b2",
    [],
    "As a consequence, it seems, our captain turned to villainy to recoup his fortune. I supposed I'd do the same if, the Heavens forbid, I ever faced indebtedness and ruination. Now, any watch captain worth his salary will have a few thieves and robbers on his payroll, to inform on the rest, but our captain decides to employ these bastards wholesale. He brings them into the town, lets them do as they will, and takes a share of their take. You've heard of poachers turning gamekeepers? Well, in the unfortunate land of the Northlands, sometimes gamekeepers will turn poacher. Luckily, there are still a few brave, honest souls in the watch who've told me how he works.", "merchant_quest_4b3",
    []],
  
  [anyone, "merchant_quest_4b3",
    [
      (faction_get_slot, ":local_ruler", "$g_encountered_party_faction", slot_faction_leader),
      (str_store_troop_name, s4, ":local_ruler"),
    ],
    "Now -- here's my plan. I could bring this to the attention of {s4}, lord of the city, but that would mean an inquiry, my word against the captain's, and witnesses can be bought and evidence destroyed, or maybe the whole thing will be forgotten if the enemy comes across the border again, and all I'll get for my trouble is a knife in the ribs. In time of war, you see, a king's eye wanders far from his domain, and his subjects suffer. So I've got another idea. I've got a small group of townsfolk together, some men in my employ and some others who've lost relatives to these bandits, and we'll storm the captain's home and bring him in chains before {s4}, hopefully with a few captured bandits to explain how things stack up.", "merchant_quest_4b4",
    []],
  
  [anyone, "merchant_quest_4b4",
    [
    ],
    "All I need now is someone to lead my little army into battle -- and I can't think of anyone better than you. So, what do you say?", "merchant_quest_4b5",
    [
  ]],
  
  [anyone|plyr, "merchant_quest_4b5",
    [
    ],
    "How do I know that you're telling me the truth?", "merchant_quest_4b6",
    [
  ]],
  
  [anyone, "merchant_quest_4b6",
    [
      (str_store_party_name, s4, "$g_encountered_party"),
    ],
    "Oh, well, I suppose it's possible that I found a dozen bandits who were willing to give their lives to give a passing stranger a false impression of life in old {s4}... Well, I guess you can't really know if my word is good, but I reckon you've learned by now that my money is good, and there's another 100 peningas, or maybe a bit more, that's waiting for you if you'll do me this last little favor. So what do you say?", "merchant_quest_4b7",
    [
  ]],
  
  
  [anyone|plyr, "merchant_quest_4b7",
    [
    ],
    "All right, I'll lead your men.", "merchant_quest_4b8",
    [
  ]],
  
  [anyone|plyr, "merchant_quest_4b7",
    [
    ],
    "I'm sorry. This is too much, too fast. I need time to think.", "merchant_quest_4_decline",
    [
  ]],
  
  [anyone, "merchant_quest_4b8",
    [
    ],
    "Splendid. It's been a long time since I staked so much on a single throw of the dice, and frankly I find it exhilarating. My men are ready to move on your word. Are you ready?", "merchant_quest_4b9",
    [
  ]],
  
  [anyone|plyr, "merchant_quest_4b9",
    [
    ],
    "Yes. Give them the sign.", "merchant_quest_4_accept",
    [
  ]],
  
  [anyone|plyr, "merchant_quest_4b9",
    [
    ],
    "Not now. I will need to rest before I can fight again.", "merchant_quest_4_decline",
    [
  ]],
  
  [anyone, "merchant_quest_4_accept",
    [
    ],
    "Good! Now -- strike hard, strike fast, and the captain and his henchmen won't know what hit them. May the heavens be with you!", "close_window",
    [
      (assign, "$current_startup_quest_phase", 3),
      (jump_to_menu, "mnu_start_phase_3"),
      (finish_mission),
  ]],
  
  [anyone, "merchant_quest_4_decline", #was startup
    [
    ],
    "Right. I can keep my men standing by. If you let this go too long, then I suppose that I shall have to finish this affair without you, but I would be most pleased if you could be part of it as well. For now, take what time you need.", "close_window",
    []],
  
  
  
  #QUEST 2 - Learning where prominent's brother is.
  [anyone|plyr, "merchant_quest_2a",
    [
    ],
    "Very well. I shall hunt for bandits.", "close_window",
    [
      (str_store_party_name, s9, "$current_town"),
      (str_store_string, s2, "str_start_up_quest_message_2"),
      (call_script, "script_start_quest", "qst_learn_where_merchant_brother_is", "$g_talk_troop"),
      
      (set_spawn_radius, 2),
      (spawn_around_party, "$current_town", "pt_leaded_looters"),
      (assign, ":spawned_bandits", reg0),
      
      (party_get_position, pos0, "$current_town"),
      (party_set_ai_behavior, ":spawned_bandits", ai_bhvr_patrol_location),
      (party_set_ai_patrol_radius, ":spawned_bandits", 3),
      (party_set_ai_target_position, ":spawned_bandits", pos0),
  ]],
  
  [anyone|plyr, "merchant_quest_2a",
    [
    ],
    "Why don't you come with us?", "merchant_quest_2a_whynotcome",
    [
  ]],
  
  [anyone, "merchant_quest_2a_whynotcome",
    [
    ],
    "Because I'm paying you to go take care of it. That's the short answer. The long answer is that I've got some leads to follow up here in town, and I have just as much chance of getting knocked on my head as you, if that's what you're asking. But I respect your question. Now, what do you say?", "merchant_quest_2a",
    [
  ]],
  
  
  [anyone|plyr, "merchant_quest_2a",
    [
    ],
    "I cannot deal with this matter at this time.", "close_window",
    [
  ]],
  
  #Quest 3 - Saving merchant's brother.
  [anyone|plyr, "merchant_quest_3a",
    [
    ],
    "Very well. I go now to attack the bandits in their lair, and find your brother.", "close_window",
    [
      #no need to below three lines anymore, this quest is auto starting after player learn where bandits are hiding merchant's brother.
      #(str_store_party_name, s9, "$lair_neighboor_village"),
      #(str_store_string, s2, "str_start_up_quest_message_3"),
      #(call_script, "script_start_quest", "qst_save_relative_of_merchant", "$g_talk_troop"),
  ]],
  
  
  
  
  
  [anyone|plyr, "merchant_quest_3a",
    [
    ],
    "I cannot deal with this matter at this time.", "close_window",
    [
      #think about placing end_quest here. Because it is auto-starting. If player do not want this quest he/she should have a way to avoid it.
  ]],
  
  
  [anyone, "start",
    [
      (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      
      (this_or_next|eq, "$talk_context", tc_tavern_talk),
      (neq, "$dialog_with_merchant_ended", 0),
      
      (assign, ":continue", 0),
      (try_begin),
        (neg|check_quest_succeeded, "qst_collect_men"),
        (neg|check_quest_active, "qst_collect_men"),
        (assign, ":continue", 1),
      (else_try),
        (neg|check_quest_active, "qst_collect_men"),
        (neg|check_quest_succeeded, "qst_learn_where_merchant_brother_is"),
        (neg|check_quest_active, "qst_learn_where_merchant_brother_is"),
        (assign, ":continue", 1),
      (else_try),
        (neg|check_quest_active, "qst_collect_men"),
        (neg|check_quest_active, "qst_learn_where_merchant_brother_is"),
        (neg|check_quest_succeeded, "qst_save_relative_of_merchant"),
        (neg|check_quest_active, "qst_save_relative_of_merchant"),
        (assign, ":continue", 1),
      (try_end),
      
      (eq, ":continue", 1),
    ],
    "You may do as you wish, {reg59?my lady:sir}, but I am disappointed. You would do well to reconsider. I am a rich man, and would show you my gratitude in coin.", "merchant_quest_persuasion",
    [
  ]],
  
  [anyone|auto_proceed, "start",
    [
      (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      
      (this_or_next|eq, "$talk_context", tc_tavern_talk),
      (neq, "$dialog_with_merchant_ended", 0),
      
      (check_quest_finished, "qst_save_relative_of_merchant"),
      (neg|check_quest_succeeded, "qst_save_town_from_bandits"),
      (neg|check_quest_active, "qst_save_town_from_bandits"),
    ],
    "{!}.", "merchant_quest_4b4",
    [
  ]],
  
  [anyone|plyr, "merchant_quest_persuasion",
    [
      (neg|check_quest_finished, "qst_collect_men"),
      (neg|check_quest_active, "qst_collect_men"),
    ],
    "You make a persuasive case. I will help you.", "merchant_quest_1_prologue_3",
    [
  ]],
  
  [anyone|plyr, "merchant_quest_persuasion",
    [
      (check_quest_finished, "qst_collect_men"),
      (neg|check_quest_finished, "qst_learn_where_merchant_brother_is"),
      (neg|check_quest_active, "qst_learn_where_merchant_brother_is"),
    ],
    "You make a persuasive case. I will help you.", "merchant_quest_2",
    [
  ]],
  
  [anyone|plyr, "merchant_quest_persuasion",
    [
      (check_quest_finished, "qst_collect_men"),
      (check_quest_finished, "qst_learn_where_merchant_brother_is"),
      (neg|check_quest_finished, "qst_save_relative_of_merchant"),
      (neg|check_quest_active, "qst_save_relative_of_merchant"),
    ],
    "You make a persuasive case. I will help you.", "merchant_quest_3",
    [
  ]],
  
  [anyone|plyr, "merchant_quest_persuasion",
    [
      (check_quest_finished, "qst_collect_men"),
      (check_quest_finished, "qst_learn_where_merchant_brother_is"),
      (check_quest_finished, "qst_save_relative_of_merchant"),
      (neg|check_quest_finished, "qst_save_town_from_bandits"),
      (neg|check_quest_active, "qst_save_town_from_bandits"),
    ],
    "You make a persuasive case. I will help you.", "merchant_quest_4b8",
    [
  ]],
  
  [anyone|plyr, "merchant_quest_persuasion",
    [
    ],
    "As I say, I have more important business elsewhere.", "close_window",
    [
  ]],
  
  [anyone, "merchant_quest_2",
    [
    ],
    "Now -- go find and defeat that group of bandits.", "merchant_quest_2a",
    [
  ]],
  
  [anyone, "merchant_quest_3",
    [
    ],
    "Now -- go attack that bandit hideout, get my brother back, and show those brigands what happens to those who threaten my household.", "merchant_quest_3a",
    [
  ]],
  
  [anyone, "start",
    [
      (is_between, "$g_talk_troop", "trp_relative_of_merchant", "trp_relative_of_merchant"),
    ],
    "Oh -- thank the heavens... Thank the heavens... Am I safe?", "close_window",
    []],
  
  
  [anyone,"start",
    [
      (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      (eq, "$g_do_one_more_meeting_with_merchant", 1),
      (faction_get_slot, ":faction_leader", "$g_encountered_party_faction", slot_faction_leader),
      (str_store_troop_name, s5, ":faction_leader"),
    ],
    "Ah... {playername}. Things didn't go quite so well as I had hoped. {s5} couldn't quite find it in him to overlook my little breach of the peace. Oh, he's grateful enough that I got rid of his crooked captain -- a guard who'll let in bandits will let in an enemy army, if the price is right -- but he can't exactly have me running around here as a lasting reminder of his failure to take care of things himself.", "merchant_closing_statement_2",
    []],
  
  [anyone|plyr,"merchant_closing_statement_2",
    [],
    "That hardly seems fair...", "merchant_closing_statement_3",
    []],
  
  [anyone,"merchant_closing_statement_3",
    [],
    "Fair? This is the Northlands, {reg59?my lady:my boy}! Kings do what they will, and the rest of us do as they must. He didn't string me up, and instead gave me time to sell my properties -- even put in a word with the other merchants that they best pay me a fair price, too. That's gracious enough, as kings go -- but he's a weak king, as they all are here, and weak kings must always look to their authority first, and justice second. I suppose I'd do the same, in his shoes.", "merchant_closing_statement_4",
    []],
  
  [anyone,"merchant_closing_statement_4",
    [],
    "Anyway, I wouldn't go rubbing your part in this affair in {s5}'s face -- but he's taken note of you, and decided that you're not worth hanging, and that's something to which I'll raise a glass any day of the week. He might even have work for you, further down the road. Or, you can sell your sword to one of his competitors. Anyway, I hope you've learned a bit about what it will take to stay alive in this troubled land, and I suspect that the money you've earned won't go to waste. Good luck.", "close_window",
    [
      (assign, "$g_do_one_more_meeting_with_merchant", 2),
  ]],
  
  [anyone|auto_proceed, "start",
    [
      (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      (check_quest_finished, "qst_save_town_from_bandits"),
      (eq, "$g_do_one_more_meeting_with_merchant", 2),
    ],
    "{!}.", "merchant_quests_last_word",
    []],
  
  [anyone,"merchant_quests_last_word",
    [
    ],
    "I am preparing to leave town in a short while. It's been an honor to know you. Good luck.", "close_window",
    [
  ]],
  
  
  [anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
      (eq, "$talk_context", tc_tavern_talk),
      (troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_gather_intel)],
    "Greetings, stranger.", "member_intel_liaison", []],
  
  [anyone|plyr, "member_intel_liaison", [
    ],
    "What have you discovered?", "member_intel_liaison_results", []],
  
  [anyone|plyr, "member_intel_liaison", [],
    "It's time to pull you out. Let's leave town separately, but join me soon after.", "close_window", [
      (assign, "$npc_to_rejoin_party", "$g_talk_troop"),
      (troop_set_slot, "$g_talk_troop", slot_troop_days_on_mission, 0), #backup
  ]],
  
  [anyone|plyr, "member_intel_liaison", [],
    "You're doing good work. Stay here for a little longer.", "close_window", []],
  
  
  
  [anyone, "member_intel_liaison_results", [
      (store_faction_of_party, ":town_faction", "$g_encountered_party"),
      (call_script, "script_update_faction_political_notes", ":town_faction"),  #loads s11
    ],
    "{s11} I noticed that you have been keeping some notes about individual lords. I have annotated those with my findings.", "member_intel_liaison", []],
  
  
  
  [anyone,"member_fief_grant_1", [
      ], "Which fief did you have in mind?", "member_fief_grant_2",[]],
  
  [anyone|plyr|repeat_for_parties,"member_fief_grant_2", [
      (store_repeat_object, ":center"),
      (is_between, ":center", centers_begin, centers_end),
      (neq, ":center", "$g_player_court"),
      (store_faction_of_party, ":center_faction", ":center"),
      (eq, ":center_faction", "fac_player_supporters_faction"),
      (neg|party_slot_ge, ":center", slot_town_lord, active_npcs_begin), #ie, owned by player or unassigned
      (str_store_party_name, s11, ":center"),
      
      ], "{!}{s11}", "member_fief_grant_3",[
      (store_repeat_object, "$temp"),
  ]],
  
  [anyone|plyr, "member_fief_grant_2", [
      ], "Never mind. There is no fief I can offer.", "do_member_trade",[
  ]],
  
  
  [anyone,"member_fief_grant_3", [
      ], "{!}{s5}", "close_window",[
      (call_script, "script_npc_morale", "$g_talk_troop"),
      (assign, ":npc_morale", reg0),
      
      (remove_member_from_party, "$g_talk_troop", "p_main_party"),
      
      
      (try_begin),
        (neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
        (call_script, "script_give_troop_next_banner", "$g_talk_troop"),
        (troop_set_slot, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (try_end),
      
      (troop_set_faction, "$g_talk_troop", "fac_player_supporters_faction"),
      (call_script, "script_give_center_to_lord", "$temp", "$g_talk_troop", 0),
      (try_begin),
        (faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$temp"),
        (faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
      (try_end),
      
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_troop_original_faction, 0),
        (party_get_slot, ":fief_culture", "$temp", slot_center_original_faction),
        (troop_set_slot, "$g_talk_troop", slot_troop_original_faction, ":fief_culture"),
      (try_end),
      
      (store_character_level, ":renown", "$g_talk_troop"),
      (val_mul, ":renown", 15),
      (val_max, ":renown", 200),
      (troop_set_slot, "$g_talk_troop", slot_troop_renown, ":renown"),
      
      (troop_set_slot, "$g_talk_troop", slot_troop_wealth, 2500), #represents accumulated loot
      #		(troop_set_slot, "$g_talk_troop", slot_troop_readiness_to_join_army, 100),
      #		(troop_set_slot, "$g_talk_troop", slot_troop_readiness_to_follow_orders, 100),
      
      (str_store_troop_name_plural, s12, "$g_talk_troop"),
      (troop_get_type, ":is_female", "$g_talk_troop"),
      (val_mod, ":is_female", 2),
      (try_begin),
        (eq, "$g_talk_troop", "trp_npc10"),
        (str_store_string, s14, "str_tribune_s12"),
      (else_try),
        (eq, ":is_female", 1),
        (str_store_string, s14, "str_lady_s12"),
      (else_try),
        (str_store_string, s14, "str_lord_s12"),
      (try_end),
      (troop_set_name, "$g_talk_troop", s14),
      (unlock_achievement, ACHIEVEMENT_I_DUB_THEE),
      
      (call_script, "script_check_concilio_calradi_achievement"),
      
      (try_begin),
        (troop_add_item, "$g_talk_troop", "itm_common_horse", 0),
        (troop_add_item, "$g_talk_troop", "itm_common_pony", 0),
        (troop_add_item, "$g_talk_troop", "itm_bl_tunic01",0),
        (troop_add_item, "$g_talk_troop", "itm_mail_shirt_7",0),
        (troop_add_item, "$g_talk_troop", "itm_btunic_7",0),
        (troop_add_item, "$g_talk_troop", "itm_noble_sword",0),
        (troop_add_item, "$g_talk_troop", "itm_tab_shield_round_c",0),
        (troop_add_item, "$g_talk_troop", "itm_seax_1",0),
      (try_end),
      (troop_equip_items, "$g_talk_troop"),
      
      (store_div, ":relation_boost", ":npc_morale", 3),
      #		(val_add, ":relation_boost", 10),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", ":relation_boost"),
      
      (str_store_party_name, s17, "$temp"),
      (store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
      (store_add, ":speech", "str_npc1_fief_acceptance", ":npc_no"),
      #        (troop_get_slot, ":speech", "$g_talk_troop", slot_troop_fief_acceptance_string),
      (str_store_string, s5, ":speech"),
  ]],
  
  
  ###mainquest dialogs companions
  ###global conversation special scenes
  [anyone, "start", [(eq, "$g_encountered_party", "p_battle_stones"),
      (store_conversation_troop, "$g_talk_troop"),
      (is_between, "$g_talk_troop", companions_begin,companions_end),
    ],
    "You lead.", "close_window", [
  ]],
  #
  #################bodo mainquest begining#####################
  [trp_npc6, "start", [
      (check_quest_active,"qst_bodo_letter"),
      (quest_slot_eq,"qst_bodo_letter",slot_quest_current_state, 3),
    ],
    "My {reg59?lady:lord}, you have retrieved the letter!", "bodo_carta1", [
      (add_xp_as_reward,300),
  ]],
  [trp_npc6, "start", [ #bodo choice mainquest
      (store_current_scene,":current_scene"),(eq,":current_scene","scn_conversation3people_scene"),
      (check_quest_active,"qst_sven_traitor"),
      (quest_slot_eq,"qst_sven_traitor",slot_quest_current_state, 4),
    ],
    "Wait, my {reg59?lady:lord}. It's time to say farewell to the Danish and travel south to West Seaxe. We need to deliver the letter of the king of Asturias to Aethelred Aethelwulfing, king of West Seaxe and brother of Aelfred. " +
    "I will finally be able to finish my mission.", "bodo_choiceside1", [
  ]],
  
  [trp_npc6, "start", [(store_current_scene,":current_scene"),(eq,":current_scene","scn_viking_camp"),
      (check_quest_active,"qst_sven_traitor"),
      (quest_slot_eq,"qst_sven_traitor",slot_quest_current_state, 2),
      # (eq, "$g_encountered_party", "p_bjorn_camp"),
    ],
    "My {reg59?lady:lord}, give me a moment before we go to the Danish camp, please!", "bodo_danishcamp1", [
  ]],
  [trp_npc6, "start", [(store_current_scene,":current_scene"),(eq,":current_scene","scn_viking_camp"),
      (check_quest_active,"qst_sven_traitor"),
      # (eq, "$g_encountered_party", "p_bjorn_camp"),
    ],
    "Good luck with Bjorn.", "close_window", [
  ]],
  [trp_npc6, "start", [(store_current_scene,":current_scene"),(eq,":current_scene","scn_viking_camp"),
      (check_quest_active,"qst_sven_traitor"),
      # (eq, "$g_encountered_party", "p_bjorn_camp"),
    ],
    "My {reg59?lady:lord}, give me a moment before we go to the Danish camp, please!", "bodo_danishcamp1", [
  ]],
  ###
  ###Bodo entregado
  #Bodo habla por traicion
  [trp_npc6, "start", [
      (check_quest_active,"qst_revenge_exchange"),
      (quest_slot_eq,"qst_revenge_exchange",slot_quest_current_state, 1),
    ],
    "You send me to my death, my friend, but I do not blame you. I understand that you want to rescue your mother. " +
    "I regret only two things: failing my king and leaving his letter in the hands of his enemies and not having obtained your fidelity when I had the chance.", "sigurd_quest_revenge10", [
  ]],
  
  #####################egil mainquest begining#######################
  #egil rebelion
  [trp_npc2, "start", [
      (store_current_scene,":current_scene"),(eq,":current_scene","scn_conversation3people_scene"),
      (check_quest_active,"qst_the_alliance"),
      (quest_slot_eq,"qst_the_alliance",slot_quest_current_state, 1),
    ],
    "So, scum, did you think that you could turn against the Danish and not pay? It's time for someone else to take legitimate direction of this party. It is time for me, Egil, to take possession of this letter and bring it to my father, King Horik. " +
    "I spent so long at your side, just to discover that you are a treacherous rat. After everything that has happened... Well, I have long doubted your skills to command an army. Now, you are going to die. This is my moment of glory.", "close_window", [
      (jump_to_menu,"mnu_egil_duel"),
  ]],
  #egil en The Assembly
  [trp_npc2, "start", [       (store_current_scene,":current_scene"),(eq,":current_scene","scn_the_thing"),
      (check_quest_active,"qst_the_thing"),
      (quest_slot_eq,"qst_the_thing",slot_quest_current_state, 2),
    ],
    "My {reg59?lady:lord}, you must hurry to join the king. Follow me.", "close_window", [
      (quest_set_slot,"qst_the_thing",slot_quest_current_state, 3),
  ]],
  [trp_npc2,"start", [#The Assembly
      (store_current_scene,":current_scene"),(eq,":current_scene","scn_the_thing"),
      (quest_get_slot, ":stage", "qst_the_thing", slot_quest_current_state),
      (ge,":stage", 3),
      ], "Sorry, this is not a good time to talk.", "close_window",[]],
  ########brunhild mainquest begining ################################
  [trp_npc3, "start", [
      (store_current_scene,":current_scene"),(eq,":current_scene","scn_conversation3people_scene"),
      (check_quest_active,"qst_sven_lair"),
      (quest_slot_eq,"qst_sven_lair",slot_quest_current_state, 5), #despues de lair
      (main_party_has_troop, "trp_npc3"),#troop should be part of player's party - Juju70
    ],
    "My {reg59?lady:lord}, Sven's hideout was a dangerous place, but we managed to ransom Bodo. I understand you want to find your mother, but let me tell you when I was in the court of the jarl of Kennemer, I heard horrible things about Sigurd...", "brunhild_avisa", [
      (add_xp_as_reward,300),
      ##                    (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 6),
      ##                    (call_script, "script_end_quest", "qst_sven_lair"),
  ]],
  
  [trp_npc3, "start", [
      (store_current_scene,":current_scene"),(eq,":current_scene","scn_conversation3people_scene"),
      (check_quest_active,"qst_the_holmgang"),
      (quest_slot_eq,"qst_the_holmgang",slot_quest_current_state, 3), #despues de the_holmgang
      (main_party_has_troop, "trp_npc3"),#troop should be part of player's party - Juju70
    ],
    "My {reg59?lady:lord}, we want you to know that no one blames you for what happened in the duel, and everyone still fully supports you.", "companions_despuesduelo1", [
      (quest_set_slot,"qst_the_holmgang",slot_quest_current_state, 4),
      (call_script, "script_end_quest", "qst_the_holmgang"),
      (talk_info_show, 0),
  ]],
  
  ###companions companeros
  
  [anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
      (this_or_next|eq, "$talk_context", tc_tavern_talk),
      (eq, "$talk_context", tc_court_talk),
      (main_party_has_troop, "$g_talk_troop")],
    "Let's leave whenever you are ready.", "close_window", []],
  
  [anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
      (store_current_scene,":current_scene"),
      (this_or_next|eq,":current_scene","scn_celidon_forest"), #Dwywei
      (this_or_next|eq,":current_scene","scn_hadrian_wall1"), #Caio
      (eq, "$talk_context", tc_tavern_talk),
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
      (troop_slot_eq, "$g_talk_troop", slot_troop_turned_down_twice, 1),
    ],
    "Please do not waste any more of my time today, {reg59?lady:lord}. Perhaps we shall meet again in our travels.", "close_window", [
  ]],
  
  #reginhard mainquest donations
  [trp_npc8, "start", [#(is_between, "$g_talk_troop", companions_begin, companions_end), #dialogo tavern recruit initial
      ##                      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
      ##                     (troop_slot_eq, "$g_talk_troop", slot_troop_met_previously, 1),
      (check_quest_active,"qst_reginhard_donations"),
      # (eq, "$g_talk_troop", "trp_npc3"),
      (quest_slot_eq,"qst_reginhard_donations",slot_quest_current_state, 2),
      # (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
    ],
    "An orphan came in to thank me for helping her family. You're a good person, {playername}! You've gotten me to feel less guilty and a little happier.", "companion_reginhard4x", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (add_xp_as_reward,100),
      (call_script, "script_change_player_party_morale", 60),
      
      (quest_set_slot,"qst_reginhard_donations",slot_quest_current_state, 3),
      (call_script, "script_end_quest", "qst_reginhard_donations"),
  ]],
  
  [trp_npc8, "start", [#(is_between, "$g_talk_troop", companions_begin, companions_end), #dialogo tavern recruit initial
      (check_quest_active,"qst_reginhard_donations"),
      # (eq, "$g_talk_troop", "trp_npc3"),
      (quest_slot_eq,"qst_reginhard_donations",slot_quest_current_state, 1),
      # (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
    ],
    "Did you give Adda the money?", "close_window", [
  ]],
  [trp_npc8, "start", [ #chief mainquest
      (check_quest_active, "qst_kennemer_mission_2"),
      (quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 3),
      # (eq, "$g_talk_troop", "trp_npc8"),
      ], "You have turned back for now, but surely you remain interested in Thiaderd's hideout...", "companion_reginhard43", []],
  #intro mainquest bodo
  [anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end), #dialogo tavern recruit initial
      (check_quest_active,"qst_sven_lair"),
      (eq, "$g_talk_troop", "trp_npc6"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
      (eq, "$g_talk_troop_met", 0),
      (troop_get_slot, ":intro", "$g_talk_troop", slot_troop_intro),
      (assign, "$g_encountered_party", "p_town_4"),
      (str_store_string, 5, ":intro"),
      (str_store_party_name, 20, "p_town_4"),
    ],
    "{!}{s5}", "companion_recruit_intro_responsebodos", [
      (troop_set_slot, "$g_talk_troop", slot_troop_first_encountered, "p_town_4"),
  ]],
  
  
  #intro mainquest reginhard
  [anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end), #dialogo tavern recruit initial
      (check_quest_active, "qst_kennemer_mission_2"),
      (eq, "$g_talk_troop", "trp_npc8"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
      (eq, "$g_talk_troop_met", 0),
      (troop_get_slot, ":intro", "$g_talk_troop", slot_troop_intro),
      (assign, "$g_encountered_party", "p_town_11"),
      
      (str_store_string, 5, ":intro"),
      (str_store_party_name, 20, "$g_encountered_party"),
    ],
    "{!}{s5}", "companion_recruit_intro_responseregin", [
      (troop_set_slot, "$g_talk_troop", slot_troop_first_encountered, "$g_encountered_party"),
  ]],
  ####
  #intro mainquest brunhild
  [anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end), #dialogo tavern recruit initial
      (check_quest_active,"qst_getting_ship"),
      (eq, "$g_talk_troop", "trp_npc3"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
      (eq, "$g_talk_troop_met", 0),
      (troop_get_slot, ":intro", "$g_talk_troop", slot_troop_intro),
      (assign, "$g_encountered_party", "p_town_11"),
      (str_store_string, 5, ":intro"),
      (str_store_party_name, 20, "$g_encountered_party"),
    ],
    "{!}{s5}", "companion_recruit_intro_responsebrunhilds", [
      (troop_set_slot, "$g_talk_troop", slot_troop_first_encountered, "$g_encountered_party"),
  ]],
  ##EGIL
  [anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end), #dialogo tavern recruit initial
      (eq, "$campaign_type", camp_storyline), #only in storyline mode chief
      (eq, "$g_talk_troop", "trp_npc2"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
      (eq, "$g_talk_troop_met", 0),
      (troop_get_slot, ":intro", "$g_talk_troop", slot_troop_intro),
      (assign, "$g_encountered_party", "p_town_4"),
      (str_store_string, 5, ":intro"),
      (str_store_party_name, 20, "$g_encountered_party"),
    ],
    "{!}{s5}", "companion_recruit_intro_response", [
      (troop_set_slot, "$g_talk_troop", slot_troop_first_encountered, "$g_encountered_party"),
  ]],
  ####
  [anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end), #dialogo tavern recruit initial
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
      (eq, "$g_talk_troop_met", 0),
      (troop_get_slot, ":intro", "$g_talk_troop", slot_troop_intro),
      (str_store_string, 5, ":intro"),
      (str_store_party_name, 20, "$g_encountered_party"),
    ],
    "{!}{s5}", "companion_recruit_intro_response", [
      (troop_set_slot, "$g_talk_troop", slot_troop_first_encountered, "$g_encountered_party"),
  ]],
  
  ###mainquest Bodo
  [anyone|plyr, "companion_recruit_intro_responsebodos", [
      ], "Tell me what's happened since the Woden Ric was attacked by Sven Bull Neck.", "companion_recruit_backstory_a", []],
  ###mainquest Brunhild
  [anyone|plyr, "companion_recruit_intro_responsebrunhilds", [
      ], "Calm down. Your father, Thonkrik, has sent me to find you.", "companion_recruit_backstory_a", []],
  ###reginhard
  [anyone|plyr, "companion_recruit_intro_responseregin", [
      (troop_get_slot, ":intro_response", "$g_talk_troop", slot_troop_intro_response_1),
      (str_store_string, 6, ":intro_response")
      ], "{!}{s6}", "companion_recruit_backstory_a", []],
  #egil
  [trp_npc2|plyr, "companion_recruit_intro_response", [
      (eq, "$campaign_type", camp_storyline), #no in storyline mode chief
      ], "Keep your distance and tell me what you want.", "companion_recruit_egil1", []],
  [anyone, "companion_recruit_egil1", [
    ],
    "Easy! I'm not an enemy. I saw you talking to King Horik and followed you. My hands are nowhere near my weapons, and I'm at your mercy...", "companion_recruit_backstory_a", []],
  ###
  [anyone|plyr, "companion_recruit_intro_response", [
      (troop_get_slot, ":intro_response", "$g_talk_troop", slot_troop_intro_response_1),
      (str_store_string, 6, ":intro_response")
      ], "{!}{s6}", "companion_recruit_backstory_a", []],
  
  [anyone|plyr, "companion_recruit_intro_response", [
      (neq, "$campaign_type", camp_storyline), #no in storyline mode chief
      (troop_get_slot, ":intro_response", "$g_talk_troop", slot_troop_intro_response_2),
      (str_store_string, 7, ":intro_response")
      ],  "{!}{s7}", "close_window", [
  ]],
  
  [anyone, "companion_recruit_backstory_a", [(troop_get_slot, ":backstory_a", "$g_talk_troop", slot_troop_backstory_a),
      (str_store_string, 5, ":backstory_a"),
      (str_store_string, 19, "str_here_plus_space"),
      (try_begin),
        (party_is_active,"$g_encountered_party"),
        (str_store_party_name, 20, "$g_encountered_party"),
      (try_end),
    ],
    "{!}{s5}", "companion_recruit_backstory_b", []],
  
  [anyone, "companion_recruit_backstory_b", [(troop_get_slot, ":backstory_b", "$g_talk_troop", slot_troop_backstory_b),
      (str_store_string, 5, ":backstory_b"),
      (try_begin),
        (party_is_active,"$g_encountered_party"),
        (str_store_party_name, 20, "$g_encountered_party"),
      (try_end),
    ],
    "{!}{s5}", "companion_recruit_backstory_c", []],
  ##
  ##reginhard
  [anyone, "companion_recruit_backstory_c", [ #chief mainquest
      (check_quest_active, "qst_kennemer_mission_2"),
      #  (quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 0),
      (eq, "$g_talk_troop", "trp_npc8"),
      (troop_get_slot, ":backstory_c", "$g_talk_troop", slot_troop_backstory_c),
      (str_store_string, 5, ":backstory_c"),
    ],
    "{!}{s5}", "companion_recruit_backstory_response2", []],
  #brunhild
  [anyone, "companion_recruit_backstory_c", [ #chief mainquest
      (check_quest_active,"qst_getting_ship"),
      (eq, "$g_talk_troop", "trp_npc3"),
      (troop_get_slot, ":backstory_c", "$g_talk_troop", slot_troop_backstory_c),
      (str_store_string, 5, ":backstory_c"),
    ],
    "{!}{s5}", "companion_recruit_backstory_responsebrunhild", []],
  #bodo
  [anyone, "companion_recruit_backstory_c", [ #chief mainquest
      (check_quest_active,"qst_sven_lair"),
      (eq, "$g_talk_troop", "trp_npc6"),
      (troop_get_slot, ":backstory_c", "$g_talk_troop", slot_troop_backstory_c),
      (str_store_string, 5, ":backstory_c"),
    ],
    "{!}{s5}", "companion_recruit_backstory_responsebodo", []],
  ##
  #asbjorn
  [anyone, "companion_recruit_backstory_c", [ #chief mainquest
      (check_quest_active,"qst_the_fleet"),
      (eq, "$g_talk_troop", "trp_npc12"),
      (troop_get_slot, ":backstory_c", "$g_talk_troop", slot_troop_backstory_c),
      (str_store_string, 5, ":backstory_c"),
    ],
    "{!}{s5}", "companion_recruit_backstory_responseasbjorn", []],
  ##
  #solveig
  [anyone, "companion_recruit_backstory_c", [ #chief mainquest
      (check_quest_active,"qst_kennemer_jarl_missions"),
      (eq, "$g_talk_troop", "trp_npc11"),
      (troop_get_slot, ":backstory_c", "$g_talk_troop", slot_troop_backstory_c),
      (str_store_string, 5, ":backstory_c"),
    ],
    "{!}{s5}", "companion_recruit_backstory_responsesolveig", [
      (quest_set_slot,"qst_kennemer_jarl_missions",slot_quest_current_state, 9), #status 9
      
  ]],
  ##
  #agathinos
  [anyone, "companion_recruit_backstory_c", [ #chief mainquest
      (check_quest_active,"qst_bodo_letter"),
      (eq, "$g_talk_troop", "trp_npc15"),
      (troop_get_slot, ":backstory_c", "$g_talk_troop", slot_troop_backstory_c),
      (str_store_string, 5, ":backstory_c"),
    ],
    "{!}{s5}", "companion_recruit_backstory_responseagathinos", []],
  ##
  #beda
  [anyone, "companion_recruit_backstory_c", [ #chief mainquest
      (check_quest_active,"qst_douar_an_enez"),
      (eq, "$g_talk_troop", "trp_npc16"),
      (troop_get_slot, ":backstory_c", "$g_talk_troop", slot_troop_backstory_c),
      (str_store_string, 5, ":backstory_c"),
    ],
    "{!}{s5}", "companion_recruit_backstory_responsebeda", []],
  ##
  
  [anyone, "companion_recruit_backstory_c", [(troop_get_slot, ":backstory_c", "$g_talk_troop", slot_troop_backstory_c),
      (str_store_string, 5, ":backstory_c"),
    ],
    "{!}{s5}", "companion_recruit_backstory_response", []],
  
  #solveig response
  [anyone|plyr, "companion_recruit_backstory_responsesolveig", [ #chief mainquest
      ], "I do not like when someone is following me.", "companion_questions_solveig1", []],
  [anyone|plyr, "companion_recruit_backstory_responsesolveig", [ #chief mainquest
      ], "Thanks, I think I owe you my life.", "companion_questions_solveig2", []],
  [anyone|plyr, "companion_recruit_backstory_responsesolveig", [ #chief mainquest
      ], "Thanks, but no help was needed with these men.", "companion_questions_solveig3", []],
  
  [anyone, "companion_questions_solveig1", [
      (str_clear, s2),
    ],
    "{s2}^^Neither do I! I'm Solveig, and I have chosen to serve you and protect you while you remain worthy.", "companion_recruit_backstory_response", [
      (str_store_string, s2, "@--She smiles.--", color_good_news),
  ]],
  [anyone, "companion_questions_solveig2", [
      (str_clear, s2),
    ],
    "{s2}^^They were but fools. They had been following you for days and have had a hundred better opportunities. However, any chosen time would have been a failure, because I was ready to rescue you.", "companion_recruit_backstory_response", [
      (str_store_string, s2, "@--She smiles.--", color_good_news),
  ]],
  [anyone, "companion_questions_solveig3", [
      (str_clear, s2),
    ],
    "{s2}^^Do not worry. I will not tell anyone that I had to rescue you when you were with your pants down.", "companion_recruit_backstory_response", [
      (str_store_string, s2, "@--She smiles.--", color_good_news),
  ]],
  
  #aghatinos response
  [anyone|plyr, "companion_recruit_backstory_responseagathinos", [ #chief mainquest
      ], "Are you not afraid of bandits on the roads, traveling alone as you are?", "companion_questions_aghatinos1", []],
  [anyone|plyr, "companion_recruit_backstory_responseagathinos", [ #chief mainquest
      ], "I would never have expected to see a Greek in Northvegr.", "companion_questions_aghatinos2", []],
  
  [anyone, "companion_questions_aghatinos1", [
      (str_clear, s2),
    ],
    "{s2}^^Well, I was not alone, and now I'm with you, and I'm sure the bandits will run away when they see you.", "companion_recruit_backstory_response", [
      (str_store_string, s2, "@--He mutters something under his breath as if talking to someone unseen.--", color_good_news),
  ]],
  [anyone, "companion_questions_aghatinos2", [
      (str_clear, s2),
    ],
    "{s2}^^I had never expected to find a Norwegian in Konstantinoupolis, but there they were, busy taking me into slavery!", "companion_recruit_backstory_response", [
      (str_store_string, s2, "@--He mutters something under his breath as if talking to someone unseen.--", color_good_news),
  ]],
  
  #beda response
  [anyone|plyr, "companion_recruit_backstory_responsebeda", [ #chief mainquest
      ], "What are you talking about? Was it you who sent the message about my mother?", "companion_questions_beda1", []],
  [anyone|plyr, "companion_recruit_backstory_responsebeda", [ #chief mainquest
      ], "Shut up, scum! So you know my mother?", "companion_questions_beda1", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (call_script, "script_change_player_honor", -5),
  ]],
  
  [anyone, "companion_questions_beda1", [
      (str_clear, s2),
    ],
    "{s2}^^Yes, yes! She sent me to talk to you. I was with her... I mean that I was her servant, her slave, when the Danish of Sven Bull Neck took me prisoner. " +
    "Sven is terrible! I was afraid. I often thought about escaping, but I was so scared that I did not even try.", "companion_questions_beda2", [
      (str_store_string, s2, "@--He seems very nervous and scared.--", color_good_news),
  ]],
  
  [anyone|plyr,"companion_questions_beda2", [
      (str_clear, s10),
    ],
    "{!}{s10}", "companion_questions_beda3",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@Please calm down. I am not your enemy. Take a deep breath and tell me about my mother. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@You're making me worried... very worried... Please calm down and tell me about my mother. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Relax! You're talking to a friend, and I can protect you from whoever would hurt you. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Calm down and tell me about my mother! Otherwise, I swear, your corpse will be answering my questions. (Sanguine)"),
      (try_end),
  ]],
  
  [anyone,"companion_questions_beda3", [
      (str_clear, s4),
    ],
    "{!}{s4}", "companion_questions_beda4",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s4, "@Thank you for being so understanding. I've had a hard day today. I'm better now. Listen, I have important things to say."),
        #  (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s4, "@Please, please, do not be anxious! When Sven was anxious, he cut off the fingers of those who bothered him. Look, I'm better, and I'll tell you important things."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s4, "@Oh, well, yes, I trust you. She told me to trust you. I'm going to tell you everything."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s4, "@Oh my god... Do not kill me! Do not kill me! I'm very quiet. I'll kiss the ground you walk on. I will be your servant, even your slave. I'll tell you everything I know."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
      (try_end),
  ]],
  
  [anyone, "companion_questions_beda4", [
      (str_clear, s2),
    ],
    "{s2}^^I was the slave of your mother after the Danish captured me in East Engle little more than a month ago. She is not well, but that you already know. She is very ill; is dying. Most of the time, she does not remember who she is and says strange things. " +
    "The Vikings of Sven Bull Neck think she is a seidr, someone who has spirits, and they consult her about their Fate. Sven has married her because that is believed to improve luck. " +
    "He says that when he captures you, he will sacrifice you to the gods, because you have the blood of a seidr.", "companion_questions_beda5", [
      (str_store_string, s2, "@--He seems calmer.--", color_good_news),
  ]],
  
  [anyone|plyr, "companion_questions_beda5", [
      ], "I'm listening.", "companion_questions_beda61", []],
  [anyone|plyr, "companion_questions_beda5", [ #
      ], "I'm not interested in Sven. Tell me about my mother.", "companion_questions_beda62", [
  ]],
  
  [anyone, "companion_questions_beda61", [
    ],
    "Sven Bull Neck is a troubled man, and you have become his obsession for having killed his brother, a man named Olvir. " +
    "Your mother predicted Olvir's death at your hands, and Sven is angry with his master, Sigurd Ragnarsson, as he was the one who sent Olvir to where you were.^^" +
    "I've only known Sven a little. I heard the men say he was once a great leader, a shepherd of men. To the contrary, I saw a man who maintains loyalty through fear.", "companion_questions_beda62", [
  ]],
  
  [anyone, "companion_questions_beda62", [
    ],
    "Sometimes your mother could remember and be herself. Then she would speak about you, her {reg59?daughter:son}. " +
    "She said that you were destined for greatness, and that your destiny is beyond the control of the Norns that sent Sven. Only she regrets that her end is near and that she will not see you.^^" +
    "She told me to flee, to find you and remind you that the happiest day of her life was when you came into the world. She also told me that if she never sees you again, she would always be by your side.", "companion_questions_beda63", [
  ]],
  
  [anyone|plyr, "companion_questions_beda63", [
      ], "Where is she?", "companion_questions_beda7", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone|plyr, "companion_questions_beda63", [ #
      ], "She was always a weak woman. Where is Sven?", "companion_questions_beda7", [
      (call_script, "script_change_player_honor", -5),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone, "companion_questions_beda7", [
    ],
    "When I escaped, we were close to Grantebrycge, but that was two weeks ago, which is what it took me to find you. " +
    "The last I heard was that Sven Bull Neck gathered his men and led them to their ships to be at the service of the king.", "companion_questions_beda8", [
  ]],
  
  [anyone|plyr, "companion_questions_beda8", [
      ], "Is he going to Douar-an-Enez?", "companion_questions_beda9", [
  ]],
  [anyone|plyr, "companion_questions_beda8", [
      ], "I understand. I think I know where they went.", "companion_questions_beda92", [
  ]],
  
  [anyone, "companion_questions_beda9", [
    ],
    "What? I have no idea who Douar is. Listen, I can't stay here. Your mother asked me to take care of you, so I'm going with you.", "companion_recruit_backstory_response", [
      (str_store_string, s2, "@In Boar Grove, you found a priest named Beda who had been a slave of your mother. He was freed so that he could find you and remind you about your mother's love. " +
        "You finally managed to get news about your mother. You are now one step closer to finding her.^^" +
      "Finally, you are ready to sail to Douar-an-Enez. Talk to the old captain at the port. He is always near ships."),
      (add_quest_note_from_sreg, "qst_douar_an_enez", 5, s2, 0),
      (quest_set_slot,"qst_douar_an_enez",slot_quest_current_state, 3), #status 0
  ]],
  [anyone, "companion_questions_beda92", [
    ],
    "That is great! Listen. I can't remain here. Your mother asked me to take care of you, so I'm going with you.", "companion_recruit_backstory_response", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (str_store_string, s2, "@In Boar Grove, you found a priest named Beda who had been a slave of your mother. He was freed so that he could find you and remind you about your mother's love. " +
        "You finally managed to get news about your mother. You are now one step closer to finding her.^^" +
      "Finally, you are ready to sail to Douar-an-Enez. Talk to the old captain at the port. He is always near ships."),
      (add_quest_note_from_sreg, "qst_douar_an_enez", 5, s2, 0),
      (quest_set_slot,"qst_douar_an_enez",slot_quest_current_state, 3), #status 0
  ]],
  ###asbjorn response
  #chief mainquest
  [anyone|plyr, "companion_recruit_backstory_responseasbjorn", [ #chief mainquest asbjorn
      ], "I've had to kill a companion and join a war fleet. Now I must take a judge along?", "companion_questions_asbjorn1", []],
  [anyone|plyr, "companion_recruit_backstory_responseasbjorn", [ #chief mainquest asbjorn
      ], "I supposed that the Assembly would send someone. I did not think it would be you.", "companion_questions_asbjorn2", []],
  [anyone|plyr, "companion_recruit_backstory_responseasbjorn", [ #chief mainquest asbjorn
      ], "A doctor, eh? Yes, you are welcome. Let's get on track and join the Viking fleet.", "companion_questions_asbjorn6", []],
  
  [anyone, "companion_questions_asbjorn2", [
      (str_clear, s2),
    ],
    "{s2}^^The Assembly decided I join you, but I am happy to carry it out. It is not my intention to control you, but I must ensure that you join the fleet and come to Englaland. " +
    "From that moment on, I would like you to see me as a companion, as the doctor your men need.", "companion_questions_asbjorn2_1", [
      (str_store_string, s2, "@--He smiles.--", color_good_news),
  ]],
  
  [anyone|plyr, "companion_questions_asbjorn2_1", [ #chief mainquest asbjorn
      ], "I've had to kill a companion and join a war fleet. Now I must take a judge along?", "companion_questions_asbjorn1", []],
  [anyone|plyr, "companion_questions_asbjorn2_1", [ #chief mainquest asbjorn
      ], "I guess I have no choice. Let's get on track and join the Viking fleet.", "companion_questions_asbjorn6", []],
  
  [anyone, "companion_questions_asbjorn1", [
      (str_clear, s2),
    ],
    "{s2}^^I understand that things have not been easy, but the Assembly is the law. It is what keeps the balance in every part of Danmark and even in the whole kingdom. " +
    "What do you think would have happened without the jurisdiction of the Assembly? Possibly a war between the King Horik and Jarl Sigurd? Who knows, this may still occur despite the Assembly. It would not be the first time. " +
    "Honor and truth are very important in Danmark, and there are only two ways to satisfy their requirements: with wergild or blood. The line between friendship and hatred between two neighbors sharing the land is very thin. If the Assembly did not exist, hundreds of men would die every day for the slightest of complaints.", "companion_questions_asbjorn3", [
      (str_store_string, s2, "@--He closes his eyes for a few seconds, as if searching for the right words.--", color_good_news),
  ]],
  [anyone|plyr, "companion_questions_asbjorn3", [ #chief mainquest asbjorn
      ], "The Assembly was not fair to me, whatever good there is in avoiding a war.", "companion_questions_asbjorn4", []],
  [anyone|plyr, "companion_questions_asbjorn3", [ #chief mainquest asbjorn
      ], "That is fine. Let's get on track and join the Viking fleet.", "companion_questions_asbjorn6", []],
  
  [anyone, "companion_questions_asbjorn4", [
      (str_clear, s2),
    ],
    "{s2}^^Assembly decisions cannot please everyone. Dare I say, sometimes the judgments of the Assembly are not meant to be fair. " +
    "Its mission is to maintain order and balance, ensuring that men come to the Assembly to settle disputes instead of killing each other.", "companion_questions_asbjorn5", [
      (str_store_string, s2, "@--He takes a deep breath and then responds slowly, calmly.--", color_good_news),
  ]],
  [anyone|plyr, "companion_questions_asbjorn5", [ #chief mainquest asbjorn
      ], "Let's get on track and join the Viking fleet.", "companion_questions_asbjorn6", []],
  
  [anyone, "companion_questions_asbjorn6", [
    ],
    "I'm sure we will be good friends. We must go to the port of Ribe as soon as you can and ask the port master to join the fleet.", "companion_recruit_signup", [
      (str_store_party_name_link, s3, "p_town_4"),
      (str_store_string, s2, "@Asbjorn has joined your party to make sure you join the fleet. Besides that, he has offered to accompany your band and serve as a physician. Now it is time to get the port master of {s3} to take you to the Viking fleet departing for Englaland."),
      (add_quest_note_from_sreg, "qst_the_fleet", 5, s2, 0),
      (quest_set_slot,"qst_the_fleet",slot_quest_current_state, 3), # asbjorn  esta en party
  ]],
  
  #########
  
  #chief mainquest
  [anyone|plyr, "companion_recruit_backstory_responsebodo", [ #chief mainquest bodo
      (check_quest_active,"qst_sven_lair"),
      # (eq, "$g_talk_troop", "trp_npc3"),
      ], "How did you get here?", "companion_questions_bodo1", []],
  [anyone|plyr, "companion_recruit_backstory_responsebodo", [ #chief mainquest bodo
      (check_quest_active,"qst_sven_lair"),
      # (eq, "$g_talk_troop", "trp_npc3"),
      ], "Bodo... did anyone else survive the Viking attack?", "companion_questions_bodo2", []],
  #
  [anyone|plyr, "companion_recruit_backstory_responsebrunhild", [ #chief mainquest Brunhild
      (check_quest_active,"qst_getting_ship"),
      # (eq, "$g_talk_troop", "trp_npc3"),
      ], "Friese has not treated me well either, especially the jarl of Kennemer. I'm leaving this land, and you're coming with me.", "companion_recruit_signup", []],
  
  [anyone|plyr, "companion_recruit_backstory_response2", [ #chief mainquest Reginhard
      (check_quest_active, "qst_kennemer_mission_2"),
      (quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 0),
      ##                (eq, "$g_talk_troop", "trp_npc8"),
      ], "Take another drink and tell me why you should not be here, Reginhard.", "companion_reginhard1", []],
  
  ###bodo entregado
  [anyone|plyr,"sigurd_quest_revenge10", [ #
    ],
    "You are not dead yet. I will rescue you later.", "sigurd_quest_revenge11",[
  ]],
  [anyone|plyr,"sigurd_quest_revenge10", [ #
    ],
    "Good luck, Bodo. It was interesting to travel with you.", "sigurd_quest_revenge12",[
  ]],
  
  [anyone|plyr,"sigurd_quest_revenge10", [ #
    ],
    "I never wanted you by my side, scitte.", "sigurd_quest_revenge12",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -50),
  ]],
  
  [anyone, "sigurd_quest_revenge11", [ #
    ],
    "I think that rescue won't be possible, but thank you for the kind thought. " +
    "I hope we meet in the afterlife. Now go and rescue your mother, my friend.", "sigurd_quest_revenge12", [
  ]],
  [anyone|plyr,"sigurd_quest_revenge12", [ #
    ],
    "(You watch as Sigurd's men drag Bodo away. The Cantabrian turns his head back once to look at you before accepting his fate.)", "close_window",[
      (troop_set_slot, "trp_npc6", slot_troop_occupation, 0),
      (troop_set_slot, "trp_npc6", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc6"),
      (quest_set_slot,"qst_revenge_exchange",slot_quest_current_state, 3),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),     ]],
  ####
  
  
  ###dialogo bodo letter en Atli cave
  [anyone, "bodo_carta1", [	          (main_party_has_troop,"trp_npc6"),
    ],
    "{s2}^^Damn! These Vikings have broken the seal. Fortunately, the letter of King Aldefonso was encrypted. I hope that the Vikings were not able to solve the mystery.", "bodo_carta2", [
      (str_store_string, s2, "@--Bodo seems excited.--", color_good_news),
  ]],
  
  [anyone, "bodo_carta1", [
    ],
    "{s2}^^When you gave me to Sigurd 'Snake in the Eye,' I thought it was my end. I would die disgraced for having brought death to the Woden Ric and for not being able to fulfill the mission of my king. " +
    "Fortunately for me, the letter of King Aldefonso was encrypted, so I'm still alive. The Vikings were not able to solve the mystery and brought me here to torture and tell them the code before the Assembly. " +
    "The Vikings are not imaginative with torture, but they are brutal. I think if you had not come, I would not have endured much longer alive.", "bodo_carta21", [
      (str_store_string, s2, "@--Bodo seems excited.--", color_good_news),
  ]],
  
  [anyone|plyr, "bodo_carta21", [(neg|main_party_has_troop,"trp_npc6"),
      ], "I'm sorry for having given you to Sigurd, my friend. I'm glad to have you back.", "bodo_carta31", [
      (call_script, "script_recruit_troop_as_companion", "$g_talk_troop"), #bodo en party de nuevo
  ]],
  [anyone|plyr, "bodo_carta21", [(neg|main_party_has_troop,"trp_npc6"),
      ], "I thought Sigurd would kill you. I see you're tougher than I thought.", "bodo_carta32", [
      (call_script, "script_recruit_troop_as_companion", "$g_talk_troop"), #bodo en party de nuevo
  ]],
  [anyone|plyr, "bodo_carta2", [(eq, "$sabe_leer", 1),
      ], "--You try to read the letter.--", "bodo_carta33", [
      (call_script, "script_recruit_troop_as_companion", "$g_talk_troop"), #bodo en party de nuevo
  ]],
  [anyone|plyr, "bodo_carta2", [(eq, "$sabe_leer", 0),
      ], "--You don't know how to read, so you cannot understand it. Give the letter to Bodo.--", "bodo_carta34", [
      (call_script, "script_recruit_troop_as_companion", "$g_talk_troop"), #bodo en party de nuevo
  ]],
  [anyone|plyr, "bodo_carta2", [
      ], "Tell me about this letter, Bodo. Why is it so important?", "bodo_carta35", [
      (call_script, "script_recruit_troop_as_companion", "$g_talk_troop"), #bodo en party de nuevo
  ]],
  
  [anyone, "bodo_carta31", [	(str_clear, s2),
    ],
    "{s2}^^Do not worry. I am aware of the pressure that you feel on your shoulders and of the concern that you have for the life of your mother. What matters now is that we are together and we have the letter.", "bodo_carta4", [
      (str_store_string, s2, "@--He smiles at you.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone, "bodo_carta32", [
    ],
    "Fortunately, they needed me to decrypt the document. If I had given them what they wanted, I would have been dead long ago. " +
    "Well, I do not want to think about this. Now we're back together and have the letter.", "bodo_carta4", [
      #(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone|plyr, "bodo_carta4", [(eq, "$sabe_leer", 1),
      ], "--You open the parchment carefully, avoiding touching Atli's bloodstains with your fingers. You try reading the letter.--", "bodo_carta33", []],
  [anyone|plyr, "bodo_carta4", [(eq, "$sabe_leer", 0),
      ], "--You don't know how to read, so you cannot understand it. Give the letter to Bodo.--", "bodo_carta34", []],
  [anyone|plyr, "bodo_carta4", [(eq, "$sabe_leer", 0),
      ], "Tell me about this letter, Bodo. Why is it so important?", "bodo_carta35", []],
  
  [anyone|plyr, "bodo_carta33", [
      ], "--The text is Latin, and it talks about Noah and his ark, with many comments by a monk, but nothing that would appear relevant.--", "bodo_carta34", []],
  
  [anyone, "bodo_carta35", [
    ],
    "This letter is important and can change everything, but I need your help to finish my mission. It's time to reveal its secrets...", "bodo_carta34", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone, "bodo_carta34", [(str_clear, s2),
    ],
    "The trick is to read the first word after each period in the first three lines of each paragraph and read the last words before the period in the following.", "bodo_carta5", [
      (str_store_string, s2, "@--He takes the letter from your hands.--", color_good_news),
  ]],
  
  [anyone, "bodo_carta5", [(str_clear, s2),
    ],
    "{s2}^^Aldefonso became king very recently, after inheriting the throne of his father. He explains at the beginning of this letter that he respects the North and continues the covenants of his father. He sends a messenger to West Seaxe -- me -- and another to Frankia. " +
    "The North Sea, he says, should be made safe and the Vikings eradicated. West Seaxe is the best place from which to do this, given its proximity to Danmark.", "bodo_carta6", [
      (str_store_string, s2, "@--He takes the letter from your hands.--", color_good_news),
  ]],
  
  [anyone|plyr, "bodo_carta6", [
      ], "Why would the Kingdom of Asturias be worried about the Vikings?", "bodo_carta61", []],
  [anyone|plyr, "bodo_carta6", [
      ], "Get to the point, Bodo.", "bodo_carta8", []],
  
  [anyone, "bodo_carta61", [ (str_clear, s2),
    ],
    "{s2}^^My king, Aldefonso, is particularly concerned about the Danish, who are the ones who led the raids on his kingdom in the past. There were two particularly worrying attacks, which King Aldefonso does not want repeated. " +
    "The first was about twenty-four years ago, during the reign of King Ranimiro, Aldefonso's grandfather, when the Vikings were seen near to Asturias coast with more than 120 ships and 3000 men. Ranimiro quickly gathered his men in Cantabria and Asturias and sent messages to come to Gallaecia, where the Vikings landed to cause damage. " +
    "Ranimiro was a warrior king. When the Vikings arrived, he was firmly entrenched in a stronghold, so he was able to defeat them in battle and burn 70 ships.", "bodo_carta7", [
      (str_store_string, s2, "@--He looks up from the page and turns to you.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
  ]],
  [anyone, "bodo_carta7", [ (str_clear, s2),
    ],
    "All the same, another big Viking expedition came ten years ago, in the time of King Ordonio, the father of the current king. The fleet of almost 100 ships was led by Bjorn Ironside and Haesten, Ragnar's sons. They disembarked in Gallaecia, near the tomb of Santiago, and caused much damage before they were expelled. " +
    "After this King Ordonio began contacting other kingdoms in the North that had been attacked by Vikings, too, especially Frankia and West Seaxe. This letter is the finale to years of diplomatic efforts.", "bodo_carta8", [
  ]],
  
  [anyone, "bodo_carta8", [
    ],
    "The letter says that according to what was promised by his father, Aldefonso agrees to send 20 ships and 600 men to West Seaxe. The men are all veterans of the Muslim wars, fully equipped with chain mail, sword, spear and shield. " +
    "These men, joining West Seaxe with contributions from Frankia, will cleanse the sea of Vikings. The letter details the route and the ports these men will use on their journey to West Seaxe and asks the very noble king, Aethelred of the Seaxna, to prepare accommodation and food for them. " +
    "Do you see the importance of this letter, and why Sigurd Ragnarsson, or any Viking leader, for that matter, would want to intercept it?", "bodo_carta9", [
  ]],
  
  [anyone|plyr, "bodo_carta9", [		(store_attribute_level, ":intelligence", "trp_player", ca_intelligence),
      (ge,":intelligence",12),
      ], "This alliance may harm the interests of the Danish and their way of life.", "bodo_carta91", [
      (add_xp_as_reward,200),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone|plyr, "bodo_carta9", [
      ], "Six hundred veteran men would allow West Seaxe to conquer other kingdoms.", "bodo_carta92", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone|plyr, "bodo_carta9", [
      ], "I'd rather you tell me.", "bodo_carta91", []],
  [anyone|plyr, "bodo_carta9", [
      ], "Honestly, I do not care. Now that we have the letter, it's time to go back to King Horik.", "bodo_carta11", []],
  
  
  [anyone, "bodo_carta92", [
    ],
    "No, you are not listening to me. This army is not to be used for conquering. It is an alliance with one objective: cleanse the North Sea of Vikings. Allow me to explain.", "bodo_carta91", [
  ]],
  
  [anyone, "bodo_carta91", [
    ],
    "Figure that 600 veteran men from each kingdom make 1800 soldiers whose sole purpose is to finish the Vikings. We're not talking about a peasant levy but about professional warriors, well trained and well equipped. " +
    "This is a huge economic burden for any one kingdom, but if they are well led -- King Aethelred's brother, Aelfred, was chosen for this -- it could free the North Sea of the tempest that now whips it. " +
    "Therefore, the letter is important to my mission, so Sigurd Ragnarsson made every effort to intercept it. If he can show the letter in the Assembly and so demonstrate the danger that it portends for all of them, the Assembly will make him king with the mission of preventing this alliance.", "bodo_carta10", [
  ]],
  
  [anyone|plyr, "bodo_carta10", [
      ], "Then I will give the letter to King Horik, so it will be he who will lead the Danish.", "bodo_carta11", []],
  [anyone|plyr, "bodo_carta10", [
      ], "Fine. In that case, I'll give the letter to West Seaxe.", "bodo_carta13", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone|plyr, "bodo_carta10", [
      ], "I need to see what the Assembly decides. Then I will decide. Save it for now.", "bodo_carta13", []],
  [anyone|plyr, "bodo_carta10", [
      ], "This letter is a powerful weapon. Keep it safe.", "bodo_carta13", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
  ]],
  
  [anyone, "bodo_carta11", [
    ],
    "If you give this letter to King Horik or any other Norseman, he will use it to gain power and then destroy all that my kings have fought for over the years. " +
    "I understand that your concerns now are the Assembly and your mother. I'll help you with that now. Later we will discuss the letter again.", "bodo_carta12", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -3),
  ]],
  [anyone|plyr, "bodo_carta12", [
      ], "Fine, but don't think I'll change my mind. I will certainly give it to the Vikings.", "bodo_carta13", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone|plyr, "bodo_carta12", [
      ], "Fine, but don't think I'll change my mind. I will certainly give it to West Seaxe.", "bodo_carta13", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone|plyr, "bodo_carta12", [
      ], "Fine, we'll talk about the letter later.", "bodo_carta13", []],
  
  [anyone, "bodo_carta13", [
    ],
    "Well, we will tell King Horik that the letter was destroyed during the fight with Atli Eiriksson. Then he does not have to worry about Sigurd 'Snake in the Eye' using it in the Assembly. " +
    "This will ensure his support for your cause.", "bodo_carta14", [
      
      (str_clear, s9),
      (str_clear, s11),
      (str_store_troop_name_link, s9, "trp_kingdom_1_lord"),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_string, s2, "@Bodo's letter has fallen into your hands, and you have decided that you'll figure out what to do with it once you're done with the Assembly and current problems. " +
      "For now, you will tell {s9} that the letter was burned in the attack on Odin's cave, to assure him that {s11} cannot use it against him."),
      (add_quest_note_from_sreg, "qst_bodo_letter", 4, s2, 0),
      (quest_set_slot,"qst_bodo_letter",slot_quest_current_state, 4),
  ]],
  [anyone|plyr, "bodo_carta14", [
      ], "Let's not waste any more time but get out of this cave.", "close_window", [
      (assign, "$g_battle_result", 1),
      #(assign,"$g_encountered_party",-1),
      (jump_to_menu, "mnu_cueva_odin"),
      (finish_mission),
  ]],
  #####
  ##########
  ###dialogo 3 bandas despues de lair Sven Lair chief
  [anyone, "brunhild_avisa", [
    ],
    "Sigurd 'Snake in the Eye' was in the mead hall of the jarl of Kennemer on more than one occasion. He is not just any man, my {reg59?lady:lord}! You know that the jarl of Kennemer is a hard man, but he trembled before Sigurd. " +
    "Sigurd doesn't say a lot, he never smiles, and his snake eyes burrow into you as if he were trying to read your thoughts. " +
    "I was but a slave, but I heard things. People say that he is the most dangerous of the sons of Ragnar, a man who would kill you just for coughing nearby or for being in his way on the wrong day.", "companion_brunhild_conv", [
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 6),
      (call_script, "script_end_quest", "qst_sven_lair"),
      (talk_info_show, 0),      ]],
  
  [anyone|other(trp_npc6), "companion_brunhild_conv", [ #bodo
      #  	   (main_party_has_troop, "trp_npc6"),#troop should be part of player's party - Juju70
    ],
    "The beautiful Brunhild is right, {playername}. From what I know, Sigurd Ragnarsson is the kind of man that one should avoid. Unfortunately, he blocks our way...", "companion_brunhild_conv3", [
      ##            (store_conversation_troop, "trp_npc6"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc6"),
  ]],
  [anyone|other(trp_npc8), "companion_brunhild_conv3", [ #reginhard
      #  	(main_party_has_troop, "trp_npc8"),#troop should be part of player's party - Juju70
    ],
    "I don't believe it is so bad. You can't trust the jarl of Kennemer, since he is an accomplished actor who uses every possible tool to try to manipulate others. If he saw an advantage in passing as timid before Sigurd, he would've done that. " +
    "I would be very careful with him, as he's a man who smiles when you face him, and stabs you with a dagger when you turn. With Sigurd, at least, you always know where he is coming from.", "companion_brunhild_conv4", [
      ##            (store_conversation_troop, "trp_npc8"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc8"),
  ]],
  
  [anyone, "companion_brunhild_conv4", [ #brunhild
    ],
    "Reginhard is talking without knowing him. I've heard things and seen things. Maybe Reginhard was too busy drinking or betraying someone. Sigurd is spiteful, never forgiving -- and never forgetting...", "companion_brunhild_conv5", [
  ]],
  
  [anyone|other(trp_npc8), "companion_brunhild_conv5", [ #reginhard
    ],
    "You have the gall, woman, to call me a drunk and traitor to my face! You know nothing about me! Watch your words, or you will have to watch your back.", "companion_brunhild_conv6", [
  ]],
  
  [anyone|plyr, "companion_brunhild_conv6", [
      ], "Brunhild! Reginhard has had a hard life. Don't use what happened to Thiaderd against him.", "companion_brunhild_conv71", []],
  [anyone|plyr, "companion_brunhild_conv6", [
      ], "Reginhard! Overcome your regrets and your past and never threaten a member of this party.", "companion_brunhild_conv72", []],
  [anyone|plyr, "companion_brunhild_conv6", [
      ], "Am I with grown people or children? Silence both you, now! Bodo, what do you think?", "companion_brunhild_conv73", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", -3),
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -3),
      
  ]],
  [anyone|plyr, "companion_brunhild_conv6", [
      ], "Bodo, can you give me some advice about Sigurd?", "companion_brunhild_conv73", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", -5),
      (display_message,"@Brunhild thinks that you are a weak leader."),
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -5),
      (display_message,"@Reginhard thinks that you are a weak leader."),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -5),
      (display_message,"@Bodo thinks that you are a weak leader."),
      
  ]],
  
  [anyone, "companion_brunhild_conv71", [ #brunhild
    ],
    "I'm sorry, my {reg59?lady:lord}. I'm sorry, Reginhard. I let my temper get the best of me.", "companion_brunhild_conv73", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", 5),
  ]],
  [anyone|other(trp_npc8), "companion_brunhild_conv72", [ #reginhard
    ],
    "Yes, I see how things work now. I withdraw my threats, but she should watch her words.", "companion_brunhild_conv73", [
      ##            (store_conversation_troop, "trp_npc8"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc8"),
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -5),
  ]],
  
  [anyone|other(trp_npc6), "companion_brunhild_conv73", [ #bodo
    ],
    "We are at crossroads. Sigurd 'Snake in the Eye' has what we need, and your mother's life is in danger. In my opinion, we should go and talk to him, even if it costs us our lives. We have no choice...", "companion_brunhild_conv74", [
      ##            (store_conversation_troop, "trp_npc6"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc6"),
  ]],
  [anyone, "companion_brunhild_conv74", [ #brunhild
    ],
    "Maybe there is another way. There is a powerful man who hates Sigurd: King Horik Gottfredsson of Danmark, Sigurd's king.", "companion_brunhild_conv75", [
  ]],
  
  [anyone|plyr, "companion_brunhild_conv75", [
      ], "Why does his king hate him, Brunhild?", "companion_brunhild_conv76", []],
  [anyone|plyr, "companion_brunhild_conv75", [
      ], "Imagine what you propose. If you were to speak to King Horik, what would you say?", "companion_brunhild_conv8", []],
  
  [anyone, "companion_brunhild_conv76", [ #brunhild
    ],
    "Well, I know only what I've heard. They are enemies. Maybe Sigurd wants to be king himself.", "companion_brunhild_conv8", [
  ]],
  
  [anyone|other(trp_npc8), "companion_brunhild_conv8", [ #reginhard
    ],
    "Sigurd would be stupid, then. King Horik could banish him, make him an outcast, and strip him of his lands by denouncing him for the slightest infraction at the Thing.", "companion_brunhild_conv9", [
      ##            (store_conversation_troop, "trp_npc8"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc8"),
  ]],
  [anyone|other(trp_npc6), "companion_brunhild_conv9", [ #bodo
    ],
    "My knowledge is limited, but perhaps Sigurd is as powerful as the king himself. Or maybe King Horik doesn't want more wars in Danmark, after getting his throne after a long war with the other jarls.", "companion_brunhild_conv10", [
      ##            (store_conversation_troop, "trp_npc6"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc6"),
  ]],
  
  [anyone|plyr, "companion_brunhild_conv10", [
      ], "Reginhard, what is this 'thing' you speak of?", "companion_brunhild_conv111", []],
  [anyone|plyr, "companion_brunhild_conv10", [
      ], "Speak with Sigurd or tell King Horik? We have a difficult decision to make.", "companion_brunhild_conv112", []],
  
  
  [anyone|other(trp_npc8), "companion_brunhild_conv111", [ #reginhard
    ],
    "The Thing or the Assembly is a meeting of free men where disputes are solved and political decisions are made.", "companion_brunhild_conv112", [
      ##            (store_conversation_troop, "trp_npc8"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc8"),
  ]],
  
  [anyone, "companion_brunhild_conv112", [ #brunhild
    ],
    "I think we should get the protection and support of King Horik. This will give us an advantage when talking to Sigurd and will force him to respect our lives. If King Horik helps us, you can legally claim your mother back.", "companion_brunhild_conv12", [
  ]],
  
  [anyone|other(trp_npc6), "companion_brunhild_conv12", [ #bodo
    ],
    "Do not go straight to Sigurd 'Snake in the Eye' now. It may cause the death of your mother, and perhaps you will lose track of Sven Bull Neck forever. Why not see whether King Horik will support us?", "companion_brunhild_conv13", [
      ##            (store_conversation_troop, "trp_npc6"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc6"),
  ]],
  
  [anyone|other(trp_npc8), "companion_brunhild_conv13", [ #reginhard
    ],
    "If I had to choose between going straight to Sigurd and getting myself killed or going to Horik and getting your mother killed, I wouldn't know what to say. You got me out of the hole where I was, so I'm fine with your choice whatever it is.", "companion_brunhild_conv14", [
      #   (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 5),
      ##            (store_conversation_troop, "trp_npc8"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc8"),
  ]],
  
  [anyone|plyr, "companion_brunhild_conv14", [
      ], "I need to think about it. Thank you, all. We have to continue our travels.", "close_window", [
      (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 5),
      (assign, "$tem", 1),
      (str_clear, s9),
      (str_clear, s11),
      (str_store_troop_name_link, s9, "trp_knight_1_5"),
      (str_store_troop_name_link, s11, "trp_kingdom_1_lord"),
      (str_store_string, s2, "@Brunhild has advised that you go first to an enemy of {s9}, {s11}, for support before you place yourself in the hands of the son of Ragnar."),
      (add_quest_note_from_sreg, "qst_revenge_sigurd", 7, s2, 0),
      ##       (jump_to_menu, "mnu_camp"),
      (finish_mission),
      #      (leave_encounter),
      ##       #(change_screen_return),
      #                    (change_screen_map),
  ]],
  #######bodo
  [anyone, "companion_questions_bodo1", [
    ],
    "Sven Bull Neck came here after the attack. He left some of his men here with us, the prisoners. I also saw him sending ships on a mission to attack Friese. Then he went north. I think something or someone called him there. " +
    "Rather, I have heard his men say this, but not everything they say is true.", "companion_recruit_backstory_responsebodo", []],
  
  [anyone, "companion_questions_bodo2", [
    ],
    "I know you really want to ask if your mother is still alive, and where she is. Well, I have not told you everything. " +
    "I need you to stay calm and listen to me carefully.", "companion_responsebodostory", []],
  
  [anyone|plyr,"companion_responsebodostory", [
      (str_clear, s10),
    ],
    "{!}{s10}", "companion_responsebodostory1",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@I'm not sure I want to hear what you are going to say. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@You are worrying me, Bodo. What do you have to say? Out with it already! (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@I'm very calm... Trust me, you wouldn't like to see me nervous. I have little patience. Speak, or I'll beat you up. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Whatever you have to say, say it. I prepared myself for this moment a long time ago. (Sanguine)"),
      (try_end),
  ]],
  
  [anyone,"companion_responsebodostory1", [
      (str_clear, s2),
    ],
    "{!}{s2}", "companion_responsebodostory2",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s2, "@I understand, my friend, but you must know... everything."),
        (call_script, "script_change_player_relation_with_troop", "trp_npc6", 3),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s2, "@Stay calm, please. I'll tell you everything."),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s2, "@No need to be aggressive. You know my loyalty to my friends is unquestionable. Now, open your ears."),
        (call_script, "script_change_player_relation_with_troop", "trp_npc6", -3),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s2, "@I admire your strong blood. I'll tell you everything."),
        (call_script, "script_change_player_relation_with_troop", "trp_npc6", 6),
      (try_end),
  ]],
  
  [anyone, "companion_responsebodostory2", [
      (str_clear, s2),
    ],
    "{s2}^^Sven Bull Neck didn't end up there by chance. Our boat was his goal, and we had a traitor on board...", "companion_responsebodostory3", [
      (str_store_string, s2, "@--He puts his hand on your shoulder and smiles sadly.--", color_good_news),
  ]],
  
  [anyone|plyr, "companion_responsebodostory3", [ #chief mainquest bodo
      ], "What are you saying? What purpose? What traitor?", "companion_responsebodostory41", []],
  
  [anyone|plyr, "companion_responsebodostory3", [ #chief mainquest bodo
      ], "I could care less about all you have to say. I want to know what happened to my mother.", "companion_responsebodostory42", []],
  
  
  [anyone, "companion_responsebodostory42", [
      (str_clear, s2),
    ],
    "{s2}^^I told you to remain calm! I'll get to that shortly, but you should know this first...", "companion_responsebodostory41", [
      (str_store_string, s2, "@--He sighs impatiently.--", color_good_news),
  ]],
  
  [anyone, "companion_responsebodostory41", [
      (str_clear, s2),
    ],
    "{s2}^^What happened was my fault, {playername}. I was Sven Bull Neck's target, so we were attacked and so on. I commended my soul to Erudino, for I was willing to die, but the Vikings wanted me alive. Therefore, it was I who brought death to my family on the boat. " +
    "My redemption is that Sven Bull Neck will die at my hands.", "companion_responsebodostory5", [
      (str_store_string, s2, "@--He steps back, takes a deep breath, and looks you in the eyes.--", color_good_news),
  ]],
  
  [anyone|plyr, "companion_responsebodostory5", [ #chief mainquest bodo
      ], "So YOU were the traitor?", "companion_responsebodostory61", []],
  
  [anyone|plyr, "companion_responsebodostory5", [ #chief mainquest bodo
      ], "This is all your fault. You have destroyed my life.", "companion_responsebodostory62", []],
  
  [anyone|plyr, "companion_responsebodostory5", [ #chief mainquest bodo
      ], "No, Sven Bull Neck is mine, and I will kill you if you cross my path.", "companion_responsebodostory63", []],
  
  [anyone|plyr,"companion_responsebodostory5", [
      (try_begin),
        (eq, "$defect_type", cb6_prudence),
        (str_store_string, s10, "@Sven wanted you, but how did he know where to find you? Who betrayed us? (Wisdom)"),
      (else_try),
        (eq, "$defect_type", cb6_fortitude),
        (str_store_string, s10, "@Your redemption and my goal are coincident. (Fortitude)"),
      (else_try),
        (eq, "$defect_type", cb6_temperance),
        (str_store_string, s10, "@I understand that what happened was caused by you, but it's not your fault. (Temperance)"),
      (else_try),
        (eq, "$defect_type", cb6_justice),
        (str_store_string, s10, "@You're responsible for what happened. After Sven, you shall pay with your life. (Justice)"),
      (try_end),
    ],
    "{!}{s10}", "companion_responsebodostory64",[
      (str_clear, s10),
  ]],
  
  [anyone, "companion_responsebodostory61", [
      (str_clear, s2),
    ],
    "{s2}^^You're not listening to me! I was the Sven's target. How can I betray myself?", "companion_responsebodostory7", [
      (str_store_string, s2, "@--He sighs with annoyance.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -5),
  ]],
  
  [anyone, "companion_responsebodostory62", [
      (str_clear, s2),
    ],
    "{s2}^^I know, and I'm so sorry.", "companion_responsebodostory7", [
      (str_store_string, s2, "@--He lowers his head, embarrassed. His hands fidget.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -5),
  ]],
  
  [anyone, "companion_responsebodostory63", [
      (str_clear, s2),
    ],
    "{s2}^^This is not the issue to deal with now... but I promised Erudino.", "companion_responsebodostory7", [
      (str_store_string, s2, "@--He strains his face and stares at you without blinking.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -5),
  ]],
  
  [anyone,"companion_responsebodostory64", [
      (str_clear, s4),
    ],
    "{!}{s4}", "companion_responsebodostory7",[
      (str_store_string, s2, "@Info:"),
      (call_script, "script_start_quest", "qst_notes_companions", "trp_player"),
      (try_begin),
        (eq, "$defect_type", cb6_prudence),
        (str_store_string, s4, "@Regarding that matter, I thought that the Woden Ric was safe, but I was wrong. (Wisdom)"),
        (str_store_string, s2, "@Note Bodo: Bodo feels indirectly responsible for the death of the people of the Woden Ric."),
        (add_quest_note_from_sreg, "qst_notes_companions", 4, s2, 0),
      (else_try),
        (eq, "$defect_type", cb6_fortitude),
        (str_store_string, s4, "@So our paths have met, my friend. I'll tell you the rest. Then we can work together against our mutual enemy. (Fortitude)"),
        (call_script, "script_change_player_relation_with_troop", "trp_npc6", 1),
        (str_store_string, s2, "@Note Bodo: Bodo felt indirectly responsible for the death of the people of the Woden Ric, but you forgave him."),
        (add_quest_note_from_sreg, "qst_notes_companions", 4, s2, 0),
      (else_try),
        (eq, "$defect_type", cb6_temperance),
        (str_store_string, s4, "@Thanks for your trust. I hope to be worthy of it. (Temperance)"),
        (call_script, "script_change_player_relation_with_troop", "trp_npc6", 5),
        (str_store_string, s2, "@Note Bodo: Bodo felt indirectly responsible for the death of the people of the Woden Ric, but you forgave him."),
        (add_quest_note_from_sreg, "qst_notes_companions", 4, s2, 0),
      (else_try),
        (eq, "$defect_type", cb6_justice),
        (str_store_string, s4, "@That would be just. I'd pay for the damage caused. When Sven Bull Neck is dead, I will put my neck under your sword. (Justice)"),
        (str_store_string, s2, "@Note Bodo: Bodo is indirectly responsible for the death of the people of the Woden Ric. Your sense of justice dictates that he must die when Sven Bull Neck is dead, to atone for his guilt. You've committed yourself to kill him."),
        (add_quest_note_from_sreg, "qst_notes_companions", 4, s2, 0),
        (call_script, "script_change_player_honor", 1),
      (try_end),
  ]],
  
  [anyone, "companion_responsebodostory7", [
    ],
    "I was stupid. I believed that the Woden Ric was safe, but I was wrong. I was betrayed by its captain. The poor man thought that Sven Bull Neck would give him wealth. He was cheated, for, when the Vikings raided the Woden Ric, he was killed. " +
    "Maybe that is the real reason why we stopped among those shipwrecks...", "companion_responsebodostory8", [
  ]],
  
  [anyone, "companion_responsebodostory8", [
    ],
    "The Woden Ric captain betrayed me -- indeed, all of us -- but I do not begrudge him that. He was just an idiot, and this cost him his life.", "companion_responsebodostory9", [
  ]],
  
  [anyone|plyr, "companion_responsebodostory9", [ #chief mainquest bodo
      ], "He is lucky to be dead, because I would kill him myself. I hate traitors.", "companion_responsebodostory101", []],
  
  [anyone|plyr, "companion_responsebodostory9", [ #chief mainquest bodo
      ], "But why was Sven Bull Neck chasing you? Why were YOU his goal?", "companion_responsebodostory102", []],
  
  [anyone|plyr, "companion_responsebodostory9", [ #chief mainquest bodo
      ], "I'm still waiting to hear about my mother.", "companion_responsebodostory103", []],
  
  [anyone, "companion_responsebodostory101", [
      (str_clear, s2),
    ],
    "{s2}^^Little can be done in this regard.", "companion_responsebodostory103", [
      (str_store_string, s2, "@--He shrugs.--", color_good_news),
  ]],
  
  [anyone, "companion_responsebodostory102", [
    ],
    "I was Sven Bull Neck's target, as I had something very important in my hands, something so important that his lord, Sigurd Ragnarson, would kill for it. " +
    "However, I myself did something terrible before the Viking assault, something I regret.", "companion_responsebodostory11", [
  ]],
  
  [anyone, "companion_responsebodostory103", [
      (str_clear, s2),
    ],
    "Your mother is alive. When I awoke, a prisoner on Sven Bull Neck's ship, your mother was next to me. We were the only survivors, or so I thought until you came to my rescue today. " +
    "Your mother thinks you are dead, my friend.", "companion_responsebodostory102", [
  ]],
  
  [anyone|plyr, "companion_responsebodostory11", [ #chief mainquest bodo
      ], "What did you do?", "companion_responsebodostory13", []],
  
  [anyone, "companion_responsebodostory13", [
    ],
    "I gave it to your mother! I thought that it was safer in her hands than in mine... " +
    "Before you take any fatal action against me in justified anger, you should know that it saved her life, because the Vikings thought she was my master.", "companion_responsebodostory14", [
  ]],
  
  [anyone, "companion_responsebodostory14", [
    ],
    "Do you understand? If not for that object, she probably would be dead now, like the rest of the people of the Woden Ric. Your mother's disease helped too, because the Vikings think that madness is a touch of the gods. " +
    "Sven took your mother north with him and left me to my fate here, to be sold as a slave, because he thought she was my master and the object carrier. " +
    "We must hurry, because when Sven Bull Neck discovers the truth, he will kill her.", "companion_responsebodostory15", [
  ]],
  
  [anyone|plyr, "companion_responsebodostory15", [ #chief mainquest bodo
      ], "Who are you, really, and what is so important to be so wanted by Sven and his lord, Sigurd?", "companion_responsebodostory161", []],
  
  [anyone|plyr, "companion_responsebodostory15", [ #chief mainquest bodo
      ], "Where has he taken my mother?", "companion_responsebodostory162", []],
  
  [anyone, "companion_responsebodostory161", [
    ],
    "That's not important, but I will tell you that I'm not a common traveler. I was sent by the king of Asturias, and what I brought with me is a gift that could change the course of a war! " +
    "We'll talk about this later. It is urgent now to find your mother. Sven Bull Neck was summoned by his lord, Sigurd 'Snake in the Eye' Ragnarsson. Sigurd wants this object badly. He will interrogate your mother about it, because he thinks she has the information he needs. We must find Sigurd soon.", "companion_recruit_signup", [
      (add_xp_as_reward,600),
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 5),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_string, s2, "@Finally, all roads lead to {s11} 'Snake in the Eye.' Sven Bull Neck has taken your mother to him, because {s11} wants an object that Bodo gave your mother and ask her for very important information he told her. Sven thinks your mother is the carrier of the object instead of Bodo. Therefore, she is still alive. You must hurry, before Sven discovers the deception and kills her."),
      (add_quest_note_from_sreg, "qst_revenge_sigurd", 6, s2, 0),
      
  ]],
  
  [anyone, "companion_responsebodostory162", [
    ],
    "Sven Bull Neck was summoned by his lord, Sigurd 'Snake in the Eye' Ragnarsson. Sigurd wants this object badly. He will interrogate your mother about it, because he thinks she has the information he needs. We must find Sigurd soon.", "companion_recruit_signup", [
      (add_xp_as_reward,600),
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 5),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_string, s2, "@Finally, all roads lead to {s11} 'Snake in the Eye.' Sven Bull Neck has taken your mother with him, because {s11} wants an object that Bodo gave your mother and information he told her. Sven thinks your mother is the carrier of the object instead of Bodo. Therefore, she is still alive. You must hurry, before Sven discovers the deception and kills her."),
      (add_quest_note_from_sreg, "qst_revenge_sigurd", 6, s2, 0),
  ]],
  
  
  [anyone, "companion_reginhard1", [
      (str_clear, s2),
    ],
    "{s2}^^I am not sure that we have anything to talk about.", "companion_reginhard2", [
      (str_store_string, s2, "@--He takes the mead jug to his lips, drinks long, and then he just looks at you.--", color_good_news),
  ]],
  
  [anyone|plyr,"companion_reginhard2", [
      (neg|quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 1),
      (neg|quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 2),
      #(quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 0),
      (str_clear, s10),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@You don't trust me. I understand; I am new here. Maybe I should leave. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@I see... Something makes you nervous. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Look at me. Who else that comes to this mead hall sits with you? Nobody! (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@You looked like someone that would appreciate a friend, but I can go again. (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "companion_reginhard21",[
  ]],
  
  [anyone|plyr, "companion_reginhard2", [ #chief mainquest
      (quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 2),
      ], "Alright, I will stay with you, but tell me why you should not be here.", "companion_reginhard3", [
      (add_xp_as_reward,100),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
  ]],
  
  [anyone|plyr, "companion_reginhard2", [ #chief mainquest
      (quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 1),
      ], "Come on, Reginhard, I'm legitimate. Tell me why you should not be here.", "companion_reginhard3", [
  ]],
  
  [anyone|plyr, "companion_reginhard2", [ #chief mainquest
      #  (neg|quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 2),
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 50),
      ], "Reginhard, take these 50 peningas. I know that times are bad and friends should help.", "companion_reginhard3", [
      (troop_remove_gold, "trp_player", 50),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
      (str_store_string, s20, "@{s21} seems happy."),
      (quest_set_slot,"qst_kennemer_mission_2",slot_quest_current_state, 2),
  ]],
  
  [anyone|plyr, "companion_reginhard2", [ #chief mainquest
      # (neg|quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 2),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (ge, ":player_persuasion_skill", 5),
      ], "You're such an interesting person. What is your story? (Persuasion)", "companion_reginhard3", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
      (quest_set_slot,"qst_kennemer_mission_2",slot_quest_current_state, 2),
  ]],
  
  [anyone,"companion_reginhard21", [
      (str_clear, s2),
    ],
    "{!}{s2}", "companion_reginhard2",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s2, "@Please, do not leave! Let's keep talking and drinking together!"),
        (quest_set_slot,"qst_kennemer_mission_2",slot_quest_current_state, 2),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s2, "@Nervous? Me? No, mate. I am dangerous."),
        (quest_set_slot,"qst_kennemer_mission_2",slot_quest_current_state, 1),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s2, "@I've just gotten to know you. How do I know that someone has not sent you to extract information?"),
        (quest_set_slot,"qst_kennemer_mission_2",slot_quest_current_state, 1),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s2, "@Please, do not leave! Let's keep talking and drinking together!"),
        (quest_set_slot,"qst_kennemer_mission_2",slot_quest_current_state, 2),
      (try_end),
  ]],
  
  [anyone, "companion_reginhard3", [
      (str_clear, s2),
      (assign, "$option_switches", 0),
    ],
    "{s2}^^When my family died, I joined the rebels, tough and brave men who struggle to free us from the oppression of the Danish. " +
    "I fought at their side, and I was happy because being with them, always busy and fearing death, made me forget what happened to my family.", "companion_reginhard4", [
      (str_store_string, s2, "@--He smiles, drinks again, and you see the mead overflow his lips and course down his chin. He belches.--", color_good_news),
  ]],
  
  [anyone|plyr, "companion_reginhard4", [ #chief mainquest
      (store_and, reg0, "$option_switches", option_1),
      (eq, reg0, 0),
      ], "Why are you no longer with them?", "companion_reginhard41", [
  ]],
  
  [anyone|plyr, "companion_reginhard4", [ #chief mainquest
      (store_and, reg0, "$option_switches", option_2),
      (eq, reg0, 0),
      ], "What can you tell me about your leader?", "companion_reginhard42", [
  ]],
  
  [anyone|plyr, "companion_reginhard4", [ #chief mainquest
      ], "How can I find them?", "companion_reginhard421", [
  ]],
  
  [anyone, "companion_reginhard421", [
    ],
    "You cannot find them. They do not want to be found. These men fear the jarl. Thiaderd only allows people he trusts to join.", "companion_reginhard422", [
  ]],
  
  [anyone|plyr, "companion_reginhard422", [ #chief mainquest
      ], "I am trustworthy. Ask me anything you want.", "companion_reginhard423", [
  ]],
  
  [anyone|plyr, "companion_reginhard422", [ #chief mainquest
      ], "I think you're playing with me, and I do not like it. I'm leaving.", "companion_reginhard423", [
  ]],
  
  [anyone, "companion_reginhard423", [
      (str_clear, s3),
    ],
    "{s3}^^Look at me and listen. There are many people having a hard time during this rebellion, particularly the many widows and orphans. There is a woman in Dorestad who collects donations to care for these widows and orphans. Go see her and help. " +
    "I think you're a good person, but show me. Talk to this woman. Her name is Adda. You can find her in the shop on the wharf. Make a donation in my name. Maybe this will help my people see me with different eyes.", "close_window", [
      (str_store_string, s3, "@--He seems not hear you. Joy crosses his face at an idea that he has in mind.--", color_good_news),
      (str_clear, s11),
      (str_clear, s4),
      (str_store_troop_name, s11, "$g_talk_troop"),
      (str_store_party_name_link, s4, "p_town_11"),
      (str_store_string, s2, "@{s11} wants you to make a donation for Frisian widows and orphans to Adda in {s4}. Her shop is on the wharf."),
      (call_script, "script_start_quest", "qst_reginhard_donations", "$g_talk_troop"),
      (quest_set_slot,"qst_reginhard_donations",slot_quest_current_state, 1),
  ]],
  
  
  ###bodo choice chief mainquest
  
  [anyone|plyr, "bodo_choiceside1", [
      ], "Bodo, remind me about your mission.", "bodo_choiceside21", []],
  [anyone|plyr, "bodo_choiceside1", [
      ], "Yes, I was thinking about the letter, and I've made a decision.", "bodo_choiceside22", []],
  
  [anyone, "bodo_choiceside21", [ #bodo
    ],
    "Your memory is fragile, my friend. When we traveled in the Woden Ric, Sven Bull Neck attacked us to steal a letter that I had. That's where our history began. " +
    "Sven stole the letter for Sigurd 'Snake in the Eye,' his jarl, but we recovered the letter in Northvegr. We pulled it from the hands of the corpse of Atli, the man whom Sigurd had ordered to protect the letter. " +
    "Now the letter is in our possession, and we were waiting for the right time to take it to West Seaxe. This time has come.", "bodo_choiceside22", [
  ]],
  [anyone, "bodo_choiceside22", [ #bodo
    ],
    "I am very happy! Without you, I would not have gotten this far. The letter will coordinate the alliance between West Seaxe, Asturias and the Franks. " +
    "These three kingdoms will gather together men and ships to cleanse the North Sea of Vikings. In fact, it is possible that the fleet of Asturias is about to be sent, because my mission has been delayed.", "bodo_choiceside3", [
      (talk_info_show, 0),    ]],
  
  [anyone|plyr, "bodo_choiceside3", [
      ], "I would like to hear the opinions of my other companions before making a decision.", "bodo_choiceside4_s", []],
  [anyone|plyr, "bodo_choiceside3", [
      ], "Now, hear my decision.", "bodo_choiceside4_1", []],
  
  [anyone|other(trp_npc15), "bodo_choiceside4_1", [ #agathinos
    ],
    "{playername}, I think you should listen to our opinion before deciding.", "bodo_choiceside4_2", [
  ]],
  [anyone|plyr, "bodo_choiceside4_2", [
      ], "Sure.", "bodo_choiceside4_s", []],
  [anyone|plyr, "bodo_choiceside4_2", [
      ], "No, I'm the leader and don't need your opinions.", "bodo_choiceside9", [
      (try_for_range, ":companion", companions_begin, companions_end),
        (main_party_has_troop,":companion"),
        (call_script, "script_change_player_relation_with_troop", ":companion", -20),
      (try_end),
  ]], #final
  
  
  [anyone|other(trp_npc2), "bodo_choiceside4_s", [ #egil
      (main_party_has_troop, "trp_npc2"),
    ],
    "I have nothing to say. I will listen to the others.", "bodo_choiceside4", [
  ]],
  [anyone|other(trp_npc8), "bodo_choiceside4_s", [ #egil
      (main_party_has_troop, "trp_npc8"),
    ],
    "I submit to whatever {playername} chooses.", "bodo_choiceside4", [
  ]],
  
  [anyone|other(trp_npc12), "bodo_choiceside4_s", [ #
    ],
    "--He clears his throat to get the attention of all.--", "bodo_choiceside4", [
  ]],
  
  [anyone|other(trp_npc12), "bodo_choiceside4", [ #asbjorn
    ],
    "Sorry, but I can't be impartial in this matter. My ancestors, my family, are Vikings. The gods have granted us victory upon victory, so that we may acquire fame and wealth. " +
    "This invasion we have embarked upon is in the footsteps of the sons of Ragnar in Englaland. It is a rich, fertile land worth fighting for. The Danish understand that if you can seize something, it's yours. It is for the inhabitants of the land to defend it and be worthy adversaries.", "bodo_choiceside41", [
  ]],
  [anyone|other(trp_npc12), "bodo_choiceside41", [ #asbjorn
    ],
    "The Danish are not beggars, and do not come asking for a piece of land. Danes do not ask for charity from the Saxons. We come with weapons in hand, ready to fight. If the Angles or Saxons defeat us, we will respect their victory, but if we prevail, the gods are with us and the fertile soil belongs to us. " +
    "That is what I believe. If the Saxons and Franks come northward to fight and defeat the Danish, they are true warriors and the land is theirs.", "bodo_choiceside42", [
  ]],
  [anyone|plyr, "bodo_choiceside42", [
      ], "Your opinion will weigh heavily in my decision, Asbjorn. Thank you.", "bodo_choiceside43", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc12", 10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -10),
  ]],
  [anyone|plyr, "bodo_choiceside42", [
      ], "This does not clarify anything.", "bodo_choiceside43", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc12", -10),
  ]],
  [anyone|plyr, "bodo_choiceside42", [
      ], "All men have the right to live without having to worry about what the sea may bring.", "bodo_choiceside43", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc11", -10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc12", -10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", 10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", 10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc15", 10),
  ]],
  
  [anyone|other(trp_npc12), "bodo_choiceside43", [ #asbjorn is ok
      (troop_get_slot, ":relation", "trp_npc12", slot_troop_player_relation),
      (ge, ":relation", 50),
    ],
    "I've said all I have to say. You have my support, whatever you decide. It doesn't matter anyway, as fate has already been written.", "bodo_choiceside5", [
  ]],
  [anyone|other(trp_npc12), "bodo_choiceside43", [ #asbjorn leave
    ],
    "Whatever you decide, I'm taking my leave and going back to Odinsve. I've made good friends in this party, but I know that now we'll be at odds. " +
    "Therefore, I leave while we are still all friends.", "bodo_choiceside5", [
  ]],
  [anyone|other(trp_npc3), "bodo_choiceside5", [ #brunhild
    ],
    "I am not as good as Asbjorn at speaking. I'm just a slave who escaped from the hands of a Danish jarl. You know what I think about the Danish, or rather certain Danes who occupy Kennemer. " +
    "They come, kill and take what they want. If delivering the letter to West Seaxe means a safer North Sea, you have my support. If you deliver the letter to the Danish, on the other hand...", "bodo_choiceside51", [
  ]],
  [anyone|plyr, "bodo_choiceside51", [
      ], "Your opinion evens my decision, Brunhild.", "bodo_choiceside6", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", 10),
  ]],
  [anyone|plyr, "bodo_choiceside51", [
      ], "What? What would you do if I carry the letter to the Danish?", "bodo_choiceside53", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", -10),
  ]],
  
  
  [anyone|other(trp_npc3), "bodo_choiceside53", [ #brunhild is ok
      (troop_get_slot, ":relation", "trp_npc3", slot_troop_player_relation),
      (ge, ":relation", 85),
    ],
    "I'll stay by your side, even though I do not like your decision. I owe you too much and have spent too much time with you to do otherwise.", "bodo_choiceside6", [
  ]],
  [anyone|other(trp_npc3), "bodo_choiceside53", [ #brunhild leave
    ],
    "I will take another direction. I will not be part of what happens.", "bodo_choiceside6", [
  ]],
  
  [anyone|other(trp_npc15), "bodo_choiceside6", [ #agathinos is ok
      (troop_get_slot, ":relation", "trp_npc15", slot_troop_player_relation),
      (ge, ":relation", 10),
    ],
    "Well... well I do not know what to say. I'm fine here. I think I'll stay with you, choose what you want.", "bodo_choiceside7", [
  ]],
  [anyone|other(trp_npc15), "bodo_choiceside6", [ #agathinos leave
    ],
    "I'm not happy here. I'm sorry, but I must leave and find another person to follow.", "bodo_choiceside61", [
  ]],
  
  [anyone|plyr, "bodo_choiceside61", [
      ], "You are very important to this group, Agathinos. I want you to follow us.", "bodo_choiceside62", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc15", 15),
  ]],
  [anyone|plyr, "bodo_choiceside61", [
      ], "I see. We'll be better off without you.", "bodo_choiceside7", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc15", -10),
  ]],
  
  [anyone|other(trp_npc15), "bodo_choiceside62", [ #brunhild is ok
      (str_clear, s2),
    ],
    "{s2}^^Great! Then I'll stay.", "bodo_choiceside7", [
      (str_store_string, s2, "@--He looks happy to hear your words.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc11), "bodo_choiceside7", [ #
    ],
    "It is my turn to speak. I have chosen you. I have followed you. I have fought beside you. Therefore, I think I know you better than most, {playername}. I am from Northvegr. We fought against the Danes often, and many other times we drank and laughed with them. " +
    "They are like us: free men who choose to live out their fate. In Danmark or Northvegr, we have laws, but Englaland does not belong to anyone that matters. They are weak kingdoms with much wealth for the taking. " +
    "You cannot put a treasure in plain sight of a man, not protect it and simply hope that he does not take it. " +
    "If you're an idiot, why is it his fault?", "bodo_choiceside71", [
  ]],
  
  [anyone|plyr, "bodo_choiceside71", [
      ], "Strength and Chaos? I love your idea, too, Solveig.", "bodo_choiceside8", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc11", 10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -10),
  ]],
  [anyone|plyr, "bodo_choiceside71", [
      ], "Rule by force is not fair and just brings chaos.", "bodo_choiceside8", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", -10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc15", 10),
  ]],
  
  [anyone|other(trp_npc11), "bodo_choiceside8", [ #solveig is ok
      (troop_get_slot, ":relation", "trp_npc11", slot_troop_player_relation),
      (ge, ":relation", 50),
    ],
    "Chaos is good. I'll keep at your side no matter what happens. Too many things unite us.", "bodo_choiceside9", [
  ]],
  [anyone|other(trp_npc11), "bodo_choiceside8", [ #solveig leave
    ],
    "Chaos is good. Sorry, but I don't fight against free men who have merely chosen to be Vikings.", "bodo_choiceside9", [
  ]],
  [anyone|other(trp_npc6), "bodo_choiceside9", [ #solveig leave
      (str_clear, s2),
    ],
    "{s2}^^I'm worried about all this. I thought you were on my side. We were to go to the king of West Seaxe together, but now I do not know. I sense doubt...", "bodo_choiceside10", [
      (str_store_string, s2, "@--He looks at you with deep concern.--", color_good_news),
  ]],
  
  [anyone|plyr, "bodo_choiceside10", [ ###West Seaxe side
      ], "I have no doubt, Bodo. We will go together to the king of West Seaxe.", "bodo_choiceside111", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", 50),
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -90),
      
      (assign, "$player_side", 1), #wessex
      (str_store_troop_name_link, s11, "trp_kingdom_5_lord"),
      (str_store_string, s2, "@You have decided to give the letter of the king of Asturias to the king of West Seaxe. Take it to {s11}."),
      (call_script, "script_start_quest", "qst_the_alliance", "$g_talk_troop"),
      (quest_set_slot,"qst_the_alliance",slot_quest_current_state, 1),
  ]],
  
  [anyone|plyr, "bodo_choiceside10", [ #danish side
      ], "I have decided to give the letter to Rathbarth and the rest of Ragnar's sons.", "bodo_choiceside112", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", 50),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -90),
      
      (assign, "$player_side", 2), #danish
      
      (str_store_troop_name_link, s11, "trp_knight_8_2"),
      (str_store_string, s2, "@You have decided to give the letter to Ragnar's sons. Take it to {s11}."),
      (call_script, "script_start_quest", "qst_the_alliance", "$g_talk_troop"),
      (quest_set_slot,"qst_the_alliance",slot_quest_current_state, 1),
  ]],
  
  [anyone|other(trp_npc6), "bodo_choiceside111", [ #solveig leave
      (str_clear, s2),
    ],
    "{s2}^^I knew you would not fail me. Well, we must go to the king of West Seaxe as soon as possible!", "bodo_choiceside13", [
      (str_store_string, s2, "@--Bodo seems overcome with joy.--", color_good_news),
  ]],
  [anyone|other(trp_npc6), "bodo_choiceside112", [ #bodo
      (troop_get_slot, ":relation", "trp_npc6", slot_troop_player_relation),
      (ge, ":relation", 40),
      (str_clear, s2),
    ],
    "--His face goes from bewilderment to uncontrolled fury.--^^What? Traitor! I trusted you, I considered you a friend, a brother. Not only have you failed me, but you're encouraging our enemies. After all we've been through, Sigurd and Sven triumph. " +
    "Well, I will not stay idle. Farewell, {playername}, and hope we do not meet again... for your sake.", "bodo_choiceside14", [
      (str_store_string, s2, "@Note Bodo: With your decision to deliver the letter of the king of Asturias to the Danish, Bodo felt betrayed. The Cantabrian has left your party and threatened you with death if you return to find him."),
      (add_quest_note_from_sreg, "qst_notes_companions", 8, s2, 0),
      
      (troop_set_slot, "trp_npc6", slot_troop_occupation, 0), #bye bye bodo
      (troop_set_slot, "trp_npc6", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc6"),
  ]],
  [anyone|other(trp_npc6), "bodo_choiceside112", [ #bodo leave
      (troop_get_slot, ":relation", "trp_npc6", slot_troop_player_relation),
      (lt, ":relation", 40),
      (str_clear, s2),
    ],
    "{s2}^^What? Traitor! I trusted you. We have our differences and do not always get along, but I thought you'd honor your word. Not only have you failed me, but you're encouraging our enemies. After all we've been through, Sigurd and Sven triumph. " +
    "Well, I will not stay idle. Farewell, {playername}, and hope we do not meet again... for your sake.", "bodo_choiceside14", [
      (str_store_string, s2, "@--His face goes from bewilderment to uncontrolled fury.--", color_good_news),
      
      (troop_set_slot, "trp_npc6", slot_troop_occupation, 0), #bye bye bodo
      (troop_set_slot, "trp_npc6", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc6"),
  ]],
  #se van wessex
  [anyone|other(trp_npc12), "bodo_choiceside13", [ #asbjorn is ok
      (troop_get_slot, ":relation", "trp_npc12", slot_troop_player_relation),
      (ge, ":relation", 50),
    ],
    "As I say, the Norns weave the threads at will.", "bodo_choiceside131", [
  ]],
  [anyone|other(trp_npc12), "bodo_choiceside13", [ #asbjorn leave
      (troop_get_slot, ":relation", "trp_npc12", slot_troop_player_relation),
      (lt, ":relation", 50),
    ],
    "I guess this is farewell. I will be with my family, in Odinsve. Maybe in the future we see each other. I respect your decision, and I leave without rancor.", "bodo_choiceside131", [
      (troop_set_slot, "trp_npc12", slot_troop_occupation, 0), #bye bye bodo
      (troop_set_slot, "trp_npc12", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc12"),
  ]],
  
  [anyone|other(trp_npc15), "bodo_choiceside131", [ #agathinos is ok
      (troop_get_slot, ":relation", "trp_npc15", slot_troop_player_relation),
      (ge, ":relation", 10),
    ],
    "Well... well I am with you.", "bodo_choiceside132", [
  ]],
  [anyone|other(trp_npc15), "bodo_choiceside131", [ #agathinos leave
      (troop_get_slot, ":relation", "trp_npc15", slot_troop_player_relation),
      (lt, ":relation", 10),
    ],
    "I'm not happy here, you know. I'm leaving. I think it is time to return to Konstantinoupolis.", "bodo_choiceside132", [
      (troop_set_slot, "trp_npc15", slot_troop_occupation, 0), #bye bye bodo
      (troop_set_slot, "trp_npc15", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc15"),
  ]],
  
  [anyone|other(trp_npc11), "bodo_choiceside132", [ #solveig is ok
      (troop_get_slot, ":relation", "trp_npc11", slot_troop_player_relation),
      (ge, ":relation", 50),
    ],
    "You put me between a rock and a hard place, but I gave my word, and I will keep it. I follow you.", "bodo_choiceside15", [
  ]],
  [anyone|other(trp_npc11), "bodo_choiceside132", [ #solveig leave
      (troop_get_slot, ":relation", "trp_npc11", slot_troop_player_relation),
      (lt, ":relation", 50),
    ],
    "Sorry, but I don't fight against free men who have merely chosen to be Vikings. I said it, and I stand by it. It's time to find a new master. I hope you are treated well in West Seaxe, {reg59?my pretty:handsome}.", "bodo_choiceside15", [
      (troop_set_slot, "trp_npc11", slot_troop_occupation, 0), #bye bye bodo
      (troop_set_slot, "trp_npc11", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc11"),
  ]],
  
  #se van danish
  [anyone|other(trp_npc3), "bodo_choiceside14", [ #brunhild is ok
      (troop_get_slot, ":relation", "trp_npc3", slot_troop_player_relation),
      (ge, ":relation", 85),
    ],
    "I think you're wrong, but I'm loyal to you and follow you wherever you go.", "bodo_choiceside141", [
  ]],
  [anyone|other(trp_npc3), "bodo_choiceside14", [ #brunhild leave
      (troop_get_slot, ":relation", "trp_npc3", slot_troop_player_relation),
      (lt, ":relation", 85),
    ],
    "Our paths diverge, {playername}. Good luck. If you ever go through Friese, you might find me in my father's house... or maybe not.", "bodo_choiceside141", [
      (troop_set_slot, "trp_npc3", slot_troop_occupation, 0), #bye bye bodo
      (troop_set_slot, "trp_npc3", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc3"),
  ]],
  
  [anyone|other(trp_npc15), "bodo_choiceside141", [ #agathinos is ok
      (troop_get_slot, ":relation", "trp_npc15", slot_troop_player_relation),
      (ge, ":relation", 10),
    ],
    "Well... well I am with you.", "bodo_choiceside15", [
  ]],
  [anyone|other(trp_npc15), "bodo_choiceside141", [ #agathinos leave
      (troop_get_slot, ":relation", "trp_npc15", slot_troop_player_relation),
      (lt, ":relation", 10),
    ],
    "I'm not happy here, you know. I'm leaving. I think it is time to return to Konstantinoupolis.", "bodo_choiceside15", [
      (troop_set_slot, "trp_npc15", slot_troop_occupation, 0), #bye bye bodo
      (troop_set_slot, "trp_npc15", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc15"),
  ]],
  
  [anyone|plyr, "bodo_choiceside15", [ #
      ], "It's time to get back on track. We have a mission underway.", "close_window", [
      (quest_set_slot,"qst_sven_traitor",slot_quest_current_state, 6), #status 0
      (call_script, "script_end_quest", "qst_sven_traitor"),
      (add_xp_as_reward,2000),
      (call_script, "script_change_player_party_morale", -5),
      (finish_mission),
  ]],
  ######################
  ######conversacion bodo en campamento de bjorn mainquest
  [anyone, "bodo_danishcamp1", [ #bodo
    ],
    "Ragnar's sons are in a difficult situation. Besieged by the Saxons, they can easily be destroyed. We need to talk about this.", "bodo_danishcamp2", [
  ]],
  
  [anyone|plyr, "bodo_danishcamp2", [
      ], "That would end the Danish invasion. Then the alliance would not be necessary, right?", "bodo_danishcamp3", []],
  [anyone|plyr, "bodo_danishcamp2", [
      ], "Very well. I will listen to you.", "bodo_danishcamp3_2", []],
  
  [anyone, "bodo_danishcamp3", [ #bodo
    ],
    "Yes, in part, but Danish attacks and Vikings raids have roots deeper than this one siege. Let me explain.", "bodo_danishcamp3_2", [
  ]],
  [anyone, "bodo_danishcamp3_2", [ #bodo
    ],
    "If you remember, {playername}, my king wants to put a stop to all the Vikings raids and safeguard his kingdom. Even if the Saxons may now force the sons of Ragnar locked in Snotingaham to surrender or kill them, there would still be other sons of Ragnar and other Danish men whose greed knows no limits. " +
    "Perhaps the Saxons will get a few years of peace, adopt again old enmities with the Mercians, and forget about their alliance with the Franks and Asturians. Even so, the Danish would remain in Northhymbre, and Vikings would still infest the seas. " +
    "After a few years, another leader would raise an army and would start this raiding and piracy all over again.", "bodo_danishcamp4", [
  ]],
  [anyone|plyr, "bodo_danishcamp4", [
      (store_attribute_level,":intelligence","trp_player",ca_intelligence),
      (ge, ":intelligence", 14),
      ], "I think what you really fear is that the Saxons can do it without Asturias' help.", "bodo_danishcamp5_1", [
  ]],
  [anyone|plyr, "bodo_danishcamp4", [
      ], "I think you're exaggerating. Gaed a wyrd swa hio scel!", "bodo_danishcamp6", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone|plyr, "bodo_danishcamp4", [
      ], "The Saxons could also very well attack Northhymbre and push out the Danish.", "bodo_danishcamp5_2", []],
  [anyone|plyr, "bodo_danishcamp4", [
      ], "I think the Danish will defeat the Saxons in Snotingaham and then continue south.", "bodo_danishcamp5_3", []],
  [anyone|plyr, "bodo_danishcamp4", [
      ], "What are you getting at, Bodo?", "bodo_danishcamp6", []],
  
  [anyone, "bodo_danishcamp5_1", [ #bodo
    ],
    "You are clever, and you know me better than I thought, {playername}. My mission over the years has been to create and strengthen this alliance. Certainly, it affects me if that breaks. However, I want you to understand the full seriousness of this situation. I do not think I would exaggerate to call this a historical moment.", "bodo_danishcamp6", [
      (add_xp_as_reward,400),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
  ]],
  [anyone, "bodo_danishcamp5_2", [ #bodo
    ],
    "You've been in Danmark with me. Do you really believe your words? The Danish will send more men next year, and the year after.", "bodo_danishcamp6", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (add_xp_as_reward,100),
  ]],
  [anyone, "bodo_danishcamp5_3", [ #bodo
    ],
    "Yes, this could happen... The Danish are people who stand up to the difficulties they face.", "bodo_danishcamp6", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (add_xp_as_reward,100),
  ]],
  
  [anyone, "bodo_danishcamp6", [ #bodo
    ],
    "I ask you not to give my diplomatic letter to the Saxons just yet. First, we must resolve this siege situation, avoiding a battle if possible, because that would hurt my mission.", "bodo_danishcamp7", [
  ]],
  
  [anyone|plyr, "bodo_danishcamp7", [
      (store_attribute_level,":intelligence","trp_player",ca_intelligence),
      (ge, ":intelligence", 12),
      ], "Honestly, without reinforcements, the Danish cannot be interested in fighting right now.", "bodo_danishcamp8_1", [
  ]],
  [anyone|plyr, "bodo_danishcamp7", [
      ], "I am not sure what to do with the letter. Calm down.", "bodo_danishcamp8", []],
  [anyone|plyr, "bodo_danishcamp7", [
      ], "I'll give it to the Saxons when I see fit.", "bodo_danishcamp8_2", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone|plyr, "bodo_danishcamp7", [
      ], "I'll give it to the Danish when I see fit.", "bodo_danishcamp8_2", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  [anyone|plyr, "bodo_danishcamp7", [
      ], "Do not worry, Bodo. I will follow your advice.", "bodo_danishcamp8", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  
  [anyone, "bodo_danishcamp8_1", [ #bodo
    ],
    "Yes, I think so, too, but I wanted to talk to you now.", "bodo_danishcamp8", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (add_xp_as_reward,100),
  ]],
  
  [anyone, "bodo_danishcamp8_2", [ #bodo
    ],
    "When the time comes, we'll talk about this issue. Not now.", "bodo_danishcamp8", [
  ]],
  
  [anyone, "bodo_danishcamp8", [ #bodo
    ],
    "Well, I will not keep you any longer. Go see Bjorn Ironside Ragnarsson.", "close_window", [
      (quest_set_slot,"qst_sven_traitor",slot_quest_current_state, 21),
  ]],
  
  
  ###############conversacion companeros despues duelo y muerte de egil o reginhard
  [anyone|other(trp_npc15), "companions_despuesduelo1", [ #enginer
    ],
    "What happened was inevitable, my friend. It was him or you.", "companions_despuesduelo2", [
  ]],
  
  [anyone|other(trp_npc6), "companions_despuesduelo2", [ #bodo
    ],
    "I understand the weight you carry on your shoulders, because I just experienced the same, after the massacre on the Woden Ric. " +
    "I know no words can soothe you, but nobody expected Reginhard's betrayal. None of this is your fault.", "companions_despuesduelo3", [
  ]],
  
  [anyone|plyr, "companions_despuesduelo3", [
      ], "Thank you for your words, but do not worry. I'm fine.", "companions_despuesduelo3_1", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", 5),
      (call_script, "script_change_player_relation_with_troop", "trp_npc15", 5),
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", 5),
  ]],
  [anyone|plyr, "companions_despuesduelo3", [
      ], "He deserved to die, and I'm not sorry.", "companions_despuesduelo3_2", []],
  [anyone|plyr, "companions_despuesduelo3", [
      ], "I killed him... I do not think I can ever forgive myself. I'm a terrible person.", "companions_despuesduelo3_3", []],
  
  [anyone|other(trp_npc15), "companions_despuesduelo3_2", [ #enginer
    ],
    "It seems that we should not worry about you; you are a person without feelings.", "companions_despuesduelo3_1", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc15", -5),
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", -5),
      (call_script, "script_change_troop_renown", "trp_player", 10),
      (call_script, "script_change_player_honor", -5),
  ]],
  
  [anyone|other(trp_npc6), "companions_despuesduelo3_3", [ #enginer
    ],
    "This isn't necessary. I thought you were someone strong, with fortitude.", "companions_despuesduelo3_4", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc15", -5),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -5),
      (call_script, "script_change_troop_renown", "trp_player", -10),
  ]],
  
  [anyone|other(trp_npc3), "companions_despuesduelo3_4", [ #enginer
      (str_clear, s2),
    ],
    "{s2}^^Ignore him. He does not know how hard it can be.", "companions_despuesduelo3_1", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", 15),
      (str_store_string, s2, "@--Brunhild comes up to you and hugs you tightly.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc8), "companions_despuesduelo3_1", [ #reginhard
      (main_party_has_troop,"trp_npc8"),
      (str_clear, s2),
    ],
    "{s2}^^My God, my God, I... I'm guilty, and I don't understand why you've forgiven me. " +
    "I let Sigurd lie to me. I thought it was an opportunity to be happy with a house and a wife. So I blamed you for the death of Thiaderd, but the fault is really mine. I started it all when I betrayed him to the jarl of Kennemer. " +
    "Everything I do, I do wrong, and now Egil is dead because of me. I deserve to die. Please kill me.", "companions_despuesduelo4", [
      (str_store_string, s2, "@--His eyes are a well of sorrow, and tears ply his cheeks.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc2), "companions_despuesduelo3_1", [ #Egil
      (main_party_has_troop,"trp_npc2"),
      (str_clear, s2),
    ],
    "{s2}^^I do not understand all the tears. Reginhard betrayed us. " +
    "I trusted him. Everybody trusted him. I thought he was a good guy, and what he did was spy for Sigurd. He sold us out for a house and a woman. Reginhard was a piece of shit and deserved his death.", "companions_despuesduelo5", [
      (str_store_string, s2, "@--Egil bares his teeth. He seems angry.--", color_good_news),
  ]],
  
  [anyone, "companions_despuesduelo3_1", [ #other
    ],
    "Reginhard betrayed us. I trusted him. Everybody trusted him, but all he did was spy for Sigurd.", "companions_despuesduelo5", [
  ]],
  ###egil
  [anyone|plyr, "companions_despuesduelo5", [
      ], "True, Reginhard was a piece of shit and deserved his death.", "companions_despuesduelo5_1", [
  ]],
  [anyone|plyr, "companions_despuesduelo5", [
      ], "No, he was a desperate man who had lost everything.", "companions_despuesduelo5_2", [
  ]],
  [anyone|plyr, "companions_despuesduelo5", [
      ], "The piece of shit is you, and I want you out of my party now. Go back to your father.", "companions_despuesduelo5_3", [
      (str_clear, s2),
      (str_store_string, s2, "@Note Reginhard: Reginhard betrayed you at the Assembly, and you had to kill him in a holmgang decreed by the Assembly. " +
      "In the end, you drove Egil out of your party, offended by his insolence and disrespect."),
      (add_quest_note_from_sreg, "qst_notes_companions", 7, s2, 0),
  ]],
  
  [anyone|other(trp_npc2), "companions_despuesduelo5_1", [ #Egil
    ],
    "I'm glad you think the same. For a moment, I doubted your ability to lead us. We are traveling to a dangerous place, and we need you well. Now we can go on our way.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", 10),
      (call_script, "script_change_player_party_morale", 5),
      (call_script, "script_change_troop_renown", "trp_player", -5),
      (display_message,"@Your men think that Egil could be a good leader."),
      (change_screen_return),
      (finish_mission),
      #(change_screen_notes, 4),
  ]],
  
  [anyone|other(trp_npc2), "companions_despuesduelo5_2", [ #Egil
    ],
    "Desperate or not, he is a traitor. It is not worth spending another word on him. Let's go on our way.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", 5),
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -1),
      (change_screen_return),
      (finish_mission),
      #(change_screen_notes, 4),
  ]],
  
  [anyone|other(trp_npc2), "companions_despuesduelo5_3", [ #Egil
      (str_clear, s2),
    ],
    "{s2}^^Oh, to be sure, you won't! This is the best news I could have heard! I leave your pathetic little company to return to a true leader, a king, my father, Horik. I now leave you, save for my hope that they kill you in Englaland.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -30),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -5),
      (call_script, "script_change_player_relation_with_troop", "trp_npc15", -5),
      (str_store_string, s2, "@--He seems surprised, but the surprise is soon overtaken by intense anger.--", color_good_news),
      (call_script, "script_change_player_party_morale", -5),
      (call_script, "script_change_troop_renown", "trp_player", 5),
      (display_message,"@Your men think that you are a strong leader, but they will miss the charisma of Egil."),
      (troop_set_slot, "trp_npc2", slot_troop_occupation, 0),
      (troop_set_slot, "trp_npc2", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc2"),
      (change_screen_return),
      (finish_mission),
      #(change_screen_notes, 4),
  ]],
  
  
  
  ### reginhard
  [anyone|plyr, "companions_despuesduelo4", [
      ], "You are guilty, Reginhard. I spare your life, but get out of my sight forever.", "companions_despuesduelo4_1", [
      (str_clear, s2),
      (str_store_string, s2, "@Note Egil: Reginhard betrayed you at the Assembly, but you spared his life. However, Egil did not accept your decision, and you had to kill him in a holmgang by the laws of Thing.^" +
      "In the end, you drove Reginhard out of your party, unable to forgive his betrayal."),
      (add_quest_note_from_sreg, "qst_notes_companions", 7, s2, 0),
  ]],
  [anyone|plyr, "companions_despuesduelo4", [
      ], "Yes, you are guilty, and I'll grant your wish to die. --You kill Reginhard--.", "companions_despuesduelo4_2", [
      (str_clear, s2),
      (str_store_string, s2, "@Note Egil: Reginhard betrayed you at the Assembly, but you spared his life. However, Egil did not accept your decision, and you had to kill him in a holmgang by the laws of Thing.^" +
      "In the end, you killed Reginhard, too, unable to forgive his betrayal."),
      (add_quest_note_from_sreg, "qst_notes_companions", 7, s2, 0),
  ]],
  [anyone|plyr, "companions_despuesduelo4", [
      ], "Sigurd deceived you. It's not your fault. I have forgiven you.--.", "companions_despuesduelo4_3", [
      (str_clear, s2),
      (str_store_string, s2, "@Note Egil: Reginhard betrayed you at the Assembly, but you spared his life. However, Egil did not accept your decision, and you had to kill him in a holmgang by the laws of Thing.^" +
      "You forgave Reginhard of treason and let him remain in your company."),
      (add_quest_note_from_sreg, "qst_notes_companions", 7, s2, 0),
  ]],
  
  [anyone|other(trp_npc8), "companions_despuesduelo4_1", [ #reginhard
      (str_clear, s2),
    ],
    "Thank you for respecting my life. I understand your decision. " +
    "If I may say so, you're a Soguligr, someone worth giving material to in the sagas. I hope someday in the future we can meet as friends, forget the bad and remember all the good from the time we spent together.^^{s2}", "close_window", [
      (str_store_string, s2, "@--Reginhard gathers his things and leaves.--", color_good_news),
      (troop_set_slot, "trp_npc8", slot_troop_occupation, 0),
      (troop_set_slot, "trp_npc8", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc8"),
      (call_script, "script_change_player_party_morale", -5),
      (call_script, "script_change_troop_renown", "trp_player", -5),
      (display_message,"@Your men think that you are a weak leader who can't punish treachery."),
      (finish_mission),
      #(change_screen_notes, 4),
  ]],
  
  [anyone|other(trp_npc8), "companions_despuesduelo4_2", [ #reginhard
      (str_clear, s2),
    ],
    "{!}{s2}", "close_window", [
      (str_store_string, s2, "@--You approach Reginhard and slice deep into his neck with a knife. You watch how he collapses, losing blood, until his eyes are closed.--", color_good_news),
      (troop_set_slot, "trp_npc8", slot_troop_occupation, slto_dead),
      (remove_member_from_party, "trp_npc8"),
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", -15),
      (call_script, "script_change_player_party_morale", 10),
      (call_script, "script_change_troop_renown", "trp_player", 5),
      (display_message,"@Your men think that you are a strong leader who harshly punishes treachery."),
      (call_script, "script_change_player_honor", -5),
      (finish_mission),
      #(change_screen_notes, 4),
  ]],
  
  [anyone|other(trp_npc8), "companions_despuesduelo4_3", [ #reginhard
      (str_clear, s2),
    ],
    "{s2}^^Thank you for respecting my life and forgiving me. This will never happen again. I will be faithful to you above all men. My life belongs to you. " +
    "If I may say so, you're a Soguligr, someone worth giving material to in the sagas.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", 5),
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", 90),
      (str_store_string, s2, "@--He seems happy to hear your words.--", color_good_news),
      (call_script, "script_change_player_party_morale", -20),
      (call_script, "script_change_troop_renown", "trp_player", -10),
      (display_message,"@Your men think that you are a weak leader who allows betrayal."),
      (finish_mission),
      #(change_screen_notes, 4),
  ]],
  ###################################
  
  
  ###2 parte cuando regresa de mision en Dorestad
  [anyone|plyr, "companion_reginhard4x", [ #chief mainquest
      ], "I am a trustworthy person, as you can see. Now, where are Thiaderd and his men hiding?", "companion_reginhard43", [
  ]],
  
  [anyone, "companion_reginhard41", [
      (str_clear, s2),
    ],
    "{s2}^^I betrayed them, so I'm here drowning my sorrows in mead. " +
    "They were my brothers, my friend. I sold one of my brothers to the jarl of Kennemer for money! I sold Thiedold, our leader's brother. " +
    "Now they want to kill me, and I am awaiting my death as a betrayer. Damn that day I fell for the jarl! Damned jarl!", "companion_reginhard4", [
      (str_store_string, s2, "@--He pushes the jar aside and drops his head.--", color_good_news),
      (val_or, "$option_switches", option_1),
  ]],
  
  [anyone, "companion_reginhard42", [
    ],
    "Thiaderd? Don't you know him? I cannot describe in words what kind of a person he is. The men would die for him, it is true. " +
    "The Danish are afraid because they know that someday Thiaderd will raise an army of Frisians and throw them out of our land.", "companion_reginhard4", [
      (val_or, "$option_switches", option_2),
  ]],
  
  [anyone, "companion_reginhard43", [
    ],
    "Why? This is a secret I'm not willing to reveal.", "companion_reginhard5", [
      (assign, "$option_switches", 0),
  ]],
  
  
  [anyone|plyr, "companion_reginhard5", [ #chief mainquest
      (store_and, reg0, "$option_switches", option_1),
      (eq, reg0, 0),
      ], "Well, I wish to join them. I am a rebel!", "companion_reginhard51", [
  ]],
  
  [anyone|plyr, "companion_reginhard5", [ #chief mainquest
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 300),
      ], "I have a business proposal for Thiaderd. I'll pay 300 peningas to tell me where they are.", "companion_reginhard52", [
  ]],
  
  [anyone|plyr, "companion_reginhard5", [ #chief mainquest
      (store_skill_level, ":player_powerstrike_skill", "skl_power_strike", "trp_player"),
      (ge, ":player_powerstrike_skill", 3),
      ], "Your secrets shall be my secrets, even if I have to beat them out of you. (Power Strike)", "companion_reginhard54", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
  ]],
  
  [anyone|plyr, "companion_reginhard5", [ #chief mainquest
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (ge, ":player_persuasion_skill", 3),
      ], "If we talk to Thiaderd about this, surely they will understand and forgive you. (Persuasion)", "companion_reginhard53", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
  ]],
  
  [anyone|plyr, "companion_reginhard5", [ #chief mainquest
      (store_troop_gold, ":gold", "trp_player"),
      (le, ":gold", 300),
      ], "Well, I understand. Let me return later with more money -- 300 peningas, for example.", "close_window", [
      (quest_set_slot,"qst_kennemer_mission_2",slot_quest_current_state, 3),
  ]],
  
  [anyone, "companion_reginhard51", [
    ],
    "They do not accept anyone they do not know.", "companion_reginhard5", [
      (val_or, "$option_switches", option_1),
  ]],
  
  [anyone, "companion_reginhard52", [
    ],
    "Well, you seem to be a good person. I will take the money and join you, for I need to talk to him, too. Thiaderd is a man who values strength, so I suggest you bring your men.", "companion_recruit_backstory_response2", [
      (troop_remove_gold, "trp_player", 300),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
      (str_store_string, s20, "@{s21} seems happy."),
      (quest_set_slot,"qst_kennemer_mission_2",slot_quest_current_state, 4),
  ]],
  
  [anyone, "companion_reginhard53", [
      (str_clear, s2),
    ],
    "{s2}^^Thank you, {playername}. You are right. I need to talk to them. I will join you. Thiaderd's hideout is in the mountains in the east. Let me show you the way.", "companion_recruit_backstory_response2", [
      (str_store_string, s2, "@--He looks at you with tears in his eyes.--", color_good_news),
      (quest_set_slot,"qst_kennemer_mission_2",slot_quest_current_state, 4),
  ]],
  
  [anyone, "companion_reginhard54", [
      (str_clear, s2),
    ],
    "{s2}^^You may be a joker, {playername}, but you are right. No secrets between us! Also, I need to talk to them and tell them that the jarl lied to me. I would rather die than continue here. I will join you. Thiaderd's hideout is in the mountains in the East. Let me show you the way.", "companion_recruit_backstory_response2", [
      (str_store_string, s2, "@--He smiles.--", color_good_news),
      (quest_set_slot,"qst_kennemer_mission_2",slot_quest_current_state, 4),
  ]],
  
  [anyone|plyr, "companion_recruit_backstory_response2", [ #chief mainquest
      (check_quest_active, "qst_kennemer_mission_2"),
      (quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 4),
      ], "You're welcome! Let's get going.", "companion_recruit_signup_quest", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
      # (setup_quest_text, "qst_kennemer_mission_2"), #actualiza texto de quest?
      (str_store_string, s2, "@Reginhard has joined you. He informs you that Thiaderd and his men are at the foot of the mountains due east of Dorestad. Thiaderd's group is strong. Perhaps you ought to be accompanied by a large group of men who support you."),
      (add_quest_note_from_sreg, "qst_kennemer_mission_2", 4, s2, 0),
      #-264.106,262.426
      ##    (set_spawn_radius, 1),
      ##    (spawn_around_party,"p_destroy1","pt_thiaderd_lair"),
      ##		(assign, "$thiaderd_lair", reg0),
      (enable_party, "p_thiaderd_lair"),
      
      (call_script, "script_change_troop_renown", "trp_player", 10),
  ]],
  [anyone|plyr, "companion_recruit_backstory_response2", [ #chief mainquest
      (check_quest_active, "qst_kennemer_mission_2"),
      (quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 4),
      ], "I guess we need a guide to the hideout, but then you might abandon us there.", "companion_recruit_signup_quest", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (str_store_string, s20, "@{s21} seems unhappy."),
      (str_store_string, s2, "@Reginhard has joined you. He informs you that Thiaderd and his men are at the foot of the mountains due east of Dorestad. Thiaderd's group is strong. Perhaps you ought to be accompanied by a large group of men who support you."),
      (add_quest_note_from_sreg, "qst_kennemer_mission_2", 4, s2, 0),
      ##    (set_spawn_radius, 1),
      ##    (spawn_around_party,"p_destroy1","pt_thiaderd_lair"),
      ##		(assign, "$thiaderd_lair", reg0),
      (enable_party, "p_thiaderd_lair"),
      (call_script, "script_change_troop_renown", "trp_player", 10),
  ]],
  
  [anyone, "companion_recruit_signup_quest", [(troop_get_slot, ":signup", "$g_talk_troop", slot_troop_signup),
      (str_store_string, 5, ":signup"),
      (try_begin),
        (party_is_active,"$g_encountered_party"),
        (str_store_party_name, 20, "$g_encountered_party"),
      (try_end),
    ],
    "{!}{s5}", "companion_recruit_signup_b", [
  ]],
  ###
  ###egil
  [trp_npc2|plyr, "companion_recruit_backstory_response", [
      (eq, "$campaign_type", camp_storyline), #chief no en sandbox
      ], "My relationship with King Horik is... delicate. Taking you with me could cause me problems.", "companion_egilrefuse", []],
  
  [anyone, "companion_egilrefuse", [
    ],
    "No, you misunderstand me. I serve King Horik, and when you talked to the king, I asked him to let me go with you. " +
    "I need to make a name and gain reputation, and you need someone who can back you up with the king.", "companion_egilrefuse2", []],
  
  [anyone|plyr, "companion_egilrefuse2", [
      ], "No, there's no place for you in my party.", "companion_egilrefuse3", []],
  [anyone|plyr, "companion_egilrefuse2", [
      ], "Well, can you fight?", "companion_recruit_signup", []],
  [anyone, "companion_egilrefuse3", [
    ],
    "I see you do not understand anything, and that makes everything more difficult. King Horik wants me to go with you, and he is the king in these lands. You must obey his wishes. " +
    "While you're in Danmark, I'll be with you. If anything happens to me, you'll have trouble with King Horik.", "companion_egilrefuse4", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone|plyr, "companion_egilrefuse4", [
      ], "I see. He wants to have a spy among my men. I hope you know at least how to fight.", "companion_recruit_signup", []],
  ###
  
  
  [anyone|plyr, "companion_recruit_backstory_response", [
      (troop_get_slot, ":backstory_response", "$g_talk_troop", slot_troop_backstory_response_1),
      (str_store_string, 6, ":backstory_response")
      ], "{!}{s6}", "companion_recruit_signup", []],
  
  [anyone|plyr, "companion_recruit_backstory_response", [(neq, "$campaign_type", camp_storyline), #chief no reply in story mode
      (troop_get_slot, ":backstory_response", "$g_talk_troop", slot_troop_backstory_response_2),
      (str_store_string, 7, ":backstory_response")
      ],  "{!}{s7}", "close_window", [
  ]],
  
  [anyone, "companion_recruit_signup", [(troop_get_slot, ":signup", "$g_talk_troop", slot_troop_signup),
      (str_store_string, 5, ":signup"),
      (str_store_party_name, 20, "$g_encountered_party"),
      
    ],
    "{!}{s5}", "companion_recruit_signup_b", []],
  
  
  #mainquest chief Brunhild
  [anyone, "companion_recruit_signup_b", [
      (check_quest_active,"qst_getting_ship"),
      (eq, "$g_talk_troop", "trp_npc3"),
      (troop_get_slot, ":signup", "$g_talk_troop", slot_troop_signup_2),
      
      (str_store_string, 5, ":signup"),
      (try_begin),
        (party_is_active,"$g_encountered_party"),
        (str_store_party_name, 20, "$g_encountered_party"),
      (try_end),
    ],
    "{!}{s5}", "companion_recruit_signup_responsebrunhild", [
      ################# Space for companions in storyline
      (try_begin),
        (eq, "$campaign_type", camp_storyline),
        (neg|hero_can_join, "p_main_party"),
        (call_script, "script_game_get_party_companion_limit"),
        (assign, ":party_size_limit", reg0),
        (party_get_num_companions, ":num_men", "p_main_party"),
        (store_sub, ":difference", ":num_men", ":party_size_limit"),
        (try_begin),
          (gt, ":difference", 0),
          (assign, ":num_troops", ":difference"),
          (try_for_range, ":unused", 0, ":num_troops"),
            (call_script, "script_cf_party_remove_random_regular_troop", "p_main_party"),
          (try_end),
        (try_end),
      (try_end),
      ################
  ]],

  [anyone, "companion_recruit_signup_b", [
      (troop_get_slot, ":signup", "$g_talk_troop", slot_troop_signup_2),
      
      (str_store_string, 5, ":signup"),
      (try_begin),
        (party_is_active,"$g_encountered_party"),
        (str_store_party_name, 20, "$g_encountered_party"),
      (try_end),
    ],
    "{!}{s5}", "companion_recruit_signup_response", [
      ################# Space for companions in storyline
      (try_begin),
        (eq, "$campaign_type", camp_storyline),
        (neg|hero_can_join, "p_main_party"),
        (call_script, "script_game_get_party_companion_limit"),
        (assign, ":party_size_limit", reg0),
        (party_get_num_companions, ":num_men", "p_main_party"),
        (store_sub, ":difference", ":num_men", ":party_size_limit"),
        (try_begin),
          (gt, ":difference", 0),
          (assign, ":num_troops", ":difference"),
          (try_for_range, ":unused", 0, ":num_troops"),
            (call_script, "script_cf_party_remove_random_regular_troop", "p_main_party"),
          (try_end),
        (try_end),
      (try_end),
      ################
    ]],
    
  ###mainquest Brunhild
  [anyone|plyr, "companion_recruit_signup_responsebrunhild", [
      (hero_can_join, "p_main_party"),
      (troop_get_slot, ":signup_response", "$g_talk_troop", slot_troop_signup_response_1),
      (str_store_string, 6, ":signup_response")
      ], "Your father wants you as far away as possible from the jarl, and I understand why. You are welcome.", "companion_recruit_payment", [
      (quest_set_slot,"qst_getting_ship",slot_quest_current_state, 2),
  ]],
  [anyone|plyr, "companion_recruit_signup_responsebrunhild", [(neg|hero_can_join, "p_main_party"),], "Unfortunately, I can't take on any more hands in my party right now.", "close_window", [
  ]],
  ###
  [anyone|plyr, "companion_recruit_signup_response", [(neg|hero_can_join, "p_main_party"),], "Unfortunately, I can't take on any more hands in my party right now.", "close_window", [
  ]],
  
  [anyone|plyr, "companion_recruit_signup_response", [
      (hero_can_join, "p_main_party"),
      (troop_get_slot, ":signup_response", "$g_talk_troop", slot_troop_signup_response_1),
      (str_store_string, 6, ":signup_response")
      ], "{!}{s6}", "companion_recruit_payment", []],
  
  [anyone|plyr, "companion_recruit_signup_response", [
      (neq, "$campaign_type", camp_storyline), #no in storyline mode chief
      (hero_can_join, "p_main_party"),
      (troop_get_slot, ":signup_response", "$g_talk_troop", slot_troop_signup_response_2),
      (str_store_string, 7, ":signup_response")
      ],  "{!}{s7}", "close_window", [
  ]],
  
  [anyone|auto_proceed, "companion_recruit_payment", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_payment_request, 0),
    ],
    ".", "companion_recruit_signup_confirm", []],
  
  [anyone, "companion_recruit_payment", [
      (troop_get_slot, ":amount_requested", "$g_talk_troop", slot_troop_payment_request),#
      (assign, reg3, ":amount_requested"),
      (store_sub, ":npc_offset", "$g_talk_troop", "trp_npc1"),
      (store_add, ":dialog_line", "str_npc1_payment", ":npc_offset"),
      (str_store_string, s5, ":dialog_line"),
      (try_begin),
        (party_is_active,"$g_encountered_party"),
        (str_store_party_name, s20, "$g_encountered_party"),
      (try_end),
    ],
    "{!}{s5}", "companion_recruit_payment_response", []],
  
  [anyone|plyr, "companion_recruit_payment_response", [
      (hero_can_join, "p_main_party"),
      (troop_get_slot, ":amount_requested", "$g_talk_troop", slot_troop_payment_request),#
      (store_troop_gold, ":gold", "trp_player"),#
      (ge, ":gold", ":amount_requested"),#
      (assign, reg3, ":amount_requested"),
      (store_sub, ":npc_offset", "$g_talk_troop", "trp_npc1"),
      (store_add, ":dialog_line", "str_npc1_payment_response", ":npc_offset"),
      (str_store_string, s6, ":dialog_line"),
      ], "{!}{s6}", "companion_recruit_signup_confirm", [
      (troop_get_slot, ":amount_requested", "$g_talk_troop", slot_troop_payment_request),#
      (gt, ":amount_requested", 0),#
      (troop_remove_gold, "trp_player", ":amount_requested"),  #
      (troop_set_slot, "$g_talk_troop", slot_troop_payment_request, 0),#
  ]],
  
  [anyone|plyr, "companion_recruit_payment_response", [
      (troop_get_slot, ":signup_response", "$g_talk_troop", slot_troop_signup_response_2),
      (str_store_string, s7, ":signup_response")
      ],  "Sorry. I can't afford that at the moment.", "close_window", [
  ]],
  
  [anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
      (store_current_scene,":current_scene"),
      (this_or_next|eq,":current_scene","scn_celidon_forest"), #Dwywei
      (this_or_next|eq,":current_scene","scn_hadrian_wall1"), #Caio
      (eq, "$talk_context", tc_tavern_talk),
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
      (troop_slot_eq, "$g_talk_troop", slot_troop_met_previously, 1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, 0),
    ],
    "We meet again.", "companion_recruit_meet_again", [
      (troop_set_slot, "$g_talk_troop", slot_troop_turned_down_twice, 1),
  ]],
  
  [anyone|plyr, "companion_recruit_meet_again", [
      #					(store_current_scene,":current_scene"),
      #                   (this_or_next|eq,":current_scene","scn_celidon_forest"), #Dwywei
      #					(this_or_next|eq,":current_scene","scn_hadrian_wall1"), #Caio
      #					(eq, "$talk_context", tc_tavern_talk),
      ], "So... What have you been doing since our last encounter?", "companion_recruit_backstory_delayed", []],
  
  [anyone|plyr, "companion_recruit_meet_again", [
      ],  "Good day to you.", "close_window", [
  ]],
  
  
  [anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
      (troop_slot_eq, "$g_talk_troop", slot_troop_met_previously, 0),
      (troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, 0),
    ],
    "Yes?", "companion_recruit_secondchance", [
      (troop_set_slot, "$g_talk_troop", slot_troop_turned_down_twice, 1),
  ]],
  
  
  [anyone|plyr, "companion_recruit_secondchance", [
      ], "My apologies if I was rude, earlier. What was your story again?", "companion_recruit_backstory_b", []],
  
  [anyone|plyr, "companion_recruit_secondchance", [
      ],  "Never mind.", "close_window", [
  ]],
  
  [anyone, "companion_recruit_backstory_delayed",
    [(troop_get_slot, ":backstory_delayed", "$g_talk_troop", slot_troop_backstory_delayed),
      (str_store_string, 5, ":backstory_delayed")
    ],
    "{!}{s5}", "companion_recruit_backstory_delayed_response", []],
  
  [anyone|plyr, "companion_recruit_backstory_delayed_response", [
      ], "I might be able to use you in my company.", "companion_recruit_signup_b", [
  ]],
  
  [anyone|plyr, "companion_recruit_backstory_delayed_response", [
      ],  "I'll let you know if I hear of anything.", "close_window", [
  ]],
  
  [anyone, "companion_recruit_signup_confirm", [], "Good! Give me a few moments to prepare and I'll be ready to move.", "close_window", [
      (call_script, "script_recruit_troop_as_companion", "$g_talk_troop"),
      (try_begin),
        (eq, "$campaign_type", camp_storyline),
        (call_script, "script_change_troop_renown", "trp_player", 10),
      (try_end),
    ]],
  
  
  
  ### Rehire dialogues
  [anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, pp_history_indeterminate),
      
      (troop_get_slot, ":prison_center", "$g_talk_troop", slot_troop_prisoner_of_party),
      (lt, ":prison_center", centers_begin),
    ],
    "My offer to rejoin you still stands, if you need me.", "companion_rehire", []],
  
  ### If the companion and the player were separated in battle
  [anyone, "start",
    [
      (is_between, "$g_talk_troop", companions_begin, companions_end),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, pp_history_scattered),
      
      (this_or_next|eq, "$talk_context", tc_hero_freed),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      
      (neq, "$talk_context", tc_prison_break),
      
      (assign, ":battle_fate", "str_battle_fate_1"),
      (store_random_in_range, ":fate_roll", 0, 5),
      (val_add, ":battle_fate", ":fate_roll"),
      (str_store_string, s6, ":battle_fate"),
      (troop_get_slot, ":honorific", "$g_talk_troop", slot_troop_honorific),
      (str_store_string, s5, ":honorific"),
    ],
    "It is good to see you alive, {s5}! {s6}, and I did not know whether you had been captured, or slain, or got away. I've been roaming around since then, looking for you. Shall I get my gear together and rejoin your company?","companion_rehire",
    [
      (troop_set_slot, "$g_talk_troop", slot_troop_playerparty_history, pp_history_indeterminate),
      (troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, -1),
  ]],
  
  [anyone|plyr,"start",
    [
      (is_between, "$g_talk_troop", companions_begin, companions_end),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, pp_history_scattered),
      
      (troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      
      (neq, "$talk_context", tc_prison_break),
      
      (assign, ":battle_fate", "str_battle_fate_1"),
      (store_random_in_range, ":fate_roll", 0, 5),
      (val_add, ":battle_fate", ":fate_roll"),
      (str_store_string, s6, ":battle_fate"),
      (troop_get_slot, ":honorific", "$g_talk_troop", slot_troop_honorific),
      (str_store_string, s5, ":honorific"),
    ],
    "I've come to break you out of here.", "companion_prison_break_chains",[]],
  
  [anyone,"companion_prison_break_chains", [],
    "Thank the heavens you came! However, I'm not going anywhere with these chains on my legs. You'll need to get the key away from the guard somehow.", "close_window",[]],
  
  
  
  
  ### If the player and the companion parted on bad terms
  [anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
      (troop_slot_eq, "$g_talk_troop", slot_troop_turned_down_twice, 0),
      (troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, pp_history_quit),
      (troop_get_slot, ":speech", "$g_talk_troop", slot_troop_rehire_speech),
      (str_store_string, 5, ":speech"),
    ],
    "{!}{s5}", "companion_rehire", [
      (troop_set_slot, "$g_talk_troop", slot_troop_playerparty_history, pp_history_indeterminate),
  ]],
  
  
  ###If the player and the companion parted on good terms
  #mainquest brunhild
  [anyone, "start", [
      (is_between, "$g_talk_troop", companions_begin, companions_end),
      #   (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
      (check_quest_active,"qst_getting_ship"),
      (eq, "$g_talk_troop", "trp_npc3"),
    ],
    "I look forward to traveling with you.",
    "close_window", [
  ]],
  ###
  [anyone, "start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, 0),
      (troop_slot_eq, "$g_talk_troop", slot_troop_playerparty_history, pp_history_dismissed),
      (troop_get_slot, ":honorific", "$g_talk_troop", slot_troop_honorific),
      (str_store_string, 21, ":honorific"),
      (troop_get_slot, ":speech", "$g_talk_troop", slot_troop_backstory_delayed),
      (str_store_string, 5, ":speech"),
    ],
    "It is good to see you, {s21}! To tell you the truth, I had hoped to run into you.",
    "companion_was_dismissed", [
      (troop_set_slot, "$g_talk_troop", slot_troop_playerparty_history, pp_history_indeterminate),
  ]],
  
  [anyone, "companion_was_dismissed", [
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (troop_get_slot, ":speech", "$g_talk_troop", slot_troop_backstory_delayed),
      (str_store_string, 5, ":speech"),
    ],
    "{s5}. Would you want me to rejoin your shield wall?", "companion_rehire", [
  ]],
  
  
  [anyone|plyr, "companion_rehire",
    [
      (hero_can_join, "p_main_party"),
      ], "Welcome back, my friend!", "companion_recruit_signup_confirm", []],
  
  [anyone|plyr, "companion_rehire",
    [],
    "Sorry, I can't take on anyone else right now.", "companion_rehire_refused", []],
  
  [anyone, "companion_rehire_refused", [], "Well... Look me up if you change your mind, eh?", "close_window",
    [
      (troop_get_slot, ":current_town_no", "$g_talk_troop", slot_troop_cur_center),
      
      (try_begin),
        (neg|is_between, ":current_town_no", towns_begin, towns_end),
        
        (store_random_in_range, ":town_no", towns_begin, towns_end),
        (troop_set_slot, "$g_talk_troop", slot_troop_cur_center, ":town_no"),
        
        (try_begin),
          (ge, "$cheat_mode", 1),
          (assign, reg1, ":current_town_no"),
          (str_store_party_name, s7, ":town_no"),
          (display_message, "@{!}current town was {reg1}, now moved to {s7}"),
        (try_end),
      (try_end),
  ]],
  
  #Default dialog added - for rehire
  #######
  
  [anyone, "start", [
      (is_between, "$g_talk_troop", companions_begin, companions_end),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (store_faction_of_troop, ":faction","$g_talk_troop"),
      (neg|is_between, ":faction", kingdoms_begin, kingdoms_end),
      (troop_get_slot, ":prison_center", "$g_talk_troop", slot_troop_prisoner_of_party),
      (lt, ":prison_center", centers_begin),
    ], "So... Do you want me back yet?", "companion_rehire",
    []],
  #Ministerial issues
  
  
  
  
  [anyone, "minister_issues",
    [
      (check_quest_active, "qst_consult_with_minister"),
      (eq, "$g_minister_notification_quest", "qst_resolve_dispute"),
      
      (setup_quest_text,"qst_resolve_dispute"),
      
      (quest_get_slot, ":lord_1", "qst_resolve_dispute", slot_quest_target_troop),
      (str_store_troop_name, s11, ":lord_1"),
      
      (quest_get_slot, ":lord_2", "qst_resolve_dispute", slot_quest_object_troop),
      (str_store_troop_name, s12, ":lord_2"),
      
      (str_store_string, s2, "str_resolve_the_dispute_between_s11_and_s12"),
      (call_script, "script_start_quest", "qst_resolve_dispute", -1),
      (quest_set_slot, "qst_resolve_dispute", slot_quest_expiration_days, 30),
      (quest_set_slot, "qst_resolve_dispute", slot_quest_giver_troop, "$g_player_minister"),
      (quest_set_slot, "qst_resolve_dispute", slot_quest_target_state, 0),
      (quest_set_slot, "qst_resolve_dispute", slot_quest_object_state, 0),
      
      (quest_get_slot, ":lord_1", "qst_resolve_dispute", slot_quest_target_troop), #this block just to check if the slots work
      (str_store_troop_name, s11, ":lord_1"),
      (quest_get_slot, ":lord_2", "qst_resolve_dispute", slot_quest_object_troop),
      (str_store_troop_name, s12, ":lord_2"),
      
    ],
    "There is a matter that needs your attention. The quarrel between {s11} and {s12} has escalated to the point where it has become unseemly. If you do intervene, you risk offending one of the lords. However, if you do nothing, you risk appearing weak. Such are the burdens of kingship, {reg59?my lady:sire}.", "minister_pretalk",
    [
      (call_script, "script_end_quest", "qst_consult_with_minister"),
  ]],
  
  [anyone, "minister_issues",
    [
      (assign, "$g_center_taken_by_player_faction", -1),
      (try_for_range, ":center_no", centers_begin, centers_end),
        (eq, "$g_center_taken_by_player_faction", -1),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (eq, ":center_faction", "fac_player_supporters_faction"),
        (neg|party_slot_ge, ":center_no", slot_town_lord, 0),
        (assign, "$g_center_taken_by_player_faction", ":center_no"),
      (try_end),
      (is_between, "$g_center_taken_by_player_faction", centers_begin, centers_end),
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
    ],
    "{s1} currently does not have a lord. You may wish to keep it this way, as lords will sometimes gravitate towards lieges who have land to offer, but for the time being, no one is collecting any of its rents.", "minister_talk",
    []],
  
  [anyone, "minister_issues",
    [
      (neg|is_between, "$g_player_minister", active_npcs_begin, kingdom_ladies_end),
    ],
    "At this point, there are no particularly urgent matters that need your attention. I should point out though, sire, that I am not very skilled in the ways of politics, and that I am anxious to return to private life. If you wish to issue any but the most basic directives, I suggest appointing a trusted companion in my stead. In the meantime, is there anything you wish done?", "minister_talk",[]],
  
  [anyone, "minister_issues",
    [
      (eq, 1, 0),
    ],
    "{!}[Should not appear - there to prevent error related to center_captured_lord_advice]", "center_captured_lord_advice",[]],
  
  [anyone, "minister_issues",
    [
      (lt, "$player_right_to_rule", 30),
    ],
    "If I may offer you a world of advice, my {reg59?lady:lord}, it seems that your right to rule as an independent monarch is not sufficiently recognized, and this may bring us problems further down the road. It may be advisable to find another kingdom with whom you have shared interests and seek its recognition, to establish yourself as an equal with the Northlands's other kings.", "minister_talk",[]],
  
  
  [anyone, "minister_issues",
    [],
    "At this point, there are no particularly urgent matters that need your attention. Is there anything you wish done?", "minister_talk",[]],
  
  [anyone, "minister_pretalk",
    [],
    "Is there anything you wish done?", "minister_talk",
    []],
  
  [anyone|plyr,"minister_talk",
    [
      (is_between, "$g_player_minister", active_npcs_begin, kingdom_ladies_end),
    ],
    "Do you have any ideas on how to strengthen our kingdom's unity?", "combined_political_quests",[
      (call_script, "script_get_political_quest", "$g_talk_troop"),
      (assign, "$political_quest_found", reg0),
      (assign, "$political_quest_target_troop", reg1),
      (assign, "$political_quest_object_troop", reg2),
      
  ]],
  
  [anyone|plyr,"minister_talk", [
      (check_quest_active, "qst_offer_gift"),
      (quest_slot_eq, "qst_offer_gift", slot_quest_giver_troop, "$g_talk_troop"),
      
      (quest_get_slot, ":target_troop", "qst_offer_gift", slot_quest_target_troop),
      (str_store_troop_name, s4, ":target_troop"),
      (player_has_item, "itm_vc_furs"),
      (player_has_item, "itm_jewelry"),
    ],
    "I have acquired everything for {s4}'s gift.", "offer_gift_quest_complete",[
  ]],
  
  [anyone,"offer_gift_quest_complete", [
      (quest_get_slot, ":target_troop", "qst_offer_gift", slot_quest_target_troop),
      (troop_get_type, reg4, ":target_troop"),
      (val_mod, reg4, 2),
    ],
    "Ah, let me take those. I hope that this will mend the quarrel between you two. You may wish to speak to {reg4?her:him}, and see if I had any success.", "close_window",[
      (quest_set_slot, "qst_offer_gift", slot_quest_current_state, 2),
      (quest_set_slot, "qst_offer_gift", slot_quest_expiration_days, 365),
      (troop_remove_item, "trp_player", "itm_vc_furs"),
      (troop_remove_item, "trp_player", "itm_jewelry"),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  [anyone|plyr,"minister_talk",
    [
      (assign, "$political_quest_to_cancel", -1),
      (try_begin),
        (check_quest_active, "qst_offer_gift"),
        (quest_slot_eq, "qst_offer_gift", slot_quest_giver_troop, "$g_talk_troop"),
        (assign, "$political_quest_to_cancel", "qst_offer_gift"),
        (str_store_string, s10, "str_offer_gift_description"),
      (else_try),
        (check_quest_active, "qst_resolve_dispute"),
        (quest_slot_eq, "qst_resolve_dispute", slot_quest_giver_troop, "$g_talk_troop"),
        (assign, "$political_quest_to_cancel", "qst_resolve_dispute"),
        (str_store_string, s10, "str_resolve_dispute_description"),
      (try_end),
      (gt, "$political_quest_to_cancel", 0),
    ],
    "Let's abandon our plan to {s10}.", "minister_cancel_political_quest",[
  ]],
  
  [anyone,"minister_cancel_political_quest",
    [],
    "Are you sure you want to drop that idea?", "minister_cancel_political_quest_confirm",[
  ]],
  
  [anyone|plyr,"minister_cancel_political_quest_confirm",
    [],
    "Yes, I am sure. Let's abandon that idea.", "minister_pretalk",[
      (call_script, "script_abort_quest", "$political_quest_to_cancel", 1),
  ]],
  
  [anyone|plyr,"minister_cancel_political_quest_confirm",
    [],
    "Actually, never mind.", "minister_pretalk",[
  ]],
  
  
  
  [anyone|plyr, "minister_talk",
    [
      (is_between, "$g_player_minister", active_npcs_begin, kingdom_ladies_end),
    ],
    "I wish to dispatch an emissary.", "minister_diplomatic_kingdoms",
    []],
  
  [anyone|plyr, "minister_talk",
    [
      (is_between, "$g_player_minister", active_npcs_begin, kingdom_ladies_end),
    ],
    "I wish to indict a disloyal vassal for treason.", "minister_indict",
    []],
  
  [anyone|plyr, "minister_talk",
    [
      (faction_get_slot, ":current_marshal", "$players_kingdom", slot_faction_marshal),
      (ge, ":current_marshal", 0),
      (try_begin),
        (gt, ":current_marshal", 0),
        (str_store_troop_name, s4, ":current_marshal"),
      (else_try),
        (str_store_string, s4, "str_myself"),
      (try_end),
    ],
    "I wish to replace {s4} as marshal.", "minister_change_marshal",
    []],
  
  [anyone|plyr, "minister_talk",
    [
      (faction_slot_eq,  "$players_kingdom", slot_faction_marshal, -1),
    ],
    "I wish to appoint a new marshal.", "minister_change_marshal",
    []],
  
  [anyone, "minister_change_marshal",
    [
      (store_current_hours, ":hours"),
      (val_sub, ":hours", "$g_player_faction_last_marshal_appointment"),
      (lt, ":hours", 48),
    ],
    "You have just made such an appointment, {reg59?my lady:my lord}. If you countermand your decree so soon, there will be great confusion. We will need to wait a few days.", "minister_pretalk",
    []],
  
  ####
  [anyone|plyr, "minister_talk", #chief minister redward kingdom screen
    [(eq,"$premio_minister",0),
    ],
    "I want to reward you for your work as my advisor.", "minister_premio1",
    []],
  [anyone, "minister_premio1",
    [],
    "Thank you, {reg59?my lady:my lord}. What do you have in mind?", "minister_premio2",
    []],
  [anyone|plyr, "minister_premio2", #chief minister redward kingdom screen
    [		(store_troop_gold,":cur_wealth","trp_player"),
      (ge,":cur_wealth",2500),
    ],
    "These bracelets and rings worth 2500 peningas.", "minister_premio3",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (troop_remove_gold,"trp_player",2500),
  ]],
  [anyone|plyr, "minister_premio2", #chief minister redward kingdom screen
    [		(store_troop_gold,":cur_wealth","trp_player"),
      (ge,":cur_wealth",5000),
    ],
    "I'll buy some slaves worth 5,000 peningas to help you with your tasks.", "minister_premio3",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 8),
      (call_script, "script_change_player_honor", -2),
      (troop_remove_gold,"trp_player",5000),
  ]],
  [anyone|plyr, "minister_premio2", #chief minister redward kingdom screen
    [		(store_troop_gold,":cur_wealth","trp_player"),
      (ge,":cur_wealth",10000),
    ],
    "A beautiful estate valued at 10,000 peningas with a tenant who will pay you rent.", "minister_premio3",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 12),
      (troop_remove_gold,"trp_player",10000),
  ]],
  [anyone|plyr, "minister_premio2", #chief minister redward kingdom screen
    [
    ],
    "Oh, nothing. Let's get back to our tasks.", "minister_pretalk",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -2),
  ]],
  [anyone, "minister_premio3",
    [],
    "Thank you so much, {reg59?my lady:my lord}. I am happy to be at your service and now will be even more zealous in my duties.", "minister_pretalk",
    [ (assign, "$premio_minister", 1), #premio a ministro
  ]],
  
  ###############
  [anyone|plyr,"minister_talk",[
      (faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
      (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
      ], "Give me a report on the kingdom.", "minister_kingdom_report1",[
  ]],
  
  [anyone, "minister_kingdom_report1",
    [
    ],
    "But of course, {reg59?my lady:sire}. I have it ready to present.", "close_window",[
      ##                (is_camera_in_first_person),
      ##                (set_camera_in_first_person, 0),
      (set_fixed_point_multiplier, 100),
      (get_player_agent_no, ":player_agent"),
      (agent_get_position, pos1, ":player_agent"),
      (position_rotate_z, pos1, -70),
      (agent_set_position, ":player_agent", pos1),
      (assign, "$g_no_some_options", 1),  #usable, always finish in 0
      (assign, "$factionorders_type", factionorders_no),
      (start_presentation, "prsnt_faction_screen_main"),
  ]],
  #####send a menssage using messenger system
  [anyone|plyr,"minister_talk",[(eq,"$message_sent",0),
      ], "I want to send a message.", "minister_messenger_system1",[
  ]],
  
  [anyone, "minister_messenger_system1",
    [
    ],
    "Certainly, {reg59?my lady:my lord}. We have a messenger ready at your disposal. To whom would you like to send the message? I've heard the following are nearby:", "minister_messenger_system2",[
  ]],
  
  [anyone|plyr|repeat_for_parties, "minister_messenger_system2", #lord reino player
    [
      (store_repeat_object, ":party_no"),
      (store_faction_of_party, ":party_faction", ":party_no"),
      (party_is_active, ":party_no"),
      (party_get_slot, ":party_type",":party_no",slot_party_type),
      (eq, ":party_type", spt_kingdom_hero_party),
      (party_get_battle_opponent, ":opponent",":party_no"),
      (lt, ":opponent", 0), #party is not itself involved in a battle
      (party_get_attached_to, ":attached_to",":party_no"),
      (lt, ":attached_to", 0), #party is not attached to another party in battle
      (get_party_ai_behavior, ":behavior", ":party_no"),
      (neq, ":behavior", 8),#party is not in a town/castle
      (neq, ":party_no","p_main_party"),
      (store_distance_to_party_from_party, ":cur_distance", ":party_no", "p_main_party"),
      (lt, ":cur_distance", 90),  #party is within distance   #more distance for kingdom messengers
      (eq, ":party_faction", "fac_player_supporters_faction"),
      (str_store_party_name, s1, ":party_no"),
    ],"{!}{s1}.", "minister_messenger_system3",
    [
      (store_repeat_object, "$message_target"),
      (assign, "$message_target_type", 1),  # 1 player's kingdom lord , 2 no player's kingdom lord , 3 King of other kingdom
  ]],
  
  
  [anyone|plyr|repeat_for_parties, "minister_messenger_system2", #lord de otro reino
    [
      (store_repeat_object, ":party_no"),
      (store_faction_of_party, ":party_faction", ":party_no"),
      (party_is_active, ":party_no"),
      (party_get_slot, ":party_type",":party_no",slot_party_type),
      (eq, ":party_type", spt_kingdom_hero_party),
      (party_get_battle_opponent, ":opponent",":party_no"),
      (lt, ":opponent", 0), #party is not itself involved in a battle
      (party_get_attached_to, ":attached_to",":party_no"),
      (lt, ":attached_to", 0), #party is not attached to another party in battle
      #(get_party_ai_behavior, ":behavior", ":party_no"),
      #(neq, ":behavior", 8),#party is not in a town/castle
      (neq, ":party_no","p_main_party"),
      (store_distance_to_party_from_party, ":cur_distance", ":party_no", "p_main_party"),
      (lt, ":cur_distance", 140),  #party is within distance  #more distance for kingdom messengers
      (neq, ":party_faction", "fac_player_supporters_faction"),
      (party_stack_get_troop_id, ":leader", ":party_no", 0),
      (neg|is_between, ":leader", kings_begin, kings_end),
      (str_store_party_name, s1, ":party_no"),
    ],"{!}{s1}.", "minister_messenger_system3",
    [
      (store_repeat_object, "$message_target"),
      (assign, "$message_target_type", 2),  # 1 player's kingdom lord , 2 no player's kingdom lord , 3 King of other kingdom
  ]],
  
  [anyone|plyr|repeat_for_parties, "minister_messenger_system2", #king
    [
      (store_repeat_object, ":party_no"),
      (store_faction_of_party, ":party_faction", ":party_no"),
      (party_is_active, ":party_no"),
      (party_get_slot, ":party_type",":party_no",slot_party_type),
      (eq, ":party_type", spt_kingdom_hero_party),
      (party_get_battle_opponent, ":opponent",":party_no"),
      (lt, ":opponent", 0), #party is not itself involved in a battle
      (party_get_attached_to, ":attached_to",":party_no"),
      (lt, ":attached_to", 0), #party is not attached to another party in battle
      #(get_party_ai_behavior, ":behavior", ":party_no"),
      #(neq, ":behavior", 8),#party is not in a town/castle
      (neq, ":party_no","p_main_party"),
      (store_distance_to_party_from_party, ":cur_distance", ":party_no", "p_main_party"),
      (lt, ":cur_distance", 240),  #party is within distance  #more distance for kingdom messengers
      (neq, ":party_faction", "fac_player_supporters_faction"),
      (party_stack_get_troop_id, ":leader", ":party_no", 0),
      (is_between, ":leader", kings_begin, kings_end),
      (str_store_party_name, s1, ":party_no"),
    ],"{!}{s1}.", "minister_messenger_system3",
    [
      (store_repeat_object, "$message_target"),
      (assign, "$message_target_type", 3),  # 1 player's kingdom lord , 2 no player's kingdom lord , 3 King of other kingdom
  ]],
  
  
  [anyone|plyr, "minister_messenger_system2",
    [],"No, none of those. Later perhaps.", "minister_pretalk",
    []],
  
  
  [anyone, "minister_messenger_system3",
    [
      (str_store_party_name, s4, "$message_target"),
    ],
    "Very well. What do you wish to say?", "close_window",[
      (assign, "$message_type", no_menssage_choosed),
      (assign,"$message_sent",0), #message sent
      # (finish_mission),
      (set_fixed_point_multiplier, 100),
      (get_player_agent_no, ":player_agent"),
      (agent_get_position, pos1, ":player_agent"),
      (position_rotate_z, pos1, -70),
      (agent_set_position, ":player_agent", pos1),
      (start_presentation, "prsnt_messenger_system"),
  ]],
  ##############
  ###kingdom storage
  [anyone|plyr, "minister_talk",
    [
    ],
    "Let me check my kingdom stock.", "minister_pretalk",[
      (change_screen_loot, "trp_household_possessions"),
  ]],
  
  #######tax rate kingdom
  [anyone|plyr, "minister_talk",
    [
    ],
    "I wish to change the tax rate in my lands.", "minister_taxrate",
    []],
  [anyone, "minister_taxrate",
    [
    ],
    "{reg59?Lady:Lord}, remember that a high level of taxes generates distrust and can cause riots, while a low rate may deplete the treasury. " +
    "What would you like to do?", "minister_taxrate2",
    []],
  #high = -5 relation each week with center. -10 relation = riots.
  #low = +1 relation each week but low income
  #normal = -1 relation each week. Nobody likes pay taxes, no?
  
  [anyone|plyr, "minister_taxrate2",
    [
      #    (neq, "$tax_rate", 2),
    ],
    "Set a high rate.", "minister_taxrate3",
    [
      (str_store_string, s11, "@high"),
      (assign, "$tax_rate", 2),
  ]],
  
  [anyone|plyr, "minister_taxrate2",
    [
      #    (neq, "$tax_rate", 1),
    ],
    "Set a low rate.", "minister_taxrate3",
    [
      (str_store_string, s11, "@low"),
      (assign, "$tax_rate", 1),
  ]],
  [anyone|plyr, "minister_taxrate2",
    [
      #   (neq, "$tax_rate", 0),
    ],
    "Set a medium rate.", "minister_taxrate3",
    [
      (str_store_string, s11, "@normal"),
      (assign, "$tax_rate", 0),
  ]],
  
  [anyone|plyr, "minister_taxrate2",
    [
    ],
    "Leave it as is.", "minister_pretalk",
    []],
  
  [anyone, "minister_taxrate3",
    [
    ],
    "The tax rate is {s11} now in all of your fiefs.", "minister_pretalk",
    [(try_for_range, ":center_no", centers_begin, centers_end),
        (party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
        (party_set_slot, ":center_no", slot_center_tax_rate, "$tax_rate"),
      (try_end),
  ]],
  
  ####kingdom screen control of tax
  ####
  [anyone|plyr, "minister_talk", #Interesing for players with many places
    [(eq, "$control_tax", 0),
    ],
    "I want you to hire personnel to eradicate tax losses. Make sure they intimidate even you a bit.", "minister_controltax",
    []],
  
  [anyone, "minister_controltax",
    [],
    "To hire and keep this staff will cost 3,000 peningas per week. " +
    "{reg59?My lady:My lord}, you must choose whether the new staff expense is worth the additional money they will collect for you.", "minister_controltax2",
    []],
  [anyone|plyr, "minister_controltax2", #
    [		(store_troop_gold,":cur_wealth","trp_player"),
      (ge,":cur_wealth",3000),
    ],
    "I have decided. Hire the staff.", "minister_controltax3",
    [(assign, "$control_tax", 1),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone|plyr, "minister_controltax2", #
    [
    ],
    "Very well, I've thought more about it. Let's avoid the new weekly expenditure, as it's too high...", "minister_pretalk",
    [
  ]],
  [anyone, "minister_controltax3",
    [],
    "Well, {reg59?my lady:sire}. From now on, your income taxes will be higher. I guarantee it.", "minister_pretalk",
    [
  ]],
  ###
  [anyone|plyr, "minister_talk", #Interesing for players with many places
    [(eq, "$control_tax", 1),
    ],
    "Dismiss the staff working on tax loss mitigation.", "minister_nocontroltax",
    []],
  [anyone, "minister_nocontroltax",
    [],
    "Dismissing this staff means tax revenues will be reduced. Are you sure?", "minister_nocontroltax2",
    []],
  [anyone|plyr, "minister_nocontroltax2", #
    [
    ],
    "Yes, I cannot bear seeing so many peningas flying out of our coffers.", "minister_nocontroltax3",
    [(assign, "$control_tax", 0),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone|plyr, "minister_nocontroltax2", #
    [
    ],
    "Ah, no. Let me think more about it.", "minister_pretalk",
    [
  ]],
  [anyone, "minister_nocontroltax3",
    [],
    "Well, {reg59?my lady:sire}. They shall be dismissed.", "minister_pretalk",
    [
  ]],
  ###############
  ###pay for free to prisoner
  [anyone|plyr, "minister_talk",
    [(neq,"$message_sent",1), #message sent
      (is_between, "$g_player_minister", active_npcs_begin, kingdom_ladies_end),
      (assign, ":prisoners", 0),
      (try_for_range, ":lord_id", active_npcs_begin, active_npcs_end),
        (troop_slot_eq, ":lord_id", slot_troop_occupation, slto_kingdom_hero),
        (troop_slot_ge, ":lord_id", slot_troop_prisoner_of_party, 1),
        (store_troop_faction, ":lord_faction", ":lord_id"),
        (eq, ":lord_faction", "fac_player_supporters_faction"),
        (val_add, ":prisoners", 1),
      (try_end),
      (ge, ":prisoners", 1),
      (assign,"$message_cost",0),
      (assign,"$message_lord",0), #free lord.
    ],
    "Send a messenger to pay for the release of a prisoner.", "minister_prisionero1",
    [           (str_clear, s10),
      (str_clear, s11),]],
  
  [anyone, "minister_prisionero1",
    [
    ],
    "Who should we pay the ransom for?^^" +
    "Remember the prisoner should be in a prison so our messenger can find him.", "minister_prisionero2",
    []],
  
  [anyone|plyr|repeat_for_troops, "minister_prisionero2",
    [
      (store_repeat_object, ":troop_no"),
      (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (store_faction_of_troop, ":troop_faction", ":troop_no"),
      (eq, ":troop_faction", "fac_player_supporters_faction"),
      (troop_get_slot, ":party", ":troop_no", slot_troop_prisoner_of_party),
      (is_between, ":party", walled_centers_begin, walled_centers_end),
      (str_store_troop_name, s10, ":troop_no"),
    ],
    "{!}{s10}.", "minister_prisionero3",
    [
      (store_repeat_object, "$message_target"),
  ]],
  
  [anyone|plyr, "minister_prisionero2",
    [],
    "Forget this.", "minister_pretalk",
    []],
  
  [anyone, "minister_prisionero3",
    [
    ],
    "How much ransom shall we offer? We must also add a messenger's salary of 400 peningas for the mission.", "minister_prisionero4",
    []],
  
  [anyone|plyr, "minister_prisionero4",
    [		(store_troop_gold,":cur_wealth","trp_player"),
      (ge,":cur_wealth",3400),],
    "Three thousand peningas is a good number.", "minister_prisionero5",
    [
      (assign,"$message_type",3000), #payment
  ]],
  [anyone|plyr, "minister_prisionero4",
    [		(store_troop_gold,":cur_wealth","trp_player"),
      (ge,":cur_wealth",8400),],
    "Eight thousand peningas would assure that the offer will be accepted.", "minister_prisionero5",
    [
      (assign,"$message_type",8000), #payment
  ]],
  [anyone|plyr, "minister_prisionero4",
    [		(store_troop_gold,":cur_wealth","trp_player"),
      (ge,":cur_wealth",15400),],
    "Well, I want our subject back for sure. Offer them 15,000 peningas.", "minister_prisionero5",
    [
      (assign,"$message_type",15000), #payment
  ]],
  [anyone|plyr, "minister_prisionero4",
    [],
    "What? Even more money is necessary? Ye gods, let us think this over!", "minister_pretalk",
    []],
  
  [anyone, "minister_prisionero5",
    [            (str_clear, s10),
      (str_clear, s11),
      (assign,":troop","$message_target"),
      (str_store_troop_name,s10,":troop"),
      (troop_get_slot, ":party", ":troop", slot_troop_prisoner_of_party),
      (store_faction_of_party, ":cur_faction", ":party"),
      (str_store_faction_name, s11, ":cur_faction"),
    ], "Well, a messenger will be sent to {s11} with your proposal to release {s10}.", "minister_pretalk",
    [
      (assign,":cost","$message_type"), #total payment
      (val_add,":cost",400), #total payment
      (troop_remove_gold,"trp_player",":cost"),
      (assign,"$message_cost",":cost"), #total payment
      (assign,"$message_sent",1), #message sent
      (store_current_hours, ":cur_hours"),
      (party_set_slot, "p_town_1", slot_party_messenger_time, ":cur_hours"),
      (assign,"$message_lord",1), #free lord.
  ]],
  
  ##############  ####
  #chief conocer las conversiones del reino
  [anyone|plyr,"minister_talk", [(gt,"$faith_conversion",0),],
    "I want a report on the piety of my subjects and new conversions.", "minister_faith",[]],
  
  [anyone, "minister_faith", [
      (str_clear, s4),
      (str_clear, s22),
      (try_begin),
        (eq, "$g_player_faith", 1),
        (str_store_string, s4, "@Christianity"),
      (else_try),
        (str_store_string, s4, "@Norse gods"),
      (try_end),
      (assign, ":faith", "$faith_conversion"),
      (val_div, ":faith", 5),
      (assign, reg13, ":faith"),
      (try_begin),
        (ge, reg13, 0),
        (str_store_string, s22, "@The subjects of our kingdom officially believe in {s4}. Collected records indicate {reg13} people have adopted our faith."),
      (else_try),
        (val_mul, reg13,-1),
        (str_store_string, s22, "@The subjects of our kingdom officially believe in {s4}. Collected records indicate {reg13} people have given up our faith."),
      (try_end),
      ], "{!}{s22}", "minister_faith2",[
      
  ]],
  [anyone|plyr, "minister_faith2", [
      ], "Thanks.", "minister_pretalk",[
      (assign, "$faith_conversion", 0),
  ]],
  
  #############
  #very basic bank system. Minister keeps money.
  [anyone|plyr,"minister_talk", [		  (store_troop_gold, ":player_gold", "trp_player"),
      (this_or_next|gt,":player_gold",1000),
      (ge, "$g_player_coffers", 1000),
    ],
    "I want to see the kingdom's coffers.", "minister_basicnanksystem1",[]],
  
  [anyone, "minister_basicnanksystem1", [		  (assign, reg0, "$g_player_coffers"),
      
    ], "The money in your coffers currently amounts to {reg0} peningas.^^" +
    "What do you wish to do?", "minister_basicnanksystem2",[
  ]],
  
  [anyone|plyr, "minister_basicnanksystem2", [ (store_troop_gold, ":player_gold", "trp_player"),
      (gt,":player_gold",1000)
      ], "Add 1000 peningas to the kingdom's coffers.", "minister_basicnanksystem1",[
      (troop_remove_gold, "trp_player", 1000),
      (val_add, "$g_player_coffers", 1000),
  ]],
  [anyone|plyr, "minister_basicnanksystem2", [ (store_troop_gold, ":player_gold", "trp_player"),
      (gt,":player_gold",5000)
      ], "Add 5000 peningas to the kingdom's coffers.", "minister_basicnanksystem1",[
      (troop_remove_gold, "trp_player", 5000),
      (val_add, "$g_player_coffers", 5000),
  ]],
  [anyone|plyr, "minister_basicnanksystem2", [ (store_troop_gold, ":player_gold", "trp_player"),
      (gt,":player_gold",10000)
      ], "Add 10000 peningas to the kingdom's coffers.", "minister_basicnanksystem1",[
      (troop_remove_gold, "trp_player", 10000),
      (val_add, "$g_player_coffers", 10000),
  ]],
  [anyone|plyr, "minister_basicnanksystem2", [ (ge, "$g_player_coffers", 1000),
      ], "Withdraw 1000 peningas from the kingdom's coffers.", "minister_basicnanksystem1",[
      (call_script, "script_troop_add_gold", "trp_player", 1000),
      (val_sub, "$g_player_coffers", 1000),
  ]],
  [anyone|plyr, "minister_basicnanksystem2", [ (gt, "$g_player_coffers", 5000),
      ], "Withdraw 5000 peningas from the kingdom's coffers.", "minister_basicnanksystem1",[
      (call_script, "script_troop_add_gold", "trp_player", 5000),
      (val_sub, "$g_player_coffers", 5000),
  ]],
  [anyone|plyr, "minister_basicnanksystem2", [ (gt, "$g_player_coffers", 10000),
      ], "Withdraw 10000 peningas from the kingdom's coffers.", "minister_basicnanksystem1",[
      (call_script, "script_troop_add_gold", "trp_player", 10000),
      (val_sub, "$g_player_coffers", 10000),
  ]],
  [anyone|plyr, "minister_basicnanksystem2", [
      ], "Nothing.", "minister_pretalk",[
  ]],
  
  ##goes the war
  [anyone|plyr,"minister_talk", [],
    "How goes the war?", "minister_ask_about_war",[]],
  
  [anyone,"minister_ask_about_war", [],
    "{!}{s12}", "minister_ask_about_war2",
    [
      (assign, ":num_enemies", 0),
      (try_for_range_backwards, ":cur_faction", kingdoms_begin, kingdoms_end),
        (faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active),
        (store_relation, ":cur_relation", ":cur_faction", "fac_player_supporters_faction"),
        (lt, ":cur_relation", 0),
        (try_begin),
          (eq, ":num_enemies", 0),
          (str_store_faction_name_link, s12, ":cur_faction"),
          (str_store_string, s12, "@the {s12}"),
        (else_try),
          (eq, ":num_enemies", 1),
          (str_store_faction_name_link, s11, ":cur_faction"),
          (str_store_string, s12, "@the {s11} and {s12}"),
        (else_try),
          (str_store_faction_name_link, s11, ":cur_faction"),
          (str_store_string, s12, "@the {s11}, {s12}"),
        (try_end),
        (val_add, ":num_enemies", 1),
      (try_end),
      (try_begin),
        (eq, ":num_enemies", 0),
        (str_store_string, s12, "@We are quite happy not to be at war with anyone."),
      (else_try),
        (str_store_string, s12, "@We are at war with {s12}."),
      (try_end),
  ]],
  
  [anyone|plyr|repeat_for_factions, "minister_ask_about_war2", [(store_repeat_object, ":faction_no"),
      (is_between, ":faction_no", kingdoms_begin, kingdoms_end),
      (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
      (store_relation, ":cur_relation", ":faction_no", "fac_player_supporters_faction"),
      (lt, ":cur_relation", 0),
      (str_store_faction_name, s1, ":faction_no")],
    "Tell me more about the war with the {s1}.", "minister_ask_about_war_details",[(store_repeat_object, "$faction_requested_to_learn_more_details_about_the_war_against")]],
  
  [anyone|plyr,"minister_ask_about_war2", [], "That's all I wanted to know. Thank you.", "minister_pretalk",[]],
  
  [anyone,"minister_ask_about_war_details", [],
    "{!}{s9}.",
    "minister_ask_about_war2",
    [
      (store_add, ":war_damage_slot", "$faction_requested_to_learn_more_details_about_the_war_against", slot_faction_war_damage_inflicted_on_factions_begin),
      (val_sub, ":war_damage_slot", kingdoms_begin),
      (faction_get_slot, ":war_damage_inflicted", "$players_kingdom", ":war_damage_slot"),
      
      (store_add, ":war_damage_slot", "$players_kingdom", slot_faction_war_damage_inflicted_on_factions_begin),
      (val_sub, ":war_damage_slot", kingdoms_begin),
      (faction_get_slot, ":war_damage_suffered", "$faction_requested_to_learn_more_details_about_the_war_against", ":war_damage_slot"),
      
      (val_max, ":war_damage_suffered", 1),
      
      (store_mul, ":war_damage_ratio", ":war_damage_inflicted", 100),
      (val_div, ":war_damage_ratio", ":war_damage_suffered"),
      
      (try_begin),
        (eq, "$cheat_mode", 1),
        (assign, reg3, ":war_damage_inflicted"),
        (assign, reg4, ":war_damage_suffered"),
        (assign, reg5, ":war_damage_ratio"),
        (display_message, "str_war_damage_inflicted_reg3_suffered_reg4_ratio_reg5"),
      (try_end),
      
      (str_store_string, s9, "str_error__did_not_calculate_war_progress_string_properly"),
      (try_begin),
        (lt, ":war_damage_inflicted", 5),
        (str_store_string, s9, "str_the_war_has_barely_begun_so_and_it_is_too_early_to_say_who_is_winning_and_who_is_losing"),
      (else_try),
        (gt, ":war_damage_inflicted", 100),
        (gt, ":war_damage_ratio", 200),
        (str_store_string, s9, "str_we_have_been_hitting_them_very_hard_and_giving_them_little_chance_to_recover"),
      (else_try),
        (gt, ":war_damage_inflicted", 80),
        (gt, ":war_damage_ratio", 150),
        (str_store_string, s9, "str_the_fighting_has_been_hard_but_we_have_definitely_been_getting_the_better_of_them"),
      (else_try),
        (gt, ":war_damage_suffered", 100),
        (lt, ":war_damage_ratio", 50),
        (str_store_string, s9, "str_they_have_been_hitting_us_very_hard_and_causing_great_suffering"),
      (else_try),
        (gt, ":war_damage_suffered", 80),
        (lt, ":war_damage_ratio", 68),
        (str_store_string, s9, "str_the_fighting_has_been_hard_and_i_am_afraid_that_we_have_been_having_the_worst_of_it"),
      (else_try),
        (gt, ":war_damage_suffered", 50),
        (gt, ":war_damage_inflicted", 50),
        (gt, ":war_damage_ratio", 65),
        (str_store_string, s9, "str_both_sides_have_suffered_in_the_fighting"),
      (else_try),
        (gt, ":war_damage_ratio", 125),
        (str_store_string, s9, "str_no_clear_winner_has_yet_emerged_in_the_fighting_but_i_think_we_are_getting_the_better_of_them"),
      (else_try),
        (gt, ":war_damage_ratio", 80),
        (str_store_string, s9, "str_no_clear_winner_has_yet_emerged_in_the_fighting_but_i_fear_they_may_be_getting_the_better_of_us"),
      (else_try),
        (str_store_string, s9, "str_no_clear_winner_has_yet_emerged_in_the_fighting"),
      (try_end),
      
      (try_begin),
        #(neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "$g_talk_troop"),
        (call_script, "script_npc_decision_checklist_peace_or_war", "$players_kingdom", "$faction_requested_to_learn_more_details_about_the_war_against", -1),
        (str_store_string, s9, "str_s9_s14"),
      (try_end),
  ]],
  
  ############training
  [anyone|plyr, "minister_talk", [
      (faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
      (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
    ],
    "I'd like to discuss training of men.", "minister_training_lair0_tr",[]],
  
  [anyone, "minister_training_lair0_tr",
    [],
    "I can take your recruits and turn them into warriors.", "minister_training_lair0",
    []],
  
  [anyone|plyr,"minister_training_lair0", [(eq, "$g_trainerlair_training_center2", -1),],
    "I need some men in the garrison to be trained.", "minister_training_lair3",[]],
  
  [anyone|plyr, "minister_training_lair0",
    [ (eq, "$g_trainerlair_training_center2", "$current_town"),],
    "Stop training men here.", "minister_training_lair4_stop",
    []],
  
  [anyone|plyr, "minister_training_lair0",
    [],
    "Never mind.", "minister_pretalk",
    []
  ],
  
  [anyone, "minister_training_lair3",
    [],
    "Do you want me to use an alternative promotion when available?", "minister_training_lair3_a",
    []
  ],
  [anyone|plyr, "minister_training_lair3_a",
    [],
    "Yes.", "minister_training_lair3_b",
    [(assign, "$g_trainerlair_training_type2", 1),]],
  [anyone|plyr, "minister_training_lair3_a",
    [],
    "No.", "minister_training_lair3_b",
    [(assign, "$g_trainerlair_training_type2", 0),]],
  
  
  [anyone, "minister_training_lair3_b",
    [
      (str_store_party_name, s11, "$g_encountered_party"),
      ##    (try_begin),
      ##      (eq, "$g_trainerlair_training_type2", 0),
      ##      (str_store_string, s12, "@You prefer me not to promote the men."),
      ##    (else_try),
      ##      (str_store_string, s12, "@You prefer me to promote the men."),
      ##    (try_end),
    ],
    #"Alright, I will train the recruits in {s11}. {s12} Please place the troops you prefer to get trained at the bottom of the garrison list.", "minister_pretalk",
    "Alright, I will train the recruits in {s11}. Place the troops you want me to train at the bottom of the garrison list.", "minister_pretalk",
    [(assign, "$g_trainerlair_training_center2", "$g_encountered_party"),
    ]
  ],
  
  ##  [anyone|plyr, "minister_training_lair2",
  ##  [],
  ##  "I changed my mind. Don't train troops.", "minister_pretalk",
  ##  []
  ##  ],
  
  [anyone, "minister_training_lair4_stop",
    [
    ],
    "Yes, my {reg59?lady:lord}?", "minister_pretalk",
    [(assign, "$g_trainerlair_training_center2", -1),
      (assign, "$g_trainerlair_training_type2", 0),
    ]
  ],
  ######################
  
  [anyone|plyr, "minister_talk",
    [
      (neg|is_between, "$g_player_minister", active_npcs_begin, active_npcs_end),
    ],
    "I wish for you to retire as minister.", "minister_replace",
    []],
  
  [anyone|plyr, "minister_talk",
    [
      (is_between, "$g_player_minister", active_npcs_begin, active_npcs_end),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      
    ],
    "I wish you to rejoin my party.", "minister_replace",
    []],
  
  [anyone|plyr, "minister_talk",
    [
      (is_between, "$g_player_minister", active_npcs_begin, kingdom_ladies_end),
    ],
    "I wish you to grant one of my vassals a fief.", "minister_grant_fief",
    []],
  
  [anyone|plyr, "minister_talk",
    [
      (is_between, "$g_player_minister", active_npcs_begin, kingdom_ladies_end),
      (assign, ":fief_found", -1),
      (try_for_range, ":center", centers_begin, centers_end),
        (eq, ":fief_found", -1),
        (store_faction_of_party, ":center_faction", ":center"),
        (eq, ":center_faction", "fac_player_supporters_faction"),
        (party_get_slot, ":town_lord", ":center", slot_town_lord),
        (try_begin),
          (ge, ":town_lord", active_npcs_begin),
          (store_faction_of_troop, ":town_lord_faction", ":town_lord"),
          (neq, ":town_lord_faction", "fac_player_supporters_faction"),
          (assign, ":town_lord", -1),
        (try_end),
        (lt, ":town_lord", 0),
        (assign, ":fief_found", ":center"),
      (try_end),
      (gt, ":fief_found", -1),
      (str_store_party_name, s4, ":fief_found"),
    ],
    "I wish to make myself lord of {s4}.", "minister_grant_self_fief",
    []],
  
  [anyone, "minister_grant_self_fief",
    [
    ],
    "As you wish. You shall be lord of {s4}.", "minister_pretalk",
    [
      (assign, ":fief_found", -1),
      (try_for_range, ":center", centers_begin, centers_end),
        (eq, ":fief_found", -1),
        (store_faction_of_party, ":center_faction", ":center"),
        (eq, ":center_faction", "fac_player_supporters_faction"),
        (party_get_slot, ":town_lord", ":center", slot_town_lord),
        (try_begin),
          (ge, ":town_lord", active_npcs_begin),
          (store_faction_of_troop, ":town_lord_faction", ":town_lord"),
          (neq, ":town_lord_faction", "fac_player_supporters_faction"),
          (assign, ":town_lord", -1),
        (try_end),
        (lt, ":town_lord", 0),
        (assign, ":fief_found", ":center"),
      (try_end),
      
      
      (call_script, "script_give_center_to_lord", ":fief_found", "trp_player", 0),
      (try_begin),
        (faction_slot_eq, "$players_kingdom", slot_faction_political_issue, ":fief_found"),
        (faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
      (try_end),
      (str_store_party_name, s4, ":fief_found"),
      
  ]],
  
  
  
  [anyone|plyr, "minister_talk",
    [],
    "That is all for now.", "close_window",
    []],
  
  
  [anyone, "minister_change_marshal",
    [],
    "Who should be the new marshal?", "minister_change_marshal_choose",
    []],
  
  [anyone|plyr, "minister_change_marshal_choose",
    [],
    "I shall be the marshal", "minister_pretalk",
    [
      (call_script, "script_appoint_faction_marshal", "fac_player_supporters_faction", "trp_player"),
      (store_current_hours, ":hours"),
      (assign, "$g_recalculate_ais", 1),
      (assign, "$g_player_faction_last_marshal_appointment", ":hours"),
      
      
      (try_begin),
        (faction_slot_eq, "fac_player_supporters_faction", slot_faction_political_issue, 1),
        
        (faction_set_slot, "fac_player_supporters_faction", slot_faction_political_issue, 0),
        (troop_set_slot, "trp_player",  slot_troop_stance_on_faction_issue, -1),
        (try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
          (store_faction_of_troop, ":active_npc_faction", ":active_npc"),
          (eq, ":active_npc_faction", "fac_player_supporters_faction"),
          (troop_set_slot, ":active_npc", slot_troop_stance_on_faction_issue, -1),
        (try_end),
      (try_end),
  ]],
  
  [anyone|plyr, "minister_change_marshal_choose",
    [],
    "For a short while, we should have no marshal", "minister_pretalk",
    [
      (call_script, "script_appoint_faction_marshal", "fac_player_supporters_faction", -1),
      (try_begin),
        (faction_slot_eq, "fac_player_supporters_faction", slot_faction_political_issue, 1),
        (faction_set_slot, "fac_player_supporters_faction", slot_faction_political_issue, 0),
        
        (troop_set_slot, "trp_player",  slot_troop_stance_on_faction_issue, -1),
        (try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
          (store_faction_of_troop, ":active_npc_faction", ":active_npc"),
          (eq, ":active_npc_faction", "fac_player_supporters_faction"),
          (troop_set_slot, ":active_npc", slot_troop_stance_on_faction_issue, -1),
        (try_end),
      (try_end),
      
      (assign, "$g_recalculate_ais", 1),
      
  ]],
  
  [anyone|plyr|repeat_for_troops, "minister_change_marshal_choose",
    [
      (store_repeat_object, ":lord"),
      (is_between, ":lord", active_npcs_begin, active_npcs_end),
      (troop_slot_eq, ":lord", slot_troop_occupation, slto_kingdom_hero),
      (store_faction_of_troop, ":lord_faction", ":lord"),
      (eq, ":lord_faction", "fac_player_supporters_faction"),
      (str_store_troop_name, s4, ":lord"),
    ],
    "{!}{s4}", "minister_pretalk",
    [
      (store_repeat_object, ":lord"),
      (call_script, "script_appoint_faction_marshal", "fac_player_supporters_faction", ":lord"),
      (store_current_hours, ":hours"),
      (assign, "$g_player_faction_last_marshal_appointment", ":hours"),
      (try_begin),
        (faction_slot_eq, "fac_player_supporters_faction", slot_faction_political_issue, 1),
        
        (faction_set_slot, "fac_player_supporters_faction", slot_faction_political_issue, 0),
        
        (troop_set_slot, "trp_player",  slot_troop_stance_on_faction_issue, -1),
        (try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
          (store_faction_of_troop, ":active_npc_faction", ":active_npc"),
          (eq, ":active_npc_faction", "fac_player_supporters_faction"),
          (troop_set_slot, ":active_npc", slot_troop_stance_on_faction_issue, -1),
        (try_end),
      (try_end),
      (assign, "$g_recalculate_ais", 1),
  ]],
  
  
  [anyone|plyr, "minister_change_marshal_choose",
    [],
    "Never mind", "minister_pretalk",
    []],
  
  
  
  [anyone, "minister_diplomatic_kingdoms",
    [
      (assign, ":companion_found", 0),
      (try_for_range, ":emissary", companions_begin, companions_end),
        (main_party_has_troop, ":emissary"),
        (assign, ":companion_found", 1),
      (try_end),
      (eq, ":companion_found", 1),
      
    ],
    "Whom do you wish to send this emissary to?", "minister_diplomatic_kingdoms_select",
    []],
  
  [anyone, "minister_diplomatic_kingdoms",
    [
    ],
    "Unfortunately, there is no one to send right now.", "minister_pretalk",
    []],
  
  [anyone|plyr|repeat_for_factions, "minister_diplomatic_kingdoms_select",
    [
      (store_repeat_object, ":faction_no"),
      (is_between, ":faction_no", kingdoms_begin, kingdoms_end),
      (neq, ":faction_no", "fac_player_supporters_faction"),
      (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
      (try_begin),
        (eq, "$cheat_mode", 1),
        (call_script, "script_npc_decision_checklist_peace_or_war", ":faction_no", "fac_player_supporters_faction", -1),
      (try_end),
      (faction_get_slot, ":leader_no", ":faction_no", slot_faction_leader),
      (str_store_troop_name, s10, ":leader_no"),
      (str_store_faction_name, s11, ":faction_no"),
      (str_clear, s14),
    ],
    "{s10} of the {s11}{s14}", "minister_diplomatic_initiative_type",
    [
      (store_repeat_object, "$g_faction_selected"),
  ]],
  
  [anyone|plyr, "minister_diplomatic_kingdoms_select",
    [],
    "Never mind", "minister_pretalk",
    []],
  
  
  [anyone, "minister_diplomatic_initiative_type",
    [],
    "What do you wish to tell him?", "minister_diplomatic_initiative_type_select",
    []],
  
  [anyone|plyr, "minister_diplomatic_initiative_type_select",
    [(store_relation, ":relation", "fac_player_supporters_faction", "$g_faction_selected"),
      (lt, ":relation", 0),],
    "That our two kingdoms should enter into truce.", "minister_diplomatic_emissary",
    [(assign, "$g_initiative_selected", npc_mission_peace_request)]],
  
  [anyone|plyr, "minister_diplomatic_initiative_type_select",
    [],
    "That I wish to put myself under his protection, as his vassal.", "minister_diplomatic_emissary",
    [(assign, "$g_initiative_selected", npc_mission_pledge_vassal)]],
  
  [anyone|plyr, "minister_diplomatic_initiative_type_select",
    [(store_relation, ":relation", "fac_player_supporters_faction", "$g_faction_selected"),
      (faction_slot_eq, "$g_faction_selected", slot_faction_recognized_player, 0),
      (ge, ":relation", 0),],
    "That I wish to express my goodwill, as one monarch to another.", "minister_diplomatic_emissary",
    [(assign, "$g_initiative_selected", npc_mission_seek_recognition),]],
  
  [anyone|plyr, "minister_diplomatic_initiative_type_select",
    [(store_relation, ":relation", "fac_player_supporters_faction", "$g_faction_selected"),
      (ge, ":relation", 0),],
    "That I declare war upon him.", "minister_declare_war",
    []],
  
  [anyone|plyr, "minister_diplomatic_initiative_type_select",[], "Never mind.", "close_window",[]],
  
  [anyone, "minister_declare_war",
    [(try_begin),
        (call_script, "script_diplomacy_faction_get_diplomatic_status_with_faction", "fac_player_supporters_faction", "$g_faction_selected"),
        (eq, reg0, 1),
        (str_store_string, s12, "str_in_doing_so_you_will_be_in_violation_of_your_truce_is_that_what_you_want"),
      (else_try),
        (call_script, "script_diplomacy_faction_get_diplomatic_status_with_faction", "fac_player_supporters_faction", "$g_faction_selected"),
        (neq, reg0, -1),
        (str_store_string, s12, "str_if_you_attack_without_provocation_some_of_your_vassals_may_consider_you_to_be_too_warlike_is_that_what_you_want"),
      (else_try),
        (str_store_string, s12, "str_our_men_are_ready_to_ride_forth_at_your_bidding_are_you_sure_this_is_what_you_want"),
      (try_end),
    ], "{!}{s12}", "minister_declare_war_confirm",
    []],
  
  [anyone|plyr, "minister_declare_war_confirm",
    [(str_store_faction_name, s12, "$g_faction_selected"),
    ],
    "It is. I wish to make war on the {s12}.", "minister_declare_war_confirm_yes",
    [
      (call_script, "script_diplomacy_start_war_between_kingdoms",  "fac_player_supporters_faction", "$g_faction_selected", logent_player_faction_declares_war),	#MOTO chief pass log entries
  ]],
  
  [anyone|plyr, "minister_declare_war_confirm",
    [(str_store_faction_name, s12, "$g_faction_selected"),
    ],
    "Hmm. Perhaps not.", "minister_pretalk",
    [
  ]],
  
  [anyone, "minister_declare_war_confirm_yes",
    [(str_store_faction_name, s12, "$g_faction_selected"),
    ],
    "As you command. We are now at war with the {s12}. May the heavens grant us victory.", "minister_pretalk",
    [
  ]],
  
  
  [anyone, "minister_diplomatic_emissary",
    [], "Who shall be your emissary? You should choose the one who you trust, but who is also persuasive -- one who can negotiate without giving offense.", "minister_emissary_select",
    []],
  
  [anyone|plyr|repeat_for_troops, "minister_emissary_select",[
      (store_repeat_object, ":emissary"),
      (main_party_has_troop, ":emissary"),
      (is_between, ":emissary", companions_begin, companions_end),
      (troop_slot_eq, ":emissary", slot_troop_prisoner_of_party, -1),
      (is_between, ":emissary", active_npcs_begin, active_npcs_end),
      (try_begin),
        (eq, "$cheat_mode", 1),
        (call_script, "script_npc_decision_checklist_peace_or_war", "$g_faction_selected", "fac_player_supporters_faction", ":emissary"),
      (try_end),
      (str_store_troop_name, s11, ":emissary"),
      ], "{!}{s11}", "minister_emissary_dispatch",[
      (store_repeat_object, "$g_emissary_selected"),
  ]],
  
  [anyone|plyr, "minister_emissary_select",[
      ], "Actually, I can't think of anyone.", "minister_pretalk",[]],
  
  [anyone, "minister_emissary_dispatch",
    [
      (str_store_troop_name, s11, "$g_emissary_selected"),
      (str_store_faction_name, s12, "$g_faction_selected"),
      (try_begin),
        (eq, "$g_initiative_selected", npc_mission_seek_recognition),
        (str_store_string, s14, "str_seek_recognition"),
      (else_try),
        (eq, "$g_initiative_selected", npc_mission_pledge_vassal),
        (str_store_string, s14, "str_seek_vassalhood"),
      (else_try),
        (eq, "$g_initiative_selected", npc_mission_peace_request),
        (str_store_string, s14, "str_seek_a_truce"),
      (try_end),
      ], "Very well -- I shall send {s11} to the {s12} to {s14}.", "minister_diplomatic_dispatch_confirm",[]],
  
  [anyone|plyr, "minister_diplomatic_dispatch_confirm",[], "Yes, do that.", "minister_pretalk",[
      (troop_set_slot, "$g_emissary_selected", slot_troop_days_on_mission, 3),
      (troop_set_slot, "$g_emissary_selected", slot_troop_current_mission, "$g_initiative_selected"),
      (troop_set_slot, "$g_emissary_selected", slot_troop_mission_object, "$g_faction_selected"),
      
      (remove_member_from_party, "$g_emissary_selected", "p_main_party"),
  ]],
  
  
  [anyone|plyr, "minister_diplomatic_dispatch_confirm",[], "Actually, hold off on that.", "minister_pretalk",[]],
  
  [anyone, "minister_replace",
    [], "Very good. Who will you appoint in my stead?", "minister_replace_select",
    []],
  
  [anyone|plyr|repeat_for_troops, "minister_replace_select",
    [
      (store_repeat_object, ":troop_no"),
      (is_between, ":troop_no", companions_begin, companions_end),
      (main_party_has_troop, ":troop_no"),
      (troop_slot_eq, ":troop_no", slot_troop_prisoner_of_party, -1),
      (str_store_troop_name, s4, ":troop_no"),
    ], "{!}{s4}", "minister_replace_confirm",
    [
      (store_repeat_object, "$g_player_minister"),
  ]],
  
  [anyone|plyr, "minister_replace_select",
    [
      (troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
      (gt, ":spouse", 0),
      (troop_get_type, ":is_female", ":spouse"),
      (val_mod, ":is_female", 2),
      (neg|troop_slot_eq, ":spouse", slot_troop_occupation, slto_kingdom_hero),
      (eq, ":is_female", 1),
      (str_store_troop_name, s4, ":spouse"),
      (neq, ":spouse", "$g_talk_troop"),
      
    ], "My wife, {s4}.", "minister_replace_confirm", #husband disabled, as he's an active lord
    [
      (troop_get_slot, "$g_player_minister", "trp_player", slot_troop_spouse),
  ]],
  
  [anyone|plyr, "minister_replace_select",
    [], "Actually, hold off on that.", "minister_pretalk",
    []],
  
  
  
  
  [anyone, "minister_replace_confirm",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_player_companion),
    ], "Very good. {s9} is your new minister. I will rejoin you shortly.", "close_window",
    [
      (str_store_troop_name, s9, "$g_player_minister"),
      (party_add_members, "p_main_party", "$g_talk_troop", 1),
      (assign, "$g_leave_encounter", 1),
      (try_begin),
        (main_party_has_troop, "$g_player_minister"),
        (party_remove_members, "p_main_party", "$g_player_minister", 1),
      (try_end),
      
      (try_for_range, ":minister_quest", all_quests_begin, all_quests_end),
        (quest_slot_eq, ":minister_quest", slot_quest_giver_troop, "$g_talk_troop"),
        (call_script, "script_abort_quest", ":minister_quest", 0),
      (try_end),
  ]],
  
  [anyone, "minister_replace_confirm",
    [
    ], "Very good. {s9} is your new minister. It has been an honor serving you.", "close_window",
    [
      (str_store_troop_name, s9, "$g_player_minister"),
      (try_begin),
        (main_party_has_troop, "$g_player_minister"),
        (party_remove_members, "p_main_party", "$g_player_minister", 1),
      (try_end),
      
  ]],
  
  [anyone, "minister_grant_fief",
    [
      (faction_get_slot, ":fief_on_agenda", "$players_kingdom", slot_faction_political_issue),
      (str_clear, s12),
      (try_begin),
        (is_between, ":fief_on_agenda", centers_begin, centers_end),
        (str_store_party_name, s4, ":fief_on_agenda"),
        (str_store_string, s12, "str_minister_advice_select_fief"),
      (else_try),
        (eq, ":fief_on_agenda", 1),
        (str_store_string, s12, "str_minister_advice_select_fief_wait"),
      (try_end),
    ],
    "Which of your fiefs do you wish to grant?{s12}", "minister_grant_fief_select",
    []],
  
  
  [anyone|plyr|repeat_for_parties, "minister_grant_fief_select",
    [
      (store_repeat_object, ":center_no"),
      (is_between, ":center_no", centers_begin, centers_end),
      (store_faction_of_party, ":center_faction", ":center_no"),
      (eq, ":center_faction", "fac_player_supporters_faction"),
      (neq, ":center_no", "$g_player_court"),
      (party_get_slot, ":town_lord", ":center_no", slot_town_lord),
      (try_begin),
        (ge, ":town_lord", active_npcs_begin),
        (store_faction_of_troop, ":town_lord_faction", ":town_lord"),
        (neq, ":town_lord_faction", "fac_player_supporters_faction"),
        (assign, ":town_lord", -1),
      (try_end),
      (le, ":town_lord", 0),
      
      (str_store_party_name, s1, ":center_no"),
      (str_clear, s12),
      (try_begin),
        (party_slot_eq, ":center_no", slot_town_lord, -1),
        (str_store_string, s12, "str_unassigned_center"),
      (try_end),
      
    ],"{s1}{s12}", "minister_grant_fief_select_recipient",
    [
      (store_repeat_object, "$fief_selected"),
  ]],
  
  [anyone|plyr, "minister_grant_fief_select",
    [
    ],"Never mind", "minister_pretalk",
    []],
  
  [anyone, "minister_grant_fief_select_recipient",
    [
      (str_clear, s12),
      (try_begin),
        (faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$fief_selected"),
        
        (try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
          (troop_set_slot, ":active_npc", slot_troop_temp_slot, 0),
        (try_end),
        
        (assign, ":popular_favorite", -1),
        (assign, ":votes_for_popular_favorite", 0),
        (try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
          (store_faction_of_troop, ":active_npc_faction", ":active_npc"),
          (eq, ":active_npc_faction", "fac_player_supporters_faction"),
          (troop_get_slot, ":selected_npc", ":active_npc", slot_troop_stance_on_faction_issue),
          (ge, ":selected_npc", 0),
          
          (troop_get_slot, ":votes_accumulated", ":selected_npc", slot_troop_temp_slot),
          (val_add, ":votes_accumulated", 1),
          (troop_set_slot, ":selected_npc", slot_troop_temp_slot, ":votes_accumulated"),
          
          (gt, ":votes_accumulated", ":votes_for_popular_favorite"),
          (assign,  ":votes_for_popular_favorite", ":votes_accumulated"),
          (assign, ":popular_favorite", ":selected_npc"),
        (try_end),
        
        (is_between, ":popular_favorite", active_npcs_begin, active_npcs_end),
        (str_store_troop_name, s4, ":popular_favorite"),
        (assign, reg4, ":votes_for_popular_favorite"),
        
        (str_store_string, s12, "str_minister_advice_fief_leading_vassal"),
      (try_end),
      
    ],"And whom will you choose to receive the fief?{s12}", "minister_grant_fief_select_recipient_choice",
    []],
  
  [anyone|plyr|repeat_for_troops, "minister_grant_fief_select_recipient_choice",
    [
      (store_repeat_object, ":troop_no"),
      (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (is_between, ":troop_no", active_npcs_begin, active_npcs_end),
      (store_faction_of_troop, ":troop_faction", ":troop_no"),
      (eq, ":troop_faction", "fac_player_supporters_faction"),
      (str_store_troop_name, s11, ":troop_no"),
      (call_script, "script_troop_get_player_relation", ":troop_no"),
      (str_store_string, s12, "@ Relation: {reg0}"),
      (call_script, "script_print_troop_owned_centers_in_numbers_to_s0", ":troop_no"),
      (try_begin),
        (eq, reg0, 0),
        (str_store_string, s1, "str_no_fiefss12"),
      (else_try),
        (str_store_string, s1, "str_fiefs_s0s12"),
      (try_end),
    ],"{!}{s11}. {s1}", "minister_grant_fief_complete",
    [
      (store_repeat_object, "$lord_selected"),
  ]],
  
  [anyone|plyr, "minister_grant_fief_select_recipient_choice",
    [
    ],"Never mind.", "minister_pretalk",
    []],
  
  [anyone, "minister_grant_fief_complete",
    [
      (str_store_party_name, s1, "$fief_selected"),
      (str_store_troop_name, s2, "$lord_selected"),
    ],"Very well - {s2} shall receive {s1}.", "minister_pretalk",
    [
      (call_script, "script_give_center_to_lord", "$fief_selected", "$lord_selected", 0),
      (str_store_party_name, s1, "$fief_selected"),
      (str_store_troop_name, s2, "$lord_selected"),
      
      (try_begin),
        (faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$fief_selected"),
        (faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
      (try_end),
      
      (call_script, "script_add_log_entry", logent_castle_given_to_lord_by_player, "trp_player", "$fief_selected", "$lord_selected", "$g_encountered_party_faction"),
  ]],
  
  
  
  
  
  
  [anyone, "minister_indict",
    [], "Grim news, {reg59?my lady:my lord}. Who do you believe is planning to betray you?", "minister_indict_select",
    []],
  
  [anyone|plyr|repeat_for_troops, "minister_indict_select",
    [
      (store_repeat_object, ":troop_no"),
      (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (store_faction_of_troop, ":faction", ":troop_no"),
      (eq, ":faction", "fac_player_supporters_faction"),
      (troop_get_slot, ":prisoner_of_party", ":troop_no", slot_troop_prisoner_of_party),  #VC-3705 weird things happen when imprisoned lords defect or are indicted
      (lt,":prisoner_of_party", 0),
      (str_store_troop_name, s11, ":troop_no"),
    ], "{!}{s11}", "minister_indict_confirm",
    [
      (store_repeat_object, "$lord_selected"),
  ]],
  
  [anyone|plyr, "minister_indict_select",
    [], "Never mind.", "minister_pretalk",
    []],
  
  
  [anyone, "minister_indict_confirm",
    [
      (str_store_troop_name, s4, "$lord_selected"),
      (troop_get_type, reg4, "$lord_selected"),
      (val_mod, reg4, 2),
    ], "Think carefully on this, {reg59?my lady:my lord}. If you indict {s4} for treason unjustly, you may find others becoming nervous about serving you. On the other hand, if you truly believe that {reg4?she:he} is about to betray you, then perhaps it is best to move first, to secure control of {reg4?her:his} fortresses.", "minister_indict_confirm_answer",
    []],
  
  [anyone|plyr, "minister_indict_confirm_answer",[], "I have thought long enough. Issue the indictment!", "minister_indict_conclude",[]],
  
  [anyone|plyr, "minister_indict_confirm_answer",[], "Perhaps I should wait a little longer...", "minister_pretalk",[]],
  
  [anyone, "minister_indict_conclude",
    [], "It has been sent, {reg59?my lady:my lord}.", "minister_pretalk",
    [
      (call_script, "script_indict_lord_for_treason", "$lord_selected", "fac_player_supporters_faction"),
  ]],
  
  
  
  
  
  
  
  
  
  
  [anyone|plyr|repeat_for_troops, "center_captured_lord_advice",
    [
      (store_repeat_object, ":troop_no"),
      (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (neq, "$g_talk_troop", ":troop_no"),
      (neq, "trp_player", ":troop_no"),
      (store_troop_faction, ":faction_no", ":troop_no"),
      (eq, ":faction_no", "fac_player_supporters_faction"),
      (str_store_troop_name, s11, ":troop_no"),
      
      (call_script, "script_troop_get_player_relation", ":troop_no"),
      (str_store_string, s12, "@ Relation: {reg0}"),
      ##	 (try_begin),
      ##	   (troop_slot_eq, ":troop_no", slot_lord_recruitment_argument, argument_benefit),
      ##	   (str_store_string, s12, "str__promised_fief"),
      ##	 (else_try),
      ##	   (str_clear, s12),
      ##	 (try_end),
      
      (call_script, "script_print_troop_owned_centers_in_numbers_to_s0", ":troop_no"),
      (try_begin),
        (eq, reg0, 0),
        (str_store_string, s1, "str_no_fiefss12"),
      (else_try),
        (str_store_string, s1, "str_fiefs_s0s12"),
      (try_end),
    ],
    "{!}{s11}. {s1}", "center_captured_lord_advice_2",
    [
      (store_repeat_object, "$temp"),
  ]],
  
  [anyone|plyr, "center_captured_lord_advice",
    [
      (call_script, "script_print_troop_owned_centers_in_numbers_to_s0", "trp_player"),
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
      
      (try_begin),
        (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
        (str_store_string, s12, "str_please_s65_"),
      (else_try),
        (str_clear, s12),
      (try_end),
    ],
    "{s12}I want to have {s1} for myself. (fiefs: {s0})", "center_captured_lord_advice_2",
    [
      (assign, "$temp", "trp_player"),
  ]],
  
  [anyone|plyr, "center_captured_lord_advice",
    [
      (call_script, "script_print_troop_owned_centers_in_numbers_to_s0", "$g_talk_troop"),
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
      (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
    ],
    "{s66}, you should have {s1} for yourself. (fiefs: {s0})", "center_captured_lord_advice_2",
    [
      (assign, "$temp", "$g_talk_troop"),
  ]],
  
  
  [anyone, "center_captured_lord_advice_2",
    [
      (eq, "$g_talk_troop", "$g_player_minister"),
    ],
    "As you wish, {reg59?my lady:sire}. {reg6?I:{reg7?You:{s11}}} will be the new {reg3?lady:lord} of {s1}.", "minister_issues",
    [
      (assign, ":new_owner", "$temp"),
      
      (call_script, "script_give_center_to_lord", "$g_center_taken_by_player_faction", ":new_owner", 0),
      
      (try_begin),
        (faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$g_center_taken_by_player_faction"),
        (faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
      (try_end),
      
      (try_begin),
        (neq, ":new_owner", "trp_player"),
        (try_for_range, ":unused", 0, 4),
          (call_script, "script_cf_reinforce_party", "$g_center_taken_by_player_faction"),
        (try_end),
      (try_end),
      
      (assign, reg6, 0),
      (assign, reg7, 0),
      (try_begin),
        (eq, ":new_owner", "$g_talk_troop"),
        (assign, reg6, 1),
      (else_try),
        (eq, ":new_owner", "trp_player"),
        (assign, reg7, 1),
      (else_try),
        (str_store_troop_name, s11, ":new_owner"),
      (try_end),
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
      (troop_get_type, reg3, ":new_owner"),
      (val_mod, reg3, 2),
      (assign, "$g_center_taken_by_player_faction", -1),
  ]],
  
  
  
  [anyone, "center_captured_lord_advice_2",
    [
    ],
    "Hmmm. All right, {playername}. I value your counsel highly. {reg6?I:{reg7?You:{s11}}} will be the new {reg3?lady:lord} of {s1}.", "close_window",
    [
      (assign, ":new_owner", "$temp"),
      
      (troop_set_slot, ":new_owner", slot_lord_recruitment_argument, 0),
      
      (call_script, "script_give_center_to_lord", "$g_center_taken_by_player_faction", ":new_owner", 0),
      (try_begin),
        (faction_slot_eq, "$players_kingdom", slot_faction_political_issue, "$g_center_taken_by_player_faction"),
        (faction_set_slot, "$players_kingdom", slot_faction_political_issue, -1),
      (try_end),
      
      (try_begin),
        (neq, ":new_owner", "trp_player"),
        (try_for_range, ":unused", 0, 4),
          (call_script, "script_cf_reinforce_party", "$g_center_taken_by_player_faction"),
        (try_end),
      (try_end),
      
      (assign, reg6, 0),
      (assign, reg7, 0),
      (try_begin),
        (eq, ":new_owner", "$g_talk_troop"),
        (assign, reg6, 1),
      (else_try),
        (eq, ":new_owner", "trp_player"),
        (assign, reg7, 1),
      (else_try),
        (str_store_troop_name, s11, ":new_owner"),
      (try_end),
      (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
      (troop_get_type, reg3, ":new_owner"),
      (val_mod, reg3, 2),
      (assign, "$g_center_taken_by_player_faction", -1),
  ]],
  
  #####mainquest chief Reginhard later
  [anyone, "event_triggered", [ #chief thiaderd mission
      (quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 5),
      (store_conversation_troop, "$map_talk_troop"),
      #(is_between, "$map_talk_troop", companions_begin, companions_end),
      (eq, "$map_talk_troop", "trp_npc8"),
      (eq, "$npc_map_talk_context", slot_troop_mainquest_dialog),
      ##                    (store_conversation_troop, "$map_talk_troop"),
      ##					 (eq, "$map_talk_troop", "trp_npc8"),
    ],
    "My God, My God, he's dead. We killed Thiaderd.", "reginhard_calm1", [
  ]],
  
  [anyone, "event_triggered", [ #chief kill king mission, coastal assault doccinga
      (quest_slot_eq,"qst_kennemer_mission_3",slot_quest_current_state, 1),
      (store_conversation_troop, "$map_talk_troop"),
      #(is_between, "$map_talk_troop", companions_begin, companions_end),
      (eq, "$map_talk_troop", "trp_npc8"),
      (eq, "$npc_map_talk_context", slot_troop_mainquest_dialog),
      ##                    (store_conversation_troop, "$map_talk_troop"),
      ##					 (eq, "$map_talk_troop", "trp_npc8"),
    ],
    "All right, {playername}, you've seen who the jarl is, and you know what he did. He only wants one thing -- the power -- and now he's using you to take it, as before he used me to reach my Thiaderd. " +
    "For him, we are expendable tools, and the jarl of Kennemer will finish you off when you're either not useful or become dangerous, as he did with me.", "reginhard_mission3_1", [
  ]],
  
  [anyone, "event_triggered", [ #chief after jarl of kennemer enemity
      (quest_slot_eq,"qst_revenge_sigurd",slot_quest_current_state, 1),
      (store_conversation_troop, "$map_talk_troop"),
      #(is_between, "$map_talk_troop", companions_begin, companions_end),
      (eq, "$map_talk_troop", "trp_npc8"),
      (eq, "$npc_map_talk_context", slot_troop_mainquest_dialog),
      ##                    (store_conversation_troop, "$map_talk_troop"),
      ##					 (eq, "$map_talk_troop", "trp_npc8"),
    ],
    "The jarl of Kennemer is an ambitious and dangerous man, I admire your fortitude to bite him and help save Doccinga despite the consequences this has had. " +
    "You are a good person.^^Friese can be hostile land for us now, but I'm sure we'll find our destiny elsewhere.", "reginhard_postdoccingaca", [
  ]],
  ##egil
  [anyone, "event_triggered", [
      (quest_slot_eq,"qst_danmork_protection",slot_quest_current_state, 1),
      (check_quest_active,"qst_revenge_exchange"),
      (store_conversation_troop, "$map_talk_troop"),
      (eq, "$map_talk_troop", "trp_npc2"),
      (eq, "$npc_map_talk_context", slot_troop_mainquest_dialog),
    ],
    "{reg59?My lady:Sir}, I have taken the liberty of sending a message to King Horik. I think it will be best if we have the support of some of the king's men, especially if you have any intention of killing Sven.^" +
    "Well, I have not spent much time with you, but I think this could lead to a battle. I hope you will look well upon the initiative I took to invite the king's men to join us.", "egil_mensajerey", [
  ]],
  ###
  [anyone|plyr,"egil_mensajerey", [], "Yes, I think it was a good idea, Egil. Thanks.", "egil_mensajerey1",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", -3),
      (display_message,"@Brunhild thinks that you are a weak leader.", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -3),
      (display_message,"@Reginhard thinks that you are a weak leader.", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -3),
      (display_message,"@Bodo thinks that you are a weak leader.", color_good_news),
  ]],
  [anyone|plyr,"egil_mensajerey", [], "No, I do not want you taking initiatives without asking me beforehand. Do you understand?", "egil_mensajerey2",[
  ]],
  [anyone|plyr,"egil_mensajerey", [(eq, "$defect_type", cb6_prudence),], "Egil, ask me before making a decision. I have all the information to avoid mistakes.", "egil_mensajerey3",[]],
  
  [anyone,"egil_mensajerey1", [], "{s2}^^Yes, I know. I always make good decisions. I can be a leader as good as you, or better. Maybe you should let me lead this army some time.", "close_window",[
      (str_clear,s2),
      (str_store_string, s2, "@--He seems pleased.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 3),
  ]],
  [anyone,"egil_mensajerey2", [], "{s2}^^Yes, I understand. You like to control everything. Well, it's your decision.", "close_window",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -6),
      (str_clear,s2),
      (str_store_string, s2, "@--He seems upset.--", color_good_news),
      (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 3),
  ]],
  [anyone,"egil_mensajerey3", [], "{s2}^^You're right. Forgive me. Sometimes I'm too impulsive. I do not want to jeopardize this party by my imprudence. I will consult with you about everything.", "close_window",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
      (str_clear,s2),
      (str_store_string, s2, "@--He seems distressed.--", color_good_news),
      (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 3),
  ]],
  ###egil acaba
  
  #1 reginhard calm
  [anyone|plyr,"reginhard_calm1", [], "He hated you and decided to fight. He left us no choice.", "reginhard_calm2",[]],
  
  [anyone,"reginhard_calm2", [], "{s2}^^Yes, he did not listen to me. The jarl deceived me, told me he wanted to meet Thiaderd to negotiate peace, but Thiaderd was smarter than I and told me it was a trap.^" +
    "I insisted, and his brother accompanied me in secret to the meeting with the jarl. So... the Godi of the jarl sacrificed Thiaderd's brother with the Blood Eagle.", "reginhard_calm3",[
      (str_clear,s2),
      (str_store_string, s2, "@--He looks at you with his shoulders slumped. He looks dejected.--", color_good_news),
      (assign, "$option_switches", 0),
  ]],
  
  [anyone|plyr,"reginhard_calm3", [
      (store_and, reg0, "$option_switches", option_1),
      (eq, reg0, 0),
      ], "What is the Blood Eagle?", "reginhard_calm4",[]],
  
  [anyone|plyr,"reginhard_calm3", [], "He died like a warrior. It's time to get going. The jarl of Kennemer waits for us.", "reginhard_calm42",[]],
  [anyone|plyr,"reginhard_calm3", [], "He died like a warrior, but you live like a rat. Go give the news to the jarl and leave my party.", "reginhard_calm43",[
  ]],
  
  [anyone,"reginhard_calm4", [], "The Danish call it Blodugr Orn. They cut away all of the ribs from the spine, and then they rip out the living lungs to flap like eagle's wings.^" +
    "It is horrible! I hope you never see it.", "reginhard_calm3",[(val_or, "$option_switches", option_1)]],
  
  [anyone,"reginhard_calm42", [], "{s4}^^Then you work for the jarl of Kennemer... In the end, he got what he wanted. Wyrd bid ful araed. One cannot fight fate. Thiaderd is dead, and you are my new family.", "reginhard_calm_finalcon",[
      (str_clear,s4),
      (str_store_string, s4, "@--He looks with grief.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (quest_set_slot,"qst_kennemer_mission_2",slot_quest_current_state, 6),
  ]],
  
  [anyone,"reginhard_calm43", [], "{s4}^^Yes, I am a rat, but you aren't any better. You used me to get him. Thiaderd was a good man. His only sin was to revolt against the Danish and fight for freedom.^" +
    "God forgive me! I accept my fate! Talk to your jarl. Later, when you tell me, I will leave your party. Gaed a wyrd swa hio scel!", "reginhard_calm_finalcon",[
      (str_clear,s2),
      (str_store_string, s4, "@--He spits on the ground, his features hard, sadness giving way to anger--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (quest_set_slot,"qst_kennemer_mission_2",slot_quest_current_state, 6),
  ]],
  
  [anyone,"reginhard_calm_finalcon", [], "Gaed a wyrd swa hio scel!", "reginhard_calm_finalcon2",[
      (str_clear,s3),
      (add_xp_as_reward,1000),
      (str_store_party_name_link, s3, "p_castle_63"),
      (str_store_string, s2, "@Thiaderd is dead. Bring the news to the jarl of {s3}."),
      (add_quest_note_from_sreg, "qst_kennemer_mission_2", 6, s2, 0),
      (call_script, "script_succeed_quest", "qst_kennemer_mission_2"),
  ]],
  [anyone|plyr,"reginhard_calm_finalcon2", [
      ], "Fate goes ever as she shall!", "close_window",[
      (call_script, "script_change_player_party_morale", 4),
      #(change_screen_notes, 4),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  ###
  ###2 reginhard talk about kennemer jarl
  [anyone|plyr,"reginhard_mission3_1", [], "I need him to find Sven Bull Neck.", "reginhard_mission3_2",[]],
  [anyone|plyr,"reginhard_mission3_1", [], "I'm not interested in your opinion. See to preparing your things, for soon you'll leave.", "reginhard_mission3_3",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
  ]],
  
  
  [anyone,"reginhard_mission3_2", [], "{s2}^^There are always other ways that do not require that we submit to the will of others, but we'll talk later. A rider approaches from Doccinga.", "close_window",[
      (str_clear,s2),
      (str_store_string, s2, "@--He looks over your shoulder into the distance.--", color_good_news),
      (quest_set_slot,"qst_kennemer_mission_3",slot_quest_current_state, 2),
  ]],
  
  [anyone,"reginhard_mission3_3", [], "{s2}^^I know, and my things are ready. You can kick me out anytime, but now you have other concerns. A rider approaches from Doccinga.", "close_window",[
      (str_clear,s2),
      (str_store_string, s2, "@--He looks over your shoulder into the distance.--", color_good_news),
      (quest_set_slot,"qst_kennemer_mission_3",slot_quest_current_state, 2),
  ]],
  
  #reginhard after coastal assault doccinga
  [anyone|plyr,"reginhard_postdoccingaca", [], "I did what I had to do. The jarl of Kennemer is a traitor, and I want him far from me.", "reginhard_postdoccingaca2",[]],
  [anyone|plyr,"reginhard_postdoccingaca", [], "If I had known I would lose all the jarl's confidence, I would have not helped Doccinga.", "reginhard_postdoccingaca3",[]],
  [anyone|plyr,"reginhard_postdoccingaca", [], "I do not want to talk right now, Reginhard. Excuse me.", "reginhard_postdoccingaca4",[]],
  
  [anyone,"reginhard_postdoccingaca2", [], "{s2}^^I told you he is a snake. Now you are free from him, and we should leave Friese soon, as I fear that he will look for revenge. " +
    "I have heard that in the Kingdom of Mierce, over the sea, they need warriors. Wyrd bid ful araed.", "close_window",[
      (str_clear,s2),
      (str_store_string, s2, "@--He puts his hand on your shoulder and smiles.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 8),
      (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 2),
  ]],
  [anyone,"reginhard_postdoccingaca3", [], "{s2}^^These are the words of a coward. I guess you're concerned and not thinking clearly. We'll talk later.", "close_window",[
      (str_clear,s2),
      (str_store_string, s2, "@--He turns away from you with a grimace.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -8),
      (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 2),
  ]],
  [anyone,"reginhard_postdoccingaca4", [], "{s2}^^I understand. I'm by your side for what you need. Let us follow the path.", "close_window",[
      (str_clear,s2),
      (str_store_string, s2, "@--He nods. You note the concern in his eyes.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 4),
      (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 2),
  ]],
  
  ###################
  
  [anyone, "event_triggered", [
      (store_conversation_troop, "$map_talk_troop"),
      (eq, "$map_talk_troop", "$npc_is_quitting"),
      (troop_get_slot, ":honorific", "$map_talk_troop", slot_troop_honorific),
      (str_store_string, 5, ":honorific")],
    "Excuse me, {s5}. There is something I need to tell you.", "companion_quitting", [
      (assign, "$npc_is_quitting", 0),
      (assign, "$player_can_persuade_npc", 1),
      (assign, "$player_can_refuse_npc_quitting", 1),
  ]],
  
  ### This is also where the dialogue jumps if the player initiates quitting dialogue and the companion has low morale
  [anyone, "companion_quitting", [
      (store_conversation_troop, "$map_talk_troop"),
      (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_retirement_speech),
      (str_store_string, 5, ":speech")
    ],
    "{!}{s5}", "companion_quitting_2", [
  ]],
  
  ## The companion explains his/her reasons for quitting
  [anyone, "companion_quitting_2", [
      (call_script, "script_npc_morale", "$map_talk_troop"),
    ],
    "To tell you the truth, {s21}", "companion_quitting_response", [
  ]],
  
  [anyone|plyr, "companion_quitting_response", [
      (neq, "$campaign_type", camp_storyline), #chief only in sandbox
      ], "Very well. You be off, then.", "companion_quitting_yes", [
  ]],
  
  [anyone|plyr, "companion_quitting_response", [
      (neq, "$campaign_type", camp_storyline), #chief only in sandbox
      (eq, "$player_can_persuade_npc", 1),
      ], "Perhaps I can persuade you to change your mind.", "companion_quitting_persuasion", [
      (assign, "$player_can_persuade_npc", 0),
  ]],
  
  [anyone, "companion_quitting_response", [ (eq, "$campaign_type", camp_storyline), #chief only in sandbox
    ],
    "Thank you for listening to me.", "close_window", [
  ]],
  
  [anyone, "companion_quitting_persuasion", [
      (store_random_in_range, ":random", 0, 13),
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (le, ":random", ":persuasion"),
    ],
    "Hm. When you put it like that, I suppose I can stay a while longer, see if things improve.", "close_window",
    [
      (troop_get_slot, ":morality_penalties", "$map_talk_troop", slot_troop_morality_penalties),
      (val_div, ":morality_penalties", 2),
      (troop_set_slot, "$map_talk_troop", slot_troop_morality_penalties, ":morality_penalties"),
      
      (troop_get_slot, ":personalityclash_penalties", "$map_talk_troop", slot_troop_personalityclash_penalties),
      (val_div, ":personalityclash_penalties", 2),
      (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_penalties, ":personalityclash_penalties"),
  ]],
  
  [anyone, "companion_quitting_persuasion", [
    ],
    "I'm sorry, but I don't see your point. I am leaving whether you like it or not.", "companion_quitting_response",
    [
  ]],
  
  [anyone|plyr, "companion_quitting_response", [
      (neq, "$campaign_type", camp_storyline), #chief only in sandbox
      (eq, "$player_can_refuse_npc_quitting", 1),
      (call_script, "script_npc_morale", "$map_talk_troop"),
      (gt, reg0, 20),
      ], "Now is not the time to discuss these issues.", "companion_quitting_no", [
  ]],
  
  # [anyone|plyr, "companion_quitting_response", [
      # (eq, 1, 0),
      # (eq, "$player_can_refuse_npc_quitting", 1),
      # ], "We hang deserters in this company.", "companion_quitting_no", [
  # ]],
  
  [anyone, "companion_quitting_no", [],
    "Oh... Right... Do you mean that?", "companion_quitting_no_confirm", [
  ]],
  
  [anyone|plyr, "companion_quitting_no_confirm", [],
    "Absolutely. You leave by my command or carried out on your shield. Which shall it be?", "companion_quitting_no_confirmed", [
  ]],
  
  [anyone|plyr, "companion_quitting_no_confirm", [  (neq, "$campaign_type", camp_storyline), #chief only in sandbox
    ],
    "No, actually I don't mean that. You are free to leave.", "companion_quitting_yes", [
  ]],
  
  [anyone, "companion_quitting_yes", [
    ],
    "Then this is farewell. Perhaps I'll see you around, {playername}.", "close_window", [
      (troop_set_slot, "$map_talk_troop", slot_troop_playerparty_history, pp_history_quit),
      (call_script, "script_retire_companion", "$map_talk_troop", 200),
  ]],
  
  [anyone, "companion_quitting_no_confirmed", [
    ],
    "Hm. I suppose I'm staying, then.", "close_window", [
  ]],
  
  
  #Morality objections
  [anyone, "event_triggered", [
      (store_conversation_troop, "$map_talk_troop"),
      (is_between, "$map_talk_troop", companions_begin, companions_end),
      
      (eq, "$map_talk_troop", "$npc_with_grievance"),
      (eq, "$npc_map_talk_context", slot_troop_morality_state),
      
      
      (try_begin),
        (eq, "$npc_grievance_slot", slot_troop_morality_state),
        (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_morality_speech),
      (else_try),
        (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_2ary_morality_speech),
      (try_end),
      (str_store_string, 21, "$npc_grievance_string"),
      (str_store_string, 5, ":speech"),
    ],
    "{!}{s5}", "companion_objection_response", [
      (assign, "$npc_with_grievance", 0),
  ]],
  
  
  
  [anyone|plyr, "companion_objection_response", [
      (eq, "$npc_praise_not_complaint", 1),
      ], "Thanks, I appreciate your opinion.", "close_window", [
      (troop_set_slot, "$map_talk_troop", "$npc_grievance_slot", tms_acknowledged),
  ]],
  
  [anyone|plyr, "companion_objection_response", [
      (eq, "$npc_praise_not_complaint", 0),
      ], "I hope that it won't happen again.", "close_window", [
      (troop_set_slot, "$map_talk_troop", "$npc_grievance_slot", tms_acknowledged),
  ]],
  
  [anyone|plyr, "companion_objection_response", [
      (eq, "$npc_praise_not_complaint", 0),
      ],  "Your objection is noted. Now fall back in line.", "close_window", [
      (troop_set_slot, "$map_talk_troop", "$npc_grievance_slot", tms_dismissed),
      (troop_get_slot, ":grievance", "$map_talk_troop", slot_troop_morality_penalties),
      (val_add, ":grievance", 10),
      (troop_set_slot, "$map_talk_troop", slot_troop_morality_penalties, ":grievance"),
  ]],
  
  
  ##  [anyone|plyr, "companion_objection_response", [
  ##      ],  "I prefer my followers to keep their opinions to themselves.", "close_window", [
  ##                    (troop_set_slot, "$map_talk_troop", "$npc_grievance_slot", tms_dismissed),
  ##                    (troop_get_slot, ":grievance", "$map_talk_troop", slot_troop_morality_penalties),
  ##                    (val_add, ":grievance", 10),
  ##                    (troop_set_slot, "$map_talk_troop", slot_troop_morality_penalties, ":grievance"),
  ##                    (assign, "$disable_npc_complaints", 1),
  ##          ]],
  
  
  # Personality clash 2 objections
  [anyone, "event_triggered", [
      (store_conversation_troop, "$map_talk_troop"),
      
      (eq, "$map_talk_troop", "$npc_with_personality_clash_2"),
      (eq, "$npc_map_talk_context", slot_troop_personalityclash2_state),
      
      (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_personalityclash2_speech),
      (troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash2_object),
      (str_store_troop_name, 11, ":object"),
      (str_store_string, 5, ":speech"),
    ],
    "{!}{s5}", "companion_personalityclash2_b", [
      (assign, "$npc_with_personality_clash_2", 0),
      (troop_get_slot, ":grievance", "$map_talk_troop", slot_troop_personalityclash_penalties),
      (val_add, ":grievance", 5),
      (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_penalties, ":grievance"),
      
      (troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash2_object),
      (call_script, "script_troop_change_relation_with_troop", "$map_talk_troop", ":object", -15),
  ]],
  
  [anyone, "companion_personalityclash2_b", [
      ],  "{!}{s5}", "companion_personalityclash2_response", [
      (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_personalityclash2_speech_b),
      (troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash2_object),
      (str_store_troop_name, 11, ":object"),
      (str_store_string, 5, ":speech"),
  ]],
  
  
  
  [anyone|plyr, "companion_personalityclash2_response", [
      (troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash2_object),
      (str_store_troop_name, s11, ":object"),
      (troop_get_type, reg11, ":object"),
      (val_mod, reg11, 2),
      ],  "{s11} is a valuable member of this company. I don't want you picking any more fights with {reg11?her:him}.", "close_window", [
      (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash2_state, pclash_penalty_to_self),
  ]],
  
  [anyone|plyr, "companion_personalityclash2_response", [
      (troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash2_object),
      (str_store_troop_name, s11, ":object"),
      (troop_get_type, reg11, ":object"),
      (val_mod, reg11, 2),
      ],  "Tell {s11} you have my support in this, and {reg11?she:he} should hold {reg11?her:his} tongue.", "close_window", [
      (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash2_state, pclash_penalty_to_other),
  ]],
  
  [anyone|plyr, "companion_personalityclash2_response", [
      ],  "I don't have time for your petty dispute. Do not bother me with this again.", "close_window", [
      (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash2_state, pclash_penalty_to_both),
  ]],
  
  
  ##  [anyone|plyr, "companion_personalityclash2_response", [
  ##      ],  "Your grievance is noted. Now fall back in line.", "close_window", [
  ##                    (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash2_state, 1),
  ##          ]],
  
  ##  [anyone|plyr, "companion_personalityclash2_response", [
  ##      ],  "I prefer my followers to keep their opinions to themselves.", "close_window", [
  ##                    (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash2_state, 1),
  ##                    (assign, "$disable_npc_complaints", 1),
  ##          ]],
  
  
  
  
  # Personality clash objections
  
  [anyone, "event_triggered", [
      (store_conversation_troop, "$map_talk_troop"),
      
      (eq, "$map_talk_troop", "$npc_with_personality_clash"),
      (eq, "$npc_map_talk_context", slot_troop_personalityclash_state),
      
      (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_personalityclash_speech),
      (troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash_object),
      (str_store_troop_name, 11, ":object"),
      (str_store_string, 5, ":speech"),
    ],
    "{!}{s5}", "companion_personalityclash_b", [
      (assign, "$npc_with_personality_clash", 0),
      (troop_get_slot, ":grievance", "$map_talk_troop", slot_troop_personalityclash_penalties),
      (val_add, ":grievance", 5),
      (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_penalties, ":grievance"),
      
      (troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash_object),
      (call_script, "script_troop_change_relation_with_troop", "$map_talk_troop", ":object", -15),
      
  ]],
  
  [anyone, "companion_personalityclash_b", [
      ],  "{!}{s5}", "companion_personalityclash_response", [
      (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_personalityclash_speech_b),
      (troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash_object),
      (str_store_troop_name, 11, ":object"),
      (str_store_string, 5, ":speech"),
  ]],
  
  [anyone|plyr, "companion_personalityclash_response", [
      (troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash_object),
      (str_store_troop_name, s11, ":object"),
      (troop_get_type, reg11, ":object"),
      (val_mod, reg11, 2),
      ],  "{s11} is a capable member of this company. I don't want you picking any more fights with {reg11?her:him}.", "close_window", [
      (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_state, pclash_penalty_to_self),
  ]],
  
  [anyone|plyr, "companion_personalityclash_response", [
      (troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalityclash_object),
      (str_store_troop_name, s11, ":object"),
      (troop_get_type, reg11, ":object"),
      (val_mod, reg11, 2),
      ],  "Tell {s11} you have my support in this, and {reg11?she:he} should hold {reg11?her:his} tongue.", "close_window", [
      (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_state, pclash_penalty_to_other),
  ]],
  
  [anyone|plyr, "companion_personalityclash_response", [
      ],  "I don't have time for your petty dispute. Do not bother me with this again.", "close_window", [
      (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_state, pclash_penalty_to_both),
  ]],
  
  
  ##  [anyone|plyr, "companion_personalityclash_response", [
  ##      ],  "Your grievance is noted. Now fall back in line.", "close_window", [
  ##                    (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_state, 1),
  ##          ]],
  
  ##  [anyone|plyr, "companion_personalityclash_response", [
  ##      ],  "I prefer my followers to keep their opinions to themselves.", "close_window", [
  ##                    (troop_set_slot, "$map_talk_troop", slot_troop_personalityclash_state, 1),
  ##                    (assign, "$disable_npc_complaints", 1),
  ##          ]],
  
  
  
  # Personality match
  
  [anyone, "event_triggered", [
      (eq, "$npc_map_talk_context", slot_troop_personalitymatch_state),
      (store_conversation_troop, "$map_talk_troop"),
      
      (eq, "$map_talk_troop", "$npc_with_personality_match"),
      
      (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_personalitymatch_speech),
      (troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalitymatch_object),
      (str_store_troop_name, 11, ":object"),
      (str_store_string, 5, ":speech"),
      
    ],
    "{!}{s5}", "companion_personalitymatch_b", [
      (assign, "$npc_with_personality_match", 0),
      (troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalitymatch_object),
      (call_script, "script_troop_change_relation_with_troop", "$map_talk_troop", ":object", 15),
      
  ]],
  
  [anyone, "companion_personalitymatch_b", [
      (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_personalitymatch_speech_b),
      (troop_get_slot, ":object", "$map_talk_troop", slot_troop_personalitymatch_object),
      (str_store_troop_name, 11, ":object"),
      (str_store_string, 5, ":speech"),
      
    ],
    "{!}{s5}", "companion_personalitymatch_response", [
  ]],
  
  
  [anyone|plyr, "companion_personalitymatch_response", [
      ],  "Very good.", "close_window", [
      (troop_set_slot, "$map_talk_troop", slot_troop_personalitymatch_state, 1),
      
  ]],
  
  
  
  ##  [anyone|plyr, "companion_personalitymatch_response", [
  ##      ],  "I prefer my followers to keep their opinions to themselves.", "close_window", [
  ##                    (troop_set_slot, "$map_talk_troop", slot_troop_personalitymatch_state, 1),
  ##                    (assign, "$disable_npc_complaints", 1),
  ##          ]],
  
  [anyone, "event_triggered", [
      (eq, "$npc_map_talk_context", slot_troop_woman_to_woman_string),
      (store_conversation_troop, "$map_talk_troop"),
      (eq, "$map_talk_troop", "$npc_with_sisterly_advice"),
      
      (store_sub, ":npc_no", "$map_talk_troop", "trp_npc1"),
      (store_add, ":speech", "str_npc1_woman_to_woman", ":npc_no"),
      #                     (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_woman_to_woman_string),
      (str_store_string, s5, ":speech"),
    ],
    "{!}{s5}", "companion_sisterly_advice", [
      (troop_set_slot, "$map_talk_troop", slot_troop_woman_to_woman_string, -1),
      (assign, "$npc_with_sisterly_advice", 0),
  ]],
  
  [anyone|plyr, "companion_sisterly_advice", [
      ],  "Thank you.", "close_window", [
  ]],
  
  [anyone|plyr, "companion_sisterly_advice", [
      ],  "I would prefer not to discuss such things.", "close_window", [
      (assign, "$disable_sisterly_advice", 1),
  ]],
  
  
  
  [anyone, "event_triggered", [
      (eq, "$g_infinite_camping", 0),
      (eq, "$npc_map_talk_context", slot_troop_home),
      (store_conversation_troop, "$map_talk_troop"),
      (is_between, "$map_talk_troop", companions_begin, companions_end),
      
      (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_home_intro),
      (str_store_string, s5, ":speech"),
    ],
    "{!}{s5}", "companion_home_description", [
      (troop_set_slot, "$map_talk_troop", slot_troop_home_speech_delivered, 1),
  ]],
  
  [anyone|plyr, "companion_home_description", [
      ],  "Tell me more.", "companion_home_description_2", [
  ]],
  
  [anyone|plyr, "companion_home_description", [
      ],  "We don't have time to chat just now.", "close_window", [
  ]],
  
  [anyone|plyr, "companion_home_description", [
      ],  "I prefer my companions not to bother me with such trivialities.", "close_window", [
      (assign, "$disable_local_histories", 1),
  ]],
  
  
  [anyone, "companion_home_description_2", [
      (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_home_description),
      (str_store_string, 5, ":speech"),
      ],  "{!}{s5}", "companion_home_description_3", [
  ]],
  
  [anyone, "companion_home_description_3", [
      (troop_get_slot, ":speech", "$map_talk_troop", slot_troop_home_description_2),
      (str_store_string, 5, ":speech"),
      ],  "{!}{s5}", "close_window", [
  ]],
  
  [anyone,"event_triggered", [
      (eq, "$talk_context", tc_rebel_thanks),
      (store_conversation_troop, "$g_talk_troop"),
      (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
      
      (troop_get_slot, ":old_faction", "$g_talk_troop", slot_troop_original_faction),
      (str_store_faction_name, s3, ":old_faction"),
      (str_store_string, s6, "@{playername}, when we started our long walk, few people had the courage to support me. " +
        "Fewer still were willing to put their lives at risk for my cause, " +
        "but you didn't hesitate to throw yourself at my enemies. " +
        "We have gone through a lot together, and there were times I came close to losing all hope, " +
        "but we prevailed. It is now time for me to leave your shield wall and take what's rightfully mine. " +
        "From now on, I will carry out the great responsibility of ruling the {s3}. " +
        "There still lie many challenges ahead, and I count on your help in overcoming those. " +
      "Of course, you will always be my foremost vassal."), #cambios chief dialogo
    ],
    "{!}{s6}", "rebel_thanks_answer",
    [
      (unlock_achievement, ACHIEVEMENT_KINGMAKER),
      (call_script, "script_succeed_quest", "qst_rebel_against_kingdom"),
      (set_show_messages, 0),
      (call_script, "script_end_quest", "qst_rebel_against_kingdom"),
      (set_show_messages, 1),
      
      (try_begin),
        (troop_get_type, ":is_female", "trp_player"),
        (val_mod, ":is_female", 2),
        (eq, ":is_female", 1),
        
        (troop_get_type, ":is_female", "$g_talk_troop"),
        (val_mod, ":is_female", 2),
        (eq, ":is_female", 1),
        
        (unlock_achievement, ACHIEVEMENT_GIRL_POWER),
      (try_end),
  ]],
  
  [anyone|plyr,"rebel_thanks_answer", [], "It has been an honour to fight for your cause, {reg65?madame:my lord}.", "rebel_thanks_answer_2", []],
  [anyone|plyr,"rebel_thanks_answer", [], "You will always have my loyal support, {reg65?my lady:sir}.", "rebel_thanks_answer_2", []],
  
  [anyone,"rebel_thanks_answer_2", [], "I will miss living this life of adventure with you, but my duties await me. Farewell for now, {playername}. " +
    "I hope I'll see you again soon.", "close_window", []],
  
  
  
  [anyone, "event_triggered", [
      (store_conversation_troop, "$map_talk_troop"),
      
      (eq, "$map_talk_troop", "$npc_with_political_grievance"),
      (eq, "$npc_map_talk_context", slot_troop_kingsupport_objection_state),
      
      (store_sub, ":npc_no", "$g_talk_troop", "trp_npc1"),
      (store_add, ":string", "str_npc1_kingsupport_objection", ":npc_no"),
      #					 (troop_get_slot, ":string", "$map_talk_troop", slot_troop_kingsupport_objection_string),
      (str_store_string, 21, ":string"),
    ],
    "{!}{s21}", "companion_political_grievance_response", [
      (assign, "$npc_with_political_grievance", 0),
      (troop_set_slot, "$map_talk_troop", slot_troop_kingsupport_objection_state, 2),
      
  ]],
  
  [anyone|plyr, "companion_political_grievance_response", [
      #                    (eq, "$npc_praise_not_complaint", 0),
      ],  "Your opinion is noted.", "close_window", [
      (troop_get_slot, ":grievance", "$map_talk_troop", slot_troop_morality_penalties),
      (val_add, ":grievance", 25),
      (troop_set_slot, "$map_talk_troop", slot_troop_morality_penalties, ":grievance"),
  ]],
  
  
  [anyone, "event_triggered", [
      (store_conversation_troop, "$map_talk_troop"),
      
      (eq, "$map_talk_troop", "$npc_to_rejoin_party"),
      (eq, "$npc_map_talk_context", slot_troop_days_on_mission),
      
      (troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_kingsupport),
      
      (troop_get_slot, ":string", "$map_talk_troop", slot_troop_honorific),
      (str_store_string, 21, ":string"),
    ],
    "Well, {s21}, at last I've found you. I've been out spreading the word about your claim, and am now ready to rejoin the shield wall.", "companion_rejoin_response", [
      (call_script, "script_change_player_right_to_rule", 3),
      (troop_set_slot, "$g_talk_troop", slot_troop_kingsupport_state, 1),
      
      (try_begin),
        (is_between, "$player_right_to_rule", 10, 15),
        (call_script, "script_add_log_entry", logent_player_claims_throne_1, "trp_player", 0, 0, 0),
      (else_try),
        (is_between, "$player_right_to_rule", 20, 25),
        (call_script, "script_add_log_entry", logent_player_claims_throne_2, "trp_player", 0, 0, 0),
      (try_end),
  ]],
  
  [anyone, "event_triggered", [
      (store_conversation_troop, "$map_talk_troop"),
      
      (eq, "$map_talk_troop", "$npc_to_rejoin_party"),
      (eq, "$npc_map_talk_context", slot_troop_days_on_mission),
      
      (troop_slot_eq, "$map_talk_troop", slot_troop_current_mission, npc_mission_gather_intel),
      
      (troop_get_slot, ":string", "$map_talk_troop", slot_troop_honorific),
      (str_store_string, 21, ":string"),
      
      (troop_get_slot, ":town_with_contacts", "$map_talk_troop", slot_troop_town_with_contacts),
      (store_faction_of_party, ":town_faction", ":town_with_contacts"),
      
      (call_script, "script_update_faction_political_notes", ":town_faction"),  #loads s11
    ],
    "Well, {s21}, I've found you at last! {s11}. The rest of my report I submit to you in writing.", "companion_rejoin_response", [
  ]],
  
  [anyone, "event_triggered", [
      (store_conversation_troop, "$map_talk_troop"),
      
      (eq, "$map_talk_troop", "$npc_to_rejoin_party"),
      (eq, "$npc_map_talk_context", slot_troop_days_on_mission),
      
      (troop_get_slot, ":mission", "$g_talk_troop", slot_troop_current_mission),
      (this_or_next|eq, ":mission", npc_mission_peace_request),
      (this_or_next|eq, ":mission", npc_mission_pledge_vassal),
      # (this_or_next|eq, ":mission", npc_mission_test_waters),
      # (this_or_next|eq, ":mission", npc_mission_non_aggression),
      (eq, ":mission", npc_mission_seek_recognition),
      
      (troop_get_slot, ":string", "$map_talk_troop", slot_troop_honorific),
      (str_store_string, 21, ":string"),
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (str_store_faction_name, s31, ":mission_object"),
      
      (call_script, "script_npc_decision_checklist_peace_or_war", ":mission_object", "fac_player_supporters_faction", "$g_talk_troop"),
      (assign, "$g_mission_result", reg0),
    ],
    "Well, {s21}, at last I've found you. I have returned from my mission to the {s31}. In general, I would say, {s14}.","companion_embassy_results", [
  ]],
  
  [anyone, "companion_embassy_results", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_seek_recognition),
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      
      (faction_slot_eq, ":mission_object", slot_faction_recognized_player, 1),
      
      (faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
      (str_store_troop_name, s12, ":emissary_object"),
      (str_store_faction_name, s4, "fac_player_supporters_faction"),
    ],
    "In this letter, {s12} addresses you as {reg59?Lady:Lord} of the {s4}, which implies some sort of recognition that you are a sovereign and independent monarch.","companion_rejoin_response", [
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (try_begin),
        (faction_slot_eq, ":mission_object", slot_faction_recognized_player, 0),
        (faction_set_slot, ":mission_object", slot_faction_recognized_player, 1),
        (call_script, "script_change_player_right_to_rule", 10),
      (try_end),
  ]],
  
  [anyone, "companion_embassy_results", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_seek_recognition),
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      
      (ge, "$g_mission_result", 2),
      (is_between, "$g_player_court", centers_begin, centers_end),
      (neg|party_slot_eq, "$g_player_court", slot_center_original_faction, ":mission_object"),
      
      (faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
      (str_store_troop_name, s12, ":emissary_object"),
      (str_store_party_name, s4, "$g_player_court"),
    ],
    "In this letter, {s12} addresses you as {reg59?Lady:Lord} of {s4}, which implies some sort of recognition that you are a sovereign and independent monarch.","companion_rejoin_response", [
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (faction_set_slot, ":mission_object", slot_faction_recognized_player, 1),
      (call_script, "script_change_player_right_to_rule", 10),
  ]],
  
  [anyone, "companion_embassy_results", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_seek_recognition),
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      
      (ge, "$g_mission_result", 2),
      (is_between, "$g_player_court", centers_begin, centers_end),
      
      (faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
      (str_store_troop_name, s12, ":emissary_object"),
    ],
    "In his letter, {s12} merely refers to you as {playername}. {reg65?She:He} refused to acknowledge that you hold court in a former fief. This does not constitute recognition of your right to rule.","companion_rejoin_response", [
  ]],
  
  [anyone, "companion_embassy_results", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_seek_recognition),
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      
      (ge, "$g_mission_result", 2),
      
      (faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
      (str_store_troop_name, s12, ":emissary_object"),
    ],
    "In his letter, {s12} merely refers to you as {playername}, omitting any title. This does not constitute recognition of your right to rule. {reg65?She:He} seemed nonplussed that you do not hold court anywhere.","companion_rejoin_response", [
  ]],
  
  [anyone, "companion_embassy_results", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_seek_recognition),
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
      (str_store_troop_name, s12, ":emissary_object"),
      
    ],
    "In his letter, {s12} merely refers to you as {playername}, omitting any title. This does not constitute recognition of your right to rule.","companion_rejoin_response", [
  ]],
  
  [anyone, "companion_embassy_results", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_peace_request),
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (faction_slot_ge, ":mission_object", slot_faction_truce_days_with_factions_begin, 1),
      (faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
      (str_store_troop_name, s12, ":emissary_object"),
      
    ],
    "{s12} says that your current truce should suffice.","companion_rejoin_response", [
  ]],
  
  
  [anyone, "companion_embassy_results", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_peace_request),
      (ge, "$g_mission_result", 1),
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
      (str_store_troop_name, s12, ":emissary_object"),
      
    ],
    "{s12} says that he is willing to consider a truce.","companion_truce_confirm", [
  ]],
  
  [anyone, "companion_embassy_results", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_peace_request),
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
      (str_store_troop_name, s12, ":emissary_object"),
      
    ],
    "{s12} says that he is unwilling to conclude a peace.","companion_rejoin_response", [
  ]],
  
  
  [anyone|plyr, "companion_truce_confirm", [
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (str_store_faction_name, s4, ":mission_object"),
    ],
    "Very well. Let this truce with the {s4} be concluded.","companion_rejoin_response", [
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (call_script, "script_diplomacy_start_peace_between_kingdoms", ":mission_object", "$players_kingdom", 1),
      (str_store_faction_name, s4, ":mission_object"),
  ]],
  
  [anyone|plyr, "companion_truce_confirm", [],
    "On second thought, perhaps this is currently not in our interests.","companion_rejoin_response", [
  ]],
  
  
  [anyone, "companion_embassy_results", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_pledge_vassal),
      #					(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (this_or_next|check_quest_active, "qst_join_faction"),
      (is_between, "$players_kingdom", npc_kingdoms_begin, npc_kingdoms_end),
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
      (str_store_troop_name, s12, ":emissary_object"),
      
    ],
    "{s12} says that you have pledged to serve another ruler.","companion_rejoin_response", [
  ]],
  
  [anyone, "companion_embassy_results", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_pledge_vassal),
      #					(troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (lt, "$g_mission_result", -2),
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
      (str_store_troop_name, s12, ":emissary_object"),
      
    ],
    "{s12} says that he does not believe you would honor your obligations as a vassal, and suspects that your offer is just a ploy.","companion_rejoin_response", [
  ]],
  
  [anyone, "companion_embassy_results", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_current_mission, npc_mission_pledge_vassal),
      (troop_get_slot, ":mission_object", "$g_talk_troop", slot_troop_mission_object),
      (faction_get_slot, ":emissary_object", ":mission_object", slot_faction_leader),
      (str_store_troop_name, s12, ":emissary_object"),
      
    ],
    "{s12} says that he accepts your offer of vassalage. He will give you 30 days to seek him out, in which time he will refrain from making war on you.","vassalage_offer_confirm", [
  ]],
  
  [anyone|plyr, "vassalage_offer_confirm", [],
    "Tell him that I accept his terms...", "companion_rejoin_response", [
      
      (troop_get_slot, "$g_invite_faction", "$g_talk_troop", slot_troop_mission_object),
      (faction_get_slot, "$g_invite_faction_lord", "$g_invite_faction", slot_faction_leader),
      
      (str_store_troop_name,s1,"$g_invite_faction_lord"),
      (setup_quest_text,"qst_join_faction"),
      
      (str_store_troop_name_link, s3, "$g_invite_faction_lord"),
      (str_store_faction_name_link, s4, "$g_invite_faction"),
      (quest_set_slot, "qst_join_faction", slot_quest_giver_troop, "$g_invite_faction_lord"),
      (quest_set_slot, "qst_join_faction", slot_quest_expiration_days, 30),
      
      (try_begin),
        (store_relation, ":relation", "$g_invite_faction", "fac_player_supporters_faction"),
        (lt, ":relation", 0),
        (call_script, "script_diplomacy_start_peace_between_kingdoms", "$g_invite_faction", "fac_player_supporters_faction", 0),
        (quest_set_slot, "qst_join_faction", slot_quest_failure_consequence, 1),
      (try_end),
      
      (str_store_string, s2, "@Find and speak with {s3} of the {s4} to give him your oath of homage."),
      (call_script, "script_start_quest", "qst_join_faction", "$g_invite_faction_lord"),
      (call_script, "script_report_quest_troop_positions", "qst_join_faction", "$g_invite_faction_lord", 3),
  ]],
  
  
  [anyone, "event_triggered", [
      (store_conversation_troop, "$map_talk_troop"),
      
      (eq, "$map_talk_troop", "$npc_to_rejoin_party"),
      (eq, "$npc_map_talk_context", slot_troop_days_on_mission),
      
      (troop_get_slot, ":string", "$map_talk_troop", slot_troop_honorific),
      (str_store_string, 21, ":string"),
    ],
    "Greetings, {s21}. Are you ready for me to rejoin you?"	, "companion_rejoin_response", [
  ]],
  
  
  [anyone|plyr, "companion_rejoin_response", [
      (hero_can_join, "p_main_party"),
      (neg|main_party_has_troop, "$map_talk_troop"),
      ],  "Welcome back, friend!", "close_window", [
      (party_add_members, "p_main_party", "$map_talk_troop", 1),
      (assign, "$npc_to_rejoin_party", 0),
      (troop_set_slot, "$map_talk_troop", slot_troop_current_mission, 0),
      (troop_set_slot, "$map_talk_troop", slot_troop_days_on_mission, 0),
  ]],
  
  [anyone|plyr, "companion_rejoin_response", [
      ],  "Unfortunately, I cannot take you back just yet.", "companion_rejoin_refused", [
      (troop_set_slot, "$map_talk_troop", slot_troop_current_mission, npc_mission_rejoin_when_possible),
      (troop_set_slot, "$map_talk_troop", slot_troop_days_on_mission, 0),
      (assign, "$npc_to_rejoin_party", 0),
  ]],
  
  [anyone, "companion_rejoin_refused", [
      ],  "As you wish. I will take care of some business, and try again in a few days.", "close_window", [
  ]],
  
  
  #caravan merchants
  [anyone, "event_triggered",
    [(eq, "$caravan_escort_state",1),
      (eq, "$g_encountered_party","$caravan_escort_party_id"),
      (le, "$talk_context",tc_party_encounter),
      (store_distance_to_party_from_party, reg0, "$caravan_escort_destination_town", "$caravan_escort_party_id"),
      (lt, reg0, 5),
      (str_store_party_name, s3, "$caravan_escort_destination_town"),
      (assign, reg3, "$caravan_escort_agreed_reward"),
    ],
    "There! I can see the walls of {s3} in the distance. We've made it safely. " +
    "Here, take this purse of {reg3} peningas, as I promised. I hope we can travel together again someday.", "close_window",
    [
      (assign,"$caravan_escort_state",0),
      (call_script, "script_troop_add_gold", "trp_player", "$caravan_escort_agreed_reward"),
      (assign,reg(4), "$caravan_escort_agreed_reward"),
      (val_mul,reg(4), 1),
      (add_xp_as_reward,reg(4)),
      (assign, "$g_leave_encounter",1),
  ]],
  
  
  #puesto off chief por problema bug con companeros, pero seria mejor no tocarlo hasta que lo corrija talesword
  #en principio parece que no da problemas, pero estar atentos
  ##  [anyone, "event_triggered", [
  ##                     ],
  ##   "{!}Sorry -- just talking to myself [ERROR- {s51}]", "close_window", [
  ##       ]],
  
  [anyone, "event_triggered", [
    ],
    # "Sorry, I must take care of some business, but look me up again later... (companions limited to ten in party)", "close_window", [
    "Sorry, I must take care of some business, but look me up again later... [ERROR- {s51}]", "close_window", [
      # (troop_set_slot, "$map_talk_troop", slot_troop_playerparty_history, pp_history_quit),
      # (call_script, "script_retire_companion", "$map_talk_troop", 150),
  ]],
  
  
  
  
  
  
  #KINGDOM LORD DIALOGS BEGINS HERE
  
  
  
  
  #FEMALE PLAYER CHACTER WEDDING (also go to the feast, 'lift a glass' speeches for npc lords)
  #Feast not yet organized
  [anyone, "start", [
      (lt, "$talk_context", tc_siege_commander),
      
      (check_quest_active, "qst_wed_betrothed_female"),
      (quest_slot_eq, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
      
      (store_current_hours, ":hours_since_betrothal"),
      (troop_get_slot, ":betrothal_time", "$g_talk_troop", slot_troop_betrothal_time),
      (val_sub, ":hours_since_betrothal", ":betrothal_time"),
      (lt, ":hours_since_betrothal", 720), #30 days
      (str_clear, s12),
      (try_begin),
        (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
        (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_default),
        (str_store_string, s12, "@ We will of course need to wait until the realm is no longer on campaign."),
      (try_end),
    ],
    "My lady, I look forward to our marriage, as soon as there is an opportunity to hold a proper feast.{s12}", "lord_start", [
  ]],
  
  #Feast, but not at the venue
  [anyone, "start", [
      (lt, "$talk_context", tc_siege_commander),
      
      (check_quest_active, "qst_wed_betrothed_female"),
      (quest_slot_eq, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
      (faction_get_slot, ":feast_venue", "$g_talk_troop_faction", slot_faction_ai_object),
      (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_holding_center),
      (party_slot_eq, "$g_talk_troop_party", slot_party_ai_object, ":feast_venue"),
      
      (neq, ":feast_venue", "$g_encountered_party"),
      (str_store_party_name, s4, ":feast_venue"),
    ],
    "My lady, if you wish to marry, we can proceed to the feast at {s4} to exchange vows before the lords of the realm.", "lord_start", [
  ]],
  
  #Over a month, and heading to a center
  [anyone, "start", [
      (lt, "$talk_context", tc_siege_commander),
      
      (check_quest_active, "qst_wed_betrothed_female"),
      (quest_slot_eq, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
      
      (store_current_hours, ":hours_since_betrothal"),
      (troop_get_slot, ":betrothal_time", "$g_talk_troop", slot_troop_betrothal_time),
      (val_sub, ":hours_since_betrothal", ":betrothal_time"),
      (ge, ":hours_since_betrothal", 720), #30 days
      
      (party_get_attached_to, ":attached", "$g_talk_troop_party"),
      (neg|is_between, ":attached", walled_centers_begin, walled_centers_end),
      
      (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_holding_center),
      (party_get_slot, ":object", "$g_talk_troop_party", slot_party_ai_object),
      (str_store_party_name, s4, ":object"),
    ],
    "My lady, I grow tired of waiting for the lords of this realm to assemble. Come with me to {s4} exchange our vows.", "lord_start", [
  ]],
  
  #Over a month, but not in a center
  [anyone, "start", [
      (lt, "$talk_context", tc_siege_commander),
      (check_quest_active, "qst_wed_betrothed_female"),
      (quest_slot_eq, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
      
      (store_current_hours, ":hours_since_betrothal"),
      (troop_get_slot, ":betrothal_time", "$g_talk_troop", slot_troop_betrothal_time),
      (val_sub, ":hours_since_betrothal", ":betrothal_time"),
      (ge, ":hours_since_betrothal", 0), #30 days
      
      (party_get_attached_to, ":attached", "$g_talk_troop_party"),
      (neg|is_between, ":attached", walled_centers_begin, walled_centers_end),
      
    ],
    "My lady, I grow tired of waiting for the lords of this realm to assemble. Perhaps we should take the first opportunity to marry, in any great hall that is open to us.", "lord_start", [
  ]],
  
  [anyone, "start", [
      (lt, "$talk_context", tc_siege_commander),
      (check_quest_active, "qst_wed_betrothed_female"),
      (quest_slot_eq, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
      (this_or_next|neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
    ],
    "My lady, I have grown tired of waiting. Let us proceed with the vows immediately.", "lord_groom_vows", [
  ]],
  
  [anyone, "start", [
      (lt, "$talk_context", tc_siege_commander),
      (check_quest_active, "qst_wed_betrothed_female"),
      (quest_slot_eq, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
    ],
    "My lady, my eyes rejoice to see you. We may proceed with the vows.", "lord_groom_vows", [
  ]],
  
  [anyone, "lord_groom_vows", [
    ],
    "My lady, with this assembly as my witness, I vow to take you as my wife, to honor, cherish, and protect you. May the heavens bless us with health, prosperity, and children.", "female_pc_marriage_vow", [
  ]],
  
  [anyone|plyr, "female_pc_marriage_vow", [
    ],
    "I vow to take you as my husband.", "lord_groom_wedding_complete", [
      (call_script, "script_courtship_event_bride_marry_groom", "trp_player", "$g_talk_troop", 0),
      (call_script, "script_end_quest", "qst_wed_betrothed_female"),
  ]],
  
  [anyone|plyr, "female_pc_marriage_vow", [
    ],
    "Wait -- I need to think about this.", "close_window", [
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone, "lord_groom_wedding_complete", [
    ],
    "We are now husband and wife. Let the festivities commence!", "close_window",
    []],
  
  
  # KINGDOM LORD DUEL OUTCOMES
  [anyone,"start",
    [(eq, "$talk_context", tc_after_duel),
      (check_quest_active, "qst_denounce_lord"),
      (check_quest_succeeded, "qst_denounce_lord"),
      (quest_slot_eq, "qst_denounce_lord", slot_quest_target_troop, "$g_talk_troop"),
    ],
    "Very well. You've made your point. I have nothing more to say.", "close_window", [
      (call_script, "script_change_troop_renown", "trp_player", 10),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"start",
    [(eq, "$talk_context", tc_after_duel),
      (check_quest_active, "qst_denounce_lord"),
      (check_quest_failed, "qst_denounce_lord"),
      (quest_slot_eq, "qst_denounce_lord", slot_quest_target_troop, "$g_talk_troop"),
    ],
    "Well, {reg59?my lady:sir}! Please, do not trouble yourself to rise from the ground, as I would simply have to knock you down again. I shall take your silence as an apology. Good day to you.", "close_window", [
      (call_script, "script_change_troop_renown", "trp_player", -10),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  
  [anyone,"start",
    [(eq, "$talk_context", tc_after_duel),
      (assign, "$temp", 0),
      (try_begin),
        (check_quest_active, "qst_duel_avenge_insult"),
        (check_quest_succeeded, "qst_duel_avenge_insult"),
        (quest_slot_eq, "qst_duel_avenge_insult", slot_quest_target_troop, "$g_talk_troop"),
        (assign, "$temp", 1),
      (else_try),
        (check_quest_active, "qst_duel_for_lady"),
        (check_quest_succeeded, "qst_duel_for_lady"),
        (quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_talk_troop"),
        (assign, "$temp", 2),
      (try_end),
      (gt, "$temp", 0),
    ],
    "Very well. You've made your point. I retract what I said. I hope you have obtained satisfaction.", "close_window", [
      (try_begin),
        (eq, "$temp", 1),
        (call_script, "script_change_troop_renown", "trp_player", 10),
        (call_script, "script_end_quest", "qst_duel_avenge_insult"),
      (try_end),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"start",
    [(eq, "$talk_context", tc_after_duel),
      (assign, "$temp", 0),
      (try_begin),
        (check_quest_active, "qst_duel_avenge_insult"),
        (check_quest_failed, "qst_duel_avenge_insult"),
        (quest_slot_eq, "qst_duel_avenge_insult", slot_quest_target_troop, "$g_talk_troop"),
        (assign, "$temp", 1),
      (else_try),
        (check_quest_active, "qst_duel_for_lady"),
        (check_quest_failed, "qst_duel_for_lady"),
        (quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_talk_troop"),
        (assign, "$temp", 2),
      (try_end),
      (gt, "$temp", 0),
    ],
    "Hah! Not so gallant now, are we? Now trouble me no more.", "close_window", [
      (try_begin),
        (eq, "$temp", 1),
        (call_script, "script_change_troop_renown", "trp_player", -10),
        (call_script, "script_end_quest", "qst_duel_avenge_insult"),
      (try_end),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"start",
    [(eq, "$talk_context", tc_after_duel),
      (check_quest_active, "qst_duel_courtship_rival"),
      (check_quest_succeeded, "qst_duel_courtship_rival"),
      (quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_talk_troop"),
      (quest_get_slot, ":duel_object", "qst_duel_courtship_rival", slot_quest_giver_troop),
      (str_store_troop_name, s10, ":duel_object"),
    ],
    "Very well -- you have won. Let all those present today witness that you have defeated me, and I shall abandon my suit of {s10}. Are you satisfied, you heartless bastard?", "close_window", [
      (quest_get_slot, ":duel_object", "qst_duel_courtship_rival", slot_quest_giver_troop),
      (call_script, "script_courtship_event_lady_break_relation_with_suitor", ":duel_object", "$g_talk_troop"),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  [anyone,"start",
    [(eq, "$talk_context", tc_after_duel),
      (check_quest_active, "qst_duel_courtship_rival"),
      (check_quest_failed, "qst_duel_courtship_rival"),
      (quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_talk_troop"),
      (quest_get_slot, ":duel_object", "qst_duel_courtship_rival", slot_quest_giver_troop),
      (str_store_troop_name, s10, ":duel_object"),
    ],
    "Get up. Let all those present today witness that I have defeated you, and you are now bound to relinquish your suit of the {s10}. I will permit you one final visit, to make your farewells. After that, if you persist in attempting to see her, everyone shall know that you are a man of scant honor.", "close_window", [
      (assign, "$g_leave_encounter", 1),
  ]],
  #Assasination after duel
  [anyone,"start",
    [(eq, "$talk_context", tc_after_duel),
      (check_quest_active, "qst_blank_quest_15"),
      (check_quest_succeeded, "qst_blank_quest_15"),
      (quest_slot_eq, "qst_blank_quest_15", slot_quest_target_troop, "$g_talk_troop"),
    ],
    "Very well. You've made your point. I apologize for what I did.", "close_window", [
      (try_begin),
        (call_script, "script_change_troop_renown", "trp_player", 20),
        (call_script, "script_end_quest", "qst_blank_quest_15"),
      (try_end),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"start",
    [(eq, "$talk_context", tc_after_duel),
      (check_quest_active, "qst_blank_quest_15"),
      (check_quest_failed, "qst_blank_quest_15"),
      (quest_slot_eq, "qst_blank_quest_15", slot_quest_target_troop, "$g_talk_troop"),
    ],
    "Hah! You lost, {playername}, so that settles it. Be gone now.", "close_window", [
      (try_begin),
        (call_script, "script_change_troop_renown", "trp_player", -20),
        (call_script, "script_end_quest", "qst_blank_quest_15"),
      (try_end),
      (assign, "$g_leave_encounter", 1),
  ]],
  #End assasination after duel
  
  
  # Kingdom Lords:
  #SIEGE WARFARE TO SURRENDER IN SIEGES
  [anyone,"start", [(eq, "$talk_context", tc_castle_commander)],
    "What do you want?", "player_siege_castle_commander_1", []],
  [anyone|plyr,"player_siege_castle_commander_1", [],
    "Surrender! Your situation is hopeless!", "player_siege_ask_surrender", []],
  #siege warfare chief take castle with hostage
  [anyone|plyr,"player_siege_castle_commander_1", [
      (party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord),
      (gt, ":town_lord", 0),
      (is_between, ":town_lord", companions_begin, kingdom_heroes_end),
      (party_count_prisoners_of_type, ":party_has_prisoner", "p_main_party", ":town_lord"),
      (str_store_troop_name, s11, ":town_lord"),
      (gt, ":party_has_prisoner", 0),
    ],
    "I demand your surrender in exchange for the {s11}'s safe return.", "player_hostage_surrender", []],
  #chief acaba
  #siege warfare chief levantar asedio por tributo
  [anyone|plyr,"player_siege_castle_commander_1", [#(ge, "$g_talk_troop_relation", -30),
                                                   ],
    "I offer an honorable agreement to end the siege. Pay us tribute, and we will go.", "player_siege_tributo", []],
  #chief acaba
  [anyone|plyr,"player_siege_castle_commander_1", [], "Nothing. I'll leave you now.", "close_window", []],
  
  [anyone,"player_siege_ask_surrender", [
      (assign, ":modified_enemy_strength", 1),
      
      (try_begin),
        #Kings dont surrender so easily
        (this_or_next|is_between, "$g_talk_troop", kings_begin, kings_end),
        (this_or_next|is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
        (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
        (store_mul, ":modified_enemy_strength","$g_enemy_strength", 3), #player need to have x3 men than deffenders.
      (else_try),
        (is_between, "$g_talk_troop", active_npcs_begin, kingdom_ladies_end),
        (troop_slot_eq, "$g_talk_troop", slot_troop_home, "$g_encountered_party"), #important place for lord
        (store_mul, ":modified_enemy_strength","$g_enemy_strength", 2), #player need to have x2 men than deffenders.
      (else_try),
        (store_mul, ":modified_enemy_strength","$g_enemy_strength", 1.5), #player need to have x1.5 men than deffenders.
      (try_end),
      
      #to base minimum, add bonuses for Persuasion 3, preps, 
      (store_add, "$temp", ":modified_enemy_strength", 30 + 100 + 20 + 10 + 60 + 40 + 30 + 40),
      
      (call_script, "script_party_calculate_strength", "p_collective_friends",0),
      (lt, reg0, ":modified_enemy_strength"), #thank you, Evil Squid!
    ],
    "Surrender? It's a joke, right? You have very few men with which to storm the fortress.", "close_window", []],
  #########
  [anyone,"player_siege_ask_surrender", [
      (str_clear, s4),
      (store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"), #each rank of persuasion help
      (store_mul, ":persuasion_m", ":persuasion_level", 10),
      (store_mul, ":starving_m", "$g_days_spent_starving", 80),
      (store_add, ":conditions", ":persuasion_m", ":starving_m"),
      (val_add, ":conditions", 1), #make sure the value is at least 1 so it doesn't hurt your chances
      ####siege warfare chief  moral affect defense
      (try_begin),
        (party_slot_eq,"$g_encountered_party",slot_center_blockaded,2), #final
        (val_add, ":conditions", 100),
      (try_end),
      (try_begin),
        (ge, "$g_listos_para_asalto", 1), #final
        (val_add, ":conditions", 20),
      (try_end),
      (try_begin),
        (eq, "$g_mantlets_1", 2), #final
        (val_add, ":conditions", 10),
      (try_end),
      (try_begin),
        (eq, "$g_traicion_interna", 4),
        (val_add, ":conditions", 60),
      (try_end),
      (try_begin),
        (eq, "$g_infiltracion_interna", 4),
        (val_add, ":conditions", 40),
      (try_end),
      (try_begin),
        (eq, "$g_cabezas_dentro", 1),
        (val_add, ":conditions", 30),
      (try_end),
      (try_begin),
        (eq, "$g_campos_cercanos", 3),
        (val_add, ":conditions", 40),
      (try_end),
      (try_begin),
        (party_get_slot, ":center_relation", "$current_town", slot_center_player_relation), #center relation good relations help
        (val_div, ":center_relation", 3),
        (val_add, ":conditions", ":center_relation"),
      (try_end),
      #personality factor
      (try_begin),
        #dont like retreat
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial), #warrior
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous), #pride
        (val_add, ":conditions", -80), #we'd rather starve an extra day!
      (else_try),
        #variables
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome), #
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
        (val_add, ":conditions", -40),
      # (else_try), #coldlood
        # (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_custodian), #
        # (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning), #
        # (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
        # (val_add, ":conditions", 0),
      (else_try), #too good
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_benefactor),
        (val_add, ":conditions", 40),
      # (else_try),
        # (val_add, ":conditions", 10),
      (try_end),
      ###goods relations help
      (try_begin),
        (store_div, reg1, "$g_talk_troop_relation", 3),
        (val_add, ":conditions", reg1),
      (try_end),
      #siege warfare acaba
      
      (call_script, "script_party_calculate_strength", "p_collective_friends",0),
      (val_add, ":conditions", reg0), #thank you, Evil Squid!
      (lt, "$temp", ":conditions"), #condition calculated in first test above
      
      (try_begin),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial), #warrior
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous), #pride
        (str_store_string, s4, "@The fort has been defended by lions, and we leave it with our heads high. You can guarantee our safety?"),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome), #
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
        (str_store_string, s4, "@Well, I guess I can admit defeat. We will leave the fort, but I want your promise that you will not attack us."),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_custodian), #
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
        (str_store_string, s4, "@We are ready to leave this fort to you and march away if you give me your word of honour that you'll let us leave unmolested."),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_benefactor),
        (str_store_string, s4, "@There comes a time when every good leader must be responsible for the welfare of his men. We leave the fort. I want your promise that you will not attack us."),
      (else_try),
        (str_store_string, s4, "@We are ready to leave this fort to you and march away if you give me your word of honour that you'll let us leave unmolested."),
      (try_end),
    ],
    "{!}{s4}", "player_siege_ask_leave_unmolested", []],
  
  [anyone,"player_siege_ask_surrender", [
      (str_clear, s4),
      (store_random_in_range, ":rand", 0, 4),
      (try_begin),
        (eq, ":rand", 0),
        (str_store_string, s4, "@You're nothing but scum. You should leave before we kill you."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (else_try),
        (eq, ":rand", 1),
        (str_store_string, s4, "@You're wasting your time. Attack us -- if you have the courage."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (else_try),
        (eq, ":rand", 2),
        (str_store_string, s4, "@You have called me for this? We would never surrender to the likes of you."),
      (else_try),
        (str_store_string, s4, "@Surrender? Hah! We can hold these walls until we all die of old age, while you most assuredly won't."),
      (try_end),
    ],
    "{!}{s4}", "close_window",[
  ]],
    
  [anyone|plyr,"player_siege_ask_leave_unmolested", [],
    "You have my word. You will not come under attack if you leave the fort.", "player_siege_ask_leave_unmolested_accept", []],
  [anyone,"player_siege_ask_leave_unmolested_accept", [],
    "Very well. Then we leave this fort to you. You may have won this day, but we'll meet again.", "close_window", [(assign,"$g_castle_left_to_player",1)]],
  [anyone|plyr,"player_siege_ask_leave_unmolested", [],
    "Unacceptable. I need hostages as guarantees.", "player_siege_ask_leave_unmolested_reject", []],
  [anyone,"player_siege_ask_leave_unmolested_reject", [],
    "Then we will defend this fort to the death. This parley is done.", "close_window", []],
  
  
  ####hostage surrender Siege warfare
  [anyone,"player_hostage_surrender", [
      (assign, ":num_of_centers", 0),
      (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
        (store_faction_of_party, ":center_faction", ":cur_center"),
        (eq, ":center_faction", "$g_encountered_party_faction"),
        (val_add, ":num_of_centers", 1),
      (try_end),
      (le, ":num_of_centers", 1),
    ],
    "We will not fall for your plot! We shall fight to the last man!", "close_window", []],
  
  [anyone,"player_hostage_surrender", [
      (store_random_in_range, ":rand", 0, 2),
      (eq, ":rand", 0),
    ],
    "Our lord would never forgive us for accepting this deal. We must fight.", "close_window", []],
  
  [anyone,"player_hostage_surrender", [
      #(lt, "$g_enemy_strength", 200),
      (store_mul,":required_str","$g_enemy_strength",1.5), #total need x1,5 here Player has lord enemy
      (store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"), #each rank of persuasion help
      (store_mul, ":persuasion_m", ":persuasion_level", 10),  #persuasion is the key now
      (store_mul, ":starving_m", "$g_days_spent_starving", 100), #each day they've starved your side seems x2 stronger
      (store_add, ":conditions", ":persuasion_m", ":starving_m"),
      (val_add, ":conditions", 1), #make sure the value is at least 1
      ####siege warfare chief  moral affect defense
      (try_begin),
        (party_slot_eq,"$g_encountered_party",slot_center_blockaded,2), #final
        (val_add, ":conditions", 60),
      (try_end),
      (try_begin),
        (ge, "$g_listos_para_asalto", 1), #final
        (val_add, ":conditions", 20),
      (try_end),
      (try_begin),
        (eq, "$g_mantlets_1", 2), #final
        (val_add, ":conditions", 10),
      (try_end),
      (try_begin),
        (eq, "$g_traicion_interna", 4),
        (val_add, ":conditions", 60),
      (try_end),
      (try_begin),
        (eq, "$g_infiltracion_interna", 4),
        (val_add, ":conditions", 40),
      (try_end),
      (try_begin),
        (eq, "$g_cabezas_dentro", 1),
        (val_add, ":conditions", 30),
      (try_end),
      (try_begin),
        (eq, "$g_campos_cercanos", 3),
        (val_add, ":conditions", 40),
      (try_end),
      (try_begin),
        (party_get_slot, ":center_relation", "$current_town", slot_center_player_relation), #center relation good relations help
        (gt, ":center_relation", 0),
        (val_add, ":conditions", ":center_relation"),
      (try_end),
      #siege warfare acaba
      (lt, ":required_str", ":conditions"),
      (str_store_party_name, s12, "$g_encountered_party"),
    ],
    "Well, we will leave {s12} to you in exchange for our lord. Proceed with the exchange.", "player_hostage_surrender_accepted", []],
  
  [anyone,"player_hostage_surrender", [
    ],
    "Our lord would never forgive us for accepting this deal. We must fight.", "close_window", []],
  
  [anyone|plyr,"player_hostage_surrender_accepted", [(str_store_party_name, s12, "$g_encountered_party"),],
    "I free your lord. Now leave {s12}.", "player_hostage_surrender_accepted2", [
      (party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord),
      (gt, ":town_lord", 0),
      (is_between, ":town_lord", companions_begin, kingdom_heroes_end),
      (party_count_prisoners_of_type, ":party_has_prisoner", "p_main_party", ":town_lord"),
      (gt, ":party_has_prisoner", 0),
      (party_remove_prisoners, "p_main_party", ":town_lord", 1),
      (call_script, "script_remove_troop_from_prison", ":town_lord"),
  ]],
  [anyone,"player_hostage_surrender_accepted2", [],
    "Very well. Then we leave this place to you. You have won this day.", "close_window", [(assign,"$g_castle_left_to_player",1)]],
  [anyone|plyr,"player_hostage_surrender_accepted", [],
    "No, I have thought better of it and stay with our lord.", "player_hostage_surrender_accepted3", []],
  [anyone,"player_hostage_surrender_accepted3", [],
    "Then we defend this fort to the death. This parley is done.", "close_window", []],
  
  ######
  ###tributo chief
  [anyone,"player_siege_tributo", [
      (neq, "$g_siege_tribute_paid", "$current_town"),
      (str_clear, s4),
      #(lt, "$g_enemy_strength", 200),
      #(store_mul,":required_str","$g_enemy_strength",1.5), #most easy way
      (assign,":required_str","$g_enemy_strength"), #most easy way
      (store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"), #each rank of persuasion help
      (store_mul, ":persuasion_m", ":persuasion_level", 10),
      (store_mul, ":starving_m", "$g_days_spent_starving", 120), #each day they've starved your side seems x2 stronger
      (store_add, ":conditions", ":persuasion_m", ":starving_m"),
      (val_add, ":conditions", 1), #make sure the value is at least 1 so it doesn't hurt your chances
      ####siege warfare chief  moral affect defense
      (try_begin),
        (party_slot_eq,"$g_encountered_party",slot_center_blockaded,2), #final
        (val_add, ":conditions", 60),
      (try_end),
      (try_begin),
        (ge, "$g_listos_para_asalto", 1), #final
        (val_add, ":conditions", 20),
      (try_end),
      (try_begin),
        (eq, "$g_mantlets_1", 2), #final
        (val_add, ":conditions", 10),
      (try_end),
      (try_begin),
        (eq, "$g_traicion_interna", 4),
        (val_add, ":conditions", 60),
      (try_end),
      (try_begin),
        (eq, "$g_infiltracion_interna", 4),
        (val_add, ":conditions", 40),
      (try_end),
      (try_begin),
        (eq, "$g_cabezas_dentro", 1),
        (val_add, ":conditions", 30),
      (try_end),
      (try_begin),
        (eq, "$g_campos_cercanos", 3),
        (val_add, ":conditions", 40),
      (try_end),
      (try_begin),
        (party_get_slot, ":center_relation", "$current_town", slot_center_player_relation), #center relation good relations help
        (gt, ":center_relation", 0),
        (val_add, ":conditions", ":center_relation"),
      (try_end),
      #personality factor
      (try_begin),
        #dont like retreat
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial), #warrior
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous), #pride
        (val_add, ":conditions", 20),
      (else_try),
        #variables
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome), #
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
        (val_add, ":conditions", 30),
      (else_try), #coldlood
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_custodian), #
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
        (val_add, ":conditions", 40),
      (else_try), #too good
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_benefactor),
        (val_add, ":conditions", 50),
      (else_try),
        (val_add, ":conditions", 10),
      (try_end),
      ###goods relations help
      (try_begin),
        (troop_is_hero, "$g_talk_troop"),
        (ge, "$g_talk_troop_relation", 60),
        (val_add, ":conditions", 40),
      (try_end),
      #siege warfare acaba
      (lt, ":required_str", ":conditions"),
      
##      (try_begin),
##        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial), #warrior
##        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous), #pride
##        (str_store_string, s4, "@The fort has been defended by lions, and we leave it with our heads high. Can you guarantee our safety?"),
##      (else_try),
##        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome), #
##        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding), #
##        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
##        (str_store_string, s4, "@Well, I guess I can admit defeat. We leave the fort. Promise that you will not attack us."),
##      (else_try),
##        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_custodian), #
##        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning), #
##        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
##        (str_store_string, s4, "@We are ready to leave this fort to you and march away if you give me your word of honour that you'll let us leave unmolested."),
##      (else_try),
##        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured), #
##        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_benefactor),
##        (str_store_string, s4, "@There comes a time when every good leader must be responsible for the welfare of his men. We leave the fort. Promise that you will not attack us."),
##      (else_try),
##        (str_store_string, s4, "@We are ready to leave this fort to you and march away if you give me your word of honour that you'll let us leave unmolested."),
##      (try_end),
    ],
    "Perhaps... we can make a financial arrangement.", "player_siege_tributo2", [(assign, "$g_siege_tribute_paid", "$current_town")]],
  
  [anyone,"player_siege_tributo", [],
    "Tribute? Hah! I laugh in your face. You will not get anything from here.", "close_window", [
##      (try_begin),
##        (troop_is_hero, "$g_talk_troop"),
##         (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
##      (try_end),
  ]],
  
  [anyone|plyr,"player_siege_tributo2", [],
    "Pay now or prepare to die!", "player_siege_tributo_reject", []],
  [anyone,"player_siege_tributo_reject", [],
    "Bastard. We will fight you to the last man!", "close_window", []],
  
  [anyone|plyr,"player_siege_tributo2", [
          (str_clear, s4),
      (store_random_in_range, ":rand", 0, 3),
      (try_begin),
        (eq, ":rand", 0),
        (str_store_string, s4, "@8000"),
      (else_try),
        (eq, ":rand", 1),
        (str_store_string, s4, "@5000."),
      (else_try),
        (eq, ":rand", 2),
        (str_store_string, s4, "@3000"),
      (else_try),
        (str_store_string, s4,"@3000"),
      (try_end),
    ],
    "I see that we have reached an agreement. I demand {s4} peningas.", "player_siege_tributo_accept", []],
  
  [anyone,"player_siege_tributo_accept", [
      (store_random_in_range, ":rand", 0, 3),
           (str_clear, s4),
     (try_begin),
        (eq, ":rand", 0),
        (str_store_string, s4, "@3000"),
        (assign, "$g_tesoro", 1),
      (else_try),
        (eq, ":rand", 1),
        (str_store_string, s4, "@2000."),
        (assign, "$g_tesoro", 2),
      (else_try),
        (eq, ":rand", 2),
        (str_store_string, s4, "@1000"),
        (assign, "$g_tesoro", 3),
      (else_try),
        (str_store_string, s4,"@1000"),
        (assign, "$g_tesoro", 3),
      (try_end),
    ],
    "All I can offer you is {s4} peningas in coins, rings, and other treasures.", "player_tributo3", []],
  
  [anyone|plyr,"player_tributo3", [],
    "I see. Then bring the treasure now, and we'll go.", "player_tributo3_1", [
      (try_begin),
        (eq, "$g_tesoro", 1),
      #  (str_store_string, s4, "@3000"),
        (call_script, "script_troop_add_gold", "trp_player", 3000),
      (else_try),
        (eq, "$g_tesoro", 2),
      #  (str_store_string, s4, "@2000."),
        (call_script, "script_troop_add_gold", "trp_player", 2000),
      (else_try),
        (eq, "$g_tesoro", 3),
       # (str_store_string, s4, "@1000"),
        (call_script, "script_troop_add_gold", "trp_player", 1000),
      (try_end),
      # (party_set_slot,"p_main_party",slot_party_siege_camp,0),  #Tempered chief added for siege camp
      ##         #siege warfare chief
      (assign, "$g_empieza_asedio", 0),
      ##         #siege warfare acaba
  ]],
  [anyone|plyr,"player_tributo3", [],
    "That is a ridiculously small sum. You're laughing at me, and you'll pay dearly.", "player_siege_tributo_reject", []],
  
  [anyone,"player_tributo3_1", [],
    "Very well.", "close_window", [
      (assign, "$g_empieza_asedio", 0),
      (try_begin),
        (troop_is_hero, "$g_talk_troop"),
         (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (try_end),
     # (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -50),
  ]],
  
  ###tributo acaba chief
  
  ###siege warfare end
  
  #Prison break
  
  [anyone|plyr,"lord_prison_break", [],
    "I've come to get you out of here.", "lord_prison_break_confirm",
    []],
  
  [anyone|plyr,"lord_prison_break", [],
    "Never mind. Just stay quiet.", "close_window",
    [
      (troop_set_slot, "$g_talk_troop", slot_troop_mission_participation, mp_stay_out),
      (assign, "$g_reset_mission_participation", 1),
  ]],
  
  [anyone,"lord_prison_break_confirm", [],
    "Thank the heavens! I don't know how much longer I could last in here.", "lord_prison_break_confirm_2",
    []],
  
  [anyone,"lord_prison_break_confirm_2", [],
    "Wait, how will we escape? The garrison will rush us the moment we step out that door. I can try to help you hold them off, but I'll tell you now, they have fed me nothing but watery porridge and a few scraps, and I'm not as strong as I could be.", "lord_prison_break_confirm_3",
    []],
  
  [anyone|plyr,"lord_prison_break_confirm_3", [],
    "You keep well behind me and try to stay out of the fighting.", "lord_prison_break_confirm_4",
    [
      (troop_set_slot, "$g_talk_troop", slot_troop_mission_participation, mp_prison_break_stand_back),
      (assign, "$g_reset_mission_participation", 1),
      (agent_set_team, "$g_talk_agent", 0),
  ]],
  
  [anyone|plyr,"lord_prison_break_confirm_3", [],
    "I'll need you to grab a weapon and help me, despite your weakness.", "lord_prison_break_confirm_4",
    [
      (troop_set_slot, "$g_talk_troop", slot_troop_mission_participation, mp_prison_break_fight),
      (assign, "$g_reset_mission_participation", 1),
      (agent_set_team, "$g_talk_agent", 0),
  ]],
  
  [anyone|plyr,"lord_prison_break_confirm_3", [],
    "Actually, don't get involved in this.", "close_window",
    [
      (troop_set_slot, "$g_talk_troop", slot_troop_mission_participation, mp_stay_out),
      (assign, "$g_reset_mission_participation", 1),
  ]],
  
  
  [anyone,"lord_prison_break_confirm_4", [
      
      (str_clear, s14),
      (try_for_range, ":other_prisoner", active_npcs_begin, kingdom_ladies_end),
        (troop_slot_eq, ":other_prisoner", slot_troop_prisoner_of_party, "$g_encountered_party"),
        (neq, ":other_prisoner", "$g_talk_troop"),
        
        (assign, ":granted_parole", 0),
        (try_begin),
          (call_script, "script_cf_prisoner_offered_parole", ":other_prisoner"),
          (assign, ":granted_parole", 1),
        (try_end),
        (eq, ":granted_parole", 0),
        
        (troop_slot_eq, ":other_prisoner", slot_troop_mission_participation, 0),
        
        (str_store_troop_name, s15, ":other_prisoner"),
        
        (troop_get_type, reg4, ":other_prisoner"),
        (val_mod, reg4, 2),
        (str_store_string, s14, "str__s15_is_also_being_held_here_and_you_may_wish_to_see_if_reg4shehe_will_join_us"),
      (try_end),
    ],
    "Let's go!{s14}", "close_window",
    []],
  
  
  
  
  #After battle texts
  
  [anyone,"start", [
      (eq, "$talk_context", tc_hero_freed),
      (troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero)],
    "I am in your debt for freeing me, friend.", "freed_lord_answer",
    [
      (try_begin),
        (check_quest_active, "qst_rescue_lord_by_replace"),
        (quest_slot_eq, "qst_rescue_lord_by_replace", slot_quest_target_troop, "$g_talk_troop"),
        (call_script, "script_succeed_quest", "qst_rescue_lord_by_replace"),
        (assign, "$do_not_cancel_quest", 1),
      (try_end),
      
      (try_begin),
        (check_quest_active, "qst_rescue_prisoner"),
        (quest_slot_eq, "qst_rescue_prisoner", slot_quest_target_troop, "$g_talk_troop"),
        (call_script, "script_succeed_quest", "qst_rescue_prisoner"),
        (assign, "$do_not_cancel_quest", 1),
      (try_end),
      
      (call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
      (assign, "$do_not_cancel_quest", 0),
  ]],
  
  [anyone|plyr,"freed_lord_answer", [(lt, "$g_talk_troop_faction_kingdom_relation", 0)
    ],
    "You're not going anywhere, 'friend.' You're my prisoner now.", "freed_lord_answer_1",
    [#(troop_set_slot, "$g_talk_troop", slot_troop_is_prisoner, 1),
      (troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, "p_main_party"),
      (party_force_add_prisoners, "p_main_party", "$g_talk_troop", 1),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
      (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", -10), #chief cambiado
      (call_script, "script_event_hero_taken_prisoner_by_player", "$g_talk_troop"),
  ]],#take prisoner
  
  [anyone,"freed_lord_answer_1", [],
    "I'll have your head on a spear for this, you bastard! Someday!", "close_window", []], #chief cambiado
  
  [anyone|plyr,"freed_lord_answer", [
    ],
    "You are free to go wherever you want, sir.", "freed_lord_answer_2",
    [(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15), #chief cambiado
      (call_script, "script_change_player_honor", 1), #chief cambiado
      #    (troop_get_slot, ":cur_rank", "$g_talk_troop", slot_troop_kingdom_rank),
      #    (val_mul, ":cur_rank", 1),
      (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 6)]], #chief cambiado
  
  [anyone,"freed_lord_answer_2", [],
    "Thank you, good {reg59?lady:sire}. I never forget someone who's done me a good turn.", "close_window",
    [
      (assign, "$g_leave_encounter", 1), #Not sure why this is necessary
  ]],
  
  ##  [anyone|plyr,"freed_lord_answer", [(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"), #he is not a faction leader!
  ##                                     (call_script, "script_get_number_of_hero_centers", "$g_talk_troop"),
  ##                                     (eq, reg0, 0), #he has no castles or towns
  ##                                     (hero_can_join)],
  ##   "I need capable men like you. Would you like to join me?", "knight_offer_join",
  ##   []],
  ##
  ##  [anyone,"freed_lord_answer_3", [(store_random_in_range, ":random_no",0,2),(eq, ":random_no", 0)],
  ##   "Alright I will join you.", "close_window",
  ##   [
  ###     (troop_set_slot, "$g_talk_troop", slot_troop_is_player_companion, 1),
  ##     (troop_set_slot, "$g_talk_troop", slot_troop_occupation, slto_player_companion),
  ##     (store_conversation_troop, ":cur_troop_id"),
  ##     (party_add_members, "p_main_party", ":cur_troop_id", 1),#join hero
  ##   ]],
  ##
  ##  [anyone,"freed_lord_answer_3", [],
  ##   "No, I want to go on my own.", "close_window", []],
  
  
  #Troop commentary changes begin
  [anyone,"start", [(eq,"$talk_context",tc_hero_defeated),
      (troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero)],
    "{!}{s43}", "defeat_lord_answer",
    [(troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, -1),
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_surrender_offer_default"),
  ]],
  
  [anyone|plyr,"defeat_lord_answer", [],
    "You are my prisoner now.", "defeat_lord_answer_1",
    [
      #(troop_set_slot, "$g_talk_troop", slot_troop_is_prisoner, 1),
      (troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, "p_main_party"),
      (party_force_add_prisoners, "p_main_party", "$g_talk_troop", 1),#take prisoner
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -3),
      (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", -3),
      (call_script, "script_event_hero_taken_prisoner_by_player", "$g_talk_troop"),
      (call_script, "script_add_log_entry", logent_lord_captured_by_player, "trp_player",  -1, "$g_talk_troop", "$g_talk_troop_faction"),
  ]],
  
  [anyone,"defeat_lord_answer_1", [],
    "I am at your mercy.", "close_window", []],
  
  [anyone|plyr,"defeat_lord_answer", [],
    "You have fought well. You are free to go.", "defeat_lord_answer_2",
    [(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (call_script, "script_change_player_honor", 3),
      (call_script, "script_add_log_entry", logent_lord_defeated_but_let_go_by_player, "trp_player",  -1, "$g_talk_troop", "$g_talk_troop_faction")]],
  
  [anyone,"defeat_lord_answer_2", [],
    "{!}{s43}", "close_window", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_prisoner_released_default"),
  ]],
  #Troop commentary changes end
  
  #Troop commentaries changes begin
  [anyone,"start", [(eq,"$talk_context",tc_party_encounter),
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (lt,"$g_encountered_party_relation",0),
      (encountered_party_is_attacker),
      (eq, "$g_talk_troop_met", 1), ],
    "{playername}!", "party_encounter_lord_hostile_attacker", [
  ]],
  
  [anyone,"start", [(eq,"$talk_context",tc_party_encounter),
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (lt,"$g_encountered_party_relation",0),
      (encountered_party_is_attacker),],
    "Halt!", "party_encounter_lord_hostile_attacker", []],
  
  [anyone,"party_encounter_lord_hostile_attacker", [
      (gt, "$g_comment_found", 0),],
    "{!}{s42}", "party_encounter_lord_hostile_attacker", [
      (try_begin),
        (neq, "$log_comment_relation_change", 0),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", "$log_comment_relation_change"),
      (try_end),
      (assign, "$g_comment_found", 0),]],
  
  #Troop commentaries changes end
  [anyone,"party_encounter_lord_hostile_attacker", [],
    "{!}{s43}", "party_encounter_lord_hostile_attacker_2",
    [(call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_surrender_demand_default"),]],
  
  [anyone|plyr,"party_encounter_lord_hostile_attacker_2", [],
    "We will fight you to the end!", "close_window", [(assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),]],
  
  [anyone|plyr,"party_encounter_lord_hostile_attacker_2", [
      (is_between, "$g_talk_troop", active_npcs_begin, active_npcs_end),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (store_and, reg0, "$option_switches", lord_option_private),
      (eq, reg0, 0), ],
    "Stay your hand! There is something I must tell you in private.", "lord_recruit_1_relation", []],
  
  [anyone|plyr,"party_encounter_lord_hostile_attacker_2", [],
    "Is there no way to avoid this battle? I don't want to fight with you.", "party_encounter_offer_dont_fight", []],
  
  #TODO: Add a verification step.
  [anyone|plyr,"party_encounter_lord_hostile_attacker_2", [],
    "Don't attack! We surrender.", "close_window", [(assign,"$g_player_surrenders",1)]],
  
  [anyone, "party_encounter_offer_dont_fight", [(gt, "$g_talk_troop_effective_relation", 30),
      #TODO: Add adition conditions, lord personalities, battle advantage, etc...
    ],
    "I owe you a favor, don't I. Well... all right then. I will let you go just this once.", "close_window", [
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop", -7),
      (store_current_hours,":protected_until"),
      (val_add, ":protected_until", 72),
      (party_set_slot,"$g_encountered_party",slot_party_ignore_player_until,":protected_until"),
      (party_ignore_player, "$g_encountered_party", 72),
      (assign, "$g_leave_encounter",1)
  ]],
  
  [anyone, "party_encounter_offer_dont_fight", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_declines_negotiation_offer_default"),
    ],
    "{!}{s43}.", "close_window", []],
  
  ##  [anyone,"start", [(eq,"$talk_context",tc_party_encounter),
  ##                    (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
  ##                    (lt,"$g_encountered_party_relation",0),
  ##                    (neg|encountered_party_is_attacker),
  ##                    ],
  ##   "What do you want?", "party_encounter_lord_hostile_defender",
  ##   []],
  
  
  #  [anyone|plyr,"party_encounter_lord_hostile_defender", [],
  #   "Nothing. We'll leave you in peace.", "close_window", [(assign, "$g_leave_encounter",1)]],
  
  
  
  
  #Betrayal texts should go here
  
  
  ##  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
  ##                     (troop_slot_eq,"$g_talk_troop",slot_troop_last_quest_betrayed, 1),
  ##                     (troop_slot_eq,"$g_talk_troop",slot_troop_last_quest, "qst_deliver_message_to_lover"),
  ##                     (le,"$talk_context",tc_siege_commander),
  ##                     ],
  ##   "I had trusted that letter to you, thinking you were a {reg59?lady:man} of honor, and you handed it directly to the girl's father.\
  ## I should have known you were not to be trusted. Anyway, I have learned my lesson and I won't make that mistake again.", "close_window",
  ##   [(call_script, "script_clear_last_quest", "$g_talk_troop")]],
  
  
  #Lord to be recruited
  
  [anyone ,"start",
    [
      (eq, "$g_talk_troop_faction", "fac_player_supporters_faction"),
      (is_between, "$g_talk_troop", active_npcs_begin, active_npcs_end),
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_inactive),
      (neq, "$g_talk_troop", "$g_player_minister"),
      
      (call_script, "script_update_troop_location_notes", "$g_talk_troop", 1),    #assume find out this info if met
      (call_script, "script_get_information_about_troops_position", "$g_talk_troop", 0),
      
      (troop_get_slot, ":last_faction", "$g_talk_troop", slot_troop_last_faction),
      (try_begin),
        (eq, ":last_faction", 0),
        (troop_get_slot, ":last_faction", "$g_talk_troop", slot_troop_original_faction),
        (troop_set_slot, "$g_talk_troop", slot_troop_last_faction, ":last_faction"),
      (try_end),
      (faction_get_slot, ":last_leader", ":last_faction", slot_faction_leader),
      (str_store_troop_name, s10, ":last_leader"),
      (str_store_string, s9, "str_lord_indicted_dialog_approach"),
    ],
    #Greetings, {reg59?my lady:my lord}. You may have heard of my ill treatment at the hands of {s10}. You have a reputation as one who treats {reg59?her:his} vassals well, and if you will have me, I would be honored to pledge myself as your vassal.
    "{!}{s9}", "lord_requests_recruitment", []],
  
  [anyone|plyr ,"lord_requests_recruitment",
    [
      (str_store_string, s9, "str_lord_indicted_dialog_approach_yes"),
    ], #And I would be honored to accept your pledge.
    "{!}{s9}", "lord_requests_recruitment_accept", [
      (troop_set_slot, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (troop_set_slot, "$g_talk_troop", slot_troop_change_to_faction, 0),  #VC-3909 in case player refused in prior dialog
      (store_troop_faction, ":faction_no", "$g_talk_troop"),
      (call_script, "script_troop_set_title_according_to_faction", "$g_talk_troop", ":faction_no"), #new title system
      # (troop_get_slot, ":leaded_party", "$g_talk_troop", slot_troop_leaded_party), not working
      # (gt, ":leaded_party", 0),
      # (party_set_faction, ":leaded_party", "fac_player_supporters_faction"),
      #This should be enough, scriptwise, but if there is a string somewhere to confirm the pledge, I should link
  ]],
  
  [anyone ,"lord_requests_recruitment_accept", [
      #acquire intel
      (troop_get_slot, ":last_faction", "$g_talk_troop", slot_troop_last_faction),
      (call_script, "script_update_faction_political_notes", ":last_faction"),
      (call_script, "script_update_faction_traveler_notes", ":last_faction"),
      (change_screen_notes, 2, ":last_faction"),
    ],
    "{!}{s11}", "close_window", [
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone|plyr ,"lord_requests_recruitment",
    [
      (str_store_string, s9, "str_lord_indicted_dialog_approach_no"),
    ], #I'm sorry. Your service is not required.
    "{!}{s9}", "lord_requests_recruitment_refuse", []],
  
  [anyone ,"lord_requests_recruitment_refuse",
    [
      (str_store_string, s9, "str_lord_indicted_dialog_rejected"),
    ], #Indeed? Well, perhaps your reputation is misleading. Good day, {reg59?my lady:my lord} -- I go to see if another ruler in the Northlands is more appreciative of my talents.
    "{!}{s9}", "close_window", [
      #Seek alternative liege
      (assign, "$g_leave_encounter", 1),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -10),
      (call_script, "script_lord_find_alternative_faction", "$g_talk_troop", 1),
      (assign, ":new_faction", reg0),
      
      (try_begin),
        (is_between, ":new_faction", kingdoms_begin, kingdoms_end),
        (troop_set_slot, "$g_talk_troop", slot_troop_change_to_faction, ":new_faction"),  #VC-3909 don't make immediate change, but send through delay trigger
        # (troop_get_slot, ":old_faction", "$g_talk_troop", slot_troop_original_faction),
        # (str_store_troop_name, s1, "$g_talk_troop"),
        # (str_store_faction_name, s2, ":new_faction"),
        # (str_store_faction_name, s3, ":old_faction"),
        
        # (troop_set_slot, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
        # (call_script, "script_change_troop_faction", "$g_talk_troop", ":new_faction"),
        
        # (troop_get_type, reg4, "$g_talk_troop"),
        # (val_mod, reg4, 2),
        # (display_log_message, "str_lord_defects_ordinary"),#change display_message to display_log_message
        #	(display_message, "str_lord_defects_ordinary"),
        
      (else_try),
        (troop_set_slot, "$g_talk_troop", slot_troop_change_to_faction, "fac_outlaws"),  #VC-3909 don't make immediate change, but send through delay trigger
      (try_end),
  ]],
  
  
  
  
  
  #Rebellion changes begin
  [anyone ,"start",
    [
      (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
      (eq, "$g_talk_troop", "$supported_pretender"),
    ],
    "I await your counsel, {playername}.", "supported_pretender_talk", [
  ]],
  
  [anyone ,"start",
    [
      (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (assign, "$pretender_told_story", 0),
      (eq, "$g_talk_troop_met", 0),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
    ],
    "Do I know you?", "pretender_intro_1", []],
  [anyone|plyr ,"pretender_intro_1", [], "My name is {playername}. At your service.", "pretender_intro_2", []],
  [anyone|plyr ,"pretender_intro_1", [], "I am {playername}. Perhaps you have heard of my exploits.", "pretender_intro_2", []],
  
  [anyone ,"pretender_intro_2", [(troop_get_slot, ":rebellion_string", "$g_talk_troop", slot_troop_original_faction2),
      (val_sub, ":rebellion_string", "fac_kingdom_1"),
      (val_add, ":rebellion_string", "str_swadian_rebellion_pretender_intro"),
      (str_store_string, 48, ":rebellion_string"),],
    "{!}{s48}", "pretender_intro_3", []],
  
  [anyone|plyr ,"pretender_intro_3", [(troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
      (str_store_faction_name, s12, ":original_faction"),
      (faction_get_slot, ":original_ruler", ":original_faction", slot_faction_leader),
      (str_store_troop_name, s11, ":original_ruler"),],
    "I thought {s11} ruled the {s12}.", "pretender_rebellion_cause_1", [
      (troop_set_slot, "$g_talk_troop", slot_troop_discussed_rebellion, 1)
  ]],
  
  [anyone ,"start",
    [
      (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
    ],
    "Greetings, {playername}!", "pretender_start", [(assign, "$pretender_told_story", 0)]],
  
  [anyone|plyr ,"pretender_start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_discussed_rebellion, 1),
      (eq, "$pretender_told_story", 0)
    ],
    "What was your story again, {reg65?my lady:sir}?", "pretender_rebellion_cause_prelim", [
  ]],
  
  [anyone,"pretender_rebellion_cause_prelim", [],
    "I shall tell you.", "pretender_rebellion_cause_1", [
  ]],
  
  
  [anyone,"pretender_rebellion_cause_1", [],
    "{!}{s48}", "pretender_rebellion_cause_2", [
      (assign, "$pretender_told_story", 1),
      (troop_get_slot, ":rebellion_string", "$g_talk_troop", slot_troop_original_faction2),
      (val_sub, ":rebellion_string", "fac_kingdom_1"),
      (val_add, ":rebellion_string", "str_swadian_rebellion_pretender_story_1"),
      (str_store_string, 48, ":rebellion_string"),
  ]],
  
  [anyone,"pretender_rebellion_cause_2", [],
    "{!}{s48}", "pretender_rebellion_cause_3", [
      (troop_get_slot, ":rebellion_string", "$g_talk_troop", slot_troop_original_faction2),
      (val_sub, ":rebellion_string", "fac_kingdom_1"),
      (val_add, ":rebellion_string", "str_swadian_rebellion_pretender_story_2"),
      (str_store_string, 48, ":rebellion_string"),
  ]],
  
  [anyone,"pretender_rebellion_cause_3", [],
    "{!}{s48}", "pretender_start", [
      (troop_get_slot, ":rebellion_string", "$g_talk_troop", slot_troop_original_faction2),
      (val_sub, ":rebellion_string", "fac_kingdom_1"),
      (val_add, ":rebellion_string", "str_swadian_rebellion_pretender_story_3"),
      (str_store_string, 48, ":rebellion_string"),
  ]],
  
  [anyone|plyr ,"pretender_start", [						(neq, "$campaign_type", camp_storyline),						#or if it is Thonkrik but isn't the storyline
      (troop_slot_eq, "$g_talk_troop", slot_troop_discussed_rebellion, 1),
    ],
    "I want to take up your cause and help you reclaim your throne!", "pretender_discuss_rebellion_1", [
  ]],
  [anyone|plyr ,"pretender_start", [						(eq, "$campaign_type", camp_storyline),						#or if it is Thonkrik but isn't the storyline
      (troop_slot_eq, "$g_talk_troop", slot_troop_discussed_rebellion, 1),
    ],
    "When I finish with Sven Bull Neck, maybe I will take up your cause and help you reclaim your throne!", "pretender_end", [
  ]],
  
  [anyone|plyr ,"pretender_start", [
    ],
    "I must leave now.", "pretender_end", [
  ]],
  
  
  [anyone ,"pretender_discuss_rebellion_1", [(troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
      (faction_get_slot, ":original_ruler", ":original_faction", slot_faction_leader),
      (str_store_troop_name, s11, ":original_ruler")],
    "Are you sure you will be up to the task, {playername}? Reclaiming my throne will be no simple matter. " +
    "The lords of our realm have all sworn oaths of homage to {s11}. " +
    "Such oaths to a usurper are of course invalid, and we can expect some of the lords to side with us, but it will be a very tough and challenging struggle ahead.", "pretender_discuss_rebellion_2a", []],
  
  [anyone ,"pretender_discuss_rebellion_2a",[
      (troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
      (faction_get_slot, ":original_ruler", ":original_faction", slot_faction_leader),
      (str_store_troop_name, s12, ":original_ruler"),
      (call_script, "script_evaluate_realm_stability", ":original_faction"),
      (assign, ":instability_index", reg0),
      (val_add, ":instability_index", reg0),
      (val_add, ":instability_index", reg1),
      (try_begin),
        (gt, ":instability_index", 60),
        (str_store_string, s11, "str_one_thing_in_our_favor_is_that_s12s_grip_is_very_shaky_he_rules_over_a_labyrinth_of_rivalries_and_grudges_lords_often_fail_to_cooperate_and_many_would_happily_seek_a_better_liege"),
      (else_try),
        (is_between, ":instability_index", 40, 60),
        (str_store_string, s11, "str_thankfully_s12s_grip_is_fairly_shaky_many_lords_do_not_cooperate_with_each_other_and_some_might_be_tempted_to_seek_a_better_liege"),
      (else_try),
        (is_between, ":instability_index", 20, 40),
        (str_store_string, s11, "str_unfortunately_s12s_grip_is_fairly_strong_until_we_can_shake_it_we_may_have_to_look_long_and_hard_for_allies"),
      (else_try),
        (lt, ":instability_index", 20),
        (str_store_string, s11, "str_unfortunately_s12s_grip_is_very_strong_unless_we_can_loosen_it_it_may_be_difficult_to_find_allies"),
      (try_end),
    ],
    "{!}{s11}", "pretender_discuss_rebellion_2", []],
  
  
  
  [anyone|plyr ,"pretender_discuss_rebellion_2", [],  "I am ready for this struggle.", "pretender_discuss_rebellion_3", []],
  [anyone|plyr ,"pretender_discuss_rebellion_2", [],  "You are right. Perhaps, I should think about this some more.", "pretender_end", []],
  
  
  [anyone ,"pretender_discuss_rebellion_3", [(this_or_next|neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
      (neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
      (neg|troop_slot_ge, "trp_player",slot_troop_renown, 200),
      (troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
      (faction_get_slot, ":original_ruler", ":original_faction", slot_faction_leader),
      (str_store_troop_name, s11, ":original_ruler")],
    "I have no doubt that your support for my cause is heartfelt, {playername}, and I am grateful to you for it, " +
    "but I don't think we have much of a chance of success. " +
    "If you can gain renown in the battlefield and make a name for yourself as a great commander, then our friends would not hesitate to join our cause, " +
    "and our enemies would be wary to take up arms against us. When that time comes, I will come with you gladly. " +
    "Until that time, it will be wiser not to openly challenge the usurper, {s11}.", "close_window", []],
  
  [anyone ,"pretender_discuss_rebellion_3", [(this_or_next|neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
      (neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
      (gt, "$supported_pretender", 0),
      (str_store_troop_name, s17, "$supported_pretender")],
    "Haven't you already taken up the cause of {s17}? " +
    "You must have a very strong sense of justice, indeed. " +
    "No thank you. I will not be part of your game.", "close_window", []],
  
  [anyone ,"pretender_discuss_rebellion_3", [(this_or_next|neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
      (neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
      (gt, "$players_kingdom", 0),
      (neq, "$players_kingdom", "fac_player_supporters_faction"),
      (neq, "$players_kingdom", "fac_player_faction"),
      (troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
      (neq, "$players_kingdom", ":original_faction"),
      (eq, "$player_has_homage", 1),
      
      (str_store_faction_name, s16, "$players_kingdom"),
      (faction_get_slot, ":player_ruler", "$players_kingdom", slot_faction_leader),
      (str_store_troop_name, s15, ":player_ruler"),
      (str_store_faction_name, s17, ":original_faction"),
    ],
    "{playername}, you are already oath-bound to serve {s15}. " +
    "As such, I cannot allow you to take up my cause and let my enemies claim that I am but a mere puppet of the {s16}. " +
    "No, if I am to have the throne of the {s17}, I must do it due to the righteousness of my cause and the support of my subjects alone. " +
    "If you want to help me, you must first free yourself of your oath to {s15}.", "close_window", []],
  
  [anyone ,"pretender_discuss_rebellion_3", [(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
      (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player")],
    "You are a monarch in your own right, {reg59?my lady:my lord}. If you were to back me, I would be merely your puppet.", "close_window", []],
  
  
  [anyone ,"pretender_discuss_rebellion_3", [(troop_get_slot, ":original_faction", "$g_talk_troop", slot_troop_original_faction),
      (str_store_faction_name, s12, ":original_faction"),
      (faction_get_slot, ":original_ruler", ":original_faction", slot_faction_leader),
      (str_store_troop_name, s11, ":original_ruler")],
    "You are a capable warrior, {playername}, and I am sure with your renown as a commander, and my righteous cause, the nobles and the good people of the {s12} will flock to our support. " +
    "The time is ripe for us to act! I will come with you, and together, we will topple the usurper {s11} and take the throne from his bloodied hands. " +
    "But first, you must give me your oath of homage and accept me as your liege {reg65?lady:lord}.", "pretender_rebellion_ready", []],
  
  
  [anyone|plyr ,"pretender_rebellion_ready", [
      (troop_get_type, reg3, "$g_talk_troop"),
      (val_mod, reg3, 2),
    ],
    "I am ready to pledge myself to your cause, {reg3?my lady:my lord}.", "lord_give_oath_2", [
  ]],
  
  [anyone|plyr ,"pretender_rebellion_ready", [
    ],
    "Let us bide our time a little longer.", "pretender_end", [
  ]],
  
  [anyone ,"lord_give_conclude_2", [(is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
    ],
    "Forward, then! Our first task is to take hold of a fortress and persuade other lords to join us. You lead the way!", "close_window", [
      
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 60), #should be higher
      (faction_set_slot, "$g_talk_troop_faction", slot_faction_state, sfs_active),
      ##            (faction_set_slot, "$g_talk_troop_faction", slot_faction_ai_state, sfai_nascent_rebellion),
      
      (party_force_add_members, "p_main_party", "$supported_pretender", 1),
      (troop_set_slot, "$supported_pretender", slot_troop_cur_center, 0),
      (troop_set_auto_equip, "$supported_pretender",0),
      (str_store_troop_name_link, s6, "$supported_pretender"),
      (display_message, "@{s6} has joined your party."),
      
      #            (faction_get_slot, ":location", "$g_talk_troop_faction", slot_faction_inactive_leader_location),
      #            (faction_set_slot, "$g_talk_troop_faction", slot_faction_inactive_leader_location, 0),
      
      #            (call_script, "script_create_kingdom_hero_party", "$g_talk_troop", ":location"),
      #            (party_set_slot, "$pout_party", slot_party_commander_party, "p_main_party"),
      #            (call_script, "script_party_decide_next_ai_state_under_command", "$pout_party"),
      #            (store_current_hours, ":follow_until_time"),
      #            (store_add, ":follow_period", 60, "$g_talk_troop_relation"),
      #            (val_div, ":follow_period", 2),
      #            (val_add, ":follow_until_time", ":follow_period"),
      #            (party_set_slot, "$pout_party", slot_party_follow_player_until_time, ":follow_until_time"),
      #            (party_set_slot, "$pout_party", slot_party_following_player, 1),
      
      
      
      
      #            (assign, ":rebellion_target", "$supported_pretender_old_faction"),
      (call_script, "script_make_kingdom_hostile_to_player", "$supported_pretender_old_faction", -50),
      (faction_get_slot, reg0, "$supported_pretender_old_faction", slot_faction_culture), #moto chief
      (str_store_faction_name, s1, reg0),
      
      (faction_set_name, "fac_player_supporters_faction", "@{s1} Rebels"),
      (faction_set_color, "fac_player_supporters_faction", "$current_color"),
      
      ## Let us handle relation with other kingdoms later.
      ##            (try_for_range, ":existing_kingdom", kingdoms_begin, kingdoms_end),
      ##                (store_relation, ":relation", ":existing_kingdom", ":rebellion_target"),
      ##                (store_sub, ":relation_w_rebels", 0, ":relation"),
      ##                (store_relation, ":player_relation", ":existing_kingdom", "fac_player_faction"),
      ##                (val_div, ":player_relation", 3),
      ##                (val_add, ":relation_w_rebels", ":player_relation"),
      ##				  #WARNING: Never use set_relation!
      ##                (set_relation, ":existing_kingdom", "$g_talk_troop_faction", ":relation_w_rebels"),
      ##            (try_end),
      
      # we have alrady joined.
      ##            (str_store_faction_name, 4, "$g_talk_troop_faction"),
      ##            (display_message, "@Player joins {s4}"),
      ##            (call_script, "script_player_join_faction", "$g_talk_troop_faction"),
      (call_script, "script_update_all_notes"),
  ]],
  
  
  
  
  
  [anyone ,"pretender_end", [
    ],
    "Farewell for now, then.", "close_window", [
  ]],
  
  
  
  # Events....
  # Choose friend.
  #Post 0907 changes begin
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (neq, "$g_talk_troop_met", 0),
      (gt, "$g_time_since_last_talk", 24),
      (gt, "$g_talk_troop_relation", -10),
      (store_random_in_range, ":random_num", 0, 100),
      (lt, ":random_num", 30),
      (eq,"$talk_context",tc_town_talk),
      (call_script, "script_cf_troop_get_random_enemy_troop_with_occupation", "$g_talk_troop", slto_kingdom_hero),
      (assign, ":other_lord",reg0),
      (call_script, "script_troop_get_player_relation", ":other_lord"),
      (assign, ":other_lord_relation", reg0),
      #                     (troop_get_slot, ":other_lord_relation", ":other_lord", slot_troop_player_relation),
      (ge, ":other_lord_relation", 20),
      (str_store_troop_name, s6, ":other_lord"),
      (assign, "$temp", ":other_lord"),
    ],
    "I heard that you have befriended that {s43} called {s6}. " +
    "Believe me, you can't trust that man. " +
    "You should end your dealings with him.", "lord_event_choose_friend", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_insult_default"),
      
  ]],
  
  [anyone|plyr ,"lord_event_choose_friend", [],  "I assure you, {s65}, I am no friend of {s6}.", "lord_event_choose_friend_renounce", [
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",5),
      (call_script, "script_change_player_relation_with_troop","$temp",-10),
  ]],
  
  [anyone ,"lord_event_choose_friend_renounce", [],  "Glad news, {playername}. I would fear for your safety otherwise. " +
    "If you do encounter {s6}, be on your guard and don't believe a word.", "lord_pretalk", []],
  
  [anyone|plyr ,"lord_event_choose_friend", [],  "{s6} is an honourable man. You've no right to speak of him thus.", "lord_event_choose_friend_defend", [
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",-10),
      (call_script, "script_change_player_relation_with_troop","$temp",5),
  ]],
  [anyone ,"lord_event_choose_friend_defend", [],  "As you like, {playername}. " +
    "A fool you might be, but a loyal fool at the least. {s6}'s loyalty may not be so steadfast, however...", "lord_pretalk", []],
  #Post 0907 changes end
  
  [anyone|plyr ,"lord_event_choose_friend", [],  "I don't want to be involved in your quarrel with {s6}.", "lord_event_choose_friend_neutral", [
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",-2),
      (call_script, "script_change_player_relation_with_troop","$temp",-3),
  ]],
  
  [anyone ,"lord_event_choose_friend_neutral", [],  "Humph. As you wish, {playername}. " +
    "Just remember that a {reg59?woman:man} needs friends in this world, and you'll never make any if you never stand with anyone.", "lord_pretalk", []],
  
  #Meeting.
  [anyone ,"start", [(troop_slot_eq, "$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
    ],
    "Yes, my wife?", "lord_start",
    []],
  
  
  [anyone ,"start", [(store_faction_of_troop, ":faction", "$g_talk_troop"),
      (faction_slot_eq, ":faction", slot_faction_leader, "trp_player"),
      (troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (le,"$talk_context",tc_siege_commander),
    ],
    "Yes, {reg59?my lady:my lord}?", "lord_start",
    []],
  
  
  [anyone ,"start", [(is_between, "$g_talk_troop", companions_begin, companions_end),
      (troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (le,"$talk_context",tc_siege_commander),
    ],
    "It is good to see you, old friend.", "lord_start",
    []],
  
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (check_quest_active, "qst_join_faction"),
      (eq, "$g_invite_faction_lord", "$g_talk_troop"),
      (eq, "$players_kingdom", "fac_player_supporters_faction"),
    ],
    #TODO: change conversations according to relation.
    "Well, {playername}. I am willing to forgive your impudence in proclaiming yourself {reg59?queen:king} and to welcome you into my realm, with full honor, as one of my vassals. Shall we proceed to the oath of allegiance?", "lord_invite_player_monarch_1",
    []],
  
  [anyone|plyr ,"lord_invite_player_monarch_1", [],  "Yes... my lord.", "lord_invite_2",  []],
  [anyone|plyr ,"lord_invite_player_monarch_1", [],  "No. That oath sticks in my throat.", "lord_enter_service_reject",  []],
  
  
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (check_quest_active, "qst_join_faction"),
      (eq, "$g_invite_faction_lord", "$g_talk_troop"),
      (try_begin),
        (gt, "$g_invite_offered_center", 0),
        (store_faction_of_party, ":offered_center_faction", "$g_invite_offered_center"),
        (neq, ":offered_center_faction", "$g_talk_troop_faction"),
        (call_script, "script_get_poorest_village_of_faction", "$g_talk_troop_faction"),
        (assign, "$g_invite_offered_center", reg0),
      (try_end),
    ],
    #TODO: change conversations according to relation.
    "{playername}, I've been expecting you. Word has reached my ears of your exploits. " +
    "Why, I keep hearing such tales of prowess and bravery that my mind was quickly made up. " +
    "I knew that I had found someone worthy of becoming my vassal.", "lord_invite_1",
    []],
  
  [anyone,"lord_invite_1", [(gt, "$players_kingdom", 0),
      (neq, "$players_kingdom", "$g_talk_troop_faction"),
      (faction_get_slot, ":players_lord", "$players_kingdom", slot_faction_leader),
      (neq, ":players_lord", "trp_player"),
      (str_store_troop_name, s5, ":players_lord"),
      ], "However, you are already oath-bound to serve {s5}, are you not?", "lord_give_oath_under_oath_already",[(troop_set_slot, "$g_talk_troop", slot_troop_last_talk_time, "$g_current_hours"),]],
  
  [anyone,"lord_invite_1", [
      ], "I sincerely hope you will become a lord of the realm.", "lord_invite_1_1",[]],
  
  [anyone|plyr ,"lord_invite_1_1", [],  "Thank you, {s65}. You honour me with your offer.", "lord_invite_2",  []],
  [anyone|plyr ,"lord_invite_1_1", [],  "It is good to have my true value recognised.", "lord_invite_2",  []],
  
  [anyone ,"lord_invite_2", [],  "Aye. Let us dispense with the formalities, {playername}; are you ready to swear homage to me?", "lord_invite_3",  []],
  
  [anyone|plyr ,"lord_invite_3", [],  "Yes, {s65}.", "lord_give_oath_2",  []],
  [anyone|plyr ,"lord_invite_3", [(neq, "$campaign_type", camp_storyline),],  "No, {s65}. I cannot serve you right now.", "lord_enter_service_reject",  []],
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_met, 2),
      (gt, "$g_talk_troop_relation", 10),
      (gt, "$g_time_since_last_talk", 3),
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (eq, ":is_female", 1),
      (troop_slot_eq, "trp_player", slot_troop_spouse, -1),
      (troop_slot_eq, "trp_player", slot_troop_betrothed, -1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_betrothed, -1),
      (call_script, "script_npc_decision_checklist_marry_female_pc", "$g_talk_troop"),
      (ge, reg0, 1),
    ],
    "My lady, I have been giving much thought to our recent conversation. It is time for me to ask. Would you do me the honor of becoming my wife?", "lord_female_pc_marriage_proposal",  [
  ]],
  
  [anyone|plyr ,"lord_female_pc_marriage_proposal", [],  "Yes. I would.", "lord_marriage_proposal_female_pc_next_step",  []],
  [anyone|plyr ,"lord_female_pc_marriage_proposal", [],  "Let me think about this some more.", "lord_female_pc_marriage_proposal_postponed",  []],
  [anyone|plyr ,"lord_female_pc_marriage_proposal", [],  "No. I have decided that it would not be appropriate", "lord_female_pc_marriage_proposal_rejected",  []],
  
  [anyone ,"lord_female_pc_marriage_proposal_postponed", [],  "Of course, my lady. Take all the time you need.", "lord_start",  []],
  
  [anyone ,"lord_female_pc_marriage_proposal_rejected", [],  "Do you mean to reject my suit outright, my lady?", "lord_female_pc_marriage_proposal_rejected_confirm",  []],
  
  [anyone|plyr ,"lord_female_pc_marriage_proposal_rejected_confirm", [],  "Yes. I do.", "lord_female_pc_marriage_proposal_rejected_confirm_yes",  []],
  [anyone|plyr ,"lord_female_pc_marriage_proposal_rejected_confirm", [],  "No, you misunderstand. I just need some more time to think", "lord_female_pc_marriage_proposal_postponed",  []],
  
  [anyone ,"lord_female_pc_marriage_proposal_rejected_confirm_yes", [
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
      ],  "Well, in that case, let me tell you something -- with those harsh words, you have removed the scales from my eyes. I would agree that it would not be appropriate for me to marry one such as you. Good day, my lady.", "close_window",  [
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -20),
      (troop_set_slot, "$g_talk_troop", slot_troop_met, 4),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone ,"lord_female_pc_marriage_proposal_rejected_confirm_yes", [],  "Such is your right, my lady. If you ever wished to reconsider, I would be overwhelmed with joy.", "close_window",  [
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -5),
      (troop_set_slot, "$g_talk_troop", slot_troop_met, 4),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_met, 2),
      (gt, "$g_time_since_last_talk", 24),
      (gt, "$g_talk_troop_relation", 0),
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (eq, ":is_female", 1),
      (troop_slot_eq, "trp_player", slot_troop_spouse, -1),
      (troop_slot_eq, "trp_player", slot_troop_betrothed, -1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_betrothed, -1),
    ],
    "My lady, it brings my heart great joy to see you again...", "lord_start",  [
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 2),
  ]],
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_met, 2),
      (gt, "$g_talk_troop_relation", 0),
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (eq, ":is_female", 1),
    ],
    "My lady, I am always your humble servant", "lord_start",  [
  ]],
  
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (neq, "$g_talk_troop_met", 0),
      (gt, "$g_time_since_last_talk", 24),
      (gt, "$g_talk_troop_relation", 50),
      (gt, "$g_talk_troop_faction_relation", 10),
      (ge, "$g_talk_troop_faction_kingdom_relation", 0),
      (le,"$talk_context",tc_siege_commander),
    ],
    "If it isn't my brave champion, {playername}...", "lord_start",  []],
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (neq, "$g_talk_troop_met", 0),
      (gt, "$g_time_since_last_talk", 24),
      (gt, "$g_talk_troop_relation", 10),
      (le,"$talk_context",tc_siege_commander),
    ],
    "Good to see you again, {playername}...", "lord_start", []],
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (neq, "$g_talk_troop_met", 0),
      (gt, "$g_time_since_last_talk", 24),
      (le,"$talk_context",tc_siege_commander),
    ],
    "We meet again, {playername}...", "lord_start", []],
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (eq, "$g_talk_troop_met", 0),
      (ge, "$g_talk_troop_faction_kingdom_relation", 0),
      (le,"$talk_context",tc_siege_commander),
    ],
    "Do I know you?", "lord_meet_neutral", []],
  [anyone|plyr ,"lord_meet_neutral", [],  "I am {playername}.", "lord_intro", []],
  [anyone|plyr ,"lord_meet_neutral", [],  "My name is {playername}. I am at your service, sir.", "lord_intro", []],
  
  [anyone ,"lord_intro", [],
    "{!}{s11}", "lord_start", [(faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
      (try_begin),
        (gt, ":faction_leader", -1),
        (str_store_faction_name, s6, "$g_talk_troop_faction"),
        (assign, reg4, 0),
        (str_store_troop_name, s4, "$g_talk_troop"),
        (try_begin),
          (eq, ":faction_leader", "$g_talk_troop"),
          (str_store_string, s9, "@I am {s4}, the ruler of the {s6}", 0),
        (else_try),
          (str_store_string, s9, "@I am {s4}, a vassal of the {s6}", 0),
        (try_end),
        (assign, ":num_centers", 0),
        (str_clear, s8),
        (try_for_range_backwards, ":cur_center", centers_begin, centers_end),
          (party_slot_eq, ":cur_center", slot_town_lord, "$g_talk_troop"),
          (try_begin),
            (eq, ":num_centers", 0),
            (str_store_party_name, s8, ":cur_center"),
          (else_try),
            (eq, ":num_centers", 1),
            (str_store_party_name, s7, ":cur_center"),
            (str_store_string, s8, "@{s7} and {s8}"),
          (else_try),
            (str_store_party_name, s7, ":cur_center"),
            (str_store_string, s8, "@{!}{s7}, {s8}"),
          (try_end),
          (val_add, ":num_centers", 1),
        (try_end),
        (assign, reg5, ":num_centers"),
        (str_store_string, s11, "@{s9}{reg5? and the lord of {s8}.:.", 0),
      (else_try),
        (str_store_troop_name, s4, "$g_talk_troop"),
        (troop_get_slot, ":hometown", "$g_talk_troop", slot_troop_home),
        (str_store_party_name, s8, ":hometown"),
        (str_store_string, s11, "@My name is {s4}, and I come from {s8}. I am looking for adventure and glory on the battlefield.", 0),
      (try_end),
  ]],
  
  [anyone,"start", [
      (check_quest_active, "qst_blank_quest_4"),
      (check_quest_succeeded, "qst_blank_quest_4"),
      (quest_slot_eq, "qst_blank_quest_4", slot_quest_giver_troop, "$g_talk_troop"),
    ],
    "Good job, {playername}! Looks like you were able to track down the bandits and show them what happens to those who would destroy someone else's property. " +
    "Here is your reward: {reg5} peningas. " +
    "It is well earned, and I am very grateful.",
    "lord_pretalk", [
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (val_add, ":player_renown", 3),
      (troop_set_slot, "trp_player", slot_troop_renown, ":player_renown"),
      (quest_get_slot, reg5, "qst_blank_quest_4", slot_quest_gold_reward),
      (call_script, "script_finish_quest", "qst_blank_quest_4", 100),
  ]],
  
  [anyone,"start",
    [
      (check_quest_active, "qst_blank_quest_4"),
      (check_quest_failed, "qst_blank_quest_4"),
      (quest_slot_eq, "qst_blank_quest_4", slot_quest_giver_troop, "$g_talk_troop"),
    ], "Well, {playername}, I guess that at least some of those brigands eluded you, and of course it will be the peaceable citizens of this land who will pay the price. Still, it was good of you to try.", "lord_pretalk",
    [ (call_script, "script_end_quest", "qst_blank_quest_4"),]],
  
  
  #  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
  #                     (eq, "$g_talk_troop_met", 0),
  #                     (ge, "$g_talk_troop_faction_relation", 0),
  #                     (le,"$talk_context",tc_siege_commander),
  #                     ],
  #   "Who is this then?", "lord_meet_ally", []],
  #  [anyone|plyr ,"lord_meet_ally", [],  "I am {playername} sir. A warrior of {s4}.", "lord_start", []],
  #  [anyone|plyr ,"lord_meet_ally", [],  "I am but a soldier of {s4} sir. My name is {playername}.", "lord_start", []],
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (eq, "$g_talk_troop_met", 0),
      (lt, "$g_talk_troop_faction_kingdom_relation", 0),
      #                     (str_store_faction_name, s4,  "$players_kingdom"),
      (le,"$talk_context",tc_siege_commander),
    ],
    "{!}{s43}", "lord_meet_enemy", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_enemy_meet_default"),
  ]],
  [anyone|plyr ,"lord_meet_enemy", [],  "I am {playername}, {s65}.", "lord_intro", []],  #A warrior of {s4}.
  [anyone|plyr ,"lord_meet_enemy", [],  "They know me as {playername}. Mark it down. You shall be hearing of me a lot.", "lord_intro", []],
  #  [anyone, "lord_meet_enemy_2", [],  "{playername} eh? Never heard of you. What do want?", "lord_talk", []],
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (le,"$talk_context",tc_siege_commander),
      (try_begin),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
        (lt, "$g_talk_troop_relation", -15),
        (str_store_string, s8, "str_playername_come_to_plague_me_some_more_have_you"),
      (else_try),
        (lt, "$g_talk_troop_relation", -5),
        (str_store_string, s8, "str_ah_it_is_you_again"),
      (else_try),
        (str_store_string, s8, "str_well_playername"),
      (try_end),
    ],
    "{!}{s8}", "lord_start",
    []],
  
  
  
  
  [anyone,"lord_start", [(gt, "$g_comment_found", 0), #changed to s32 from s62 because overlaps with setup_talk_info strings
      (str_store_string, s1, "$g_last_comment_copied_to_s42"),
      (try_begin),
        (eq, "$cheat_mode", 1),
        (display_message, "str_comment_found_s1"),
      (try_end),
      
      ],  "{!}{s42}", "lord_start", [
      #                         (store_current_hours, ":cur_time"),
      #                         (troop_set_slot, "$g_talk_troop", slot_troop_last_comment_time, ":cur_time"),
      (try_begin),
        (neq, "$log_comment_relation_change", 0),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", "$log_comment_relation_change"),
      (try_end),
      
      
      (assign, "$g_comment_has_rejoinder", 0),
      (try_begin),
        (gt, "$g_rejoinder_to_last_comment", 0),
        (try_begin),
          (eq, "$cheat_mode", 1),
          (display_message, "str_rejoinder_noted"),
        (try_end),
        (assign, "$g_comment_has_rejoinder", 1),
      (try_end),
      
      (assign, "$g_comment_found", 0),
  ]],
  
  [anyone|auto_proceed,"lord_start",
    [
      (check_quest_active, "qst_destroy_bandit_lair"),
      (check_quest_succeeded, "qst_destroy_bandit_lair"),
      (quest_slot_eq, "qst_destroy_bandit_lair", slot_quest_giver_troop, "$g_talk_troop"),
    ], "{!}.", "lair_quest_intermediate_1",
    [
  ]],
  
  [anyone,"lair_quest_intermediate_1",
    [
    ], "Splendid work, {playername}! Your audacious attack is the talk of the realm. No doubt, they or others like them will soon be back, but for a short while, you have bought this land a small respite. We are most grateful to you.", "lord_pretalk",
    [
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (val_add, ":player_renown", 3),
      (troop_set_slot, "trp_player", slot_troop_renown, ":player_renown"),
      (call_script, "script_finish_quest", "qst_destroy_bandit_lair", 100),
  ]],
  
  [anyone|auto_proceed,"lord_start",
    [
      (check_quest_active, "qst_destroy_bandit_lair"),
      (check_quest_failed, "qst_destroy_bandit_lair"),
      (quest_slot_eq, "qst_destroy_bandit_lair", slot_quest_giver_troop, "$g_talk_troop"),
    ], "{!}.", "lair_quest_intermediate_2",
    []],
  
  [anyone,"lair_quest_intermediate_2",
    [], "Well, {playername}, I guess that at least some of those brigands eluded you. Of course, it will be the peaceable travellers of this land who will pay the price. Still, it was good of you to try.", "lord_pretalk",
    [
      (call_script, "script_end_quest", "qst_destroy_bandit_lair"),
  ]],
  
  [anyone,"lord_start",
    [
      (store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_lend_surgeon"),
      (quest_slot_eq, "qst_lend_surgeon", slot_quest_giver_troop, "$g_talk_troop")
    ], "Your surgeon managed to convince my friend to accept the operation.  The matter is in God's hands now. All we can do is pray for his recovery. " +
    "Anyway, I thank you for lending your surgeon to me, {reg59?madam:sir}. You have a noble spirit. I will not forget it.", "lord_generic_mission_completed",
    [
      (call_script, "script_finish_quest", "qst_lend_surgeon", 100),
      (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
  ]],
  
  ##### TODO: QUESTS COMMENT OUT BEGIN
  
  ##
  ##  [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                         (store_partner_quest,":lords_quest"),
  ##                         (eq,":lords_quest","qst_bring_prisoners_to_enemy"),
  ##                         (quest_slot_eq, "qst_bring_prisoners_to_enemy", slot_quest_current_state, 0),
  ##                         (check_quest_succeeded, "qst_bring_prisoners_to_enemy"),
  ##                         (quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
  ##                         (assign, reg1, ":quest_target_amount")],
  ##   "TODO: You have brought the prisoners and received {reg1} peningas. Give me the money now.", "lord_bring_prisoners_complete_2",[]],
  ##
  ##  [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                         (store_partner_quest,":lords_quest"),
  ##                         (eq,":lords_quest","qst_bring_prisoners_to_enemy"),
  ##                         (quest_slot_eq, "qst_bring_prisoners_to_enemy", slot_quest_current_state, 1),#Some of them were brought only
  ##                         (check_quest_succeeded, "qst_bring_prisoners_to_enemy"),
  ##                         (quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
  ##                         (assign, reg1, ":quest_target_amount")],
  ##   "TODO: You have brought the prisoners but some of them died during your expedition. Give me the full money of {reg1} peningas.", "lord_bring_prisoners_complete_2",[]],
  ##
  ##
  ##  [anyone|plyr,"lord_bring_prisoners_complete_2", [(store_troop_gold, ":cur_gold", "trp_player"),
  ##                                                   (quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
  ##                                                   (ge, ":cur_gold", ":quest_target_amount")],
  ##   "TODO: Here it is.", "lord_generic_mission_thank", [(quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
  ##                                                  (troop_remove_gold, "trp_player", ":quest_target_amount"),
  ##                                                  (call_script, "script_finish_quest", "qst_bring_prisoners_to_enemy", 100)]],
  ##
  ##  [anyone|plyr,"lord_bring_prisoners_complete_2", [(store_troop_gold, ":cur_gold", "trp_player"),
  ##                                                   (quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
  ##                                                   (lt, ":cur_gold", ":quest_target_amount")],
  ##   "TODO: I'm afraid I spent some of it, I don't have that much money with me.", "lord_bring_prisoners_no_money", [(quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
  ##                                                                                                                   (call_script, "script_change_debt_to_troop", "$g_talk_troop", ":quest_target_amount"),#Adding the taken money as a debt
  ##                                                                                                                   (call_script, "script_finish_quest", "qst_bring_prisoners_to_enemy", 100)]],
  ##
  ##  [anyone,"lord_bring_prisoners_no_money", [],
  ##   "TODO: You owe me that money!", "lord_pretalk", []],
  ##
  ##
  
  
  
  #MALE PLAYER CHARACTER WEDDING
  #wedding allowed
  [anyone ,"lord_start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (check_quest_active, "qst_wed_betrothed"),
      
      (quest_slot_eq, "qst_wed_betrothed", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":bride", "qst_wed_betrothed", slot_quest_target_troop),
      (troop_slot_eq, ":bride", slot_troop_cur_center, "$g_encountered_party"),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
      
      (call_script, "script_troop_get_family_relation_to_troop", ":bride", "$g_talk_troop"),
      (str_store_troop_name, s4, ":bride"),
    ],
    "May the heavens witness that I am ready to give you my {s11} {s4}, to have in marriage...", "wedding_ceremony_bride_vow",
    [
      (quest_get_slot, "$g_player_bride", "qst_wed_betrothed", slot_quest_target_troop),
  ]],
  
  
  [anyone, "lord_start", [ (check_quest_active, "qst_wed_betrothed"),
      (quest_slot_eq, "qst_wed_betrothed", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":expiration_days", "qst_wed_betrothed", slot_quest_expiration_days),
      (lt, ":expiration_days", 362),
      (eq, "$g_done_wedding_comment", 0),
      (str_clear, s12),
      (try_begin),
        (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
        (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_default),
        (str_store_string, s12, "@ We will of course need to wait until the realm is no longer on campaign."),
      (try_end),
      
    ],
    "It is good to see you, {playername}. We look forward to the wedding, as soon as we can all gather together for the feast.{s12}", "lord_wedding_reschedule",
    [
      (assign, "$g_done_wedding_comment", 1),
  ]],
  
  
  
  [anyone|plyr, "lord_wedding_reschedule", [],
    "It is no problem. I can wait.", "lord_start",
    [
  ]],
  
  [anyone|plyr, "lord_wedding_reschedule", [
      (faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_feast),
      ], "Then we should have a feast right now!","lord_ok", []],
  
  [anyone, "lord_ok", [(is_between, "$current_town", walled_centers_begin, walled_centers_end),
      (store_faction_of_party, ":faction", "$current_town"),
      (eq, ":faction", "$players_kingdom"),
      ] , "As you wish, your highness.", "close_window", [
      (faction_set_slot, "$players_kingdom", slot_faction_ai_state, sfai_feast),
      (faction_set_slot, "$players_kingdom", slot_faction_ai_object, "$current_town"),
      #  (call_script, "script_decide_faction_ai", "$players_kingdom"),
      #  (assign, "$g_recalculate_ais", 1),
  ]],
  [anyone, "lord_ok",[], "Unfortunately, we have no acceptable venue for the event.", "close_window",[]],
  
  
  
  [anyone|plyr, "lord_wedding_reschedule", [],
    "I have no faith that this wedding will be concluded. Please return my dower.", "lord_return_dower", #add in new dialog
    []],
  
  [anyone, "lord_return_dower", [],
    "Well, that is your right, if you indeed have no confidence in our family's commitments. Take your money.", "close_window",
    [
      (quest_get_slot, ":bride", "qst_wed_betrothed", slot_quest_target_troop),
      (fail_quest, "qst_wed_betrothed"),
      (call_script, "script_end_quest", "qst_wed_betrothed"),
      
      (troop_set_slot, "trp_player", slot_troop_betrothed, -1),
      (troop_set_slot, ":bride", slot_troop_betrothed, -1),
      
      (assign, "$marriage_dowry", 0),
      (troop_add_gold, "trp_player", "$marriage_dower"),
      (assign, "$marriage_dower", 0),
      
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -5),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  ###dialogo para obtener pinturas de guerra pictas
  [trp_kingdom_20_lord|plyr,"lord_talk", [(eq, "$g_pintar_cuerpo", 0),],
    "I noticed that some of your warriors painted their bodies.", "Gartnait_historia",[]],
  
  [anyone, "Gartnait_historia", [(le, "$g_talk_troop_relation", 0)],
    "How? That's not important.", "lord_pretalk",[]],
  [anyone, "Gartnait_historia", [],
    "What? -- His eyes widen. -- As you know, they are ritual paintings, {playername}.", "Gartnait_talk1",[]],
  
  [anyone|plyr, "Gartnait_talk1", [],
    "I'd like to know why they painted their bodies and how I can get the same.", "Gartnait_historia1", []],
  [anyone|plyr, "Gartnait_talk1", [],
    "Thanks.", "lord_pretalk", []],
  
  [anyone, "Gartnait_historia1", [],
    "Among my people there are Goidels and Picts. They retain very few of their ancient traditions. We are Christians, but -- he whispers -- many customs of our ancestors still exist among our people. Young warriors are expected to paint their bodies and join the fray of battle and war before they are accepted in their homes as full-grown men. " +
    "Women have the right to choose wives for their brothers, and children inherit through their mothers' lineage.^^" +
    "Painting our bodies and joining warrior brotherhoods is part of a tradition in which young people must pass some tests in order to reach maturity. Some tests still involve venturing into distant lands in search of cattle and treasures, then to come home with enough wealth to start a family.", "Gartnait_historia2", []],
  [anyone, "Gartnait_historia2", [],
    "When the young people return, the war paint is removed from their bodies, and they marry and integrate into regular society. " +
    "There are not a few Pictish women who decide to paint their bodies to participate in this test of initiation.^^-- He smiles. -- " +
    "It's up to you whether to paint your body or not. If you do, you devote yourself to a very old tradition and to powers that are beyond our understanding. " +
    "Form or join a group of young people. Make a name for yourselves. Learn the camaraderie, friendship, and pride of being a Pict. Learn to command and obey. Gain the respect of your peers. Meet several {reg59?men:women}... When you've proven your worth, remove the war paint and return to society.", "Gartnait_historia3", []],
  [anyone|plyr,"Gartnait_historia3", [(eq,reg59,tf_male),],
    "I want to paint my body.", "Gartnait_historia4",[
      ##  (try_begin),
      ##     (eq,"$character_gender",tf_male),
      (troop_add_item, "trp_player", "itm_pictish_painted1", 0),
      ##  (else_try),
      ##     (eq,"$character_gender", tf_female),
      ##	#(troop_add_item, "trp_player", "itm_picta_3", 0),
      ##  (try_end),
      (assign, "$g_pintar_cuerpo", 1),
  ]],
  [anyone|plyr, "Gartnait_historia3", [],
    "Stop. Your story is prattle. You are a bunch of idiots.", "lord_pretalk", [
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -10),
  ]],
  [anyone|plyr, "Gartnait_historia3", [],
    "Thanks for the information.", "lord_pretalk", [
  ]],
  
  [anyone,"Gartnait_historia4", [],
    "Well, it's not ancient times any more. There are no longer strict rules or rituals. To tell you the truth, I actually feel that I am more Gael than Pict. Remove your garments and let my servant trace the lines on your body. Good luck, young {reg59?lady:man}, with your rite of passage!", "Gartnait_historia5", []],
  [anyone|plyr, "Gartnait_historia5", [],
    "Thank you, Toiseach.", "lord_pretalk", []],
  
  
  ###quest personajes varios
  #chief dialogo con heir de Centware sobre pictos
  [trp_knight_8_5|plyr,"lord_talk", [],
    "I heard that you know Pictland.", "Eormenred_historia",[]],
  
  [anyone, "Eormenred_historia", [(le, "$g_talk_troop_relation", 0)],
    "I am sorry, but I hardly know you. I do not feel comfortable sharing my knowledge right now. God the mid sie.", "lord_pretalk",[]],
  [anyone, "Eormenred_historia", [],
    "What? --His eyes widen.-- Yes, but... do you plan to travel north into Alban? You should not go, {playername}. I was there when I was young and had a fine band of warriors by my side, my beadupreat. Would you care to hear my story?", "Eormenred_talk1",[]],
  
  [anyone|plyr, "Eormenred_talk1", [],
    "Sure. I am interested.", "Eormenred_historia1", []],
  [anyone|plyr, "Eormenred_talk1", [],
    "No thanks. I have other matters to attend to.", "lord_pretalk", []],
  
  [anyone, "Eormenred_historia1", [],
    "Picts are strange, weird people. --He whispers.-- Some young warriors paint their bodies and become dangerous bandits. " +
    "Pictish villages are dirty and hidden between the high peaks and dense forests that cover their land. " +
    "I remember that from several years ago, when I took a war band of young warriors there to plunder and pillage.", "Eormenred_historia2", []],
  [anyone, "Eormenred_historia2", [],
    "After days of travel, we spotted a village spread about a strange construction. Today, I know it was a Broch, a fortress erected by the ancients. The Picts found the ruins, repaired them, and built their homes under its protection. " +
    "We felt a sudden surge of happiness. There was booty, cattle and women. -- He smiles. -- " +
    "The doors and gates were wide open. They were not expecting us, we all thought. We started howling like wolves, excited by the prospect of battle. We prepared our spears and swords, gathered our shields and ran, certain that our victory was going to be as easy as it would be profitable. " +
    "We were young, passionate, and anxious to show our worth. What would you have done?", "Eormenred_historia3", []],
  [anyone|plyr,"Eormenred_historia3", [],
    "Mm... Too easy. You should have suspected a trap, but please continue,", "Eormenred_historia4",[]],
  [anyone|plyr, "Eormenred_historia3", [],
    "What a sorry tale! You behaved like a bunch of untrained recruits.", "lord_pretalk", [
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -10),
  ]],
  
  [anyone,"Eormenred_historia4", [],
    "Yes, I know you are right, but back then we all were exceedingly impetuous. --He beats his chest.-- As for them, well, they were expecting us long before we even knew their village existed. They had archers, by Woden! ...beg pardon, by God! and an awful lot of arrows. Their Isenscur, or rain of arrows, was death to my men. One for one, arrow by arrow. Only I survived, for in fact they knew who I was... " +
    "I was captured and forced to do their queen's bidding. When she tired of me, they ransomed me for a treasure worth many gold coins. My father gladly paid it when they sent him my left ear inside a finely wrought leather pouch. " +
    "Hear me! Forget Pictland!", "Eormenred_historia5", []],
  [anyone|plyr, "Eormenred_historia5", [],
    "Thank you, my lord. I have learnt much from your story, and I will not meddle in Pictish affairs.", "lord_pretalk", []],
  [anyone|plyr, "Eormenred_historia5", [],
    "What a sorry tale! Your men behaved like untrained recruits -- with you as an idiot-in-chief.", "lord_pretalk", [
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -10),
  ]],
  
  #chief acaba pictos
  ###farmstead quest
  #prisionera madre
  [trp_farmstead_prisoner, "start", [(check_quest_active,"qst_danmork_protection"),(quest_slot_eq,"qst_danmork_protection",slot_quest_current_state, 11),
    ],
    "Now you die!", "close_window", [
  ]],
  
  [trp_farmstead_prisoner, "start", [(eq, "$g_talk_troop_met", 0),#mainquest chief
    ],
    "{!}...", "mother_prisoner_saco", [
  ]],
  
  [trp_farmstead_prisoner, "start", [
    ],
    "Now you die!", "close_window", [
      (agent_unequip_item,"$g_talk_agent","itm_saco_enlacabeza"),
      (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 11), #status 0
      (mission_disable_talk), #no permite hablar
  ]],
  
  
  [anyone|plyr, "mother_prisoner_saco", [],
    "Mother? Are you fine?", "mother_prisoner_saco2", []],
  [anyone|plyr, "mother_prisoner_saco", [],
    "(Remove the sack)", "mother_prisoner_saco3", []],
  [anyone, "mother_prisoner_saco2", [
    ],
    "{!}...", "mother_prisoner_saco3", [
  ]],
  
  [anyone|plyr, "mother_prisoner_saco3", [],
    "(Carefully, you take the sack off the head of your mother)", "mother_prisoner_saco4", [
      (agent_unequip_item,"$g_talk_agent","itm_saco_enlacabeza"),
      (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 11), #status 0
      # (troop_remove_item, "$g_talk_agent", "itm_saco_enlacabeza"),
  ]],
  [anyone, "mother_prisoner_saco4", [
    ],
    "{s2}^^Perhaps you thought we were just going to give you your mother? After what you've done -- destroying our plans in Doccinga, insulting my jarl at his own home -- Sigurd Ragnarsson wants you dead.", "close_window", [
      (str_store_string, s2, "@--The ugly face of a smiling man appears before you.--", color_good_news),
      #      (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 11), #status 0
      (mission_disable_talk), #no permite hablar
  ]],
  
  ###Add-ons dialogs
  #Mael Bresail's men in farm.
  [trp_maelbresail_man, "start", [
    ],
    "Welcome, {playername}. My lord, Mael Bresail, told me that you would come.", "maelbresail_men1", [
  ]],
  
  [anyone|plyr, "maelbresail_men1", [
      (check_quest_active, "qst_blank_quest_26"),
      (quest_slot_eq,"qst_blank_quest_26",slot_quest_current_state, 1),
    ],
    "Where is your lord?", "maelbresail_men2", [
  ]],
  [anyone|plyr, "maelbresail_men1", [
      (check_quest_active, "qst_blank_quest_26"),
      (quest_slot_eq,"qst_blank_quest_26",slot_quest_current_state, 2),
    ],
    "I am ready for the symbel. I only await Mael Bresail.", "maelbresail_men3", [
  ]],
  [anyone|plyr, "maelbresail_men1", [
    ],
    "Farewell.", "close_window", [
  ]],
  
  [anyone, "maelbresail_men2", [
    ],
    "He is on his way. Some issues in Aileach detained him, but I think that he will come soon. Meanwhile, we have orders to throw a feast for you and your main men. " +
    "My lord must esteem you greatly, because he has ordered only the best.", "maelbresail_men3", []],
  
  [anyone, "maelbresail_men3", [
      (assign, ":continue", 0),
      (try_begin),
        (store_party_size_wo_prisoners, ":party_size", "p_main_party"),
        (le, ":party_size", 20),
        (assign, ":continue", 1),
      (try_end),
      (eq, ":continue", 1),
    ],
    "Honored guest, I'm sorry, but my lord told me to prepare for five-and-twenty persons. " +
    "Do you not have more that you would like to participate? Empty places would leave a bad impression...", "maelbresail_men3_1", [
      (str_store_string, s2, "@Fergus, Mael Bresail's man at the farm, told you that the feast was prepared for twenty-five people. " +
      "You must bring more companions."),
      (add_quest_note_from_sreg, "qst_blank_quest_26", 5, s2, 0),
      (quest_set_slot,"qst_blank_quest_26",slot_quest_current_state, 2), #
  ]],
  
  [anyone, "maelbresail_men3", [
      (assign, ":continue", 0),
      (try_begin),
        (store_party_size_wo_prisoners, ":party_size", "p_main_party"),
        (ge, ":party_size", 26),
        (assign, ":continue", 1),
      (try_end),
      (eq, ":continue", 1),
    ],
    "Honored guest, I'm sorry, but my lord told me to prepare for only five-and-twenty persons. " +
    "Please come to the feast when you have chosen the ones you would like to participate.", "maelbresail_men3_1", [
      (str_store_string, s2, "@Fergus, Mael Bresail's man at the farm, told you that the feast was prepared for twenty-five people. " +
      "You must dismiss or leave the rest of your men at a nearby camp. Then, return to him."),
      (add_quest_note_from_sreg, "qst_blank_quest_26", 5, s2, 0),
      (quest_set_slot,"qst_blank_quest_26",slot_quest_current_state, 2), #
  ]],
  
  [anyone, "maelbresail_men3", [
    ],
    "Everything is ready. Please bring your companions to the hall, where you will enjoy the best food and drink.", "close_window", [
      (str_store_string, s2, "@Around you, everybody becomes busy on the farm as the feast starts."),
      (add_quest_note_from_sreg, "qst_blank_quest_26", 5, s2, 0),
      (quest_set_slot,"qst_blank_quest_26",slot_quest_current_state, 3), #
      (jump_to_menu, "mnu_bresail_farm_visit"),
      (finish_mission),
  ]],
  
  [anyone|plyr, "maelbresail_men3_1", [
    ],
    "Very well.", "close_window", [
  ]],
  
  ### add-ons seneschal quest for High Titles and conquest areas
  
  [anyone, "start",	#initial dialog
    [
      (store_conversation_troop, "$g_talk_troop"),
      (is_between,"$g_talk_troop","trp_town_1_seneschal", "trp_town_6_seneschal"),
    ],
    "Greetings, my {reg59?lady:lord}. What do you need?", "seneschal_quest_1",
    []],
  #reward
  [anyone|plyr,"seneschal_quest_1", [(check_quest_active,"qst_blank_quest_19"), (check_quest_succeeded, "qst_blank_quest_19"),(store_conversation_troop, "$g_talk_troop"),
      (eq,"$g_talk_troop","trp_town_1_seneschal"),
    ], #norse option
    "I am ready to be konungr over the Norse.", "seneschal_quest_norse",[]],
  [anyone|plyr,"seneschal_quest_1", [(check_quest_active,"qst_blank_quest_20"), (check_quest_succeeded, "qst_blank_quest_20"),(store_conversation_troop, "$g_talk_troop"),
      (eq,"$g_talk_troop","trp_town_2_seneschal"),
    ], #briton option
    "I am ready to be Vrenhin Lloegr, ruler of the Britons.", "seneschal_quest_briton",[]],
  [anyone|plyr,"seneschal_quest_1", [(check_quest_active,"qst_blank_quest_21"), (check_quest_succeeded, "qst_blank_quest_21"),(store_conversation_troop, "$g_talk_troop"),
      (eq,"$g_talk_troop","trp_town_3_seneschal"),
    ], #irish option
    "I am ready to be Ard Ruire, high king of the Goidels.", "seneschal_quest_irish",[]],
  [anyone|plyr,"seneschal_quest_1", [(check_quest_active,"qst_blank_quest_22"), (check_quest_succeeded, "qst_blank_quest_22"),(store_conversation_troop, "$g_talk_troop"),
      (eq,"$g_talk_troop","trp_town_4_seneschal"),
    ], #saxon option
    "I am ready to be Brytenwalda, ruler of all Englaland.", "seneschal_quest_saxon",[]],
  
  [anyone, "seneschal_quest_norse", [
    ],
    "You have done it, my {reg59?lady:lord}! I am very surprised, because the Norse value their freedom of action. Well, I will add your story in my history book and proclaim you Konungr of the Norse. " +
    "In recognition of your accomplishment, I give you the treasure of the Norse.", "seneschal_quest_2f", [
      (troop_add_item, "trp_player", "itm_trophy_norse"),
      (call_script, "script_change_troop_renown", "trp_player", 60),
      (add_xp_as_reward,1000),
      (quest_set_slot,"qst_blank_quest_19",slot_quest_current_state, 1), #status 0
      (call_script, "script_end_quest", "qst_blank_quest_19"),
  ]],
  [anyone, "seneschal_quest_briton", [
    ],
    "You have done it, my {reg59?lady:lord}! I am very surprised, because the Britons are tough people. Well, I will add your story in my history book and proclaim you Vrenhin Lloegr, ruler of the Britons. " +
    "In recognition of your accomplishment, I give you the treasure of the Britons.", "seneschal_quest_2f", [
      (troop_add_item, "trp_player", "itm_trophy_cymry"),
      (call_script, "script_change_troop_renown", "trp_player", 60),
      (add_xp_as_reward,1000),
      (quest_set_slot,"qst_blank_quest_20",slot_quest_current_state, 1), #status 0
      (call_script, "script_end_quest", "qst_blank_quest_20"),
  ]],
  [anyone, "seneschal_quest_irish", [
    ],
    "You have done it, my {reg59?lady:lord}! I am very surprised, because the Goidels are independent people who accept with difficulty the leadership of others. Well, I will add your story in my history book and proclaim you Ard Ruire of the Goidels. " +
    "In recognition of your accomplishment, I give you the treasure of the Goidels.", "seneschal_quest_2f", [
      (troop_add_item, "trp_player", "itm_trophy_irish"),
      (call_script, "script_change_troop_renown", "trp_player", 60),
      (add_xp_as_reward,1000),
      (quest_set_slot,"qst_blank_quest_21",slot_quest_current_state, 1), #status 0
      (call_script, "script_end_quest", "qst_blank_quest_21"),
  ]],
  [anyone, "seneschal_quest_saxon", [
    ],
    "You have done it, my {reg59?lady:lord}! I am very surprised, because the Angles and Saxons are distrustful people. Well, I will add your story in my history book and proclaim you Brytenwalda, ruler over all Englaland. " +
    "In recognition of your accomplishment, I give you the treasure of the Angles and Saxons.", "seneschal_quest_2f", [
      (troop_add_item, "trp_player", "itm_trophy_saxon"),
      (call_script, "script_change_troop_renown", "trp_player", 60),
      (add_xp_as_reward,1000),
      (quest_set_slot,"qst_blank_quest_22",slot_quest_current_state, 1), #status 0
      (call_script, "script_end_quest", "qst_blank_quest_22"),
  ]],
  
  [anyone|plyr, "seneschal_quest_2f", [
    ],
    "Thank you so much for the award and for helping my fame and prestige grow. Farewell, chronicler!", "close_window", [
  ]],
  
  
  #basic questions
  [anyone|plyr, "seneschal_quest_1", [(neg|check_quest_active,"qst_blank_quest_19"), (neg|quest_slot_eq,"qst_blank_quest_19",slot_quest_current_state,1),(store_conversation_troop, "$g_talk_troop"),
      (eq,"$g_talk_troop","trp_town_1_seneschal"),
    ],
    "Who are you?", "seneschal_quest_2", [
  ]],
  [anyone|plyr, "seneschal_quest_1", [(neg|check_quest_active,"qst_blank_quest_20"), (neg|quest_slot_eq,"qst_blank_quest_20",slot_quest_current_state,1),(store_conversation_troop, "$g_talk_troop"),
      (eq,"$g_talk_troop","trp_town_2_seneschal"),
    ],
    "What about you, Briton?", "seneschal_quest_2", [
  ]],
  [anyone|plyr, "seneschal_quest_1", [(neg|check_quest_active,"qst_blank_quest_21"), (neg|quest_slot_eq,"qst_blank_quest_21",slot_quest_current_state,1),(store_conversation_troop, "$g_talk_troop"),
      (eq,"$g_talk_troop","trp_town_3_seneschal"),
    ],
    "Goidelic and chronicler? Is this a joke?", "seneschal_quest_2", [
  ]],
  [anyone|plyr, "seneschal_quest_1", [(neg|check_quest_active,"qst_blank_quest_22"), (neg|quest_slot_eq,"qst_blank_quest_22",slot_quest_current_state,1),(store_conversation_troop, "$g_talk_troop"),
      (eq,"$g_talk_troop","trp_town_4_seneschal"),
    ],
    "What do you do?", "seneschal_quest_2", [
  ]],
  
  #
  [anyone|plyr, "seneschal_quest_1", [
    ],
    "Farewell.", "close_window", [
  ]],
  
  [anyone, "seneschal_quest_2", [
    ],
    "I guess that's not an easy question to answer. My role here is to leave for posterity the history of great men. " +
    "I write the life of the greatest king in this area. I am his chronicler.", "seneschal_quest_3", []],
  [anyone|plyr, "seneschal_quest_3", [
    ],
    "I want you to write my story.", "seneschal_quest_4", [
  ]],
  [anyone|plyr, "seneschal_quest_3", [
    ],
    "Very well. Farewell.", "close_window", [
  ]],
  
  [anyone, "seneschal_quest_4", [
    ],
    "First, you have to be the most important person in this part of the world. That means displacing the person that currently holds that position and unifying under your rule this territory. " +
    "Do you want to take on this challenge?", "seneschal_quest_5", []],
  [anyone|plyr, "seneschal_quest_5", [
    ],
    "Sure.", "seneschal_quest_6", [
  ]],
  [anyone|plyr, "seneschal_quest_5", [
    ],
    "No. Farewell.", "close_window", [
  ]],
  [anyone, "seneschal_quest_6", [	  (store_conversation_troop, "$g_talk_troop"),
      (eq,"$g_talk_troop","trp_town_1_seneschal"),
    ],
    "Surely, you are bold to take on the challenge of uniting all the small kingdoms and conflicting jarls of the Norse under your command.^" +
    "For me to be your chronicler and give you the title of Konungr of the Norse, you must unify the territory of these towns under your kingdom: Ribe, Tunsberg and Dorestad.^^" +
    "Good luck. Return when you have subjugated these territories, and I will proclaim that you are the most powerful {reg59?queen:king} among the Norse.", "seneschal_quest_7", [
      (str_clear, s3), (str_clear, s9), (str_clear, s11),
      (str_store_party_name_link, s3, "p_town_4"),
      (str_store_party_name_link, s9, "p_town_5"),
      (str_store_party_name_link, s11, "p_town_11"),
      (str_store_string, s2, "@The chronicler has promised to write about your life and proclaim to the world that you are Konungr of the Norse if you subjugate the Norse towns: {s3}, {s9} and {s11}."),
      (call_script, "script_start_quest", "qst_blank_quest_19", "$g_talk_troop"),
      (quest_set_slot,"qst_blank_quest_19",slot_quest_current_state, 0), #status 0
  ]],
  
  [anyone, "seneschal_quest_6", [	  (store_conversation_troop, "$g_talk_troop"),
      (eq,"$g_talk_troop","trp_town_2_seneschal"),
    ],
    "Surely, you are bold to take on the challenge of uniting all the small kingdoms and conflicting lords of the Britons under your command.^" +
    "For me to be your chronicler and give you the title of Vrenhin Lloegr, the king of the Britons, you must unify the territory of these towns under your kingdom: Ynys_Mon, Bosvenegh and Caer_Dyf.^^" +
    "Good luck. Return when you have subjugated these territories, and I will proclaim that you are the most powerful {reg59?queen:king} among the Britons.", "seneschal_quest_7", [
      (str_clear, s3), (str_clear, s9), (str_clear, s11),
      (str_store_party_name_link, s3, "p_town_13"),
      (str_store_party_name_link, s9, "p_town_17"),
      (str_store_party_name_link, s11, "p_town_9"),
      (str_store_string, s2, "@The chronicler has promised to write about your life and proclaim to the world that you are the Vrenhin Lloegr if you subjugate the Briton towns: {s3}, {s9} and {s11}."),
      (call_script, "script_start_quest", "qst_blank_quest_20", "$g_talk_troop"),
      (quest_set_slot,"qst_blank_quest_20",slot_quest_current_state, 0), #status 0
  ]],
  [anyone, "seneschal_quest_6", [	  (store_conversation_troop, "$g_talk_troop"),
      (eq,"$g_talk_troop","trp_town_3_seneschal"),
    ],
    "Surely, you are bold to take on the challenge of uniting all the small kingdoms and conflicting lords of the Goidels under your command.^" +
    "For me to be your chronicler and give you the title of Ard Ruire, the high king of Eriu, you must unify the territory of these towns under your kingdom: Aileach, Cruaghan and Temair.^^" +
    "Good luck. Return when you have subjugated these territories, and I will proclaim that you are the most powerful {reg59?queen:king} of Eriu.", "seneschal_quest_7", [
      (str_clear, s3), (str_clear, s9), (str_clear, s11),
      (str_store_party_name_link, s3, "p_town_25"),
      (str_store_party_name_link, s9, "p_town_28"),
      (str_store_party_name_link, s11, "p_town_29"),
      (str_store_string, s2, "@The chronicler has promised to write about your life and proclaim to the world that you are the Ard Ruire of Eriu if you subjugate the Goidelic towns: {s3}, {s9} and {s11}."),
      (call_script, "script_start_quest", "qst_blank_quest_21", "$g_talk_troop"),
      (quest_set_slot,"qst_blank_quest_21",slot_quest_current_state, 0), #status 0
  ]],
  [anyone, "seneschal_quest_6", [	  (store_conversation_troop, "$g_talk_troop"),
      (eq,"$g_talk_troop","trp_town_4_seneschal"),
    ],
    "Surely, you are bold to take on the challenge of uniting all the small kingdoms and conflicting lords of the Angles and Saxons under your command.^" +
    "For me to be your chronicler and give you the title of Brytenwalda, ruler over all Englaland, you must unify the territory of these towns under your kingdom: Lundenwic, Witan Ceaster and Jorvik.^^" +
    "Good luck. Return when you have subjugated these territories, and I will proclaim that you are the most powerful {reg59?queen:king} of Englaland.", "seneschal_quest_7", [
      (str_clear, s3), (str_clear, s9), (str_clear, s11),
      (str_store_party_name_link, s3, "p_town_12"),
      (str_store_party_name_link, s9, "p_town_16"),
      (str_store_party_name_link, s11, "p_town_10"),
      (str_store_string, s2, "@The chronicler has promised to write about your life and proclaim to the world that you are the Brytenwalda over all Englaland if you subjugate the Angle and Saxon towns: {s3}, {s9} and {s11}."),
      (call_script, "script_start_quest", "qst_blank_quest_22", "$g_talk_troop"),
      (quest_set_slot,"qst_blank_quest_22",slot_quest_current_state, 0), #status 0
  ]],
  
  [anyone|plyr, "seneschal_quest_7", [
    ],
    "Very well. I must buy ink and parchment, I will return soon.", "close_window", [
  ]],
  #Mael Bresail
  [trp_town_25_seneschal, "start", [	(check_quest_active, "qst_blank_quest_26"),
      (quest_get_slot, ":quest_current_state", "qst_blank_quest_26", slot_quest_current_state),
      (eq, ":quest_current_state", 6),
    ],
    "{playername}, when you escaped my trap, I came to hide here. From the fact that you have managed to find me, I perceive that, contrary to appearances, you are someone with resources.", "maelbresail_pactofinal", [
  ]],
  #
  
  [trp_town_25_seneschal, "start", [	(check_quest_active, "qst_blank_quest_26"),
      (quest_get_slot, ":quest_current_state", "qst_blank_quest_26", slot_quest_current_state),
      (eq, ":quest_current_state", 0),
    ],
    "Welcome, {playername}. The abbot of Finian informed me that you eliminated the main enemies of my lord and mine. " +
    "I expect that you've found our rewards a more than acceptable way to get rich.", "maelbresail_aftermorrigan1", [
  ]],
  
  [trp_town_25_seneschal, "start", [],
    "Yes?", "maelbresail_dialog1", [
  ]],
  
  [anyone|plyr, "maelbresail_dialog1", [
      (neg|check_quest_succeeded, "qst_blank_quest_25"),
      (check_quest_active, "qst_blank_quest_25"),
      (quest_get_slot, ":quest_current_state", "qst_blank_quest_25", slot_quest_current_state),
      (ge, ":quest_current_state", 2),
    ],
    "I am {playername}. I was told you want to meet me.", "maelbresail_dialog2", [
  ]],
  [anyone|plyr, "maelbresail_dialog1", [
    ],
    "[Say nothing]", "close_window", [
  ]],
  [anyone, "maelbresail_dialog2", [
    ],
    "Ah, {playername}! The abbot spoke wonders about you and your diligence in solving my problems. I wanted to meet you personally in order to put a face to my hero.^^--He smiles widely--^^" +
    "Also, I look forward to hearing news about the matter we have pending.", "maelbresail_dialog3", []],
  
  [anyone|plyr, "maelbresail_dialog3", [
    ],
    "It is likewise a pleasure to meet you, my lord. Your enemies are at a farm near Dinas Bran.", "maelbresail_dialog4_1", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -3),
  ]],
  [anyone|plyr, "maelbresail_dialog3", [
    ],
    "Flaithbertach's grandchildren are at a farm near Dinas Bran, my lord.", "maelbresail_dialog4", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
  ]],
  [anyone|plyr, "maelbresail_dialog3", [
    ],
    "Flaithbertach's grandchildren are at a farm near Dinas Bran.", "maelbresail_dialog4", [
  ]],
  
  [anyone, "maelbresail_dialog4_1", [
    ],
    "I guess you still do not know me and the abbot gave no warning, but I prefer short and direct answers. My occupations are numerous and my time very limited.", "maelbresail_dialog4", []],
  [anyone, "maelbresail_dialog4", [
    ],
    "Your news is excellent. In fact, I want to reward you personally, in addition to what the abbot promised you, with 8,000 peningas. " +
    "The people who work for me do not have to worry about money or wealth. All that I ask of them is to be faithful and execute my orders promptly.", "maelbresail_dialog5", [
      (call_script, "script_troop_add_gold", "trp_player", 8000),
  ]],
  [anyone|plyr, "maelbresail_dialog5", [
    ],
    "Thank you so much, my lord.", "maelbresail_dialog6", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
  ]],
  [anyone|plyr, "maelbresail_dialog5", [
    ],
    "Thank you.", "maelbresail_dialog6", [
  ]],
  [anyone, "maelbresail_dialog6", [
    ],
    "Well, I'm sorry I don't have more time. Ask the abbot to give you your reward and your next assignment. Your next task is particularly important, so put all effort into it. " +
    "Now I have to go. I wish you all well.", "close_window", [
      (call_script, "script_succeed_quest", "qst_blank_quest_25"),
  ]],
  
  #after morrigan
  [anyone|plyr, "maelbresail_aftermorrigan1", [
    ],
    "Honestly? I expected more.", "maelbresail_aftermorrigan2", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone|plyr, "maelbresail_aftermorrigan1", [
    ],
    "I do what I have to do.", "maelbresail_aftermorrigan2_1", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone|plyr, "maelbresail_aftermorrigan1", [
    ],
    "It has been a pleasure to serve you and kill your enemies.", "maelbresail_aftermorrigan2_2", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  [anyone|plyr, "maelbresail_aftermorrigan1", [
    ],
    "You lied to make me a murderer of your enemies.", "maelbresail_aftermorrigan2_3", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  
  [anyone, "maelbresail_aftermorrigan2", [
    ],
    "You are ambitious, but I think you've been well paid. I will not give you a pening more until you deserve one.", "maelbresail_aftermorrigan3", []],
  [anyone, "maelbresail_aftermorrigan2_1", [
    ],
    "That's important to me. In this world, it is not easy to find effective people.", "maelbresail_aftermorrigan3", []],
  [anyone, "maelbresail_aftermorrigan2_2", [
    ],
    "I know. Not all patrons reward their servants as well. Although it is sometimes difficult to know if your loyalty is to me or my money.", "maelbresail_aftermorrigan3", []],
  
  [anyone, "maelbresail_aftermorrigan2_3", [
    ],
    "You were commissioned to do something, and you agreed to do it. Nobody forced you to accept. Why now come, whining? I cannot stand the capricious nor the faint-hearted.", "maelbresail_aftermorrigan3", []],
  
  [anyone, "maelbresail_aftermorrigan3", [
    ],
    "--He chuckles.--^^I hear Morrigan tried to save her life with lies. What were her last words?", "maelbresail_aftermorrigan4", []],
  
  
  [anyone|plyr, "maelbresail_aftermorrigan4", [
    ],
    "She told me she was the last of the line of Flaithbertach.", "maelbresail_aftermorrigan5", [
  ]],
  [anyone|plyr, "maelbresail_aftermorrigan4", [
    ],
    "She died before I could talk to her.", "maelbresail_aftermorrigan5_2", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -3),
  ]],
  
  [anyone|plyr, "maelbresail_aftermorrigan5", [
    ],
    "Working for Aed mac Niall, Ard Ruire of Eriu, you sent me to kill the remnants of the family Flaithbertach in order to remove potential rivals for the throne.", "maelbresail_aftermorrigan6", [
  ]],
  [anyone, "maelbresail_aftermorrigan5_2", [
    ],
    "Do not lie! I know when you're lying. Liars have a place not at my side but on the gallows!", "maelbresail_aftermorrigan6", [
  ]],
  [anyone, "maelbresail_aftermorrigan6", [
    ],
    "You've done a huge favor to Eriu, if you're not aware of it. This island is populated by numerous clans, but each feels entitled to rule over others. " +
    "The social system is a pyramid -- the weaker subject to the stronger, but all led by the high king, the Ard Ruire. " +
    "However, the elements of this system constantly mutate, and clan alliances break according to changing interests. In sum, it is very difficult to rule this land.", "maelbresail_aftermorrigan7", [
  ]],
  [anyone, "maelbresail_aftermorrigan7", [
    ],
    "I believe Aed mac Niall is a good leader, as he favors my interests, and therefore yours. " +
    "However, Flaithbertach was a man beloved by the Ui-Neill, and his death caused much discomfort. " +
    "His children could easily have taken up arms with many northern clans. As an internal war within the Kingdom of Aileach would only favor our rivals, the Southern Ui Neill, in their desire to secure once again the throne at Tara. " +
    "Ard Ruire Aed is strong leader, uniquely able to keep the Vikings at bay. Do you understand?", "maelbresail_aftermorrigan8", [
  ]],
  
  [anyone|plyr, "maelbresail_aftermorrigan8", [
    ],
    "There is no need to justify our actions to me.", "maelbresail_aftermorrigan9_1", [
  ]],
  [anyone|plyr, "maelbresail_aftermorrigan8", [
    ],
    "I hate politics.", "maelbresail_aftermorrigan9_2", [
  ]],
  [anyone|plyr, "maelbresail_aftermorrigan8", [
    ],
    "Sure.", "maelbresail_aftermorrigan10", [
  ]],
  [anyone, "maelbresail_aftermorrigan9_1", [
    ],
    "Justify? No, I am happy to do so.", "maelbresail_aftermorrigan10", [
  ]],
  [anyone, "maelbresail_aftermorrigan9_2", [
    ],
    "Politics is what moves the world, but it's a game that you win or die.", "maelbresail_aftermorrigan10", [
  ]],
  [anyone, "maelbresail_aftermorrigan10", [
    ],
    "Everything I've done has been for the benefit of Eriu. If I had directly attacked Flaithbertach's children, they would have become martyrs, and certain northern clans could have taken up arms under that pretext. " +
    "You, however, were not among my people, so nobody can associate me. You and the abbot of Finian just killing with some other malefactors. " +
    "We have not seen one another many times. Now it is your name that is famous for killing the children of Flaithbertach.", "maelbresail_aftermorrigan11", [
  ]],
  
  [anyone|plyr, "maelbresail_aftermorrigan11", [
    ],
    "So you refuse me? After all I've done?", "maelbresail_aftermorrigan12", [
  ]],
  [anyone|plyr, "maelbresail_aftermorrigan11", [
    ],
    "I want more money, or I will talk to others about your involvement.", "maelbresail_aftermorrigan12_2", [
  ]],
  [anyone|plyr, "maelbresail_aftermorrigan11", [                    	(store_attribute_level,":intelligence","trp_player",ca_intelligence),
      (ge, ":intelligence", 12),
    ],
    "Traitor! Your hands remain clean while I will be hated by all the lords! (Intelligence)", "maelbresail_aftermorrigan12_3", [
      (add_xp_as_reward,500),
  ]],
  [anyone|plyr, "maelbresail_aftermorrigan11", [                    	(main_party_has_troop, "trp_morrigan_npc")
    ],
    "Well, Morrigan is still alive.", "maelbresail_aftermorrigan12_4", [
  ]],
  
  
  [anyone, "maelbresail_aftermorrigan12", [
    ],
    "I never promised you anything I haven't paid. This arrangement was important to Eriu. Now, at least, I help you leave this island. Here many will hate you for killing Flaithbertach's children. " +
    "I don't abandon any who has served me well, no matter how mercenary. I could reward you with 50,000 peningas. This should help you in your new life far from here.", "maelbresail_aftermorrigan13", [
  ]],
  [anyone, "maelbresail_aftermorrigan12_2", [
    ],
    "Well, I understand. I guess I can pay you for your silence. How about 100,000 peningas? This should help you in your new life far from here", "maelbresail_aftermorrigan13", [
  ]],
  [anyone, "maelbresail_aftermorrigan12_3", [
    ],
    "You're smarter than you act. I cannot lie. This much is true: many a lord has put you on his list of enemies, but it was for the good of Eriu. However, I desire to give you enough gold for your exile from Eriu. Seventy thousand peningas should be sufficient to start a new life far from here.", "maelbresail_aftermorrigan13", [
  ]],
  [anyone, "maelbresail_aftermorrigan12_4", [
    ],
    "Aah... I understand you're worried and will try to use anything to scare me. I know Morrigan is no longer a threat. You must leave Eriu as soon as possible, but this does not mean I not care about your welfare. I'll give you 30.000 peningas. This should be sufficient to start a new life far from here.", "maelbresail_aftermorrigan13", [
  ]],
  
  [anyone|plyr, "maelbresail_aftermorrigan13", [
    ],
    "I guess I have no choice. I take your money and leave this island.", "maelbresail_aftermorrigan14", [
  ]],
  [anyone|plyr, "maelbresail_aftermorrigan13", [
    ],
    "Give me the money; then see what I'll do.", "maelbresail_aftermorrigan14", [
  ]],
  [anyone|plyr, "maelbresail_aftermorrigan13", [
    ],
    "You can keep your money. I want you to clear my name.", "maelbresail_aftermorrigan15", [
  ]],
  
  [anyone, "maelbresail_aftermorrigan14", [
    ],
    "Alright. I do not have that amount here and now. I have a farm near Temair. I will see you there and pay as agreed. In fact, I will give a banquet in your honor, for we will not meet again after that. Farewell, {playername}.", "close_window", [
      (enable_party, "p_bresail_farm"),
      (str_store_party_name_link, s3, "p_town_29"),
      (str_store_string, s2, "@Mael Bresail has used you to kill Flaithbertach's children. Now, many of the lords of northern Ireland hate you for being a murderer of royalty. " +
      "Your options are limited, but it seems that all involve meeting with Mael Bresail on his farm near {s3}. He promised to give you a lot of peningas. Whatever you decide at this meeting will determine your destiny."),
      (add_quest_note_from_sreg, "qst_blank_quest_26", 4, s2, 0),
      (quest_set_slot,"qst_blank_quest_26",slot_quest_current_state, 1), #status 10, morrigan live.
      (call_script, "script_change_player_relation_with_troop", "trp_knight_18_4", -20),
      (call_script, "script_change_player_relation_with_troop", "trp_knight_18_6", -20),
      (call_script, "script_change_player_relation_with_troop", "trp_knight_18_7", -20),
  ]],
  [anyone, "maelbresail_aftermorrigan15", [
    ],
    "I understand. Your reputation is most important for you. I agree, I will help you to clear your name, I have strong influence in Eriu. I will use it and all money that I was going to give you. " +
    "I have to think of a plan. Meanwhile, we will do this: I have a farm near Temair. I will see you there. In fact, I will give a banquet in your honor while we talk about the way to clear your name. Farewell, {playername}.", "close_window", [
      
      (enable_party, "p_bresail_farm"),
      (str_store_party_name_link, s3, "p_town_29"),
      (str_store_string, s2, "@Mael Bresail has used you to kill Flaithbertach's children. Now, many of the lords of northern Ireland hate you for being a murderer of royalty. " +
      "Your options are limited, but it seems that all involve meeting with Mael Bresail on his farm near {s3}. Whatever you decide at this meeting will determine your destiny."),
      (add_quest_note_from_sreg, "qst_blank_quest_26", 4, s2, 0),
      (quest_set_slot,"qst_blank_quest_26",slot_quest_current_state, 1), #status 10, morrigan live.
      (call_script, "script_change_player_relation_with_troop", "trp_knight_18_4", -20),
      (call_script, "script_change_player_relation_with_troop", "trp_knight_18_6", -20),
      (call_script, "script_change_player_relation_with_troop", "trp_knight_18_7", -20),
  ]],
  #Mael bresail pacto final
  [anyone, "maelbresail_pactofinal", [
    ],
    "I guess it is fair to recognize that you've exceeded all my expectations. You're much too dangerous to have as an enemy. I offer here and now peace between us. " +
    "I'll pay you 50,000 peningas for all the harm I've caused you, and from this moment, our paths never cross again. You will not pursue me, and I won't send men to kill you. It will simply be as if we had never known one another. " +
    "I promise before my mother, present here. Do you agree?", "maelbresail_pactofina2", [
  ]],
  
  [anyone|plyr, "maelbresail_pactofina2", [
    ],
    "Well, we both are but businessmen. I accept your money. You will never again hear from me.", "maelbresail_pactofina3_1", [ #final 1 accept money
  ]],
  [anyone|plyr, "maelbresail_pactofina2", [
    ],
    "I agree, but exchange the money for favor with Ard Ruire Aed mac Niall of Aileach.", "maelbresail_pactofina3_2", [ #final 1 accept money
  ]],
  [anyone|plyr, "maelbresail_pactofina2", [
    ],
    "I think not. Blood is paid with blood. Today your days over.", "maelbresail_pactofina3_3", [ #final 2, fight.
  ]],
  
  #morrigan in party = no negotiation
  [anyone|other(trp_morrigan_npc), "maelbresail_pactofina3_1", [(main_party_has_troop,"trp_morrigan_npc"),
    ],
    "No! My family demands revenge from their graves. This cannot end without blood!^^Remember me, Mael Bresail? Do you remember me, rat? I've come to kill you!", "maelbresail_pactofina5",
    [
  ]],
  [anyone|other(trp_morrigan_npc), "maelbresail_pactofina3_2", [(main_party_has_troop,"trp_morrigan_npc"),
    ],
    "No! My family demands revenge from their graves. This cannot end without blood!^^Remember me, Mael Bresail? Do you remember me, rat? I've come to kill you!", "maelbresail_pactofina5",
    [
  ]],
  #money
  [anyone, "maelbresail_pactofina3_1", [
    ],
    "Here's your money. If ever we meet again, I do not know you. Our business is done. No more fear; no more death. May gold seal our pact, and may God witness our oaths.", "maelbresail_pactofina3_6", [
      (call_script, "script_troop_add_gold", "trp_player", 50000),
      (call_script, "script_change_player_honor", -2),
  ]],
  #relation
  [anyone, "maelbresail_pactofina3_2", [
    ],
    "That seems fair. I shall speak highly of you to my king, and he will love you more than he loves his favorite vassal. " +
    "If ever we meet again, I do not know you. Our business is done. No more fear; no more death. May God witness our oaths.", "maelbresail_pactofina3_6", [
      (call_script, "script_change_player_relation_with_troop", "trp_kingdom_18_lord", 100),
      (call_script, "script_change_player_honor", -1),
  ]],
  #
  [anyone|plyr, "maelbresail_pactofina3_6", [
    ],
    "I swear. Our enmity is buried.", "maelbresail_pactofina3_7",
    [
  ]],
  [anyone, "maelbresail_pactofina3_7", [
    ],
    "I swear before my mother. Go in peace. You are a rich man now.", "close_window", [
      ##    (call_script, "script_succeed_quest", "qst_blank_quest_26"),
      ##    (call_script, "script_end_quest", "qst_blank_quest_26"),
      (str_store_string, s2, "@Note 4: You chose to spare Mael Bresail's life. Both of you made oaths to not cross ways ever again."),
      (add_quest_note_from_sreg, "qst_blank_quest_27", 7, s2, 0),
      (quest_set_slot,"qst_blank_quest_26",slot_quest_current_state, 10), #
      (jump_to_menu, "mnu_bresail_fort_visit"),
      (finish_mission,0),
      ##                                 (leave_encounter),
      ##                                 (change_screen_return),
  ]],
  #fight option
  [anyone, "maelbresail_pactofina3_3", [
    ],
    "I see you're a warrior unable to see for the glints from steel, so steel shall you receive. Here. Now. Of the two, only one will leave. Men, to me!", "maelbresail_pactofina4", [
  ]],
  
  [anyone|other(trp_morrigan_npc), "maelbresail_pactofina4", [(main_party_has_troop,"trp_morrigan_npc"),
    ],
    "Do you remember me, rat? I have also come to kill you, to avenge my family!", "maelbresail_pactofina5",
    [
  ]],
  [anyone|plyr, "maelbresail_pactofina4", [
    ],
    "It's time to meet with your Maker!", "maelbresail_pactofina5_2",
    [
  ]],
  
  [anyone, "maelbresail_pactofina5", [
    ],
    "--His face shows terror--^^You? But... Kill them, kill them all!", "close_window", [
      (str_store_string, s2, "@Note 4: Morrigan forces you to end the life of Mael Bresail."),
      (add_quest_note_from_sreg, "qst_blank_quest_27", 7, s2, 0),
      (quest_set_slot,"qst_blank_quest_26",slot_quest_current_state, 7), #
  ]],
  [anyone, "maelbresail_pactofina5_2", [
    ],
    "Kill them, kill them all!", "close_window", [
      (str_store_string, s2, "@Note 4: You killed Mael Bresail in revenge for his ambush on the farm."),
      (add_quest_note_from_sreg, "qst_blank_quest_27", 7, s2, 0),
      (quest_set_slot,"qst_blank_quest_26",slot_quest_current_state, 7), #
  ]],
  
  ########the snake
  [trp_the_snake, "start", [  (check_quest_active,"qst_blank_quest_24"),
      (quest_slot_eq,"qst_blank_quest_24",slot_quest_current_state, 0),
    ],
    "You look like a warrior. Are you looking for work?", "thesnake1_dialog", [
  ]],
  
  [anyone|plyr, "thesnake1_dialog", [],
    "I know who you are. They call you 'the Snake.' I was sent to kill you.", "thesnake2_dialog", []],
  [anyone|plyr, "thesnake1_dialog", [],
    "Snake, I'm not here to join your army, I fear.", "thesnake2_1_dialog", []],
  [anyone|plyr, "thesnake1_dialog", [],
    "Sure, Snake, how much you pay?", "thesnake2_2_dialog", []],
  
  [anyone, "thesnake2_dialog", [
    ],
    "Why? Ah, I understand. " +
    "I will not run away. This town has a field for local competitions. I'll wait there with my best men. Come and bring your most loyal companions. We will fight to the death.", "thesnake3_dialog", []],
  [anyone, "thesnake2_1_dialog", [
    ],
    "Only my enemies call me 'the Snake.' I know I am a loose thread. I represent a danger to the interests of the Rat, your patron. Coward that he is, he does not dare to come himself but sends murderers. " +
    "I will not run away. This town has a field for local competitions. I'll wait there with my best men. Come and bring your most loyal companions. We will fight to the death.", "thesnake3_dialog", []],
  [anyone, "thesnake2_2_dialog", [
    ],
    "Only my enemies call me 'the Snake.' The same that destroyed my family. Do you come to kill me? " +
    "I will not run away. This town has a field for local competitions. I'll wait there with my best men. Come and bring your most loyal companions. We will fight to the death.", "thesnake3_dialog", []],
  
  [anyone|plyr, "thesnake3_dialog", [],
    "Then we have an appointment.", "close_window", [
      (try_begin),
        (store_troop_health, ":health", "trp_player", 0), #get relative health in 1-100 range and put it into the ":health" variable
        (lt, ":health", 30),
        (val_add, ":health", 35),               #add to it the 5%
        (troop_set_health,   "trp_player", ":health"),   #set it
      (try_end),
      (party_get_slot, ":arena_scene", "$current_town", slot_town_arena),
      (modify_visitors_at_site, ":arena_scene"),
      (reset_visitors),
      
      (set_visitor,0,"trp_player"), #player
      (assign, ":cur_entry", 1), #no companions, more difficult?
      (try_for_range, ":companion", companions_begin, companions_end),
        (main_party_has_troop,":companion"),
        (set_visitor, ":cur_entry", ":companion"),
        #(val_add, ":cur_entry", 1),
      (try_end),
      
      (set_visitor, 20, "trp_the_snake"), #leader
      (set_visitor, 21, "trp_scotch_level1_skirmisher",3),
      (set_visitor, 22, "trp_scotch_level2_landed",3),
      (set_visitor, 23, "trp_irish_level1_companion",4),
      (set_visitor, 24, "trp_scotch_level2_companion",4),
      
      (set_jump_mission, "mt_thesnake_duel"),
      (jump_to_scene,":arena_scene"),
      (change_screen_mission),
  ]],
  [anyone|plyr, "thesnake3_dialog", [],
    "Erm, just a moment.", "thesnake4_dialog", []],
  
  [anyone, "thesnake4_dialog", [
    ],
    "No! You want my head, so at least have the courage to battle for it.^^[Your companions will join to you in this duel.]", "close_window", [
      (try_begin),
        (store_troop_health, ":health", "trp_player", 0), #get relative health in 1-100 range and put it into the ":health" variable
        (lt, ":health", 30),
        (val_add, ":health", 35),               #add to it the 5%
        (troop_set_health,   "trp_player", ":health"),   #set it
      (try_end),
      (party_get_slot, ":arena_scene", "$current_town", slot_town_arena),
      (modify_visitors_at_site, ":arena_scene"),
      (reset_visitors),
      
      (set_visitor,0,"trp_player"), #player
      (assign, ":cur_entry", 1), #no companions, more difficult?
      (try_for_range, ":companion", companions_begin, companions_end),
        (main_party_has_troop,":companion"),
        (set_visitor, ":cur_entry", ":companion"),
        #(val_add, ":cur_entry", 1),
      (try_end),
      
      (set_visitor, 20, "trp_the_snake"), #leader
      
      (store_character_level, ":troop_level", "trp_player"),
      (try_begin),
        (le, ":troop_level", 9),
        (set_visitor, 21, "trp_scotch_level1_skirmisher",2),
        (set_visitor, 22, "trp_scotch_level2_landed",1),
        (set_visitor, 23, "trp_irish_level1_companion",2),
        (set_visitor, 24, "trp_scotch_level2_companion",1),
      (else_try),
        (set_visitor, 21, "trp_scotch_level1_skirmisher",2),
        (set_visitor, 22, "trp_scotch_level2_landed",2),
        (set_visitor, 23, "trp_irish_level1_companion",2),
        (set_visitor, 24, "trp_scotch_level2_companion",2),
      (try_end),
      
      (set_jump_mission, "mt_thesnake_duel"),
      (jump_to_scene,":arena_scene"),
      (change_screen_mission),
  ]],
  #####Morrigan add-ons
  [trp_morrigan_npc, "start", [  (check_quest_active,"qst_blank_quest_23"),
      (quest_get_slot, ":quest_current_state", "qst_blank_quest_23", slot_quest_current_state),
      (eq, ":quest_current_state", 8),
    ],
    "Do you come to kill me, murderer? Your lord, Mael Bresail, would be happy to end my lineage.", "morrigan1_dialog", [
  ]],
  [trp_morrigan_npc, "start", [  (check_quest_active,"qst_blank_quest_26"), #morrigan final
      (quest_get_slot, ":quest_current_state", "qst_blank_quest_26", slot_quest_current_state),
      (ge, ":quest_current_state", 9),
    ],
    "{playername}, I want to thank you for all your help. Without you, I would never have avenged my family. " +
    "Although the death of Mael Bresail has not given me any joy, I feel I've done the right thing. My family can now rest in peace. " +
    "My travels with you are over. I leave you because I need to remove myself from the world I have known and find a place to live in peace, far away from Eriu. I need to leave behind my past to build a future, and that means leaving you.", "morriganleave_final1", [
  ]],
  
  [anyone|plyr, "morrigan1_dialog", [],
    "It is your end, witch. I kill you now.", "morrigan1_dialog1", []],
  [anyone|plyr, "morrigan1_dialog", [],
    "What are you talking about, witch?", "morrigan1_dialog2", []],
  [anyone|plyr, "morrigan1_dialog", [],
    "Mael Bresail isn't my lord.", "morrigan1_dialog3", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone, "morrigan1_dialog1", [
    ],
    "My father, Flaithbertach, could have been king, but he was killed by his own brother, Aed of Aileach, and your master, Mael Bresail. You plan to kill the last member from Flaithbertach's lineage. The gods and men curse your name.^^" +
    "For some time now, I have owned nothing more than my life. Yet I do not fear death and think maybe it may remedy my torment.^^" +
    "(Before you can do anything, Morrigan casts herself on your weapon, inviting death. She utters no sound. You watch her eyes close and peace spread across her face.)", "close_window", [
      (mission_disable_talk), #permite hablar
      (call_script, "script_change_troop_renown", "trp_player", 25),
      (call_script, "script_troop_add_gold", "trp_player", 400),
      (str_store_string, s2, "@Morrigan has died. Return to the abbot to get your reward and maybe some answers."),
      (add_quest_note_from_sreg, "qst_blank_quest_23", 9, s2, 0),
      
      (quest_set_slot,"qst_blank_quest_23",slot_quest_current_state, 9), #status 7
      (call_script, "script_succeed_quest", "qst_blank_quest_23"),
      (str_store_string, s2, "@Note 3: You chose to kill Morrigan."),
      (add_quest_note_from_sreg, "qst_blank_quest_27", 6, s2, 0),
      (jump_to_menu, "mnu_morrigan_lair_attack"),
      (finish_mission),
  ]],
  
  [anyone, "morrigan1_dialog2", [
    ],
    "Then you kill without knowing your victim or why she should be killed, murderer?", "morrigan1_dialog4", []],
  [anyone, "morrigan1_dialog3", [
    ],
    "Then why do you work for him and his damned lord, Aed of Aileach, and kill their enemies for them, murderer?", "morrigan1_dialog4", [
  ]],
  
  [anyone|plyr,"morrigan1_dialog4", [
      (str_clear, s10),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@Oh, I'm no murderer... I am only trying to help Bal Luighne. (Phlegmatic)"),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@My duty is but to protect the people of Bal Luighne. (Melancholic)"),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@I am not a murderer. You attacked Bal Luighne, and now I will kill you. (Choleric)"),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -2),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@My only goal is to kill you for what you did to Bal Luighne, witch (Sanguine)"),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -2),
      (try_end),
    ],
    "{!}{s10}", "morrigan1_dialog5",[
  ]],
  
  [anyone, "morrigan1_dialog5", [
    ],
    "Bal Luighne? I could have destroyed that village long ago, but never attacked. I just terrorized the locals so that they would leave the place and leave this land to me. " +
    "I only seek a place to live and feel protected, but the peasants are stubborn and Mael Bresail found out where I am. Then he sent you to kill me and finish off my lineage. " +
    "You may have no idea, but your patron is implacable. Recently, he sent men to kill to my brother in Pictland and his sons -- just children -- near Caer Meguaidd. Now, I am last of my family. " +
    "I see it was impossible to hide from Mael Bresail. I found this remote part of the world and forgot my name by taking that of the goddess, Morrigan. Yet here you are to kill me.", "morrigan1_dialog6", [
  ]],
  
  [anyone|plyr, "morrigan1_dialog6", [],
    "Liar! You are trying to confuse me. It's time to die.", "morrigan1_dialog1", []],
  [anyone|plyr, "morrigan1_dialog6", [],
    "Then that would make you... Flaithbertach's daughter? No wonder you are a menace!", "morrigan1_dialog7", [
  ]],
  [anyone, "morrigan1_dialog7", [
    ],
    "My father, Flaithbertach, could have been king, but he was killed by his own brother, your master. This is Eriu. If you want the throne, you have to catch and eliminate all potential competitors. Fratricide is practically a way of life. " +
    "Aed was faster to the deed than my father. Then, with the help of Mael Bresail, he killed my mother and the rest of my family. Just my brother, his sons, and I escaped, but Mael eventually found us. Now only I am alive, but even so, now at the tip of your sword.", "morrigan1_dialog8", [
  ]],
  
  [anyone|plyr, "morrigan1_dialog8", [],
    "Even so, you did too much damage to the people of Bal Luighne. You pay now with your life.", "morrigan1_dialog1", []],
  [anyone|plyr, "morrigan1_dialog8", [],
    "Mael Bresail used me? I am NOT his hired murderer!", "morrigan1_dialog9", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
  ]],
  
  [anyone, "morrigan1_dialog9", [   (troop_get_slot, ":relation", "$g_talk_troop", slot_troop_player_relation),
      (lt, ":relation", 4),
    ],
    "Well, that's hardly my problem. I'm tired of fleeing. Everyone I cared for is dead. I just want to see them again and be at peace. Go back to your master and collect your reward, murderer. I do not begrudge you that.", "morrigan1_dialog1", [
  ]],
  [anyone, "morrigan1_dialog9", [
    ],
    "Mael Bresail uses everybody. What do you want to do now?", "morrigan1_dialog10", [
  ]],
  [anyone|plyr, "morrigan1_dialog10", [],
    "You did too much damage to the people of Bal Luighne. You pay now with your life.", "morrigan1_dialog1", [
      (call_script, "script_change_player_honor", 3),
  ]],
  [anyone|plyr, "morrigan1_dialog10", [],
    "I will let you live, as I want answers from Mael Bresail. I will be back.", "morrigan1_dialog11", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
  ]],
  [anyone, "morrigan1_dialog11", [
      ################# Space for companions in storyline
      (try_begin), #
        (neg|hero_can_join, "p_main_party"),
        (call_script, "script_game_get_party_companion_limit"),
        (assign, ":party_size_limit", reg0),
        (party_get_num_companions, ":num_men", "p_main_party"),
        (store_sub, ":difference", ":num_men", ":party_size_limit"),
        (try_begin),
          (gt, ":difference", 0),
          (assign, ":num_troops", ":difference"),
          (try_for_range, ":unused", 0, ":num_troops"),
            (call_script, "script_cf_party_remove_random_regular_troop", "p_main_party"),
          (try_end),
        (try_end),
        #  (call_script, "script_change_troop_renown", "trp_player", 18),
      (try_end),
      
      (try_begin), #chief +10 renown in storyline
        (call_script, "script_change_troop_renown", "trp_player", 10),
      (try_end),
      ################
    ],
    "I'd rather go with you. You've killed my last supporter, and in any case, I do not want to try to hide anymore. I will join you, disguised as one of your warriors.", "close_window", [
      (mission_disable_talk), #permite hablar
      (call_script, "script_change_troop_renown", "trp_player", 25),
      (call_script, "script_troop_add_gold", "trp_player", 400),
      (str_store_string, s2, "@Morrigan has joined your party. Return to the abbot to get your reward and maybe some answers."),
      (add_quest_note_from_sreg, "qst_blank_quest_23", 9, s2, 0),
      
      (party_add_members,"p_main_party","trp_morrigan_npc",1),
      (quest_set_slot,"qst_blank_quest_23",slot_quest_current_state, 10), #status 10, morrigan live.
      (call_script, "script_succeed_quest", "qst_blank_quest_23"),
      
      (str_store_string, s2, "@Note 3: You chose to spare the life of Morrigan and seek answers from Mael Bresail. Morrigan has joined your shield wall."),
      (add_quest_note_from_sreg, "qst_blank_quest_27", 6, s2, 0),
      
      (jump_to_menu, "mnu_morrigan_lair_attack"),
      (finish_mission),
  ]],
  #morrigan final
  [anyone|plyr, "morriganleave_final1", [],
    "I understand. I hope you find the peace that you wish.", "morriganleave_final2", [   (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
  ]],
  [anyone|plyr, "morriganleave_final1", [],
    "Morrigan, you cannot leave me. I need you.", "morriganleave_final3", []],
  
  [anyone, "morriganleave_final2", [
    ],
    "Thank you for understanding me. It has not been an easy decision. In your army, I feel protected, but this life is not for me. I need a place to call home, where I can be happy. " +
    "Maybe someday we will meet again, but I think not. I just want you to know that you have become a very important person to me. " +
    "I wish you luck, {playername}. The gods allow you to get everything that you deserve. You are destined for greatness.", "morriganleave_final2_2", [
  ]],
  [anyone, "morriganleave_final3", [
    ],
    "Do not make this difficult. My decision is made. This life is not for me. I need a place to call home, where I can be happy. " +
    "Maybe someday we will meet again, but I think not. I just want you to know that you have become a very important person to me. " +
    "I wish you luck, {playername}. The gods allow you to get everything that you deserve. You are destined for greatness.", "morriganleave_final2_2", [
  ]],
  [anyone|plyr, "morriganleave_final2_2", [],
    "Farewell, Morrigan. If you ever need me, I will come.", "morriganleave_final2_3", []],
  [anyone|plyr, "morriganleave_final2_2", [],
    "Farewell, Morrigan.", "morriganleave_final2_3", []],
  [anyone, "morriganleave_final2_3", [
    ],
    "[You watch as Morrigan turns her back and walks away from you. She turns her face for an instant, and you think you see tears in her eyes. Then she leaves.]", "close_window", [
      (quest_set_slot,"qst_blank_quest_26",slot_quest_current_state, 11), #
      (remove_member_from_party, "trp_morrigan_npc", "p_main_party"),
      (jump_to_menu, "mnu_bresail_fort_visit"),
      (finish_mission,0),
  ]],
  
  
  ###champions
  [trp_campeon_1, "start", [  (check_quest_active,"qst_blank_quest_23"),
      (quest_get_slot, ":quest_current_state", "qst_blank_quest_23", slot_quest_current_state),
      (eq, ":quest_current_state", 2),
    ],
    "--A tall man, his face marked by surprise, moves toward you.--^^" +
    "What were those creatures? What happened here?", "campeon1_dialog", [
  ]],
  
  [trp_campeon_1, "start", [
    ],
    "Farewell.", "close_window", [
  ]],
  
  [anyone|plyr, "campeon1_dialog", [],
    "And you are?", "campeon1_dialog1", []],
  [anyone|plyr, "campeon1_dialog", [],
    "Thanks for your help!", "campeon1_dialog2", []],
  [anyone|plyr, "campeon1_dialog", [],
    "Those things were Morrigan and his minions.", "campeon1_dialog3", []],
  
  [anyone, "campeon1_dialog1", [
    ],
    "Eh? Oh, yes... My name is Aed mac Ainmerech, and the man who accompanies me is Olchobar mac Cinaeda of the Ui Neill.", "campeon1_dialog1_1", []],
  
  
  [anyone|other(trp_campeon_2), "campeon1_dialog1_1", [
    ],
    "That's me. We have been chosen to save Bal Luighne from the evil that has befallen it.", "campeon1_dialog3",
    [
  ]],
  [anyone, "campeon1_dialog2", [
    ],
    "Our help? This is pure coincidence! We were returning to Bal Luighne when we saw something in the fog. We played the horns to signal that we had no hostile intentions.", "campeon1_dialog3", []],
  [anyone, "campeon1_dialog3", [
    ],
    "Was that Morrigan? With the fog, I saw demons. I was sure old Caliacas' problem was a Viking war band...", "campeon1_dialog3_1", []],
  [anyone|other(trp_campeon_2), "campeon1_dialog3_1", [
    ],
    "You seem worried now, Aed, but a few hours ago you were telling me how you could defeat any creature!", "campeon1_dialog3_2",
    [
  ]],
  [anyone, "campeon1_dialog3_2", [
    ],
    "This is no time for jokes, Olchobar.^^--He turns to you--^^And who are you, and what brings you to this godforsaken place?", "campeon1_dialog3_3", []],
  
  [anyone|plyr,"campeon1_dialog3_3", [
      (str_clear, s10),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@My parents gave me the name of {playername}. I am the third champion you were waiting for. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@Well, I am {playername}, the third champion. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@My name is {playername}, the third and foremost champion. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@I am {playername}. As the third champion, I feel honored to meet you. (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "campeon1_dialog4",[
  ]],
  
  [anyone,"campeon1_dialog4", [
      (str_clear, s4),
    ],
    "{!}{s4}", "campeon1_dialog4_1",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s4, "@Ah, well, we were waiting outside the old, burned-out pagan's place. You made us wait quite a long time."),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s4, "@Now you decide to show up. You arrive late."),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s4, "@Yes, yes, I see, and you have grandma. Anyway, we waited several days for your arrival, and I'm not as sure as you that it was worth it."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s4, "@Short and polite! That's fine. Too bad you have not left us time for proper ceremony, late as you are."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
      (try_end),
  ]],
  [anyone|other(trp_campeon_2), "campeon1_dialog4_1", [
    ],
    "Your performances are stellar, but unfortunately we must cut this entertainment short. If that's Morrigan, we have to follow her and find out where her lair is.", "campeon1_dialog4_2",
    [
  ]],
  [anyone, "campeon1_dialog4_2", [
    ],
    "But Caliacas sent us a message to return to the village. Something bad must be happening...", "campeon1_dialog4_3", []],
  
  [anyone|plyr, "campeon1_dialog4_3", [],
    "This is more important. We should all follow Morrigan.", "campeon1_dialog5", []],
  [anyone|plyr, "campeon1_dialog4_3", [],
    "The village is more important. We should all return with haste.", "campeon1_dialog5_2", []],
  [anyone|plyr, "campeon1_dialog4_3", [],
    "We must part ways. You two go to the village, and I will follow Morrigan.", "campeon1_dialog5", []],
  [anyone|plyr, "campeon1_dialog4_3", [],
    "We must part ways. You two follow Morrigan, and I will go to Bal Luighne.", "campeon1_dialog5_2", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (call_script, "script_change_player_relation_with_troop", "trp_campeon_2", 10),
  ]],
  
  [anyone, "campeon1_dialog5", [
    ],
    "Ha! I see you were thinking up orders while dragging your feet!", "campeon1_dialog6", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone|other(trp_campeon_2), "campeon1_dialog6", [
    ],
    "Actually, we do know the area better. We will follow Morrigan. Meanwhile, find out what is happening to Caliacas in Bal Luighne.", "campeon1_dialog7",
    [
  ]],
  [anyone|other(trp_campeon_2), "campeon1_dialog5_2", [
    ],
    "Yes, somebody has to see what is happening to Caliacas in Bal Luighne. You go there while we follow Morrigan.", "campeon1_dialog7",
    [
  ]],
  [anyone|plyr, "campeon1_dialog7", [],
    "Very well. I will see you soon.", "campeon1_dialog8", []],
  [anyone|plyr, "campeon1_dialog7", [],
    "I do not agree with that plan.", "campeon1_dialog8_2", []],
  
  [anyone|other(trp_campeon_2), "campeon1_dialog8", [
    ],
    "Good luck. We will send a messenger as soon as we find Morrigan's lair.", "close_window",
    [
      (call_script, "script_change_player_relation_with_troop", "trp_campeon_2", 5),
      (str_store_party_name_link, s3, "p_village_78"),
      (str_store_string, s2, "@After being defeated by Morrigan, you met the other two champions, Aed and Olchobar. After talking to them, you have parted ways. They will follow Morrigan while you go back to {s3}. It looks like Caliacas has problems."),
      (add_quest_note_from_sreg, "qst_blank_quest_23", 6, s2, 0),
      (quest_set_slot,"qst_blank_quest_23",slot_quest_current_state, 3), #status 0
      
      (jump_to_menu,"mnu_morrigan_leave"),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  [anyone, "campeon1_dialog8_2", [
    ],
    "Do I look worried about that? You were the last to arrive, so your mission is to hear and obey.", "campeon1_dialog8_3", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone|other(trp_campeon_2), "campeon1_dialog8_3", [
    ],
    "There is no need to be arrogant, Aed. Believe me, {playername}, this makes the most sense. We are from Eriu and won't waste time getting lost. We will send a messenger as soon as we find Morrigan's lair. Farewell.", "close_window",
    [
      (str_store_party_name_link, s3, "p_village_78"),
      (str_store_string, s2, "@After being defeated by Morrigan, you met the other two champions, Aed and Olchobar. After talking to them, you have parted ways. They will follow Morrigan while you go back to {s3}. It looks like Caliacas has problems."),
      (add_quest_note_from_sreg, "qst_blank_quest_23", 6, s2, 0),
      (quest_set_slot,"qst_blank_quest_23",slot_quest_current_state, 3), #status 0
      
      (jump_to_menu,"mnu_morrigan_leave"),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  ######################################
  ###champion 2
  [trp_campeon_2, "start", [  (check_quest_active,"qst_blank_quest_23"),
      (quest_get_slot, ":quest_current_state", "qst_blank_quest_23", slot_quest_current_state),
      (eq, ":quest_current_state", 7),
    ],
    "{playername}! My messenger found you. Morrigan's beasts attacked us. They killed our men, and we're stuck here. " +
    "Morrigan's camp is just ahead. You and your troops are our only hope. You have to get us out of here.", "campeon2_dialog", [
  ]],
  [trp_campeon_2, "start", [
    ],
    "Farewell.", "close_window", [
  ]],
  
  [anyone|plyr, "campeon2_dialog", [],
    "Morrigan's beasts attacked me, too.", "campeon2_dialog1", []],
  [anyone|plyr, "campeon2_dialog", [],
    "We must kill Morrigan together.", "campeon2_dialog2", []],
  
  [anyone, "campeon2_dialog1", [
    ],
    "Then they caught you here, too. We must flee before they decide to return.", "campeon2_dialog3", []],
  [anyone, "campeon2_dialog2", [
    ],
    "Are you crazy? Her beasts destroyed my men. Caliacas and his farmers left, looking for other heroes. I will not lose my life in this place.", "campeon2_dialog3", []],
  
  [anyone|plyr, "campeon2_dialog3", [],
    "Morrigan's camp is just ahead. We must kill her together. Follow me now!", "campeon2_dialog4", []],
  [anyone|plyr, "campeon2_dialog3", [],
    "I will kill Morrigan with or without you.", "campeon2_dialog4_2", []],
  
  [anyone|other(trp_campeon_1), "campeon2_dialog4_2", [
    ],
    "They'll finish you, stupid, Morrigan or her beasts. We will not go with you, but stay here and wait for the best time to escape.", "close_window",
    [
      (str_store_string, s2, "@Note 2: Despite their cowardice and refusal to help defeat Morrigan, you spared the lives of the other two champions in Morrigan's lair."),
      (add_quest_note_from_sreg, "qst_blank_quest_27", 5, s2, 0),
      (mission_disable_talk),
      ##                  (tutorial_message_set_background, 1),
      ##		  (tutorial_message,"@Leave the cowards champions behind. Then, explore area and meet to Morrigan."),
  ]],
  
  [anyone|other(trp_campeon_1), "campeon2_dialog4", [
    ],
    "No. We will not go with you. We'll stay right here and wait for the best time to escape. If you want so much to die, you will die alone.", "campeon2_dialog5",
    [
  ]],
  [anyone|plyr, "campeon2_dialog5", [],
    "Rat! Then I shall kill you.", "close_window", [
      (mission_disable_talk),
      (try_for_agents, ":cur_agent"),
        (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
        (this_or_next|eq, ":cur_agent_troop", "trp_campeon_1"),
        (this_or_next|eq, ":cur_agent_troop", "trp_campeon_2"),
        (eq, ":cur_agent_troop", "trp_mercenary_swordsman"),
        (agent_set_team, ":cur_agent", 2),
      (try_end),
      (str_store_string, s2, "@Note 2: You chose kill the other champions for their cowardice in Morrigan's lair."),
      (add_quest_note_from_sreg, "qst_blank_quest_27", 5, s2, 0),
      ##                  (tutorial_message_set_background, 1),
      ##		  (tutorial_message,"@Kill them. Then, explore area and meet to Morrigan."),
  ]],
  [anyone|plyr, "campeon2_dialog5", [],
    "Cowards! I will kill Morrigan by myself. Farewell.", "close_window", [
      (str_store_string, s2, "@Note 2: Despite their cowardice and refusal to help defeat Morrigan, you spared the lives of the other two champions in Morrigan's lair."),
      (add_quest_note_from_sreg, "qst_blank_quest_27", 5, s2, 0),
      (mission_disable_talk),
      ##                  (tutorial_message_set_background, 1),
      ##		  (tutorial_message,"@Leave the cowards champions behind. Then, explore area and meet to Morrigan."),
  ]],
  ###################
  
  #
  [trp_hija_granja, "start", [ (eq, "$g_talk_troop_met", 0),#mainquest chief
    ],
    "Heill! Welcome! My name is Thora Ulfsdottir. I am the only daughter of Ulf. You should talk to him.", "thora_dialog", [
  ]],
  
  [trp_hija_granja, "start", [              (check_quest_active,"qst_revenge_exchange"),
      (quest_get_slot, ":quest_current_state", "qst_revenge_exchange", slot_quest_current_state),
      (lt, ":quest_current_state", 4),
    ],
    "Heill! Welcome! My name is Thora Ulfsdottir. I am the only daughter of Ulf. You should talk to him.", "thora_dialog", [
  ]],
  
  [trp_hija_granja, "start", [ (eq, "$g_encountered_party", "p_farmland"),
    ],
    "Sorry, I am busy.", "close_window", []],
  
  [anyone|plyr, "thora_dialog", [],
    "Thora, nice to meet you. I will go and talk to your father. Farewell.", "thora_dialog_sigurd", []],
  [anyone|plyr, "thora_dialog", [(eq,reg59,tf_male),],
    "Thora, I'd rather talk to you than your father. You're a very pretty girl.", "thora_dialog_romance", []],
  
  [anyone|other(trp_npc2), "thora_dialog_sigurd", [
    ],
    "Thora, your name is pretty, as are you. I am Egil Horiksson. My weapons are sword and spear, but I yield to your beauty.", "thora_dialog_sigurd2",
    [
  ]],
  
  [anyone, "thora_dialog_sigurd2", [#mainquest chief
    ],
    "Why, thank you... sir. I blush at your compliments. You're also... very handsome.", "thora_dialog_sigurd2", []],
  
  [anyone|plyr, "thora_dialog_sigurd2", [],
    "(Allow them to continue talking and go talk to Ulf)", "close_window", [
      (str_store_string, s2, "@Note 3: Without regard to Ulf's rules, you decided to let Egil and Thora have a conversation."),
      (add_quest_note_from_sreg, "qst_notes_danmork", 6, s2, 0),
      (assign, "$thora_hijo", 2), #Egil and Thora romance.
  ]],
  [anyone|plyr, "thora_dialog_sigurd2", [],
    "Egil, leave the girl alone, and let's go.", "thora_dialog_sigurd3", []],
  
  [anyone|other(trp_npc2), "thora_dialog_sigurd3", [
    ],
    "Damn, you cannot stand to see people happy, can you? All right, I will, {reg59?madam:sir}.", "close_window",
    [
      (str_store_string, s2, "@Note 3: You decided to respect Ulf's rules and protect the dignity of his daughter, Thora."),
      (add_quest_note_from_sreg, "qst_notes_danmork", 6, s2, 0),
      (assign, "$thora_hijo", 0), #player no romance with Thora
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -5),
  ]],
  [anyone, "thora_dialog_romance", [#mainquest chief
      (store_attribute_level, ":charisma", "trp_player", ca_charisma),
      (ge, ":charisma", 12),
    ],
    "Why, thank you... sir. I blush at your compliments. You're also... very handsome.", "thora_dialog_romance2", []],
  [anyone, "thora_dialog_romance", [#mainquest chief
    ],
    "Thank you, but you should talk to my father, Ulf.", "thora_dialog_sigurd", []],
  
  [anyone|plyr, "thora_dialog_romance2", [
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (ge, ":persuasion", 4),
    ],
    "(Use your powers of persuasion to make Thora interested in you)", "thora_dialog_romance4", []],
  [anyone|plyr, "thora_dialog_romance2", [
    ],
    "You seem like such a smart girl. Tell me about yourself.", "thora_dialog_romance3", []],
  [anyone|plyr, "thora_dialog_romance2", [],
    "Well, then I will go to talk to your father. Farewell.", "thora_dialog_sigurd", []],
  
  [anyone, "thora_dialog_romance3", [#mainquest chief
    ],
    "Better not. My father does not like me to talk to strangers. Please go talk to him.", "thora_dialog_sigurd", []],
  
  [anyone, "thora_dialog_romance4", [#mainquest chief
    ],
    "(You see her eyes brighten as you tell her about your adventures. You approach her and put your hand over hers. It is not rejected. You try to kiss her, but she puts her hand on your mouth.)", "thora_dialog_romance5", []],
  [anyone, "thora_dialog_romance5", [#mainquest chief
    ],
    "Not here. My father will get angry. I will look for you tonight. Now, go see my father, Ulf.", "close_window", [
      (str_store_string, s2, "@Note 3: Without regard to Ulf's rules, you decided to have a romance with Thora, his daughter."),
      (add_quest_note_from_sreg, "qst_notes_danmork", 6, s2, 0),
      (assign, "$thora_hijo", 1), #player romance and hijo
  ]], ##asignar hijo player
  
  #orm
  [trp_orm_robagranjas, "start", [(eq, "$g_encountered_party", "p_farmland"),
    ],
    "I don't have time for you now.", "close_window", []],
  
  ###ulf
  [trp_ulf_thefarmer, "start", [(check_quest_active, "qst_ulf_testigo"),(quest_slot_eq,"qst_ulf_testigo",slot_quest_current_state, 1),
    ],
    "{playername}, what are you doing here again?", "ulf_testigo1", [
      (str_clear,s2),
      (str_clear,s4),
      (str_clear,s9),
      (try_for_range, ":troop_no", active_npcs_begin, active_npcs_end), #jarls relation check for quest chief
        (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
        (store_troop_faction, ":troop_faction_no", ":troop_no"),
        (eq, ":troop_faction_no", "fac_kingdom_1"),
        (call_script, "script_troop_get_relation_with_troop", "trp_player", ":troop_no"),
        (ge, reg0, 15),
        (str_store_troop_name_link, s9, ":troop_no"),
        (str_store_string, s4, "@{s9} has good relations with you."),
        (str_store_string, s2, "@{!}{s2}^{s4}"),
        (add_quest_note_from_sreg, "qst_ulf_testigo", 5, s2, 0),
      (try_end),
  ]],
  [trp_ulf_thefarmer, "start", [(check_quest_active, "qst_ulf_testigo"),(quest_slot_eq,"qst_ulf_testigo",slot_quest_current_state, 3), #victoria duelo con orm
    ],
    "{s2}^^{playername}, thank you very much for saving my life, my farm and my daughter, Thora. I want to reward you by giving you these treasures. " +
    "Besides, these are the weapons of Orm Svarti. I think they should be yours.", "ulf_ormvictory1", [
      (str_store_string, s2, "@--Ulf seems very happy. He carries in his hands the sword and chainmail of Orm Svarti.--", color_good_news),
  ]],
  
  [trp_ulf_thefarmer, "start", [(eq, "$g_talk_troop_met", 0),#mainquest chief
    ],
    "Heill! My name is Ulf Thorirsson. My jarl, Sigurd Ragnarsson, notified me that you were coming. Welcome to my farm. You and your men can eat and sleep here until Sigurd's people arrive. " +
    "The only thing I ask is that none of them comes close to my daughter, Thora.", "ulf_dialog", [
  ]],
  
  [trp_ulf_thefarmer, "start", [
      (check_quest_active,"qst_revenge_exchange"),
      (quest_get_slot, ":quest_current_state", "qst_revenge_exchange", slot_quest_current_state),
      (lt, ":quest_current_state", 4),
      #(eq, "$g_talk_troop_met", 0),#mainquest chief
    ],
    "Heill! My name is Ulf Thorirsson. My jarl, Sigurd Ragnarsson, sent me a warning that you were coming. Welcome to my farm. You and your men can eat and sleep here until Sigurd's people arrive. " +
    "The only thing I ask is that none of them comes close to my daughter, Thora.", "ulf_dialog", [
  ]],
  
  [trp_ulf_thefarmer, "start", [(eq, "$g_encountered_party", "p_farmland"),
    ],
    "I am very busy now. My thralls are lazy.", "close_window", []],
  
  [anyone|plyr, "ulf_dialog", [
    ],
    "Thank you, Ulf. I promise that no one will touch your daughter, and I appreciate your hospitality.", "ulf_dialog2", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone|plyr, "ulf_dialog", [
    ],
    "Enough about your daughter. Provide food and drink for my men, as hospitality dictates.", "ulf_dialog2", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  
  [anyone, "ulf_dialog2", [#mainquest chief
    ],
    "(Ulf gives some orders, and two servants step out of the main house with viands and drink. They give skvr -sour milk- and buttered bread to you and your men.)", "ulf_dialog3", [
  ]],
  
  [anyone|plyr,"ulf_dialog3", [
      (str_clear, s10),
    ],
    "{!}{s10}", "ulf_dialog4",[
      (str_clear, s10),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@Thanks for sharing your drink and your food with us, Ulf. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@Thanks for sharing your drink and your food with us, Ulf. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Sour milk and buttered bread? Don't you have anything better? (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Sour milk and buttered bread? We will accept your poor hospitality, but I expected better from a man like you. (Sanguine)"),
      (try_end),
  ]],
  
  [anyone, "ulf_dialog4", [#mainquest chief
    ],
    "It is all that I have, and I offered it with good will.", "ulf_dialog5", [
      (talk_info_show, 0),]],
  
  [anyone|other(trp_npc8), "ulf_dialog5", [
      (main_party_has_troop, "trp_npc8"),#JuJu70 - troop must be in the party
    ],
    "He's lying! I've seen barrels of beer and venison in a nearby warehouse. " +
    "We are eating and drinking this shit while he is keeping the best for himself.", "ulf_dialog6",
    [
  ]],
  ##    [anyone|plyr, "ulf_dialog5", [
  ##        ],
  ##   "I've seen barrels of beer and venison in a nearby warehouse.", "ulf_dialog8",
  ##   [
  ##    ]],
  
  [anyone|other(trp_npc2), "ulf_dialog6", [
    ],
    "{s2}^^He is laughing at us. He's a rich man yet gives us the worst dining. He has neglected the laws of hospitality! He dies now! " +
    "Nobody laughs at Egil, and he will serve as an example to others to respect us.", "ulf_dialog7",
    [
      (str_store_string, s2, "@--He spits out what he was eating and throws away his skvr horn.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc3), "ulf_dialog7", [
      (main_party_has_troop, "trp_npc3"),#JuJu70 - troop must be in the party
    ],
    "{s2}^^If you kill this man, you'll have to pay high compensation to his family, or perhaps they decide to seek revenge on yours. Is that what you want?", "ulf_dialog81",
    [
      (str_store_string, s2, "@--She raises her hands, calling for calm.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc2), "ulf_dialog81", [
    ],
    "Do not kill him, then, but let's cut his sword hand. He does not deserve Walhalla!", "ulf_dialog8",
    [
  ]],
  
  [anyone|plyr, "ulf_dialog8", [
    ],
    "Good food and drink has been offered. This is the home of Ulf, and we will follow his ways.", "ulf_dialog91", [
  ]],
  [anyone|plyr, "ulf_dialog8", [
    ],
    "Nobody's going to die here. Eat and drink what our host offered you and be happy with it.", "ulf_dialog91", [
  ]],
  
  [anyone|plyr, "ulf_dialog8", [
    ],
    "Egil and Reginhard are right. Ulf has broken the rules of hospitality, so off with his hand.", "ulf_dialog92", [
  ]],
  
  [anyone, "ulf_dialog92", [#mainquest chief
    ],
    "Bastard! Sigurd Ragnarsson will know about this!", "ulf_dialog93", [
  ]],
  
  [anyone|other(trp_npc2), "ulf_dialog93", [
    ],
    "{s2}^^That will be a pleasure!", "ulf_dialog94",
    [
      (str_store_string, s2, "@--He applauds.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", 5),
  ]],
  
  [anyone|other(trp_npc8), "ulf_dialog94", [
      (main_party_has_troop, "trp_npc8"),#JuJu70 - troop must be in the party
    ],
    "What about the food and the beer?", "ulf_dialog95",
    [
  ]],
  
  [anyone|plyr, "ulf_dialog95", [
    ],
    "Distribute the beer and food. Ulf has broken the standard of hospitality, so we will too.", "ulf_dialog121", [
      (call_script, "script_change_player_honor", -10),
      (call_script, "script_change_troop_renown", "trp_player", 10),
      (display_message,"@Your men think that you are a great leader."),
  ]],
  [anyone|plyr, "ulf_dialog95", [
    ],
    "No one will touch the food and beer. We are not thieves.", "ulf_dialog91", [
  ]],
  
  
  [anyone|other(trp_npc8), "ulf_dialog91", [
      (main_party_has_troop, "trp_npc8"),#JuJu70 - troop must be in the party
    ],
    "Bullshit! I will not drink their piss and eat their garbage. I do not care if Egil kills him or not. I'll go directly to Ulf's warehouse and take what I want.", "ulf_dialog10",
    [
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -10),
  ]],
  
  [anyone|other(trp_npc2), "ulf_dialog10", [
    ],
    "{s2}^^Yes, good idea, Reginhard. I'll do the same. {playername} may stay with him and drink sour milk, if {reg59?she:he} wants.", "ulf_dialog11",
    [
      (str_store_string, s2, "@--He applauds.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -10),
  ]],
  
  [anyone|plyr, "ulf_dialog11", [
    ],
    "(Let them go to the warehouse to drink and eat what they want.)", "ulf_dialog121", [
      (try_for_range, ":cur_troop", companions_begin, companions_end),
        (main_party_has_troop, ":cur_troop"),
        (call_script, "script_change_player_relation_with_troop", ":cur_troop", -5),
        (str_store_troop_name, s11, ":cur_troop"),
        (str_store_string, s14, "@{s11} thinks that you are a weak leader."),
        (display_message,"@{s14}"),
      (try_end),
      (call_script, "script_change_troop_renown", "trp_player", -25),
      (display_message,"@Your men think that you are a weak leader."),
  ]],
  
  [anyone|plyr, "ulf_dialog11", [
    ],
    "Reginhard and Egil, stay still where you are, or you will pay dearly.", "ulf_dialog122", [
  ]],
  
  [anyone|plyr, "ulf_dialog11", [
      (store_skill_level, ":leadership", "skl_leadership", "trp_player"),
      (gt, ":leadership", 5),
    ],
    "Egil and Reginhard, when I make decisions, you follow them, got it? (Leadership)", "ulf_dialog123", [
  ]],
  
  [anyone|other(trp_npc2), "ulf_dialog123", [
    ],
    "{s2}^^Yes, {reg59?my lady:my lord}. We are at your service and will do as you command.", "ulf_dialog1231",
    [
      (str_store_string, s2, "@--Both stop, surprised by your authoritative tone. Egil turns to you, nervous.--", color_good_news),
  ]],
  [anyone|plyr, "ulf_dialog1231", [
    ],
    "Distribute the beer and food. Ulf has broken the standard of hospitality, so we will too.", "ulf_dialog121", [
      
      (try_for_range, ":cur_troop", companions_begin, companions_end),
        (main_party_has_troop, ":cur_troop"),
        (call_script, "script_change_player_relation_with_troop", ":cur_troop", 5),
        (str_store_troop_name, s11, ":cur_troop"),
        (str_store_string, s14, "@{s11} thinks that you are a great leader."),
        (display_message,"@{s14}"),
      (try_end),
      (call_script, "script_change_troop_renown", "trp_player", 15),
      (display_message,"@Your men think that you are a great leader."),
  ]],
  
  [anyone|other(trp_npc8), "ulf_dialog122", [
      (main_party_has_troop, "trp_npc8"),#JuJu70 - troop must be in the party
    ],
    "You threaten your friends to protect a rat like Ulf, who has laughed in our face. " +
    "I will not fight against you, in memory of what we went through together, but I do not like your decision.", "ulf_dialog1221",
    [
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -15),
  ]],
  
  [anyone|other(trp_npc2), "ulf_dialog1221", [
    ],
    "Good words, Reginhard. I also respect your decision, {playername}, but you should think how good you are with the men under your command...", "ulf_dialog1232",
    [
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -15),
  ]],
  
  [anyone|plyr, "ulf_dialog1231", [
    ],
    "Do not touch the stock. That food is not ours.", "ulf_dialog1232", [
  ]],
  #ulf molesto
  [anyone, "ulf_dialog121", [
    ],
    "{s2}^^But that is my food and my drink... You're a thief and a robber.", "ulf_dialog122",
    [
      (str_store_string, s2, "@--Ulf watches, mouth agape, as Egil and Reginhard, followed by many of your men, assail his warehouse.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -50),
  ]],
  
  [anyone|plyr, "ulf_dialog122", [ #saltar a menu y tiempo de espera
    ],
    "It's not yours. This farm belongs to my men while we await the arrival of Sven Bull Neck.", "close_window", [
      (call_script, "script_change_player_honor", -10),
      (call_script, "script_change_player_party_morale", 5),
      (try_begin), #
        (quest_slot_eq,"qst_danmork_protection",slot_quest_current_state, 3),
        (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 5), #king help ok
      (else_try),
        # (quest_slot_eq,"qst_danmork_protection",slot_quest_current_state, 1),
        (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 4), #King no help
        (quest_set_slot,"qst_revenge_exchange",slot_quest_current_state, 4), #Enemy troop is coming
      (try_end),
      (jump_to_menu, "mnu_farmstead_sigurd"),
      (finish_mission),
  ]],
  #ulf contento
  [anyone, "ulf_dialog1232", [
    ],
    "Thanks, I'm sure that the gods will reward you. I will tell you one thing. Sven Bull Neck is not a man who easily submits, so keep your weapons close.", "ulf_dialog1233",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 30),
  ]],
  
  [anyone|plyr, "ulf_dialog1233", [ #saltar a menu y tiempo de espera
    ],
    "That's what I'll do. Now I go to station my men to wait until Sven Bull Neck appears.", "close_window", [
      (call_script, "script_change_player_honor", 10),
      (call_script, "script_change_player_party_morale", -10),
      (try_begin), #
        (quest_slot_eq,"qst_danmork_protection",slot_quest_current_state, 3),
        (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 5), #king help ok
      (else_try),
        # (quest_slot_eq,"qst_danmork_protection",slot_quest_current_state, 1),
        (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 4), #King no help
        (quest_set_slot,"qst_revenge_exchange",slot_quest_current_state, 4), #Enemy troop is coming
      (try_end),
      (jump_to_menu, "mnu_farmstead_sigurd"),
      (finish_mission),
  ]],
  
  ###duelo victoria Orm Svarte
  [anyone|plyr, "ulf_ormvictory1", [(eq, "$thora_hijo", 1), #hijo player
    ],
    "Ulf, keep these spoils for Thora's future child, and tell him something about his father.", "ulf_ormvictory21", [
      (add_xp_as_reward,200),
      (call_script, "script_change_troop_renown", "trp_player", 10),
      (call_script, "script_change_player_honor", 20),
      (call_script, "script_change_player_party_morale", -5),
  ]],
  [anyone|plyr, "ulf_ormvictory1", [#mainquest chief
    ],
    "Ulf, keep this money and these items for Thora's future child. I will be content with this.", "ulf_ormvictory2", [
      (add_xp_as_reward,200),
      (call_script, "script_change_troop_renown", "trp_player", 10),
      (call_script, "script_change_player_honor", 20),
      (call_script, "script_change_player_party_morale", -5),
  ]],
  [anyone|plyr, "ulf_ormvictory1", [#mainquest chief
    ],
    "Ulf, keep this money for Thora's future child. I will be content to keep Orm's sword and mail.", "ulf_ormvictory2", [
      (add_xp_as_reward,100),
      (call_script, "script_change_player_honor", 10),
      (call_script, "script_change_player_party_morale", 4),
      (troop_add_item, "$g_player_troop","itm_noble_sword_3",0), #orm sword
      (troop_add_item, "$g_player_troop","itm_orm_byrnie",0), #orm armor
  ]],
  [anyone|plyr, "ulf_ormvictory1", [#mainquest chief
    ],
    "Thanks, Ulf, your gifts are welcome.", "ulf_ormvictory3", [
      (call_script, "script_troop_add_gold", "trp_player", 4000),
      (call_script, "script_change_player_party_morale", 4),
      (troop_add_item, "$g_player_troop","itm_noble_sword_3",0), #orm sword
      (troop_add_item, "$g_player_troop","itm_orm_byrnie",0), #orm armor
  ]],
  
  [anyone|other(trp_hija_granja), "ulf_ormvictory21", [(eq, "$thora_hijo", 1), #hijo player
    ],
    "Please be assured that your child will know who his father is, and I will always remember.", "ulf_ormvictory2",
    [
      (call_script, "script_change_player_relation_with_troop", "trp_hija_granja", 90),
  ]],
  
  [anyone, "ulf_ormvictory2", [
    ],
    "You are a generous man. I hope you leave the Assembly in good standing. My house is your house. Farewell.", "ulf_ormvictory4",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  [anyone, "ulf_ormvictory3", [
    ],
    "May the Spinners of Fate be benevolent to you.", "ulf_ormvictory4",
    [
  ]],
  
  [anyone|other(trp_npc2), "ulf_ormvictory4", [(talk_info_show, 0),
    ],
    "There is no doubt that your luck exceeds that of most other men. You, my friend, are destined either for greatness or to give greatness to whoever kills you. You've beaten a notorious berserker. You have my respect and admiration.", "close_window",
    [
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", 15),
      (str_store_string, s2, "@You fought a duel with Orm the Black and killed him, saving Ulf's farmstead and his daughter, Thora. Ulf has promised he will not testify against you in the Assembly and not ask compensation for Thora's pregnancy."),
      (add_quest_note_from_sreg, "qst_ulf_testigo", 4, s2, 0),
      (quest_set_slot,"qst_ulf_testigo",slot_quest_current_state, 4),
  ]],
  ### Ulf convencer para q no sea testigo
  [anyone|plyr, "ulf_testigo1", [#mainquest chief
    ],
    "Ulf, I want to convince you not to testify against me in the Assembly.", "ulf_testigo2", [
      (talk_info_show, 0),]],
  [anyone|plyr, "ulf_testigo1", [#mainquest chief
    ],
    "I'm just passing through. Just wanted to say hello. Farewell.", "close_window", [
  ]],
  
  [anyone, "ulf_testigo2", [(eq, "$thora_hijo", 1), #hijo player
    ],
    "I prefer to talk about my daughter. She's pregnant with your child, an illegitimate baby of a man without a future. You have dishonored my house and my daughter. I will present my case to the Assembly.", "ulf_testigo3",
    [
      (str_store_string, s2, "@Note 3: Your romance with Thora on Ulf's farm has had consequences: she will have your child."),
      (add_quest_note_from_sreg, "qst_notes_danmork", 6, s2, 0),
  ]],
  [anyone, "ulf_testigo2", [(eq, "$thora_hijo", 2),
    ],
    "I prefer to talk about my daughter. She's pregnant with the illegitimate child of your companion, Egil, a man without a future. You have dishonored my house and my daughter. I will present my case to the Assembly.", "ulf_testigo3",
    [
      (str_store_string, s2, "@Note 3: Egil's romance with Thora on Ulf's farm has had consequences: she will have his child."),
      (add_quest_note_from_sreg, "qst_notes_danmork", 6, s2, 0),
  ]],
  [anyone, "ulf_testigo2", [
    ],
    "I prefer to talk about my daughter. She's pregnant with the illegitimate child of one of your men, who raped her in the night after drinking too much mead. You have dishonored my house and my daughter. I will present my case to the Assembly.", "ulf_testigo3",
    [
      (str_store_string, s2, "@Note 3: Thora from Ulf's farm has gotten pregnant by one of your men."),
      (add_quest_note_from_sreg, "qst_notes_danmork", 6, s2, 0),
  ]],
  
  [anyone|plyr, "ulf_testigo3", [(eq, "$thora_hijo", 1),
    ],
    "Sorry, I had no idea. I will marry her.", "ulf_testigo41", [
  ]],
  [anyone|plyr, "ulf_testigo3", [(eq, "$thora_hijo", 2),
    ],
    "Sorry, I had no idea. Egil will marry her.", "ulf_testigo42", [
  ]],
  [anyone|plyr, "ulf_testigo3", [
    ],
    "This is terrible. The man that you choose from my party will marry her.", "ulf_testigo43", [
      (call_script, "script_change_player_party_morale", -5),
  ]],#
  [anyone|plyr, "ulf_testigo3", [
    ],
    "I understand. I'll take your daughter with me.", "ulf_testigo44", [
  ]],
  [anyone|plyr, "ulf_testigo3", [
    ],
    "It was an unfortunate incident. Let us agree on wergild in compensation.", "ulf_testigo6", [ #wergild
  ]],
  [anyone|plyr, "ulf_testigo3", [
    ],
    "Are you sure this child is not simply that of one of your thralls?", "ulf_testigo46", [
  ]],
  
  [anyone, "ulf_testigo41", [
    ],
    "Marry you? My daughter? No, you are lower class than she, and besides, you'll soon be dead. Everybody knows that Sigurd Ragnarsson will ask for your head at the Assembly.", "ulf_testigo5",
    [
  ]],
  [anyone, "ulf_testigo43", [
    ],
    "With any of your men? Perhaps you think she's a whore. Say something sensible or clear out of here.", "ulf_testigo5",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  
  [anyone, "ulf_testigo44", [
    ],
    "This is a joke, no? Thora cannot go with you. She is my only daughter. She is too important to be left in your hands.", "ulf_testigo5",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
  ]],
  ### ulf enfadado
  [anyone, "ulf_testigo46", [
    ],
    "{!}{s2}", "ulf_testigo46_1",
    [
      (str_store_string, s2, "@--Ulf's mouth opens and closes several times, not knowing what to say. You see his face redden, looking ready to burst. His eyes search around to rest on a spear. " +
      "His thralls have stopped doing their chores. They are five or six men armed with knives and sticks, but there could be more in the house.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
  ]],
  [anyone|other(trp_hija_granja), "ulf_testigo46_1", [
    ],
    "Father, calm down. I'm sure {playername} has spoken without thinking. {reg59?She:He} knows I am a virtuous woman not given to anyone.", "ulf_testigo46_2",
    [
  ]],
  [anyone|other(trp_npc3), "ulf_testigo46_2", [
    ],
    "{playername}, you should apologize to this man. Remember that you need him to be happy to avoid his testifying against you at the Assembly.", "ulf_testigo46_3",
    [
  ]],
  
  [anyone|plyr,"ulf_testigo46_3", [
      (eq, "$virtue_type", cb5_bold),
      (str_store_string, s10, "@Do not question me, Brunhild. Sometimes it's hard to hear the truth, Ulf. (Sanguine)"),
    ],
    "{!}{s10}", "ulf_testigo46_5",[
      (str_clear, s10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", -8),
  ]],
  
  [anyone|plyr,"ulf_testigo46_3", [
      (assign, ":continue", 0),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@I apologize, Ulf. I spoke without thinking. I respect your daughter. (Phlegmatic)"),
        (assign, ":continue", 1),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@I see it is important and makes you anxious. I am sorry. I apologize. (Melancholic)"),
        (assign, ":continue", 1),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@We are friends, Ulf. I apologize. (Choleric)"),
        (assign, ":continue", 1),
      (try_end),
      (eq, ":continue", 1),
    ],
    "{!}{s10}", "ulf_testigo46_4",[
      (str_clear, s10),
  ]],
  
  [anyone, "ulf_testigo46_4", [
    ],
    "{s2}^^I will act as if I didn't hear this.", "ulf_testigo5",
    [
      (str_store_string, s2, "@--Ulf makes an effort to calm down, takes a deep breath and looks you in the eyes.--", color_good_news),
  ]],
  [anyone, "ulf_testigo46_5", [
      (str_clear, s2),
    ],
    "{s2}^^This conversation is over. I will be happy when Sigurd Ragnarsson kills you after the Assembly. Now, get out of my farm.", "ulf_testigo46_6",
    [
      (str_store_string, s2, "@--Ulf makes an effort to calm down, takes a deep breath and looks you in the eyes.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  [anyone|plyr,"ulf_testigo46_6", [
    ],
    "Ulf, if you testify against me at the Assembly, I will kill you, Thora, and burn your farm to the ground. Got it? (Sanguine).", "ulf_testigo46_7",[
  ]], #
  
  [anyone|other(trp_orm_robagranjas), "ulf_testigo46_7", [
    ],
    "Calm down man! There is no need to humiliate this man so much.", "ulf_testigo8",
    [
  ]],
  ###
  [anyone|other(trp_npc2), "ulf_testigo42", [
    ],
    "Hey! I am right here. Marry? I will never marry. Thora should be proud to have a child with royal blood in her belly.", "ulf_testigo42_1",
    [
  ]],
  [anyone, "ulf_testigo42_1", [
    ],
    "Egil is an inveterate womanizer. He is fickle, usually drunk and futureless. Would you marry your daughter to him?", "ulf_testigo42_2",
    [
  ]],
  [anyone|plyr, "ulf_testigo42_2", [
    ],
    "Yes.", "ulf_testigo42_3", [
  ]],
  [anyone|plyr, "ulf_testigo42_2", [
    ],
    "No.", "ulf_testigo42_31", [
  ]],
  [anyone|plyr, "ulf_testigo42_2", [
    ],
    "Who? Brunhild here? She is not my daughter.", "ulf_testigo42_31", [
  ]],
  
  [anyone, "ulf_testigo42_3", [
    ],
    "Well, you are quite the dolt. Thora is the daughter of a wealthy man, while Egil is but a bastard. You're insulting me.", "ulf_testigo5",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone|other(trp_npc2), "ulf_testigo42_31", [
    ],
    "Well, I do not quite know whether to be flattered or offended. I will act as if I have not heard your words.", "ulf_testigo42_32",
    [
  ]],
  
  [anyone, "ulf_testigo42_32", [
    ],
    "Nobody wants Egil in the family. Moreover, Thora is the daughter of a wealthy man, while Egil is but a bastard.", "ulf_testigo5",
    [
  ]],
  
  [anyone|plyr, "ulf_testigo5", [
    ],
    "I understand. I'll take your daughter with me.", "ulf_testigo44", [
  ]],
  [anyone|plyr, "ulf_testigo5", [
    ],
    "It was an unfortunate incident. Let us agree on wergild in compensation.", "ulf_testigo6", [ #wergild
  ]],
  [anyone|plyr, "ulf_testigo5", [
    ],
    "Are you sure this child is not by one of your thralls?", "ulf_testigo46", [
  ]],
  
  [anyone|other(trp_npc2), "ulf_testigo6", [
      (str_clear, s2),
    ],
    "The law in Danmark makes a distinction between if she was raped or voluntarily surrendered. It is also important to note the differences in status. " +
    "Anyway, if you want to avoid further problems and leave this man satisfied, give him 4000 peningas, and he will deliver all his daughters to sleep with you.^^{s2}", "ulf_testigo7_1",
    [
      (str_store_string, s2, "@--Egil laughs at his own joke while making indecent gestures.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc3), "ulf_testigo7_1", [
    ],
    "Do not listen to silly Egil, {reg59?lady:sir}, but it's true that with 4000 peningas, Ulf will be more than happy and will not testify against you.", "ulf_testigo7",
    [
  ]],
  
  [anyone|other(trp_orm_robagranjas), "ulf_testigo7", [
    ],
    "Oh, money! My favorite topic. This is where I come in.", "ulf_testigo8",
    [
  ]],
  
  [anyone|other(trp_npc8), "ulf_testigo8", [
      (main_party_has_troop, "trp_npc8"),#JuJu70 - troop must be in the party
      (str_clear, s2),
    ],
    "{s2}^^Look at this man! He must be more than two meters if he's an inch!", "ulf_testigo9",
    [
      (str_store_string, s2, "@--Reginhard launches a whistle of astonishment.--", color_good_news),
  ]],
  [anyone|plyr, "ulf_testigo8", [
    ],
    "And who are you?", "ulf_testigo9",
    [
  ]],
  [anyone, "ulf_testigo9", [
      (str_clear, s2),
    ],
    "He is a...", "ulf_testigo10",
    [
      (str_store_string, s2, "@--Ulf looks dejected when he sees the giant appear above your shoulder.--", color_good_news),
  ]],
  [anyone|other(trp_orm_robagranjas), "ulf_testigo10", [
    ],
    "He is Orm the Black, guest of Ulf Thorinsson and future owner of his farm and daughter. " +
    "I am not in the habit of eavesdropping, but since everything related to this farmstead is now my business, I've decided to introduce myself and act.", "ulf_testigo11",
    [
  ]],
  
  [anyone|plyr, "ulf_testigo11", [
    ],
    "So... Orm. How is it that you are the future owner of this farm?", "ulf_testigo12", [
  ]],
  [anyone|plyr, "ulf_testigo11", [
    ],
    "I do not care who you are. This is a private matter. Go away.", "ulf_testigo13", [
  ]],
  
  [anyone|other(trp_orm_robagranjas), "ulf_testigo13", [
    ],
    "Oh, I don't think so. This farm and the girl pregnant because of you will be my property tomorrow, so you will negotiate with me and not with this old fool.", "ulf_testigo12",
    [
      (call_script, "script_change_player_relation_with_troop", "trp_orm_robagranjas", -5),
  ]],
  
  [anyone|other(trp_hija_granja), "ulf_testigo12", [
    ],
    "{playername}, my father has his pride, but we need your support. Orm Svarti is a berserk and a duelist. He is an evil person, but no one can stand up to him. " +
    "He arrived shortly after you left us and asked for my hand, which my father withheld. Then he challenged my father to a duel to the death. " +
    "Orm will kill my father and then stay with me on the farm. My father is old and cannot deal with this man. Please be our second.", "ulf_testigo14_1",
    [
  ]],
  
  [anyone|other(trp_npc3), "ulf_testigo14_1", [
      (str_clear, s2),
    ],
    "{s2}^^This man is scum, {reg59?my lady:my lord}. " +
    "He challenges old defenseless peasants in order to steal everything they have. Worst of all, he wants to make Ulf's daughter a slave... and who knows what will happen to the child in Thora's belly.", "ulf_testigo14",
    [
      (str_store_string, s2, "@--She spits near the foot of Orm.--", color_good_news),
  ]],
  
  [anyone|other(trp_orm_robagranjas), "ulf_testigo14", [
    ],
    "Ignore them. You're lucky I'm here. Ulf will not testify against you in the Assembly on account of his death, and the girl will not be your problem because I will take care of her and the rat within. " +
    "And since I like you, I'll give you half price. All you have to do is give me 2000 peningas. What do you say?", "ulf_testigo15",
    [
  ]],
  
  [anyone|plyr, "ulf_testigo15", [(store_troop_gold,":money","trp_player"),(ge,":money",2000),
    ],
    "It's a deal, Orm. Take this money, and thanks for taking care of this matter.", "ulf_testigo16_1", [
      (call_script, "script_change_player_honor", -10),
      (call_script, "script_change_player_party_morale", -10),
      (troop_remove_gold, "trp_player", 2000),
  ]],
  [anyone|plyr, "ulf_testigo15", [
    ],
    "Ulf will be dead tomorrow, so my problem is solved. Why pay you a single pening?", "ulf_testigo16_2", [
      (call_script, "script_change_player_honor", -20),
      (call_script, "script_change_player_party_morale", -10),
  ]],
  [anyone|plyr, "ulf_testigo15", [(store_troop_gold,":money","trp_player"),(ge,":money",4000),
    ],
    "I will pay wergild of 4000 peningas to Ulf now, and the case is closed.", "ulf_testigo16_3", [
      (call_script, "script_change_player_party_morale", -20),
      (troop_remove_gold, "trp_player", 4000),
  ]],
  [anyone|plyr, "ulf_testigo15", [
    ],
    "No, I'm afraid not. I hate injustice and must settle my debt. I will fight on Ulf's behalf.", "ulf_testigo16_4", [
      (call_script, "script_change_player_honor", 10),
      (call_script, "script_change_player_party_morale", 5),
  ]],
  [anyone|plyr, "ulf_testigo15", [(store_troop_gold,":money","trp_player"),(ge,":money",4000),
    ],
    "No. The two matters are separate. I will both pay my wergild of 4000 peningas and fight.", "ulf_testigo16_4", [
      (call_script, "script_change_troop_renown", "trp_player", 10),
      (call_script, "script_change_player_honor", 50),
      (call_script, "script_change_player_party_morale", 5),
      
  ]],
  #
  [anyone|other(trp_orm_robagranjas), "ulf_testigo16_1", [
    ],
    "Well, well. A farm, a pretty girl and 2000 peningas to boot. The gods have always loved me. Good travels and good luck so that, someday, in the unlikely event that you ever make anything of yourself, we may meet again.", "ulf_testigo16",
    [
  ]],
  
  
  [anyone|other(trp_orm_robagranjas), "ulf_testigo16_2", [
    ],
    "Oh, well, right you are. Then get off my farm. Good travels and good luck so that, someday, in the unlikely event that you ever make anything of yourself, we may meet again.", "ulf_testigo16",
    [
  ]],
  
  [anyone|other(trp_orm_robagranjas), "ulf_testigo16_3", [
    ],
    "Well, his money is my money. If you are such an idiot, the better for me. A farm, a pretty girl and 4000 peningas to boot. The gods have always loved me. Good travel and good luck so that, someday, in the unlikely event that you ever make anything of yourself, we may meet again.", "ulf_testigo16",
    [
  ]],
  
  [anyone|other(trp_npc8), "ulf_testigo16_4", [ #Reginhard
    ],
    "{reg59?My lady:My lord}, are you sure? Have you considered your relative height and your old wounds? This man is made for murder!", "ulf_testigo20",
    [
  ]],
  
  #
  [anyone|other(trp_npc2), "ulf_testigo20", [ #Egil
    ],
    "No, worse, he's a berserker. If he enters his trance, {playername}, you won't have a chance.", "ulf_testigo21",
    [
  ]],
  
  [anyone|other(trp_orm_robagranjas), "ulf_testigo21", [
    ],
    "Ha! No way to back out now! A word spoken is a word that cannot be returned!", "ulf_testigo22",
    [
  ]],
  
  ##        [anyone|plyr, "ulf_testigo21", [
  ##      ],
  ##   "I am sure.", "ulf_testigo22", [
  ##]],
  ##        [anyone|plyr, "ulf_testigo21", [
  ##      ],
  ##   "Let me reconsider.", "ulf_testigo14", [
  ##]],
  
  [anyone|other(trp_hija_granja), "ulf_testigo22", [
    ],
    "The gods bless you, {playername}. We will always be indebted to you.", "ulf_testigo23",
    [
      (call_script, "script_change_player_relation_with_troop", "trp_hija_granja", 30),
  ]],
  
  [anyone, "ulf_testigo23", [
    ],
    "I did not expect this selfless reaction. I know that I do not stand a chance against Orm Svarti, so I'm very grateful. Whatever happens, know that I will not testify against you at the Assembly. Ragnarsson will not like that much, but it's you that are here for me. What's more, I won't ask wergild for my daughter. " +
    "What you do makes up for any debt between us. Thank you. We are now at peace.", "ulf_testigo24",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 80),
      # (str_store_string, s2, "@You fought a duel with Orm the Black and killed him, saving Ulf's farmstead and his daughter, Thora. Ulf has promised he will not testify against you at the Assembly and not ask compensation for Thora's pregnancy."),
      #(add_quest_note_from_sreg, "qst_ulf_testigo", 4, s2, 0),
      (quest_set_slot,"qst_ulf_testigo",slot_quest_current_state, 2), #
  ]],
  
  [anyone|other(trp_orm_robagranjas), "ulf_testigo24", [
    ],
    "If you are such an idiot, the better for me. Such heroes always end up occupying but six square feet of earth. If you so desire such a plot, your time has come. I am only too happy to add all of your things to the farm and the girl.", "close_window",
    [
      (call_script, "script_change_player_relation_with_troop", "trp_orm_robagranjas", -80),
      (str_store_string, s2, "@Note 5: You chose to engage Orm Svarti in a duel so that Ulf and Thora could keep their farm and their lives."),
      (add_quest_note_from_sreg, "qst_notes_danmork", 8, s2, 0),
      (mission_disable_talk),
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", 5),
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", 10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", 5),
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -5),
      (jump_to_menu, "mnu_orm_duel"),
      (finish_mission),
  ]], # duelo
  
  #
  [anyone|other(trp_hija_granja), "ulf_testigo16", [
    ],
    "Gods curse you, {playername}. You've effectively sentenced my father to death and me to slavery.", "ulf_testigo17_1",
    [
      (call_script, "script_change_player_relation_with_troop", "trp_hija_granja", -30),
  ]],
  [anyone, "ulf_testigo17_1", [
    ],
    "Gentle, Thora, my daughter. This piece of scit is not worth a curse.", "ulf_testigo17",
    [
      (str_store_string, s2, "@Orm the Black has promised to kill Ulf to get his farm and his daughter. So you no longer have to worry about Ulf testifying against you at the Assembly."),
      (add_quest_note_from_sreg, "qst_ulf_testigo", 4, s2, 0),
      (quest_set_slot,"qst_ulf_testigo",slot_quest_current_state, 4), #
  ]],
  [anyone|other(trp_npc3), "ulf_testigo17", [
    ],
    "This is not right...", "ulf_testigo18",
    [
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", -5),
  ]],
  [anyone|other(trp_npc8), "ulf_testigo18", [
    ],
    "It is, if you do not want to die. {playername} does well. Let's go, we're done here.", "close_window",
    [
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", 5),
      (str_store_string, s2, "@Note 5: You chose that Orm Svarti kill Ulf to get the farm and Thora."),
      (add_quest_note_from_sreg, "qst_notes_danmork", 8, s2, 0),
      (assign,"$orm_the_black",1),
  ]], #termina huyendo
  
  ###################
  
  ###player lair dialogs
  #followers camp mule troop
  [trp_mule_troop,"start", [],
    "Ic grete thee, {playername}. What you need?", "muletroop_1",[]],
  
  [anyone|plyr, "muletroop_1", [],
    "I want to load some things on the horses.", "muletroop_2", [
      (change_screen_loot, "trp_household_possessions2"),]],
  
  [anyone|plyr, "muletroop_1", [],
    "Nothing. Farewell.", "close_window", []],
  
  [anyone, "muletroop_2", [],
    "Always at your service.", "close_window", []],
  
  
  ###player lair dialogs
  #anadido para sacerdotes chief en player lair
  [trp_sacerdote_lair,"start", [],
    "Yes?", "sacerdote1_action",[
  ]],
  [anyone|plyr,"sacerdote1_action", [ (store_troop_gold,":money","trp_player"),(gt,":money",499),],
    "Pater, I will donate 500 peningas to aid the families of my fallen men.", "sacerdote2_action",[]],
  [anyone|plyr,"sacerdote1_action", [],"Nothing. Farewell.", "close_window",[]],
  
  [anyone, "sacerdote2_action", [],
    "Ego absolvo te a peccatis tuis, in nomine Patris et Filii et Spiritus Sanctii. Amen. Your men will feel better now.", "close_window",[
      (troop_remove_gold,"trp_player", 500),
      (try_begin),
        (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0),
        (call_script, "script_change_player_party_morale", 3),
        (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 1),
      (else_try),
        (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,1),
        (call_script, "script_change_player_party_morale", 2),
        (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 1),
      (else_try),
        (troop_slot_ge,"$g_talk_troop",slot_troop_days_on_mission,2),
        (display_message, "@Your men are getting tired of listening to the same old sermons. Perhaps it's time to let it go for a while.", color_bad_news),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
      (troop_set_slot,"$g_talk_troop",slot_troop_days_on_mission,3),]],
  ###
  [trp_pagano_lair,"start", [],
    "Yes?", "pagano1_action",[
  ]],
  
  [anyone|plyr,"pagano1_action", [(store_troop_gold,":money","trp_player"),(gt,":money",499),],
    "Priest, my men need Odin. I will donate 500 peningas for your aid in this matter.", "pagano2_action",[]],
  
  [anyone|plyr,"pagano1_action", [(eq, "$g_player_faith", 2),
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (ge, ":player_renown", 250),
      (le, "$g_rezar_monasterio", 0),
      (store_current_scene,":current_scene"),
      (this_or_next|eq,":current_scene","scn_pagan_holy_site_norway"),(eq,":current_scene","scn_pagan_holy_site_danmark"),],
    "Priest, my men need you. Will you join my shield wall?", "pagano2_recruit",[(assign, "$g_rezar_monasterio", 1),]],
  
  
  [anyone|plyr,"pagano1_action",[
      (neg|check_quest_active, "qst_blank_quest_9"),
      (store_relation,":rel","fac_pagans","fac_player_faction"),
      (lt, ":rel", 30),
      (store_random_in_range, ":rand", 0, 100),
      (lt, ":rand", 15),
      (store_current_scene,":current_scene"),
      (this_or_next|eq,":current_scene","scn_pagan_holy_site_norway"),(eq,":current_scene","scn_pagan_holy_site_danmark"),
      ], "Is there anything I can do to help this hof? ", "pagano_quest", []],
  
  [anyone, "pagano_quest", [
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (ge, ":player_renown", 150),
      (store_random_in_range, ":rand", 2, 5),
      (assign, reg33, ":rand"),
      (assign, "$temp", reg33),
    ],"Perhaps. We are having a feast soon, to honor goddess Saga, and we are running low on some essential supplies. Would you be able to bring us {reg33} drinking horns of mead?", "pagano_quest1",[
      (str_store_party_name_link, s3, "$g_encountered_party"),
      (setup_quest_text, "qst_blank_quest_9"),
      (str_store_string, s2, "@The priest at {s3} asked you to bring him {reg33} drinking horns of mead."),
      ]],
  
  [anyone, "pagano_quest", [], "No, my son, we don't need your help at the moment.","close_window",[]],
  
  [anyone|plyr,"pagano_quest1", [], "You can count on me.", "close_window", [
      (quest_set_slot, "qst_blank_quest_9", slot_quest_target_amount, "$temp"),
      (quest_set_slot, "qst_blank_quest_9", slot_quest_expiration_days, 30),
      (quest_set_slot, "qst_blank_quest_9", slot_quest_xp_reward, 400),
      (quest_set_slot, "qst_blank_quest_9", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_set_slot, "qst_blank_quest_9", slot_quest_target_center, "$g_encountered_party"),
      (quest_set_slot, "qst_blank_quest_9", slot_quest_dont_give_again_period, 60),
      (call_script, "script_start_quest", "qst_blank_quest_9", "$g_talk_troop"),]],
  
  [anyone|plyr,"pagano1_action", [(check_quest_active, "qst_blank_quest_9"),
      (quest_get_slot, ":quest_target_center",  "qst_blank_quest_9",slot_quest_target_center),
      (quest_get_slot, ":quest_target_amount",  "qst_blank_quest_9",slot_quest_target_amount),
      (eq, ":quest_target_center", "$g_encountered_party"),
      (assign,":mead",0),
      (troop_get_inventory_capacity,":capacity","trp_player"),
      (try_for_range,":slot",0,":capacity"),
        (troop_get_inventory_slot,":cur_item","trp_player",":slot"),
        (eq,":cur_item","itm_mead"),
        (val_add,":mead",1),
      (try_end),
      (ge,":mead",":quest_target_amount"),
      (assign, reg33, ":quest_target_amount"),
      (store_current_scene,":current_scene"),
      (this_or_next|eq,":current_scene","scn_pagan_holy_site_norway"),(eq,":current_scene","scn_pagan_holy_site_danmark"),
      ], "Priest, I brought you {reg33} drinking horns of mead, as you requested.", "pagano_thankyou", []],
  
  [anyone, "pagano_thankyou", [(str_store_party_name, s3, "$g_encountered_party"),],"Thank you, {playername}. Saga will be proud of {s3} and your efforts. May she guide you in battles.","close_window",[
      (quest_get_slot, ":quest_target_amount", "qst_blank_quest_9", slot_quest_target_amount),
      (quest_get_slot, ":quest_xp", "qst_blank_quest_9", slot_quest_xp_reward),
      (troop_remove_items, "trp_player", "itm_mead", ":quest_target_amount"),
      (add_xp_as_reward, ":quest_xp"),
      (call_script, "script_change_player_relation_with_faction", "fac_pagans", ":quest_target_amount"),
      (call_script, "script_end_quest", "qst_blank_quest_9"),
  ]],
  
  [trp_abad|plyr,"pagano_quest1", [], "Priest, I don't believe I have time for this.", "close_window", [
      (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 7),]],
  ####
  
  
  [anyone|plyr,"pagano1_action", [],
    "Nothing. Farewell.", "close_window",[
  ]],
  
  [anyone, "pagano2_recruit", [],
    "Well, I'll pack my things and join you.", "close_window",[
      (party_add_members,"p_main_party","trp_norse_priest",1),
  ]],
  [anyone, "pagano2_action", [],
    "I will talk to your men about Odin, Thor and Freya. It will encourage them to fight proudly by your side, to earn their seats at Walhalla.", "close_window",[
      (troop_remove_gold,"trp_player", 500),
      (try_begin),
        (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0),
        (call_script, "script_change_player_party_morale", 3),
        (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 1),
      (else_try),
        (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,1),
        (call_script, "script_change_player_party_morale", 2),
        (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 1),
      (else_try),
        (troop_slot_ge,"$g_talk_troop",slot_troop_days_on_mission,2),
        (display_message, "@Your men are getting tired of listening to the same old stories about the gods. Perhaps it's time to let it go for a while.", color_bad_news),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
      (troop_set_slot,"$g_talk_troop",slot_troop_days_on_mission,3),]],
  #anadido chief para sacerdotes en lair acaba
  
  #cocinero cook
  [trp_cook_lair,"start", [], "Greetings. What can I do for you?", "lair_cook",[]],
  [anyone ,"lair_cook_pretalk", [], "Anything else?", "lair_cook",[]],
  [anyone|plyr, "lair_cook", [(eq, "$banquete_refuge", 0),], "Cook, I have a job for you! My men deserve a feast.", "lair_cook_menu1", []],
  [anyone|plyr, "lair_cook", [(assign, "$g_leave_encounter", 1)], "That'll be all.", "close_window", [(change_screen_return, 0)]],
  [anyone ,"lair_cook_menu1", [], "I estimate the cost of the feast to be 1000 peningas.", "lair_cook_menu2",[
  ]],
  [anyone|plyr, "lair_cook_menu2", [], "Go ahead. Take the money and prepare it all.", "lair_cook_menu", []],
  [anyone|plyr, "lair_cook_menu2", [], "Hmm, let me think more about this.", "lair_cook_pretalk", []],
  
  [anyone ,"lair_cook_menu", [(store_troop_gold,":money","trp_player"),(gt,":money",999),], "So shall it be done! " +
    "I'll get the necessary money from your coffers, buy ingredients for my finest dishes, and hire staff to make it a memorable night!", "close_window",[
      (troop_remove_gold, "trp_player", 1000),
      (assign, "$banquete_refuge", 1),
      #(assign, "$g_leave_encounter", 1),
      (jump_to_menu, "mnu_banquete_moral_refuge"),
  ]],
  [anyone ,"lair_cook_menu", [], "Sorry, sir, but your coffers are empty. We will need more money for the banquet.", "lair_cook_pretalk",[
  ]],
  #whore lair
  [anyone, "start", [(is_between, "$g_talk_troop", "trp_quastuosa_lair1", "trp_lair_barber1"),
    ],
    "{s2}^^Hello, {reg59?my lady:my lord}. How can I serve you?", "quastuosa_talk1", [
      (str_store_string, s2, "@--She smiles and looks at you provocatively.--", color_good_news),
  ]],
  [anyone, "quastuosa_pretalk1", [],
    "I am at your service, {playername}.", "quastuosa_talk1", []],
  [anyone|plyr,"quastuosa_talk1", [ (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0),],
    "I need to raise the spirits of my men.", "quastuosa_serve1",[]],
  [anyone|plyr,"quastuosa_talk1", [],
    "I do not want anything for my men. I would like your company.", "quastuosa_serve2a",[]],
  [anyone|plyr, "quastuosa_talk1", [],
    "I need nothing. Farewell.", "close_window", []],
  #quastuosa de elite
  [anyone,"quastuosa_serve1", [(is_between, "$g_talk_troop", "trp_quastuosa_lair1", "trp_quastuosa_lair3"),],
    "Your men will have fun as ever. I'll get the prettiest girls, the best drinks and the best food. I assure you their moral will be sky high after this party. " +
    "It will cost you 1700 coins.", "quastuosa_serve3b", []],
  #quastuosa normal
  [anyone,"quastuosa_serve1", [(is_between, "$g_talk_troop", "trp_quastuosa_lair1", "trp_lair_barber1"),],
    "Well, your men will have the mead hall at their disposal. They can eat and drink all they want and I'll get some girls to keep them company. I assure you they will be happy after this party. " +
    "It will cost you 1500 coins.", "quastuosa_serve3a", []],
  [anyone|plyr,"quastuosa_serve3a", [],
    "Well, I suppose my men have earned it. This time.", "quastuosa_pretalk1",
    [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",1499),
        (troop_remove_gold, "trp_player", 1500),
        (get_player_agent_no, ":player_agent"),
        (store_agent_hit_points, ":hit_points", ":player_agent"),
        (try_begin),
          (lt, ":hit_points", 90),
          (agent_set_hit_points, ":player_agent", 90),
        (try_end),
        (call_script, "script_change_player_party_morale", 15),
      (else_try),
        (display_message,"str_no_money"),
        (call_script, "script_change_player_party_morale", -5),
      (try_end),
      (troop_set_slot, "$g_talk_troop", slot_troop_days_on_mission, 5),
  ]],
  [anyone|plyr,"quastuosa_serve3b", [], #elite
    "Well, I suppose my men have earned it. This time.", "quastuosa_pretalk",
    [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",1699),
        (troop_remove_gold, "trp_player", 1700),
        (get_player_agent_no, ":player_agent"),
        (store_agent_hit_points, ":hit_points", ":player_agent"),
        (try_begin),
          (lt, ":hit_points", 90),
          (agent_set_hit_points, ":player_agent", 90),
        (try_end),
        (call_script, "script_change_player_party_morale", 20),
      (else_try),
        (display_message,"str_no_money"),
        (call_script, "script_change_player_party_morale", -1),
      (try_end),
      (troop_set_slot, "$g_talk_troop", slot_troop_days_on_mission, 6),
  ]],
  
  [anyone|plyr, "quastuosa_serve3a", [],
    "Alas, my lady, my purse weighs not enough for all your considerable charm. Farewell!", "close_window", []],
  
  [anyone,"quastuosa_serve2a", [],
    "I'm pleased, my {reg59?lady:lord}. So you like me. Well, for you, there is a special price of only 100 coins, as a token of our 'friendship'...", "quastuosa_serve4a",[]],
  [anyone|plyr, "quastuosa_serve4a", [],
    "Great, here, take these coins as a 'gift.'", "quastuosa_serve5a", [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",99),
        (troop_remove_gold, "trp_player", 100),
        (add_xp_as_reward, 20),
        (call_script, "script_change_player_party_morale", -2),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  [anyone|plyr, "quastuosa_serve4a", [],
    "No thanks. Why help you steal from me?", "close_window", []],
  [anyone,"quastuosa_serve5a", [],
    "(Time passes, and you forget the rigors and fatigue from the journey that lingered upon your body and soul. For a few hours, your armor and sword, the fear of dying in any skirmish, the punishment of the rain and wind, and the dust of the roads are relegated to a small piece of happiness. Finally, it ends swiftly as your friend quietly leaves your room.)", "quastuosa_pretalk1",
    []],
  #Physican
  [anyone, "start",
    [ (store_conversation_troop, "$g_talk_troop"),
      (this_or_next|is_between, "$g_talk_troop", healer_begin, healer_end),
      (				is_between, "$g_talk_troop", "trp_lair_barber1", "trp_cook_lair"),
    ],
    "Ave, my {reg59?lady:lord}. What do you need?", "barber_talk", []],
  [anyone, "barber_pretalk", [],
    "I am at your service.", "barber_talk", []],
  
  # BEARD
  
  # [anyone|plyr,"barber_talk",
    # [
      # (eq, 1, 0),
      # (str_store_troop_face_keys, s1, "trp_player"),
      # (face_keys_get_beard, ":beard", s1),
      # (gt, ":beard", 0),
    # ],
    # "I need you to cut my beard.", "barber_talk",
    # [
      # (str_store_troop_face_keys, s1, "trp_player"),
      # (face_keys_get_beard, ":beard", s1),
      # (val_sub, ":beard", 1),
      # (face_keys_set_beard, s1, ":beard"),
      # (troop_set_face_keys, "trp_player", s1),
    # ]
  # ],
  
  # CURE LIGHT WOUNDS  (store_agent_hit_points,<destination>,<agent_id>,[absolute]),
  [anyone|plyr,"barber_talk",
    [
      (get_player_agent_no, ":player_agent"),
      (store_agent_hit_points, ":hp_percent", ":player_agent"),
      (lt, ":hp_percent", 40),
    ],
    "I need you to dress my light wounds.", "barber_curel_1",[]], #necesario crear sistema de heridas
  
  [anyone, "barber_curel_1",
    [
      (assign, "$current_dialog_cost", 10),
      (get_player_agent_no, ":player_agent"),
      (store_agent_hit_points, ":hp_percent", ":player_agent"),
      (store_sub, ":missing_hp_percent", 40, ":hp_percent"),
      (store_agent_hit_points, ":hp_absolute", ":player_agent", 1),
      (store_mul, reg1, ":hp_absolute", ":missing_hp_percent"),
      (val_div, reg1, ":hp_percent"),	# now reg1 should be missing hp absolute
      (assign, "$current_dialog_cost", reg1),
    ],
    "You have some light wounds. I will cure them, but I charge {reg1} peningas for my work.", "barber_curel_2", []],#
  
  [anyone|plyr,"barber_curel_2",
    [
      (store_troop_gold, ":money", "trp_player"),
      (ge, ":money", "$current_dialog_cost"),
    ],
    "Here are your {reg1} peningas. Now cure my wounds.", "barber_curel_3",
    [
      (troop_remove_gold, "trp_player", "$current_dialog_cost"),
      (get_player_agent_no, ":player_agent"),
      (agent_set_hit_points, ":player_agent", 40),
      (troop_set_health, "trp_player", 40),
  ]],
  
  [anyone|plyr,"barber_curel_2", [],
    "I don't have enough money.", "barber_pretalk",[ ]],
  
  [anyone, "barber_curel_3", [],
    "I shall do as you ask, {reg59?madame:sir}. Fetch oil and wine!", "close_window", []], #pending Phaiak's wound system
  
  # CURE HEAVY WOUNDS
  [anyone|plyr,"barber_talk",
    [
      (this_or_next|quest_slot_ge, "qst_vc_wounds", slot_quest_int_penalty_left_days, 1),
      (this_or_next|quest_slot_ge, "qst_vc_wounds", slot_quest_cha_penalty_left_days, 1),
      (this_or_next|quest_slot_ge, "qst_vc_wounds", slot_quest_str_penalty_left_days, 1),
      (			  quest_slot_ge, "qst_vc_wounds", slot_quest_agi_penalty_left_days, 1),
    ],
    "I need you to tend to my heavy wounds.", "barber_cureh_1",[]],
  [anyone|plyr, "barber_talk", [],
    "I have no need of your services. Farewell.", "close_window", []],
  
  [anyone, "barber_cureh_1",
    [
      (assign, "$current_dialog_cost", 50),
      (try_for_range, ":curr_left_days_slot", slot_quest_int_penalty_left_days, slot_quest_end_penalty_left_days),
        (quest_slot_ge, "qst_vc_wounds", ":curr_left_days_slot", 1),
        (store_add, ":curr_fluid_points_slot", ":curr_left_days_slot", 10),
        (quest_get_slot, ":fluid_points", "qst_vc_wounds", ":curr_fluid_points_slot"),
        (val_mul, ":fluid_points", 100),
        (val_add, "$current_dialog_cost", ":fluid_points"),
      (end_try),
      (assign, reg1, "$current_dialog_cost"),
    ],
    "You have serious injuries. I will cure them, but I charge {reg1} peningas for my work.", "barber_cureh_2", []],#
  
  [anyone|plyr,"barber_cureh_2",
    [
      (store_troop_gold, ":money", "trp_player"),
      (ge, ":money", "$current_dialog_cost"),
    ],
    "Here are your {reg1} peningas. Now cure my wounds.", "barber_cureh_3",
    [
      (troop_remove_gold, "trp_player", "$current_dialog_cost"),
  ]],
  
  [anyone|plyr,"barber_cureh_2", [],
    "I don't have enough money.", "barber_pretalk",[ ]],
  
  [anyone, "barber_cureh_3", [],
    "I shall do my best, {reg59?madame:sir}. Fetch a hot iron and pliers!", "close_window",
    [
      (try_for_range, ":curr_left_days_slot", slot_quest_int_penalty_left_days, slot_quest_end_penalty_left_days),
        (quest_slot_ge, "qst_vc_wounds", ":curr_left_days_slot", 1),
        (quest_set_slot, "qst_vc_wounds", ":curr_left_days_slot", -5),
      (end_try),
      (assign, "$wounded_today", 0),
  ]],
  
  
  #bardo
  #chief bardos dialogo empieza
  [trp_skald_lair, "start", [
    ],
    "Ave, {reg59?my lady:my lord}. I am your skald. I can recite you a poem, or I can compose songs and poems about your honor and valour.", "skald_talk", []],
  [trp_bardo_lair, "start", [
    ],
    "Ave, {reg59?my lady:my lord}. I am your bard. I can recite you a poem, or I can compose songs and poems about your honor and valour.", "skald_talk", []],
  [anyone, "skald_pretalk", [],
    "My art and skill will not disappoint you, my lord. What else do you need?", "skald_talk", []],
  [anyone|plyr,"skald_talk", [(troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0)],
    "I want you to sing about me. I need to be known and famous.", "skald_sing",[]],
  [anyone,"skald_sing", [],
    "{s2}^^I will write a poem so epic that all the isles will know about the greatness of {playername}. However, I must ask for a small sum to cover the cost of inks and... other things. I will need 500 coins.", "skald_sing2", [
      (str_store_string, s2, "@--He jumps with joy. Finally, he stops and takes a deep breath.--", color_good_news),
  ]],
  [anyone|plyr,"skald_sing2", [(store_troop_gold,":money","trp_player"), (gt,":money",499),],
    "Take the money. It is nothing to a mighty hero like me.", "skald_pretalk",
    [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",499),
        (troop_remove_gold,"trp_player",500),
        (troop_set_slot, "$g_talk_troop", slot_troop_current_mission, npc_mission_seek_recognition),
        (troop_set_slot,"$g_talk_troop",slot_troop_days_on_mission,7),#7 days cooldown
        (play_track, "track_c105", 1),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  [anyone|plyr, "skald_sing2", [],
    "You ask the same price as a happy widow, and I could make her sing better! No, thank you.", "close_window", []],
  
  [anyone|plyr, "skald_talk", [],
    "Can you sing for me and my men?", "skald_cancion", []],
  [anyone|plyr, "skald_talk", [],
    "A bard? Songs? Why don't you go out and earn your bread like the rest of us? Farewell.", "close_window", []],
  
  [anyone, "skald_cancion", [],
    "It will cost you 100 coins. I can sing...", "skald_cancion2", []],
  [anyone|plyr, "skald_cancion2", [],
    "Cantiga 2", "close_window", [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",99),
        (troop_remove_gold, "trp_player", 100),
        (play_track, "track_c2", 1),
        (call_script, "script_change_player_party_morale", 1),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  #  [anyone|plyr, "skald_cancion2", [],
  #  "Cantiga 9", "close_window", [
  #(store_troop_gold,":money","trp_player"),
  #     (try_begin),
  #       (gt,":money",99),
  #      (troop_remove_gold, "trp_player", 100),
  #      (play_track, "track_c9", 1),
  #            (call_script, "script_change_player_party_morale", 1),
  #     (else_try),
  #      (display_message,"str_no_money"),
  #      (try_end),
  #      ]],
  # [anyone|plyr, "bardo_cancion2", [],
  #   "Cantiga 105", "close_window", [
  #(store_troop_gold,":money","trp_player"),
  #     (try_begin),
  #       (gt,":money",99),
  #       (troop_remove_gold, "trp_player", 100),
  #      (play_track, "track_c105", 1),
  #             (call_script, "script_change_player_party_morale", 1),
  #     (else_try),
  #        (display_message,"str_no_money"),
  #     (try_end),
  #      ]],
  
  [anyone|plyr, "skald_cancion2", [],
    "Never mind. I want to ask you something else.", "skald_pretalk", []],
  #chief bardos acaba
  
  
  # Captain
  [trp_lair_captain,"start", [], "How may I help you, Commander?", "lair_captain",[]],
  
  [anyone ,"lair_captain_pretalk", [], "Anything else, Commander?", "lair_captain",[]],
  
  [anyone|plyr, "lair_captain", [], "Is there anything I should know?", "lair_captain_nothing", []],
  
  [anyone|plyr, "lair_captain", [          (party_slot_eq, "$g_encountered_party", slot_lair_improve, 0), #used in place of global variable
      ], "Captain, I want to improve this place.", "lair_captain_improve", []],
  [anyone|plyr, "lair_captain", [          (party_slot_eq, "$g_encountered_party", slot_lair_improve, 1), #used in place of global variable
      ], "Captain, how goes the construction?", "lair_captain_improve_x1", []],
  [anyone|plyr, "lair_captain", [          (party_slot_eq, "$g_encountered_party", slot_lair_improve, 2), #used in place of global variable
      ], "Captain, I want to improve this hideout.", "lair_captain_improve_torefuge", []],
  [anyone|plyr, "lair_captain", [          (party_slot_eq, "$g_encountered_party", slot_lair_improve, 3), #used in place of global variable
      ], "Captain, how goes the construction?", "lair_captain_improve_x1", []],
  
  #VC-1878 begins
  [anyone|plyr, "lair_captain",
    [(party_slot_ge, "$g_encountered_party", slot_lair_improve, 2),(party_slot_eq, "$current_town", slot_town_port, 0),],
    "I would like to land my ships here next to this refuge.", "lair_captain_add_port_0", []],
  [anyone ,"lair_captain_add_port_0",
    [
      (party_get_position, pos1, "$g_encountered_party"),
      (map_get_water_position_around_position, pos2, pos1, 5),
    ],
    "We will need 1,000 peningas, to pay staff and buy materials in order to build the jetties.", "lair_captain_add_port_1",[]],
  [anyone ,"lair_captain_add_port_0", [],
    "The Refuge is too far away from the shore. We can't do this.", "lair_captain_pretalk",[]],
  [anyone|plyr, "lair_captain_add_port_1",
    [
      (store_troop_gold,":money","trp_player"),
      (ge,":money",1000),
    ],
    "Do so. Here is the money.", "lair_captain_add_port_2", []],
  [anyone|plyr, "lair_captain_add_port_1",
    [
      (store_troop_gold,":money","trp_player"),
      (ge,":money",1000),
    ],
    "I changed my mind.", "lair_captain_pretalk", []],
  [anyone|plyr, "lair_captain_add_port_1",
    [
      (store_troop_gold,":money","trp_player"),
      (lt,":money",1000),
    ],
    "I don't have enough money.", "lair_captain_pretalk", []],
  [anyone ,"lair_captain_add_port_2",
    [
      (troop_remove_gold, "trp_player", 1000),
      (party_set_slot, "$current_town", slot_town_port, 1),
      (set_spawn_radius, 0),
      (spawn_around_party, "$g_encountered_party", "pt_port"),
      (assign, ":curr_port", reg0),
      #(str_store_party_name, s1, "$g_encountered_party"),
      (party_set_name, ":curr_port", "@Jetties"),
      (party_set_slot, "$g_encountered_party", slot_party_port_party, ":curr_port"),
      (party_set_slot, ":curr_port", slot_party_port_party, "$g_encountered_party"),
      (party_get_position, pos1, "$g_encountered_party"),
      (call_script, "script_get_next_water_position", 1),
      (party_set_position, ":curr_port", pos2),
      (party_set_faction, ":curr_port", "fac_player_faction"),
      (party_set_slot, ":curr_port", slot_party_home_center, "$g_encountered_party"),
      (party_set_flags, ":curr_port", pf_no_label, 1),
      (party_set_flags, ":curr_port", pf_show_faction, 0),
      (party_set_slot, ":curr_port", slot_party_on_water, 1),
      (val_add, "$g_number_of_map_ports", 1),
      
    ],
    "Very well. It won't take long to build the jetties. You will be able to disembark here soon.", "lair_captain_pretalk",[]],
  #VC-1878 ends
  
  [anyone|plyr, "lair_captain", [],
    "I will donate 500 peningas to the families of my men.", "lairparty_action",[
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",499),
        (troop_remove_gold, "trp_player", 500),
        (call_script, "script_change_player_party_morale", 3),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  #entrenamiento
  #[anyone|plyr,"lair_captain", [(party_get_num_companions,":troops","p_main_party"),(gt,":troops",2)], "I would like to spar with some of my men.", "arena_master_spar_teams2",[]], # Jinnai
  
  [anyone|plyr, "lair_captain", [
      #(assign, "$g_leave_encounter", 1)
      ], "That'll be all.", "close_window", []],
  
  #improve 1
  [anyone ,"lair_captain_improve", [], "Currently, we have a simple and poorly defended permanent camp with few services and capacity for fifty men. I suggest building some houses for the men stationed here, for them to bring their families, a mead hall to help them relax and improve morale, and a training camp for our men to improve their skills. " +
    "It would be important to improve the defenses further. Finally, you will need more space. I would guess you would like to have a big and comfortable house.^^" +
    "I estimate that we will need a lot of money, about 5,000 peningas, to pay staff and buy materials. In addition, we need you to buy us five tool kits and five timber pallets.", "lair_captain_improve2",[]],
  [anyone|plyr, "lair_captain_improve2", [(call_script,"script_cf_player_has_tools"),
      ], "Well, go ahead. This site needs improvement, and I have the needed resources and money.", "lair_captain_improve3", [
  ]],
  [anyone|plyr, "lair_captain_improve2", [], "I will get what you asked for, and I will return with it later.", "lair_captain_pretalk", []],
  [anyone|plyr, "lair_captain_improve2", [], "I'll think about it.", "lair_captain_pretalk", []],
  
  [anyone ,"lair_captain_improve3", [(store_troop_gold,":money","trp_player"),(ge,":money",5000),], "I'll put the men to work right now, commander. If all goes well, the work will be finished in a week.", "lair_captain_pretalk",[
      (troop_remove_items,"trp_player","itm_tools",5),
      (troop_remove_items,"trp_player","itm_timber",5),
      (troop_remove_gold, "trp_player", 5000),
      (party_set_slot, "$g_encountered_party", slot_lair_improve, 1),
      (store_current_hours, ":cur_hours"),
      (party_set_slot, "$g_encountered_party", slot_lair_time_to_improve, ":cur_hours"),
  ]],
  
  [anyone ,"lair_captain_improve3", [], "Commander, how can I say this? You do not have enough money. We need 5,000 peningas.", "lair_captain_pretalk",[]],
  
  [anyone ,"lair_captain_improve_x1", [], "The workers are working hard, commander.", "lair_captain_pretalk",[]],
  ##
  [anyone ,"lair_captain_nothing", [], "Nothing right now.", "lair_captain_pretalk",[]],
  
  #improve 2
  [anyone ,"lair_captain_improve_torefuge", [], "Currently, we have a nice hideout with a mead hall and capacity for 120 men. I suggest building more houses for the men stationed here and for their families. " +
    "On the other hand, we could use a blacksmith to help to repair our weapons and armor and build a stable for our horses. Moreover, it would be important to improve the defenses further with earthen mounds and ditches. " +
    "Finally, you will need more space. I would guess you would like to have a mead hall, as befits a warlord.^^" +
    "I estimate that we will need a lot of money, about 10,000 peningas, to pay staff and buy materials. In addition, we need you to buy us five tool kits and five timber pallets.", "lair_captain_improve_torefuge2",[]],
  [anyone|plyr, "lair_captain_improve_torefuge2", [(call_script,"script_cf_player_has_tools"),
      ], "Well, go ahead. This site needs improvement, and I have the needed resources and money, too.", "lair_captain_improve_torefuge3", [
  ]],
  [anyone|plyr, "lair_captain_improve_torefuge2", [], "I will get what you ask, and will return with it later.", "lair_captain_pretalk", []],
  [anyone|plyr, "lair_captain_improve_torefuge2", [], "I'll think about it.", "lair_captain_pretalk", []],
  
  [anyone ,"lair_captain_improve_torefuge3", [(store_troop_gold,":money","trp_player"),(ge,":money",10000),], "I'll put the men to work right now, commander. If all goes well, the work will be finished in two weeks.", "lair_captain_pretalk",[
      (troop_remove_items,"trp_player","itm_tools",5),
      (troop_remove_items,"trp_player","itm_timber",5),
      (troop_remove_gold, "trp_player", 10000),
      (party_set_slot, "$g_encountered_party", slot_lair_improve, 3),
      (store_current_hours, ":cur_hours"),
      (party_set_slot, "$g_encountered_party", slot_lair_time_to_improve, ":cur_hours"),
  ]],
  
  [anyone ,"lair_captain_improve_torefuge3", [], "Commander, how can I say this? You do not have enough money. We need 10,000 peningas.", "lair_captain_pretalk",[]],
  
  ##
  
  #subir moral dando dinero en plan robin hood
  [anyone, "lairparty_action", [],
    "Thank you, {reg59?my lady:sir}. This will raise the morale and loyalty of the men.", "lair_captain_pretalk",[]],
  ##############player lair end
  #####Doccinga prissoner chief he wants to join
  [trp_sea_raider_leader2, "start", [ (eq,"$doccinga_prisoner",2),
      (str_clear, s2),
    ],
    "{reg59?Madame:Sir}, surely you do not remember me. My face looks much different when it's not being tortured. I am the man you questioned in Doccinga after the battle, Olafr the Captain.", "dcprisoner_join1", [
  ]],
  [anyone, "dcprisoner_join1", [#mainquest chief
    ],
    "The truth is that, after my defeat, Sven disowned me, and I've been without a lord ever since. I served as a mercenary but had bad luck -- I spent everything I was paid on mead and women. " +
    "I was looking for you, because you are the only person who showed compassion for me in the hardest times. I want to serve you, to fight in your army. I will be faithful if you accept me.", "dcprisoner_join2", [
  ]],
  
  [anyone|plyr, "dcprisoner_join2", [
    ],
    "Veterans like you are always welcome.", "dcprisoner_join3", [
  ]],
  [anyone|plyr, "dcprisoner_join2", [
    ],
    "No, surely you are a spy. Be gone.", "dcprisoner_join4", [
  ]],
  
  [anyone, "dcprisoner_join3", [#mainquest chief
    ],
    "Thank you. I will be the bravest and the most loyal of your men!", "close_window", [
      (party_add_members, "p_main_party", "trp_sea_raider_leader2", 1),
      (assign,"$doccinga_prisoner",3),
      (finish_mission),
  ]],
  [anyone, "dcprisoner_join4", [#mainquest chief
    ],
    "I understand and accept your rejection. You will not see me again.", "close_window", [
      (assign,"$doccinga_prisoner",3),
      (finish_mission),
  ]],
  ###Olvir despues de batalla
  [trp_sven_brother|other(trp_npc2), "start", [ (check_quest_active,"qst_danmork_protection"),(quest_slot_eq,"qst_danmork_protection",slot_quest_current_state, 13),
      (str_clear, s2),
    ],
    "{s2}^^Damn, Olvir White Hair, perhaps you thought you could beat us? I had heard that you're a smart man.", "olvir_dialog", [
      (str_store_string, s2, "@--Egil stops looting when Olvir is carried to you. He approaches.--", color_good_news),
      (agent_get_item_slot, ":item", "$g_talk_agent", 4), #head slot
      (try_begin),
        (ge, ":item", 1),
        (agent_unequip_item, "$g_talk_agent", ":item"),
      (try_end),
      (talk_info_show, 0),      ]],
  
  [anyone, "olvir_dialog", [#mainquest chief
    ],
    "{s2}^^My life and my death serve the purposes of my lord. My victory would have been over an enemy that he hates. My death will make you banned before the Assembly, {playername}.", "olvir_dialog2", [
      (str_store_string, s2, "@--Olvir coughs up blood and puts his hand on his side. He looks tired, very tired, but still proud. He stands up straight.--", color_good_news),
  ]],
  
  [anyone|plyr, "olvir_dialog2", [
    ],
    "What does he mean about the Assembly, Egil?", "olvir_dialog31", [
  ]],
  [anyone|plyr, "olvir_dialog2", [
    ],
    "I do not care about your lord. Where is your brother, Olvir?", "olvir_dialog32", [
  ]],
  
  [anyone|plyr, "olvir_dialog2", [
    ],
    "Sigurd is making a lot of trouble for me. It's time he pays for his treachery.", "olvir_dialog33", [
  ]],
  
  [trp_sven_brother|other(trp_npc2), "olvir_dialog31", [
      (str_clear, s2),
    ],
    "{s2}^^You will be accused of having killed Olvir before the Assembly, the assembly of free men, and they will demand payment or revenge. As Sigurd already wants you dead, it is clear that they will kill you.", "olvir_dialog33", [
      (str_store_string, s2, "@--He spits to one side, with apathy, before speaking.--", color_good_news),
  ]],
  
  [anyone, "olvir_dialog32", [#mainquest chief
    ],
    "{s2}^^Do not worry, he will find you. You will regret having pursued him, and have caused many evils for Sigurd Ragnarsson. You've annoyed the wrong people, {playername}.", "olvir_dialog33", [
      (str_store_string, s2, "@--His face is pale. He has a moment of life left.--", color_good_news),
  ]],
  
  [anyone, "olvir_dialog33", [#mainquest chief
    ],
    "{s2}^^You fool! I will laugh at you when Sigurd Ragnarsson kills you as I enjoy feasts at Walhalla. You have no idea who Sigurd 'Snake in the Eye' is and what he is capable of. " +
    "Everyone fears him, even his own brothers... well, maybe not Ivar the Boneless. Ivar is the most ruthless of the sons of Ragnar.", "olvir_dialog4", [
      (str_store_string, s2, "@--His face is pale. He has a moment of life left.--", color_good_news),
  ]],
  
  [anyone, "olvir_dialog4", [#mainquest chief
    ],
    "{s2}^^I'm dying... Give me my sword, so that the Valkyries will see that I am a warrior and take me to the halls of Odin.", "olvir_dialog411", [
      (str_store_string, s2, "@--He has a cough that makes him stoop. You see blood flowing from his side in less quantity, and his eyes begin to fade.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc8), "olvir_dialog411", [
    ],
    "{playername}, this man has insulted and threatened you, and tried to kill us. He is not deserving of our compassion. Also, giving the sword is a pagan custom. Let him die and go to hell.", "olvir_dialog41", [
  ]],
  
  [anyone|plyr, "olvir_dialog41", [
    ],
    "Egil, give him his sword. It allows him to travel to Walhalla.", "olvir_dialog51", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -10),
      (str_store_string, s2, "@Note 4: You chose that Olvir White Hair, brother of Sven Bull Neck, would die with his sword in his hands."),
      (add_quest_note_from_sreg, "qst_notes_danmork", 7, s2, 0),
  ]],
  
  [anyone|plyr, "olvir_dialog41", [
    ],
    "No, he's right. You do not deserve Walhalla, Olvir. Egil, give me the sword.", "olvir_dialog52", [
  ]],
  
  [anyone|plyr,"olvir_dialog41", [(eq, "$defect_type", cb6_justice),
      (str_clear, s10),
      (str_store_string, s10, "@Here, a warrior who has fought well deserves Walhalla. Egil, give him his sword. (Justice)"),
    ],
    "{!}{s10}", "olvir_dialog51",[
      (str_clear, s10),
      (str_store_string, s2, "@Note 4: You chose that Olvir White Hair, brother of Sven Bull Neck, would die with his sword in his hands."),
      (add_quest_note_from_sreg, "qst_notes_danmork", 7, s2, 0),
  ]],
  
  [anyone|other(trp_npc2), "olvir_dialog51", [
      (str_clear, s2),
    ],
    "{s2}^^Banquets, women and endless battles await you in the hall of the gods, Olvir. You've been good warrior, although we have been enemies. " +
    "I will see you someday, and maybe we can fight alongside each other at Ragnarok.", "olvir_dialog7", [
      (str_store_string, s2, "@--Egil carefully puts the sword in the hand of Olvir, who looks at you gratefully.--", color_good_news),
      
      (add_xp_as_reward,200),
      (call_script, "script_change_player_honor", 10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", 5),
  ]],
  
  [anyone|other(trp_npc3), "olvir_dialog52", [
      (str_clear, s2),
    ],
    "{reg59?Madame:Sir}, this man fought well. Let him go to Walhalla.", "olvir_dialog54", [
  ]],
  
  [anyone, "olvir_dialog54", [
    ],
    "Please...", "olvir_dialog55", [
  ]],
  
  [anyone|plyr, "olvir_dialog55", [
    ],
    "Well, Egil, give him his sword.", "olvir_dialog51", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -10),
      (str_store_string, s2, "@Note 4: You chose that Olvir White Hair, brother of Sven Bull Neck, would die with his sword in his hands."),
      (add_quest_note_from_sreg, "qst_notes_danmork", 7, s2, 0),
  ]],
  
  [anyone|plyr, "olvir_dialog55", [
    ],
    "No. Egil, give me his sword, for it will be mine. Let him go to hell.", "olvir_dialog6", [
      (str_store_string, s2, "@Note 4: You chose that Olvir White Hair, brother of Sven Bull Neck, would die without his sword in his hands. You kept the weapon for yourself."),
      (add_quest_note_from_sreg, "qst_notes_danmork", 7, s2, 0),
  ]],
  
  [anyone, "olvir_dialog6", [#mainquest chief
    ],
    "{!}{s2}", "olvir_dialog7", [
      (str_store_string, s2, "@--He looks at you with hate when you take his sword in your hand. Olvir's eyes shut, his lips utter a curse that does not reach your ears, and then, Olvir White Hair, brother of Sven Bull Neck, dies.--", color_good_news),
      (add_xp_as_reward,200),
      (troop_add_item, "$g_player_troop","itm_sword_of_war",0), #espada de Olvir
      (call_script, "script_change_player_honor", -10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -5),
  ]],
  
  [anyone|other(trp_npc2), "olvir_dialog7", [
    ],
    "{reg59?Madame:Sir}, it is time to hit the road. We should go talk to my father, King Horik. " +
    "Being charged with murder before the Assembly is a very serious thing, and Sigurd will seek to exploit this advantage to the fullest.", "olvir_dialog71",
    [
      (add_xp_as_reward,400),
      (quest_set_slot,"qst_revenge_exchange",slot_quest_current_state, 5),
      (call_script, "script_end_quest", "qst_revenge_exchange"),
  ]],
  
  [anyone|plyr, "olvir_dialog71", [
    ],
    "Let us not waste more time but go.", "close_window", [
      (str_clear, s9),
      (str_clear, s11),
      (str_store_troop_name_link, s9, "trp_knight_1_5"),
      (str_store_troop_name_link, s11, "trp_kingdom_1_lord"),
      
      (str_store_string, s2, "@Sven's Bull Neck brother, Olvir White Hair, has died at the Battle of Ulf's Farm. Egil thinks {s9} will use this to report you to the Assembly and demand blood compensation. " +
      "Your companion has proposed for you go to visit {s11} again."),
      (add_quest_note_from_sreg, "qst_danmork_protection", 4, s2, 0),
      (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 14), #status 0
      (jump_to_menu, "mnu_hablar_olvir"),
      (finish_mission),
  ]],
  ####
  
  
  
  #torturador
  [anyone,"start", [(eq,"$g_talk_troop", "trp_norse_level0_companion"),(check_quest_active,"qst_doccinga_interrogation"), #chief village_elder_talk thonkrik from Doccinga
    ],
    "We're just here to prevent escapes. Good luck.", "close_window",[
  ]], #doccinga coastal assault dialog chief
  [anyone,"start", [(eq,"$g_talk_troop", "trp_doccinga_torturador"),(check_quest_active,"qst_doccinga_interrogation"), #chief village_elder_talk thonkrik from Doccinga
    ],
    "All yours! I already hit him pretty hard.", "close_window",[
  ]], #doccinga coastal assault dialog chief
  
  
  ###prisionero interrogatorio
  [trp_sea_raider_prisoner, "start", [ (eq, "$g_talk_troop_met", 0),#mainquest chief
    ],
    "Thor, we have a new visitor. Our friend hit me hard. Come and see if you can better him?", "prisionero_interrogation1", [
      #(agent_set_slot, "$g_talk_agent", slot_agent_fatiga_inicial, 100), #resistencia inicial al interrogatorio
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, 100), #resistencia que va descendiendo o subiendo en el interrogatorio
      (assign, "$option_switches", 0),
      (talk_info_show, 0),      ]],
  
  [trp_sea_raider_prisoner, "start", [#mainquest chief
    ],
    "This is getting boring. Don't you have better things to do?", "prisionero_interrogation1", [(assign, "$option_switches", 0),(talk_info_show, 0),]],
  
  [anyone, "pretalkdc", [#mainquest chief
    ],
    "Well?", "prisionero_interrogation1", []],
  
  [anyone|plyr, "prisionero_interrogation1", [],
    "I'll ask you some questions, and, if you answer right, you won't have to keep suffering.", "prisionero_interrogation2", []],
  
  
  
  #basicos
  #camino del bueno
  [anyone|plyr, "prisionero_interrogation1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (ge, ":basic_stamina", 85),
    ],
    "--You give drinking water to the prisoner.--", "prisionero_agua", [
  ]],
  
  [anyone, "prisionero_agua", [#mainquest chief
      (str_clear, s2),
    ],
    "{!}{s2}", "pretalkdc", [
      (str_store_string, s2, "@--The prisoner drinks eagerly. He has an enormous thirst.--", color_good_news),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (val_sub, ":basic_stamina", 16),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
  ]],
  
  [anyone|other(trp_norse_level0_companion), "prisionero_agua2", [
      (str_clear, s4),
    ], #piensan q es debil
    "{!}{s4}", "pretalkdc",
    [
      (str_store_string, s11, "@You weakling!"),
      (str_store_string, s12, "@You're pathetic."),
      (str_store_string, s13, "@You give me grief."),
      (store_random_in_range, ":random", 11, 14),
      (str_store_string_reg, s4, ":random"),
      (call_script, "script_change_troop_renown", "trp_player", -3),
      
      ##(store_conversation_troop, "trp_norse_level0_companion"), #3 person conversation
      ##				(set_conversation_speaker_troop, "trp_norse_level0_companion"),
  ]],
  
  [anyone|plyr, "prisionero_interrogation1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (le, ":basic_stamina", 84),
      (ge, ":basic_stamina", 70),
    ],
    "--You clean the prisoner's wounds.--", "prisionero_lheridas", [
  ]],
  
  [anyone, "prisionero_lheridas", [#mainquest chief
      (str_clear, s2),
    ],
    "{!}{s2}", "prisionero_agua2", [
      (str_store_string, s2, "@--He is relieved by your actions.--", color_good_news),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (val_sub, ":basic_stamina", 16),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
  ]],
  
  [anyone|plyr, "prisionero_interrogation1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (le, ":basic_stamina", 69),
      (ge, ":basic_stamina", 55),
    ],
    "You need not suffer any more. We are not enemies. We can talk like people.", "prisionero_palabrasa", [
  ]],
  
  [anyone, "prisionero_palabrasa", [#mainquest chief
      (str_clear, s2),
    ],
    "{!}{s2}", "prisionero_agua2", [
      (str_store_string, s2, "@--The prisoner looks at you, confused, but he seems more relaxed.--", color_good_news),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (val_sub, ":basic_stamina", 16),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
  ]],
  
  [anyone|plyr, "prisionero_interrogation1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (le, ":basic_stamina", 54),
      (ge, ":basic_stamina", 40),
    ],
    "Now, let me ask a few questions, and you're going to answer.", "prisionero_buenofinal", [
  ]],
  
  [anyone, "prisionero_buenofinal", [#mainquest chief
      (str_clear, s2),
    ],
    "{!}{s2}", "prisionero_agua2", [
      (str_store_string, s2, "@--The prisoner nods.--", color_good_news),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (val_sub, ":basic_stamina", 16),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
  ]],
  
  #camino del malo
  [anyone|plyr, "prisionero_interrogation1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (ge, ":basic_stamina", 80),
    ],
    "--You hit the prisoner's face.--", "prisionero_golpea", [
  ]],
  
  [anyone, "prisionero_golpea", [#mainquest chief
      (str_clear, s2),
    ],
    "{!}{s2}", "pretalkdc", [
      (str_store_string, s2, "@--Your blow hits the prisoner's face, who nearly falls.--", color_good_news),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (val_sub, ":basic_stamina", 21),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
  ]],
  
  [anyone|plyr, "prisionero_interrogation1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (le, ":basic_stamina", 79),
      (ge, ":basic_stamina", 60),
    ],
    "--You hit the side of the prisoner, where it hurts.--", "prisionero_golpea2", [
      (call_script, "script_change_player_honor", -3),
  ]],
  
  [anyone, "prisionero_golpea2", [#mainquest chief
      (str_clear, s2),
    ],
    "{!}{s2}", "pretalkdc", [
      (str_store_string, s2, "@--You see the prisoner grit his teeth, trying to endure the pain.--", color_good_news),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (val_sub, ":basic_stamina", 21),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
  ]],
  [anyone|plyr, "prisionero_interrogation1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (le, ":basic_stamina", 59),
      (ge, ":basic_stamina", 40),
    ],
    "Now, let's talk! --You hit the side of the prisoner again and then his face.--", "prisionero_golpea3", [
      (call_script, "script_change_player_honor", -6),
  ]],
  
  [anyone, "prisionero_golpea3", [#mainquest chief
      (str_clear, s2),
    ],
    "{!}{s2}", "pretalkdc", [
      (str_store_string, s2, "@--He does not answer, but you're sure he will be more collaborative now.--", color_good_news),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (val_sub, ":basic_stamina", 21),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
  ]],
  #skills part
  #persuasion
  [anyone|plyr, "prisionero_interrogation1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (le, ":basic_stamina", 60),
      (ge, ":basic_stamina", 30),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (ge, ":player_persuasion_skill", 2),
    ],
    "No one will come back for you. Answer me, and I'll help you get home. (Persuasion)", "prisionero_persuasion1", []],
  
  [anyone, "prisionero_persuasion1", [#mainquest chief
    ],
    "I am your prisoner, and I'm alone in your hands, but my boss will not forget me. Sven Bull Neck never abandons his men. I'll answer what you ask, but only if it doesn't affect my master or his cause.", "pretalkdc", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (val_sub, ":basic_stamina", 31),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      (add_xp_as_reward,100),
  ]],
  
  [anyone|plyr, "prisionero_interrogation1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (le, ":basic_stamina", 70),
      (ge, ":basic_stamina", 10),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (ge, ":player_persuasion_skill", 6),
    ],
    "I promise to release you and give you 1000 coins if you answer my questions. (Persuasion)", "prisionero_persuasion2", []],
  
  [anyone, "prisionero_persuasion2", [#mainquest chief
    ],
    "Your words seem sincere, and I like your offer. I'm not ready yet to visit Walhalla. Ask, and I will answer.", "pretalkdc", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (val_sub, ":basic_stamina", 51),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      (add_xp_as_reward,200),
  ]],
  
  #power_strike
  
  
  [anyone|plyr, "prisionero_interrogation1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (le, ":basic_stamina", 90),
      (ge, ":basic_stamina", 60),
      (store_skill_level, ":player_power_strike_skill", "skl_power_strike", "trp_player"),
      (ge, ":player_power_strike_skill", 1),
    ],
    "Maybe this will motivate you --You grab his crotch and squeeze hard-- (Power Strike)", "prisionero_golpeado1", [
      (call_script, "script_change_player_honor", -2),
      (add_xp_as_reward,100),
  ]],
  
  [anyone, "prisionero_golpeado1", [#mainquest chief
      (str_clear, s2),
    ],
    "{!}{s2}", "pretalkdc", [
      (str_store_string, s2, "@--The prisoner screams in pain. Maybe now he will be more cooperative.--", color_good_news),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (val_sub, ":basic_stamina", 31),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      #Phaiak begin (test)
      (agent_set_no_death_knock_down_only, "$g_talk_agent", 1),
      (agent_deliver_damage_to_agent, "$g_talk_agent", "$g_talk_agent", 10000),
      #Phaiak end
  ]],
  
  [anyone|plyr, "prisionero_interrogation1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (le, ":basic_stamina", 59),
      (ge, ":basic_stamina", 30),
      (store_skill_level, ":player_power_strike_skill", "skl_power_strike", "trp_player"),
      (ge, ":player_power_strike_skill", 2),
    ],
    "Do you prefer pain? --You grab his hand and break his fingers one by one-- (Power Strike)", "prisionero_golpeado2", [
      (call_script, "script_change_player_honor", -5),
      (add_xp_as_reward,200),
  ]],
  
  [anyone, "prisionero_golpeado2", [#mainquest chief
      (str_clear, s2),
    ],
    "{!}{s2}", "pretalkdc", [
      (str_store_string, s2, "@--The prisoner shouts and cries in pain. You're sure he's going to answer your questions.--", color_good_news),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (val_sub, ":basic_stamina", 31),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      #Phaiak begin (test)
      (agent_set_no_death_knock_down_only, "$g_talk_agent", 1),
      (agent_deliver_damage_to_agent, "$g_talk_agent", "$g_talk_agent", 10000),
      #Phaiak end
  ]],
  
  [anyone|plyr, "prisionero_interrogation1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (le, ":basic_stamina", 40),
      (ge, ":basic_stamina", 10),
      (store_skill_level, ":player_power_strike_skill", "skl_power_strike", "trp_player"),
      (ge, ":player_power_strike_skill", 4),
    ],
    "--You take a bread knife and cut the skin on his arms into strips.-- (Power Strike)", "prisionero_golpeado3", [
      (call_script, "script_change_player_honor", -10),
      (add_xp_as_reward,300),
  ]],
  
  [anyone, "prisionero_golpeado3", [#mainquest chief
      (str_clear, s2),
    ],
    "{!}{s2}", "prisionero_interrogationth", [
      (str_store_string, s2, "@--The prisoner's screams are terrible. You've never heard a man shout so much.--", color_good_news),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (val_sub, ":basic_stamina", 50),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      #Phaiak begin (test)
      (agent_set_no_death_knock_down_only, "$g_talk_agent", 1),
      (agent_deliver_damage_to_agent, "$g_talk_agent", "$g_talk_agent", 10000),
      #Phaiak end
  ]],
  
  #
  #pide ayuda suave
  [anyone|plyr, "prisionero_interrogation1", [
      (troop_get_slot, ":relation", "trp_village_150_elder", slot_troop_player_relation),
      (gt, ":relation", 15),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (le, ":basic_stamina", 80),
      (ge, ":basic_stamina", 50),
    ],
    "Please, Thonkrik, can you help me get some answers?", "prisionero_apoyoth1", [
  ]],
  [anyone|other(trp_village_150_elder), "prisionero_apoyoth1", [
      (str_clear, s2),
    ], #thonrkil ayuda
    "{s2}^^Listen, Olafr. You attacked our village and killed our people. There are widows and orphans out there because of you, but we are ready to set you free if you answer {playername}'s questions.^" +
    "This is the choice we give you: yield a few words or die here without your sword. " +
    "I am your only friend here, but if you do not say what we want to hear, I will leave you in the hands of these animals.", "prisionero_apoyoth2",
    [
      (str_store_string, s2, "@--He seems uncomfortable with the torture that you are subjecting the prisoner to, so rejoices when you ask for help.--", color_good_news),
      ##                                (store_conversation_troop, "trp_village_150_elder"), #3 person conversation
      ##				(set_conversation_speaker_troop, "trp_village_150_elder"),
  ]],
  
  [anyone, "prisionero_apoyoth2", [#mainquest chief
      (str_clear, s2),
    ],
    "{!}{s2}", "pretalkdc", [
      (str_store_string, s2, "@--The prisoner looks at him thoughtfully, weighing his options. Finally, he nods.--", color_good_news),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (val_sub, ":basic_stamina", 31),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
  ]],
  #
  [anyone|plyr, "prisionero_interrogation1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (ge, ":basic_stamina", 50),
    ],
    "Torturer, the prisoner wants to be hit. Please accommodate him.", "prisionero_interrogation21", []],
  
  [anyone|plyr, "prisionero_interrogation1", [],
    "I don't have any more questions for now.", "close_window", []],
  #
  [anyone, "prisionero_interrogation21", [ #mainquest chief
      (str_clear, s2),
    ],
    "{s2}^^...", "prisionero_interrogation_torturer", [
      (str_store_string, s2, "@--He unsuccessfully tries to say something, but just uses up his remaining energies.--", color_good_news),
  ]],
  
  ##    [anyone, "prisionero_interrogation21", [ #mainquest chief
  ##      ],
  ##   "You're scum!", "prisionero_interrogation_torturer", [
  ##     	(str_store_string, s2, "@--He spits you.--", color_good_news),
  ##        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
  ##        (val_sub, ":basic_stamina", 10),
  ##        (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
  ##        (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
  ##       ]],
  
  [anyone|other(trp_doccinga_torturador), "prisionero_interrogation_torturer", [
      (str_clear, s2),
    ],
    "{s2}^^Sure, the pleasure is mine. Please, {playername}, get back. I need space, and I do not want you splattered with blood. Come back when you want me to stop hitting him.", "prisionero_interrogationth", #le golpea hasta que el player se acerque.
    [
      (str_clear, s2),
      (str_store_string, s2, "@--He grabs his club tightly and laughs.--", color_good_news),
      (call_script, "script_change_player_honor", -1),
      (call_script, "script_change_player_relation_with_troop", "trp_village_150_elder", -2),
      ##                                (store_conversation_troop, "trp_doccinga_torturador"), #3 person conversation
      ##				(set_conversation_speaker_troop, "trp_doccinga_torturador"),
  ]],
  
  [anyone|other(trp_village_150_elder), "prisionero_interrogationth", [
      (str_clear, s2),
    ], #thonrkil no quiere que le golpeen mas
    "{s2}^^Please, please, enough already of abuse. I am sure you will be able to obtain the information by other means.", "pretalkdc",
    [
      (str_clear, s2),
      (str_store_string, s2, "@--He makes a gesture of disgust.--", color_good_news),
      ##                                (store_conversation_troop, "trp_village_150_elder"), #3 person conversation
      ##				(set_conversation_speaker_troop, "trp_village_150_elder"),
  ]],
  #
  ###respuestas
  
  [anyone, "prisionero_interrogation2", [ #mainquest chief
      (quest_slot_eq,"qst_doccinga_interrogation",slot_quest_current_state, 2),
    ],
    "I told you all I know.", "pretalkdc", [
  ]],
  
  [anyone, "prisionero_interrogation2", [ #mainquest chief
      (str_clear, s11),
      (str_clear, s12),
      (str_clear, s13),
      ##        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      ##        (ge, ":basic_stamina", 90),
    ],
    "{!}{s4}", "prisionero_interrogation22", [
      (str_store_string, s11, "@My name is Olafr, and I'd like to meet your sister."),
      (str_store_string, s12, "@Sven Bull Neck will kill you!"),
      (str_store_string, s13, "@You're an asshole."),
      (store_random_in_range, ":random", 11, 14),
      (str_store_string_reg, s4, ":random"),
  ]],
  
  [anyone|plyr, "prisionero_interrogation22", [
      (store_and, reg0, "$option_switches", option_1),
      (eq, reg0, 0),
    ],
    "Why did you attack Doccinga?", "prisionero_interrogation31", []],
  
  [anyone|plyr, "prisionero_interrogation22", [
      (store_and, reg0, "$option_switches", option_2),
      (eq, reg0, 0),
    ],
    "Sven Bull Neck was not with you. Where is he?", "prisionero_interrogation32", []],
  
  [anyone|plyr, "prisionero_interrogation22", [
      (store_and, reg0, "$option_switches", option_3),
      (eq, reg0, 0),
    ],
    "Sigurd 'Snake in the Eye' Ragnarsson is a name I have heard recently. Is he your Lord?", "prisionero_interrogation33", []],
  
  [anyone|plyr, "prisionero_interrogation22", [
      (store_and, reg0, "$option_switches", option_4),
      (eq, reg0, 0),
    ],
    "Tell me about Ragnar and his sons.", "prisionero_interrogation34", []],
  
  [anyone|plyr, "prisionero_interrogation22", [
      (store_and, reg0, "$option_switches", option_5),
      (eq, reg0, 0),
    ],
    "Olafr, were you in the attack on a merchant ship called the Woden Ric?", "prisionero_interrogation35", []],
  
  [anyone|plyr, "prisionero_interrogation22", [],
    "No more questions.", "pretalkdc", []],
  
  [anyone, "prisionero_interrogation31", [ #mainquest chief
      (str_clear, s11),
      (str_clear, s5),
      (str_clear, s3),
      (str_clear, s4),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (str_store_troop_name,s11,":town_lord"),
    ],
    "{!}{s5}", "prisionero_interrogation22", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (try_begin),
        (lt, ":basic_stamina", 80),
        (str_store_string, s3, "@--He looks with tired eyes.--", color_good_news),
        (str_store_string, s4, "@Sven Bull Neck ordered me to disembark in Doccinga with several men and secure the site with a longphort. If all had gone well, our Lord Sigurd 'Snake in the Eye' would be sending another 100 men from Danmark, to help {s11} be crowned king. " +
        "I know only a bit, but I think the jarl of Kennemer promised to send five hundred men on this summer's expedition in Englaland if he becomes king. However, this is no longer relevant. We failed, and Sigurd 'Snake in the Eye' will not sacrifice more men. He will need to help his brothers in Englaland. You can rest easy."),
        (str_store_string, s5, "@{s3}^^{s4}"),
        
        (str_clear, s9),
        (str_clear, s11),
        (str_store_troop_name_link, s9, "trp_knight_4_3"),
        (str_store_troop_name_link, s11, "trp_knight_1_5"),
        
        (str_store_string, s2, "@All plans of {s9} to be king have been ruined by your intervention. His ally, the Danish lord, {s11} 'Snake in the Eye,' will not send more troops because he is recruiting for reinforcements to Englaland. It seems Friese will be free from Viking attacks for some time, thanks to your effort. The paradox is that you now have to run away from the land that you have just helped save."),
        (add_quest_note_from_sreg, "qst_kennemer_jarl_missions", 6, s2, 0),
        (val_or, "$option_switches", option_1),
      (else_try),
        (str_store_string, s5, "@I know nothing!"),
      (try_end),
  ]],
  
  [anyone, "prisionero_interrogation32", [ #mainquest chief
      (str_clear, s5),
      (str_clear, s3),
      (str_clear, s4),
      (str_clear, s6),
    ],
    "{!}{s5}", "prisionero_interrogation22", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (try_begin),
        (lt, ":basic_stamina", 70),
        (str_store_string, s3, "@--He forces a smile.--", color_good_news),
        (str_store_string, s4, "@Sven Bull Neck has things more important to do. Sigurd 'Snake in the Eye' called on him a few days ago from Danmark. If you want to know where he is, go and ask Sigurd himself. But I suggest you ask him more nicely than you asked me."),
        (str_store_string, s5, "@{s3}^^{s4}"),
        (str_clear, s6),
        (str_clear, s11),
        (str_store_troop_name_link, s11, "trp_knight_1_5"),
        (str_store_party_name_link, s6, "p_town_4"),
        
        (str_store_string, s2, "@Sigurd 'Snake in the Eye' called Sven Bull Neck to Danmark. It looks like the jarl has some new mission for him. It looks it would be good to travel to Danmark and ask for {s11} 'Snake in the Eye.' {s6} could be a nice place to start."),
        
        (add_quest_note_from_sreg, "qst_revenge_sigurd", 4, s2, 0),
        (val_or, "$option_switches", option_2),
      (else_try),
        (str_store_string, s5, "@I say nothing, bastard!"),
      (try_end),
  ]],
  
  [anyone, "prisionero_interrogation33", [ #mainquest chief
      (str_clear, s5),
      (str_clear, s3),
      (str_clear, s4),
    ],
    "{!}{s5}", "prisionero_interrogation22", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (try_begin),
        (lt, ":basic_stamina", 45),
        (str_store_string, s3, "@--He twists his mouth and looks at you with contempt.--", color_good_news),
        (str_store_string, s4, "@Sigurd 'Snake in the Eye' is Sven Bull Neck's jarl, and Sven is my hersir. Both of them are powerful men, great warriors, so stay away from them, or they will send you straight to hell."),
        (str_store_string, s5, "@{s3}^^{s4}"),
        (str_clear, s11),
        (str_store_troop_name_link, s11, "trp_knight_1_5"),
        (str_store_string, s2, "@Sven Bull Neck and {s11}, 'Snake in the Eye,' are famous warriors in Danmark. You'll have to be careful if you intend to fight them."),
        (add_quest_note_from_sreg, "qst_revenge_sigurd", 5, s2, 0),
        (val_or, "$option_switches", option_3),
      (else_try),
        (str_store_string, s5, "@Scum!"),
      (try_end),
  ]],
  #hijos de ragnar
  [anyone, "prisionero_interrogation34", [(agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (lt, ":basic_stamina", 25),
      (str_clear, s2),
      (str_clear, s3),
      (str_clear, s4),
      #mainquest chief
    ],
    "{!}{s2}", "prisionero_interrogation343", [
      (str_store_string, s3, "@--He tilts his head and stares, pondering the answer.--", color_good_news),
      (str_store_string, s4, "@You wish to know about the great Ragnar Lodbrok, from the Ynglingeaetten clan, descendants of Odin, eh? Well, he was a jarl feared by all Christians. He attacked Englaland and Frankia many times, and he is famous for his huge expeditions. He knew how to unite and lead men."),
      (str_store_string, s2, "@{s3}^^{s4}"),
  ]],
  [anyone, "prisionero_interrogation34", [ #mainquest chief
    ],
    "I know nothing!", "prisionero_interrogation22", [
  ]],
  
  
  [anyone, "prisionero_interrogation343", [ #mainquest chief
      (str_clear, s5),
      (str_clear, s3),
      (str_clear, s4),
    ],
    "{!}{s5}", "prisionero_interrogation344", [
      (str_store_string, s3, "@--He looks directly at you with emphatic blue eyes.--", color_good_news),
      (str_store_string, s4, "@Ragnar was more than a man, and his sons, too -- he had many sons with his many wives, especially Lathgertha and Aslaug. Ivar the Boneless, Bjorn Ironside, Halfdan, Sigurd 'Snake in the Eye,' Hubbi, and others... He had more than ten sons and many daughters.^" +
      "If you are so clever, you will avoid confronting them. You should even ask Sigurd's forgiveness for killing his men in Doccinga."),
      (str_store_string, s5, "@{s3}^^{s4}"),
      (str_store_string, s2, "@Info:"),
      (call_script, "script_start_quest", "qst_notes_danmork", "trp_player"),
  ]],
  [anyone, "prisionero_interrogation344", [ #mainquest chief
      (str_clear, s5),
      (str_clear, s3),
      (str_clear, s4),
    ],
    "{!}{s5}", "prisionero_interrogation22", [
      (str_store_string, s3, "@--He spits to the side before continuing.--", color_good_news),
      (str_store_string, s4, "@Unfortunately, King Aelle of Northhymbre, in Englaland, took Ragnar prisoner and threw him into a pit of poisonous snakes. Now, Ragnar's sons have gone to Northhymbre and killed its kings. Northhymbre is Danish land now, and soon the rest of Englaland will follow. " +
      "Sigurd 'Snake in the Eye' and Ragnar's other sons are calling to arms many men in Danmark. They will join Ivar and Halfdan Ragnarsson and will advance over rest of Englaland, everyone knows."),
      (str_store_string, s5, "@{s3}^^{s4}"),
      (str_store_string, s2, "@Note 1: Ragnar Lodbrok, a Viking now dead, had several wives, but the major were Lathgertha and Aslaug, and many children, some of whose names  are: Ivar the Boneless, Bjorn Ironside, Halfdan, Sigurd 'Snake in the Eye,' and Hubbi. Ragnar's sons are attacking Englaland in revenge for the execution of his father by a king now dead, Aelle of Northhymbre."),
      (add_quest_note_from_sreg, "qst_notes_danmork", 4, s2, 0),
      (val_or, "$option_switches", option_4),
  ]],
  #woden ric
  [anyone, "prisionero_interrogation35", [ #mainquest chief
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),
      (lt, ":basic_stamina", 31),
      (str_clear, s5),
      (str_clear, s3),
      (str_clear, s4),
    ],
    "{!}{s5}", "prisionero_interrogation4", [
      (str_store_string, s3, "@--He thinks for a few seconds.--", color_good_news),
      (str_store_string, s4, "@Yes, we attacked some ships recently, before Sven Bull Neck went away from us to Northhymbre. I remember the Woden Ric because I liked its name. Woden was an important god in Englaland before all became Christians. " +
      "I remember once meeting a family that still worshiped Woden in a village we looted. They were the only ones whose lives were spared. Woden, we call Odin."),
      (str_store_string, s5, "@{s3}^^{s4}"),
  ]],
  
  [anyone, "prisionero_interrogation35", [ #mainquest chief
    ],
    "I say nothing!", "prisionero_interrogation22", [
  ]],
  
  [anyone|plyr, "prisionero_interrogation4", [
      (store_and, reg0, "$option_switches", option_6),
      (eq, reg0, 0),
    ],
    "Why did you attack the ship? They were only travelers and traders!", "prisionero_interrogation41", []],
  
  [anyone|plyr, "prisionero_interrogation4", [],
    "Listen, this is very important. Did anyone survive your attack?", "prisionero_interrogation42", []],
  
  [anyone, "prisionero_interrogation41", [ #mainquest chief
      (str_clear, s5),
      (str_clear, s3),
      (str_clear, s4),
    ],
    "{!}{s5}", "prisionero_interrogation4", [
      (str_store_string, s3, "@--He shrugs.--", color_good_news),
      (str_store_string, s4, "@They were idiots. They stopped in the wreckage of other ships we had attacked, and it took us just a few hours to catch them. The wind was favorable and we boarded them. There were only a few warriors on board, so it was easy."),
      (str_store_string, s5, "@{s3}^^{s4}"),
      (val_or, "$option_switches", option_6),
  ]],
  
  [anyone, "prisionero_interrogation42", [ #mainquest chief
      (str_clear, s5),
      (str_clear, s3),
      (str_clear, s4),
    ],
    "{!}{s5}", "prisionero_interrogation43", [
      (str_store_string, s3, "@--He swallows.--", color_good_news),
      (str_store_string, s4, "@Very few, unfortunately. Usually we try to catch them to sell as slaves."),
      (str_store_string, s5, "@{s3}^^{s4}"),
  ]],
  
  [anyone|plyr, "prisionero_interrogation43", [],
    "My mother was on that ship.", "prisionero_interrogation44", []],
  
  [anyone|plyr, "prisionero_interrogation43", [],
    "Where did the prisoners go?", "prisionero_interrogation45", []],
  
  [anyone, "prisionero_interrogation44", [ #mainquest chief
    ],
    "Well, we spared some men, even a madwoman who talked nonsense. Maybe your mother is among them.", "prisionero_interrogation43", [
  ]],
  
  [anyone, "prisionero_interrogation45", [ #mainquest chief
    ],
    "Sven Bull Neck took them with him. He was going to leave them in his hideout before continuing his journey north. The hideout is in Danmark. It is a good place and well defended, " +
    "but I will not tell you where it is. I will not betray my masters just so you can kill me.", "prisionero_interrogation22th", [
  ]],
  [anyone|other(trp_village_150_elder), "prisionero_interrogation22th", [
      (str_clear, s2),
    ], #thonrkil sabe algo
    "{s3}^^There is no need to torture him for that information. There is a man in the port of Ribe who deals with the Vikings for their slaves. He is a Frisian from Doccinga who has thrived in Ribe as port master. One often finds him outside, by the docks. He is not a good person, but he will sell whatever information you may require. " +
    "When you talk to him, please do not mention my name, because it was I who forced him to leave Doccinga some years ago.", "prisionero_interrogation22th2",
    [
      (str_clear, s3),
      (str_store_string, s3, "@--He raises his hand before you can answer.--", color_good_news),
      ##                                (store_conversation_troop, "trp_village_150_elder"), #3 person conversation
      ##				(set_conversation_speaker_troop, "trp_village_150_elder"),
  ]],
  [anyone, "prisionero_interrogation22th2", [ #mainquest chief
    ],
    "I have nothing to add.", "prisionero_interrogation22", [
      
      (str_store_party_name_link, s3, "p_town_4"),
      (str_store_string, s2, "@The port master of {s3} may know where Sven Bull Neck's hideout is. Talk to him and convince him to give you the information regardless. One often finds him outside, by the docks."),
      (call_script, "script_start_quest", "qst_sven_lair", "$g_talk_troop"),
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 1),
      (quest_set_slot,"qst_doccinga_interrogation",slot_quest_current_state, 2),
      #(change_screen_notes, 4),
      (val_or, "$option_switches", option_5),
  ]],
  ###
  #farmstead chief
  [anyone,"start", [
      (assign, ":continue", 0),
      (eq, "$g_encountered_party", "p_farmland"),
      (check_quest_active,"qst_revenge_exchange"),
      (party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
      (try_for_range, ":stack_no", 0, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop", "p_main_party", ":stack_no"),
        (neq, ":stack_troop", "trp_player"),
        (eq, ":stack_troop", "$g_talk_troop"),
        (assign, ":continue", 1),
      (try_end),
      (ge, ":continue", 1),
      ], "Awaiting orders.", "close_window",[]],
  
  [trp_norse_slave,"start", [(eq, "$g_encountered_party", "p_farmland"),(check_quest_active,"qst_revenge_exchange"),], "I do not have time for you. Farewell.", "close_window",[]],
  
  ####leader harald in sea, sven attack the fleet quest the_fleet
  [trp_leader_svenlair, "start", [(check_quest_active,"qst_the_fleet"),
      (quest_slot_eq,"qst_the_fleet",slot_quest_current_state, 4),
      
    ],
    "Heill, captains! I have sent for you because tomorrow at noon we will reach the coasts of Northhymbre. It is time to release the details of the mission and talk about the problems that plague this fleet.", "harald_meeting1", [
  ]],
  
  ##sven lair
  [trp_leader_svenlair, "start", [(check_quest_active,"qst_sven_lair"),
      (quest_slot_eq,"qst_sven_lair",slot_quest_current_state, 3),
      
    ],
    "The men are strong, with healthy teeth and hard muscles. The women are healthy, but they are sisters. They are the last slaves I have, so they go together in the package, or nothing. " +
    "However, I'll give you a discount, and they will cost you only 900 peningas.", "sven_comprapr", [
  ]],
  
  [trp_leader_svenlair, "start", [(check_quest_active,"qst_sven_lair"),
      (quest_slot_eq,"qst_sven_lair",slot_quest_current_state, 2),
      
    ],
    "Who are you, and what do you want?", "svenlair_1", [
  ]],
  ###
  ####leader in farmstead quest chief
  [trp_leader_svenlair, "start", [(check_quest_active,"qst_revenge_exchange"),
      (quest_slot_eq,"qst_danmork_protection",slot_quest_current_state, 5),
      
    ],
    "Heill, {playername}! Heill, Egil, vinr! We received your message and we are here. We hope we are in time to come to the party.", "revenge_kingmen", [
  ]],
  
  ###the fleet 2
  [trp_leader_svenlair, "start", [(check_quest_active,"qst_the_fleet"),
    ],
    "Gods protect us!", "close_window", [
  ]],
  
  ###
  [anyone|other(trp_npc2), "revenge_kingmen", [
    ], #
    "Sure, Harald! We're still waiting for the men of Sigurd 'Snake in the Eye.' My friend, here, is eager to meet Sven Bull Neck.", "revenge_kingmen2",
    [
  ]],
  
  [anyone|plyr, "revenge_kingmen2", [],
    "Welcome, Harald. We appreciate the help of King Horik.", "revenge_kingmen3", []],
  
  [anyone, "revenge_kingmen3", [
    ],
    "I'm sure of it. Until the time comes, I will keep my men hidden, ready to intervene if things get ugly. The king was very clear, {playername}. You must not begin hostilities. In fact, he wants you to avoid confrontation if at all possible.", "revenge_kingmen4", [
  ]],
  
  [anyone|plyr, "revenge_kingmen4", [],
    "It will not be me who starts this battle. I promise.", "revenge_kingmen5", []],
  [anyone|plyr, "revenge_kingmen4", [],
    "Sven Bull Neck did me much evil. I promise nothing.", "revenge_kingmen5", []],
  
  [anyone, "revenge_kingmen5", [
    ],
    "The king is a man who likes his wishes to be executed. Now we enter the farm. My men are hungry and thirsty.", "close_window", [
      (quest_set_slot,"qst_revenge_exchange",slot_quest_current_state, 4), #King no help
      #  (rest_for_hours, 32, 5, 0),
      (jump_to_menu, "mnu_farmstead_sigurd2"),
      (finish_mission),
  ]],
  ####
  ####leader harald in sea, sven attack the fleet quest the_fleet
  [anyone|plyr, "harald_meeting1", [],
    "I am especially interested in this meeting. I have long been waiting to hear from my mother.", "harald_meeting21", []],
  [anyone|plyr, "harald_meeting1", [],
    "(Say nothing)", "harald_meeting3", []],
  
  [anyone, "harald_meeting21", [
    ],
    "I think you may be wondering what our guest may have to say about this, but first we go to the most urgent matter.", "harald_meeting3", [
  ]],
  [anyone, "harald_meeting3", [
    ],
    "In Northhymbre, our Danish brothers have become strong. They control the kingdom through a puppet king. There are small uprisings of Angles, but these are localized and severely repressed. Nothing serious. " +
    "The latest news we have is that the sons of Ragnar have moved south and taken a place, known as Snotingaham, in Mierce. The king of Mierce has not taken this well. He has besieged them there with his army, supported by the king of West Seaxe. " +
    "We fear that the Ragnarssons may be in a hard place, so our mission is to go to Jorvik and join the forces that are gathering under Rathbarth, another of the sons of Ragnar, in support of his brothers. From there we will move south to meet the Angles and Saxons. " +
    "With a little luck, we will kill their kings and the road south will be opened for plunder. You will come back rich to your wife and kids this year.", "harald_meeting4", [
      (talk_info_show, 0),      ]],
  [anyone|other(trp_sea_raider_leader2), "harald_meeting4", [
    ], #
    "I hope so. I have too many mouths to feed!", "harald_meeting4_1",
    [
  ]],
  [anyone|other(trp_norse_level3_landed), "harald_meeting4_1", [
      (str_clear, s2),
    ], #
    "{s2}^^You should have thought of that before having three wives and twenty children!", "harald_meeting4_2",
    [
      (str_store_string, s2, "@--One of the captains laughs loudly.--", color_good_news),
  ]],
  
  [anyone|plyr, "harald_meeting4_2", [],
    "I'm sure that he has as many bastards among his servants!", "harald_meeting5_1", []],
  [anyone|plyr, "harald_meeting4_2", [],
    "The issue is serious. How many men do Mierce and West Seaxe have?", "harald_meeting5_2", []],
  [anyone|plyr, "harald_meeting4_2", [],
    "Sounds like a good plan, Harald. My men will go in the front!", "harald_meeting5_3", []],
  [anyone|plyr, "harald_meeting4_2", [],
    "I agree.", "harald_meeting5", []],
  
  [anyone|other(trp_sea_raider_leader2) ,"harald_meeting5_1", [
      (str_clear, s2),
    ],
    "{!}{s2}.", "harald_meeting5",
    [
      (store_skill_level, ":leadership", "skl_leadership", "trp_player"),
      (try_begin),
        (gt, ":leadership", 3),
        (str_store_string, s2, "@Hey, hey! Enough laughter at my expense! Let Harald continue with the important things!", color_good_news),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
        (call_script, "script_change_player_honor", 5),
      (else_try),
        (str_store_string, s2, "@You, ragr, insult my children again, and I will slice you open from neck to navel.", color_good_news),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (try_end),
  ]],
  
  [anyone, "harald_meeting5_2", [
    ],
    "That is hard to say. The information we have comes from merchants and travelers. They speak of thousands of men. It hardly matters, though. The Angles and the Saxons are weak people, fully domesticated by their kings. It will be like attacking housewives.", "harald_meeting5", [
  ]],
  [anyone|other(trp_norse_level3_landed), "harald_meeting5_3", [
      (str_clear, s2),
    ], #
    "{s2}^^Well, well. We have here an authentic toady. It seems there is always someone who is willing to stoop to any depth to gain favor with the boss.", "harald_meeting5_4",
    [
      (str_store_string, s2, "@--He looks at you with ill-concealed resentment and disgust.--", color_good_news),
  ]],
  [anyone, "harald_meeting5_4", [
    ],
    "I cannot stand sycophants, {playername}. Now let's move on to the serious stuff.", "harald_meeting5", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -20),
      (call_script, "script_change_troop_renown", "trp_player", -5),
  ]],
  
  [anyone, "harald_meeting5", [
      (str_clear, s2),
    ], #
    "{s2}^^Although everything is clear and our goal is near, it seems that problems with Sven Bull Neck don't stop cropping up. " +
    "This captain, Oleif, is now with us, and he has very serious news. Go ahead, Oleif.", "harald_meeting6",
    [
      (str_store_string, s2, "@--He spits overboard before fixing his gaze on one of Sven's captains who happens to be at your side.--", color_good_news),
  ]],
  
  [anyone|other(trp_port_crew), "harald_meeting6", [
      (str_clear, s2),
    ], #
    "{s2}^^I will not beat around the bush. Sven Bull Neck is unwilling to share command with Harald Haraldsson. At first opportunity, he will kill Harald and take the command. " +
    "It may occur as we land, though I cannot be sure. Maybe my desertion of his party will change his mind.", "harald_meeting7",
    [
      (str_store_string, s2, "@--He clears his throat and looks at you one by one.--", color_good_news),
  ]],
  [anyone, "harald_meeting7", [
    ],
    "I am making a guard rotation during the trip. When we land, I will challenge Sven to a duel to the death. Sven Bull Neck is a lunatic, but he's a dangerous lunatic.", "harald_meeting8", [
  ]],
  [anyone|other(trp_norse_level3_landed), "harald_meeting8", [
    ], #
    "Sounds good. You have my full support, even if you decide to attack his boat while he is still unprepared.", "harald_meeting8_1",
    [
  ]],
  [anyone|other(trp_sea_raider_leader2), "harald_meeting8_1", [
    ], #
    "You have my support too, Harald. That man, Sven, is very dangerous.", "harald_meeting9",
    [
  ]],
  [anyone|plyr, "harald_meeting9", [],
    "I've been waiting long enough! What about my mother?", "harald_meeting11", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  [anyone|plyr, "harald_meeting9", [],
    "You have my support, but I'd like to ask about my mother.", "harald_meeting11", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  [anyone|plyr, "harald_meeting9", [],
    "I think Sven Bull Neck would make a better commander of this fleet than you.", "harald_meeting10_3", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -50),
  ]],
  [anyone, "harald_meeting10_3", [
    ],
    "I see. May you be a slave to Sven Bull Neck like your mother. I despise you, {playername}, and you give me shame, but the Assembly forced us to work together. I will tell you as you have not heard.", "harald_meeting11", [
  ]],
  
  [anyone|other(trp_port_crew), "harald_meeting11", [
    ], #
    "A woman travels with Sven Bull Neck. She is his seidr, one who accepts the spirit of the crow and speaks the words of Odin. Everybody reveres her, as she is a woman touched by the gods. " +
    "Sven Bull Neck has married her in hopes of having a child touched by the gods, but she is old and her belly is dry. If she's your mother, I do not think she remembers you, as she has a curse that does not allow her to keep memories overnight.", "harald_meeting12",
    [
      (str_store_string, s2, "@Note: Your mother is now the wife and seidr of Sven Bull Neck. It seems her disease has reached the point at which she does not remember anything from the days before."),
      (add_quest_note_from_sreg, "qst_notes_global", 7, s2, 0),
  ]],
  [anyone, "harald_meeting12", [
    ],
    "It looks like your mother now serves Sven Bull Neck. I hope you're prepared to deal with this when things get ugly.", "harald_meeting13", [
  ]],
  [anyone|plyr, "harald_meeting13", [],
    "I...", "harald_meeting13_1", [
  ]],
  [anyone|other(trp_norse_level0_companion), "harald_meeting13_1", [
    ], #
    "--All around you, the sudden tumult and shouting of men drowns out your answer. A warrior bursts into the meeting. He is hot, and his eyes show panic.--", "harald_meeting13_2",
    [
  ]],
  [anyone|other(trp_norse_level0_companion), "harald_meeting13_2", [
    ], #
    "Hersir Harald, sir! Sven Bull Neck has attacked us! Half the fleet is charging us! Thor help us, Sven has caught us unprepared.", "harald_meeting13_3",
    [
  ]],
  [anyone, "harald_meeting13_3", [
      (str_clear, s3),
    ], #
    "{s3}^^Captains, return to your ships and lead your crew. Sven Bull Neck will pay dearly for this attack. If we should lose this battle, remember to inform Rathbarth Ragnarsson about this betrayal by Sven Bull Neck. " +
    "Good luck. Now, to battle!", "close_window",
    [
      (str_store_string, s3, "@--Harald remains calm, like a man accustomed to action, and begins to give orders.--", color_good_news),
      (str_store_troop_name, s9, "$g_talk_troop"),
      (str_store_troop_name_link, s11, "trp_knight_8_2"),
      (str_store_string, s2, "@Sven Bull Neck attacked the part of the fleet led by Harald Haraldsson, killing {s9} and many of his fleet's men. {s9}'s last order was to inform {s11} about the betrayal of Sven Bull Neck. Find and talk to {s11} before Sven or any of his men do it, for giving the first report will give you more credibility."),
      (call_script, "script_start_quest", "qst_sven_traitor", "$g_talk_troop"),
      (quest_set_slot,"qst_sven_traitor",slot_quest_current_state, 1),
      (quest_set_slot,"qst_the_fleet",slot_quest_current_state, 5),
  ]],
  ###
  ####veteran of aelfred o halfdan mainquest chief final
  [trp_leader_playerrf, "start", [  (check_quest_active,"qst_svenbn_final"),
      (quest_slot_eq,"qst_svenbn_final",slot_quest_current_state, 1),
      
    ],
    "{playername}! My lord advised me that you'd come. Sven Bull Neck has taken Readingum and has many men with him, mainly Danish, who have sworn allegiance. " +
    "They are tough, battle-hardened people, same as Sven, who is a legend. I would not like to be in the shoes of you or your men.", "svenfinal_ld1", [
  ]],
  [anyone|plyr, "svenfinal_ld1", [],
    "I am not afraid. It is the time of reckoning.", "svenfinal_ld11", []],
  [anyone|plyr, "svenfinal_ld1", [],
    "Do you know if a woman is with him?", "svenfinal_ld2", []],
  [anyone|plyr, "svenfinal_ld1", [],
    "Will you not stay and fight with us?", "svenfinal_ld3", []],
  
  [anyone, "svenfinal_ld2", [
    ],
    "You mean your mother, the seidr, right? Yes, she is with them. We saw her when she entered Readingum with Sven Bull Neck. I do not know how she was before, but now she is very gaunt and thin. I do not think she has long to live.", "svenfinal_ld11", [
  ]],
  [anyone, "svenfinal_ld3", [
    ],
    "I'm afraid not. My duties call me elsewhere. My role here was to make sure Sven Bull Neck would be here when you arrived. Apparently, my lord promised you this. He never breaks his word.", "svenfinal_ld11", [
  ]],
  
  [anyone, "svenfinal_ld11", [
    ],
    "Well, from what I've heard, you also are someone dangerous. I will leave the half a hundred men I promised my lord I would. They are brave warriors who have been promised a lot of gold to help you, so fight well. Farewell, {playername}, and good luck!", "close_window", [
      
      (call_script, "script_change_troop_renown", "trp_player", 150),
      (quest_set_slot,"qst_svenbn_final",slot_quest_current_state, 2),
      (try_begin),
        (eq, "$player_side", 1), #West Seaxe
        (party_add_members,"p_main_party","trp_saxon_level2_landed",20),
        (party_add_members,"p_main_party","trp_saxon_level1_companion",20),
        (party_add_members,"p_main_party","trp_saxon_level2_companion",10),
      (else_try),
        (eq, "$player_side", 2), #Danish
        (party_add_members,"p_main_party","trp_norse_level2_landed",20),
        (party_add_members,"p_main_party","trp_norse_level1_companion",20),
        (party_add_members,"p_main_party","trp_norse_level2_companion",10),
      (try_end),
  ]],
  
  ####viking leader in sven fort chief
  [trp_elite_viking,"start", [(store_current_scene,":current_scene"),(eq,":current_scene","scn_sven_lair_player_exterior"),(check_quest_active,"qst_sven_lair"),], "I do not have time for you. Farewell.", "close_window",[]],
  [trp_taiga_bandit,"start", [(store_current_scene,":current_scene"),(eq,":current_scene","scn_sven_lair_player_exterior"),(check_quest_active,"qst_sven_lair"),], "I do not have time for you. Farewell.", "close_window",[]],
  
  [anyone|plyr, "svenlair_1", [],
    "I'm {playername}. I hear you have prisoners for sale.", "svenlair_2", []],
  [anyone|plyr, "svenlair_1", [],
    "I'm {playername}, but that's irrelevant, fool, because now we're going to kill you all!", "close_window", [
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 4),
      (call_script, "script_change_troop_renown", "trp_player", 3),
      (jump_to_menu, "mnu_sven_lair"),
      (finish_mission),
  ]],
  [anyone|plyr, "svenlair_1", [],
    "Goodness! I am lost! My apologies, I am leaving now.", "svenlair_3", [
  ]],
  
  [anyone, "svenlair_3", [#mainquest chief
    ],
    "Get out of here, trash! Never show your ugly face again, or you will pay dearly!", "close_window", [
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 4),
      (call_script, "script_change_troop_renown", "trp_player", -3),
      (jump_to_menu, "mnu_sven_lair"),
      (finish_mission),
  ]],
  
  
  [anyone, "svenlair_2", [#mainquest chief
    ],
    "Yet another slave merchant? I see. Well, I have a few slaves left.", "svenlair_21", [
  ]],
  
  [anyone|plyr, "svenlair_21", [(neg|main_party_has_troop,"trp_npc3")],
    "I would like to see these slaves.", "svenlair_42", [
  ]],
  
  [anyone|other(trp_npc3), "svenlair_21", [
      #(eq|main_party_has_troop,"trp_npc3"),
    ], #angry
    "{playername}, to pay these men is to encourage them to keep attacking and enslaving people. We should make them pay dearly for the damage they do to people, not reward them for it!", "svenlair_41",
    [
      ##  		  (start_mission_conversation, "trp_npc3"),
      ##                      (store_conversation_agent, "$g_talk_agent"),
      ##		(set_conversation_speaker_agent, "$g_talk_agent"),
      ##               (store_conversation_troop, "trp_npc3"), #3 person conversation
      ##		(set_conversation_speaker_troop, "trp_npc3"),
  ]],
  
  [anyone|plyr, "svenlair_21", [(neg|main_party_has_troop,"trp_npc3")],
    "I would like to see these slaves.", "svenlair_42", [
  ]],
  
  [anyone|plyr, "svenlair_41", [],
    "Keep your mouth shut! I would like to see these slaves.", "svenlair_42", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", -10),
  ]],
  [anyone|plyr, "svenlair_41", [],
    "You are right. We're going to kill you all!", "close_window", [
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 4),
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", 6),
      (jump_to_menu, "mnu_sven_lair"),
      (finish_mission),
  ]],
  
  
  [anyone, "svenlair_42", [#mainquest chief
    ],
    "Well, I have three slaves. They're inside, down by the river. Go ahead and look at them, then come back to me to talk about buying them.", "svenlair_43", [
  ]],
  
  [anyone|plyr, "svenlair_43", [],
    "Sounds good! I'll look over the merchandise, and then we will talk money.", "close_window", [
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 3),
      (call_script, "script_change_player_honor", -1),
      (finish_mission),
      #        (assign, "$g_leave_encounter",1),
  ]],
  #compra esclavos
  [anyone|plyr, "sven_comprapr", [(store_troop_gold,":money","trp_player"),(ge,":money",900),],
    "I understand. I'll take the three prisoners. Take your peningas. (900 peningas)", "sven_comprapr_todo", [
      (call_script, "script_change_player_honor", 4),
      (troop_remove_gold,"trp_player",900),
  ]],
  #trade
  [anyone|plyr, "sven_comprapr", [	(store_troop_gold,":money","trp_player"),(store_skill_level, ":trade", "skl_trade", "trp_player"),
      (ge,":trade",3),(ge,":money",300),],
    "Look at them! Your men have starved and raped them. I'll pay 300 coin for the lot. (Trade)", "sven_comprapr_trade", [
      (add_xp_as_reward,100), (troop_remove_gold,"trp_player",300),
  ]],
  
  [anyone|plyr, "sven_comprapr", [	(store_skill_level, ":trade", "skl_trade", "trp_player"),
      (ge,":trade",8),],
    "They're in bad shape. Give them to me, and you won't have to feed them any more, deal? (Trade)", "sven_comprapr_trade", [
      (add_xp_as_reward,100),      ]],
  
  
  [anyone|plyr, "sven_comprapr", [],
    "I don't have that kind of money. Farewell.", "close_window", [
      (jump_to_menu, "mnu_sven_lair"),
      (finish_mission),
  ]],
  [anyone|plyr, "sven_comprapr", [],
    "I've thought about it and I am not buying them. I'm leaving.", "close_window", [
      (jump_to_menu, "mnu_sven_lair"),
      (finish_mission),
  ]],
  [anyone|plyr, "sven_comprapr", [],
    "I need more time. Let me look at them again.", "close_window", []],
  
  [anyone, "sven_comprapr_todo", [#mainquest chief
    ],
    "Deal! The merchandise is yours. A good visit!", "close_window", [
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 4),
      (jump_to_menu, "mnu_sven_lair_comprado"),
      (finish_mission),
  ]],
  
  #paga con skill trade
  [anyone, "sven_comprapr_trade", [#mainquest chief
    ],
    "I see, I see. Well, I suppose you're right. The merchandise is yours. Take the stinkers away. Far thu vel.", "close_window", [
      (quest_set_slot,"qst_sven_lair",slot_quest_current_state, 4),
      (jump_to_menu, "mnu_sven_lair_comprado"),
      (finish_mission),
  ]],
  
  
  ###chief sven lair acaba
  ##para monjes chief monasterio
  #quest juicio en monasterio, mainquest
  [trp_farmer, "start", [ #mainquest chief
      (check_quest_active, "qst_kennemer_mission_1"),
      (quest_slot_eq,"qst_kennemer_mission_1",slot_quest_current_state,2),
      
      (eq, "$g_encountered_party", "p_monasterio2"),
    ],
    "Greetings, {reg59?madame:sir}. Thank you for your help.", "problema_farmer_1", []],
  
  [anyone|plyr, "problema_farmer_1", [(eq, "$sabe_leer", 1),],
    "I read the document. It seems too new. I want to know the truth.", "problema_farmer_21", []],
  
  [anyone|plyr, "problema_farmer_1", [],
    "I'd like to listen to your story.", "problema_farmer_23", []],
  
  [anyone|plyr, "problema_farmer_1", [],
    "I want your version, but remember that I will kill the person who lies here.", "problema_farmer_24", []],
  
  [anyone|plyr, "problema_farmer_1", [],
    "I don't have any more questions.", "close_window", []],
  
  
  [anyone ,"problema_farmer_21", [
      (str_clear, s2),
    ],
    "{s2}^^I know nothing! I inherited the land of my ancestors. I don't have documents to prove it because it has never been necessary to prove that it was mine.", "problema_farmer_3",
    [
      (str_store_string, s2, "@--The farmer lowers his head and looks at his foot. His voice denotes sadness.--", color_good_news),
  ]],
  
  [anyone ,"problema_farmer_23", [],
    "I know nothing! I inherited the land of my ancestors. I don't have documents to prove it because it has never been necessary to prove that it was mine.", "problema_farmer_3",
    [
  ]],
  
  [anyone ,"problema_farmer_24", [
      (str_clear, s3),
      (str_clear, s4),
      (str_clear, s2),
    ],
    "{!}{s2}", "problema_farmer_1",
    [
      (store_skill_level, ":power_strike", "skl_power_strike", "trp_player"),
      (try_begin),
        (gt, ":power_strike", 3),
        (str_store_string, s3, "@--The farmer is trembling with fear.--", color_good_news),
        (str_store_string, s4, "@My {reg59?lady:lord}! Do not kill me! I will give the land to the monks if necessary, but spare my life."),
        (str_store_string, s2, "@{s3}^^{s4}"),
      (else_try),
        (str_store_string, s2, "@You threaten me? Look, my {reg59?lady:lord}, I just don't want more trouble than I already have."),
      (try_end),
  ]],
  
  [anyone|plyr, "problema_farmer_3", [(eq, "$sabe_leer", 1),],
    "Are you a liar?", "problema_farmer_32", []],
  
  [anyone|plyr, "problema_farmer_3", [],
    "I think you are lying to me.", "problema_farmer_31", []],
  
  [anyone|plyr, "problema_farmer_3", [],
    "I see. I understand.", "close_window", []],
  
  [anyone ,"problema_farmer_31", [
      (str_clear, s3),
      (str_clear, s4),
      (str_clear, s2),
    ],
    "{!}{s2}", "problema_farmer_1",
    [
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (try_begin),
        (gt, ":persuasion", 3),
        (str_store_string, s3, "@--The farmer looks into your eyes. You see that he is crying.--", color_good_news),
        (str_store_string, s4, "@I know I cannot do anything! I'll lose my land like others here. The monastery wants more land, and now I see that the jarl supports them. I'm tired of fighting them."),
        (str_store_string, s2, "@{s3}^^{s4}"),
      (else_try),
        (str_store_string, s2, "@I'm not a liar, my {reg59?lady:lord}!"),
      (try_end),
  ]],
  
  [anyone ,"problema_farmer_32", [
      (str_clear, s3),
      (str_clear, s4),
      (str_clear, s2),
    ],
    "{!}{s2}", "problema_farmer_1",
    [
      (str_store_string, s3, "@--The farmer looks into your eyes. You see that he is crying.--", color_good_news),
      (str_store_string, s4, "@I know I cannot do anything! I'll lose my land like others here. The monastery wants more land, and now I see that the jarl supports them. I'm tired of fighting them."),
      (str_store_string, s2, "@{s3}^^{s4}"),
  ]],
  ###
  [trp_monjes, "start", [ #mainquest chief
      (check_quest_active, "qst_kennemer_mission_1"),
      (quest_slot_eq,"qst_kennemer_mission_1",slot_quest_current_state,2),
      
      (eq, "$g_encountered_party", "p_monasterio2"),
    ],
    "God bless you. I am the monk who found the document.", "problema_monjes_1", []],
  
  [anyone ,"problema_monjes_n1", [],
    "God bless you.", "problema_monjes_1",
    [
  ]],
  
  [anyone|plyr, "problema_monjes_1", [(eq, "$sabe_leer", 1),],
    "I read the document. Everything seems to be right, but it is too well preserved.", "problema_monjes_21", []],
  
  [anyone|plyr,"problema_monjes_1", [
      (try_begin),
        (eq, "$defect_type", cb6_prudence),
        (str_store_string, s10, "@There is something strange with this document, don't you think? (Prudence)"),
      (else_try),
        (eq, "$defect_type", cb6_fortitude),
        (str_store_string, s10, "@These lands are important to you, but without them, his family will starve. (Fortitude)"),
      (else_try),
        (eq, "$defect_type", cb6_temperance),
        (str_store_string, s10, "@Well, what more could you tell me about this document? (Temperance)"),
      (else_try),
        (eq, "$defect_type", cb6_justice),
        (str_store_string, s10, "@You are a monk, a man dedicated to God. I trust what you say about this document. (Justice)"),
      (try_end),
    ],
    "{!}{s10}", "problema_monjes_22",[
      (str_clear, s10),
  ]],
  
  [anyone|plyr, "problema_monjes_1", [],
    "I would like to listen to your story.", "problema_monjes_23", []],
  
  [anyone|plyr, "problema_monjes_1", [],
    "I want your version, but remember that I will kill the person who lies here.", "problema_monjes_24", []],
  
  
  [anyone|plyr, "problema_monjes_1", [],
    "I don't have any more questions.", "close_window", []],
  
  
  [anyone ,"problema_monjes_21", [       (str_clear, s2),
    ],
    "{s2}^^I'm just a scribe in the monastery! I copy the ancient Roman texts. While looking for an old useless parchment to scrape and prepare for another document, I found this.", "problema_monjes_3",
    [
      (str_store_string, s2, "@--You watch him rub his hands and dodge your look.--", color_good_news),
  ]],
  
  [anyone,"problema_monjes_22", [
      (str_clear, s2),
    ],
    "{!}{s2}", "problema_monjes_3",[
      (try_begin),
        (eq, "$defect_type", cb6_prudence),
        (str_store_string, s2, "@I don't know. It looks correct to me, {reg59?lady:sir}"),
      (else_try),
        (eq, "$defect_type", cb6_fortitude),
        (str_store_string, s2, "@Our monastery needs lands for prosperity. We can't move our monastery, but this farmer can try his luck somewhere else, {reg59?lady:sir}."),
      (else_try),
        (eq, "$defect_type", cb6_temperance),
        (str_store_string, s2, "@I'm just a scribe in the monastery! I copy the ancient Roman texts. While looking for an old useless parchment to scrape and prepare for another document, I found this."),
      (else_try),
        (eq, "$defect_type", cb6_justice),
        (str_store_string, s2, "@Err... well... My, I don't have answer for this."),
      (try_end),
  ]],
  
  [anyone ,"problema_monjes_23", [],
    "I'm just a scribe in the monastery! I copy the ancient Roman texts. While looking for an old useless parchment to scrape and prepare for another document, I found this.", "problema_monjes_1",
    [
  ]],
  
  [anyone ,"problema_monjes_24", [
      (str_clear, s3),
      (str_clear, s4),
      (str_clear, s2),
    ],
    "{!}{s2}", "problema_monjes_1",
    [
      (store_skill_level, ":power_strike", "skl_power_strike", "trp_player"),
      (try_begin),
        (gt, ":power_strike", 3),
        (str_store_string, s3, "@--The monk is trembling with fear.--", color_good_news),
        (str_store_string, s4, "@My God, {reg59?lady:sir}! Do not kill me! The abbot forced me to falsify the property deed. He wants this land, but please do not say anything."),
        (str_store_string, s2, "@{s3}^^{s4}"),
      (else_try),
        (str_store_string, s2, "@You would threaten a holy man? For shame!"),
      (try_end),
  ]],
  
  [anyone|plyr, "problema_monjes_3", [(eq, "$sabe_leer", 1),],
    "You are a liar! This document is false! We don't have to talk more. Farewell, bastard.", "close_window", []],
  
  [anyone|plyr, "problema_monjes_3", [],
    "I think you are lying to me.", "problema_monjes_31", []],
  
  [anyone|plyr, "problema_monjes_3", [],
    "Ok. I understand.", "problema_monjes_n1", []],
  
  [anyone ,"problema_monjes_31", [
      (str_clear, s3),
      (str_clear, s4),
      (str_clear, s2),
    ],
    "{!}{s2}", "problema_monjes_1",
    [
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (try_begin),
        (gt, ":persuasion", 3),
        (str_store_string, s3, "@--The monk lowers his head, cowering.--", color_good_news),
        (str_store_string, s4, "@I'll go to hell for perjury! The abbot forced me to falsify the property deed. He wants this land, but please do not say anything."),
        (str_store_string, s2, "@{s2}^^{s3}"),
      (else_try),
        (str_store_string, s2, "@I'm not a liar, {reg59?lady:sir}. The document is correct."),
      (try_end),
  ]],
  
  ###
  [trp_monjes,"start", [],
    "I am busy, talk to the Abbot.", "monjes_2",[]],
  
  [anyone|plyr,"monjes_2",[], "Very well, my good man. Farewell.", "close_window",[]],
  
  [trp_monk_walker,"start", [],
    "I am busy, talk to the Abbot.", "monjesw_2",[]],
  
  [anyone|plyr,"monjesw_2",[], "Very well, my good man. Farewell.", "close_window",[]],
  #estandartes, clerigos en pary y mujerzuelas anadido dialogo
  ###sacerdotes followers party
  [anyone|plyr,"regular_member_talk", [(eq,"$followers_on",1), #on
      (this_or_next|eq,"$g_talk_troop","trp_norse_priest"),
      (this_or_next|eq,"$g_talk_troop","trp_briton_priest"),
      (this_or_next|eq,"$g_talk_troop","trp_saxon_priest"),
      (this_or_next|eq,"$g_talk_troop","trp_scotch_priest"),
      (this_or_next|eq,"$g_talk_troop","trp_angle_priest"),
      (eq,"$g_talk_troop","trp_irish_priest"),
    ],
    "I've decided that you join our followers' party.", "followers_action",[
  ]],
  #mujeres en party para mover to Followers camp chief
  [anyone|plyr,"regular_member_talk", [(eq,"$followers_on",1), #on
      (is_between,"$g_talk_troop","trp_follower_woman","trp_refugeeromanruins"),],
    "I've decided that you join our followers' party.", "followers_action",[
  ]],
  [anyone, "followers_action", [],
    "Very well, I will support you from the rear.", "close_window",[
      (party_remove_members,"p_main_party","$g_talk_troop",1),
      (party_add_members, "p_followers_camp", "$g_talk_troop", 1),
  ]],
  
  #sacerdotes
  [anyone|plyr,"regular_member_talk", [
      (this_or_next|eq,"$g_talk_troop","trp_briton_priest"),
      (this_or_next|eq,"$g_talk_troop","trp_saxon_priest"),
      (this_or_next|eq,"$g_talk_troop","trp_scotch_priest"),
      (this_or_next|eq,"$g_talk_troop","trp_angle_priest"),
      (eq,"$g_talk_troop","trp_irish_priest"),
      (store_troop_gold,":money","trp_player"),
      (gt,":money",499),
    ],
    "Pater, I will donate 500 peningas to aid the families of my fallen men.", "briton_action",[]],
  
  [anyone, "briton_action", [],
    "Ego absolvo te a peccatis tuis, in nomine Patris et Filii et Spiritus Sanctii. Amen. Your men will feel better now.", "regular_member_talk",[
      (troop_remove_gold,"trp_player", 500),
      (try_begin),
        (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0),
        (call_script, "script_change_player_party_morale", 3),
        (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 1),
      (else_try),
        (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,1),
        (call_script, "script_change_player_party_morale", 2),
        (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 1),
      (else_try),
        (troop_slot_ge,"$g_talk_troop",slot_troop_days_on_mission,2),
        (display_message, "@Your men are getting tired of listening to the same old sermons. Perhaps it's time to let it go for a while.", color_bad_news),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
      (troop_set_slot,"$g_talk_troop",slot_troop_days_on_mission,3),
  ]],
  
  [anyone|plyr,"regular_member_talk", [
      (eq,"$g_talk_troop","trp_norse_priest"),
      (store_troop_gold,":money","trp_player"),
      (gt,":money",499),], "Priest, my men need Odin. I will donate 500 peningas to you for your aid in this matter.", "anglo1_action",[]],
  
  [anyone, "anglo1_action", [],
    "I will talk to your men about Odin, relentless Thor, and Freyja, the hope of the slain. It will encourage them to fight proudly by your side, to earn their seats at Walhalla or Folkvangr.", "regular_member_talk",[
      (troop_remove_gold,"trp_player", 500),
      (try_begin),
        (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0),
        (call_script, "script_change_player_party_morale", 3),
        (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 1),
      (else_try),
        (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,1),
        (call_script, "script_change_player_party_morale", 2),
        (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 1),
      (else_try),
        (troop_slot_ge,"$g_talk_troop",slot_troop_days_on_mission,2),
        (display_message, "@Your men are getting tired of listening to the same old stories about the gods. Perhaps it's time to let it go for a while.", color_bad_news),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
      (troop_set_slot,"$g_talk_troop",slot_troop_days_on_mission,3),
  ]],
  #sacerdotes en partida acaba
  #Tropas que dan corage empieza
  [trp_briton_standard_bearer|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_briton_standard_bearer, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - We are very useful. " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  [trp_saxon_standard_bearer|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_saxon_standard_bearer, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - We are very useful. " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  [trp_scotch_standard_bearer|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_scotch_standard_bearer, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - We are very useful. " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  [trp_angle_standard_bearer|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_angle_standard_bearer, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - We are very useful. " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  [trp_irish_standard_bearer|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_irish_standard_bearer, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - We are very useful. " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  [trp_norse_standard_bearer|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_norse_standard_bearer, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - We are very useful. " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  
  [trp_norse_priest|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_norse_priest, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - We are very useful. " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  [trp_briton_priest|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_briton_priest, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - We are very useful. " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  [trp_saxon_priest|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_saxon_priest, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - We are very useful. " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  [trp_scotch_priest|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_scotch_priest, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - We are very useful. " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  [trp_irish_priest|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_irish_priest, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - We are very useful. " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  [trp_angle_priest|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_angle_priest, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - We are very useful. " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  
  [trp_scotch_musician|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_scotch_musician, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  [trp_todos_cuerno|plyr, "regular_member_talk", [],
    "Heill, what can you do in battle?", "porta_presentacion",[]],
  [trp_todos_cuerno, "porta_presentacion", [], "Me? - He approaches and whispers in your ear. - We are very useful. " +
    "I am important for you. When your men see me in battle, they will gain courage. If things go wrong, they will fight longer before fear seizes them.", "regular_member_talk", []],
  ###dialogos tropas basicas esposas chief
  [trp_fighter_woman|plyr, "regular_member_talk", [],
    "Heill, what can you do for my men?", "porta1_presentacion",[]],
  [trp_fighter_woman, "porta1_presentacion", [], "Me? " +
    "I am important to you. I am the wife of one of your soldiers. If you have wives (30) in your party, your men will gain morale (every 48 hours).", "regular_member_talk", []],
  [trp_sword_sister|plyr, "regular_member_talk", [],
    "Heill, what can you do for my men?", "porta1_presentacion",[]],
  [trp_sword_sister, "porta1_presentacion", [], "Me? " +
    "I am important to you. I am the wife of one of your soldiers. If you have wives (30) in your party, your men will gain morale (every 48 hours).", "regular_member_talk", []],
  
  #tropas que dan corage acaban
  
  #quastuosas de campamento
  [trp_follower_woman|plyr,"regular_member_talk", [(store_troop_gold,":money","trp_player"), (gt,":money",449), (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0),],
    "I need you help me to raise the morale of my men. I pay 450 peningas for your efforts.", "follower_woman_action",[]],
  
  [trp_follower_woman, "follower_woman_action", [],
    "Men? Oh... well, it is important to help.", "regular_member_talk",[
      (troop_remove_gold, "trp_player", 450),
      (call_script, "script_change_player_party_morale", 3),
      (troop_set_slot,"$g_talk_troop",slot_troop_days_on_mission,3),
  ]],
  #quastuosas acaba parties
  
  #partys de sacerdotes y paganos encuentros chief religion
  [party_tpl|pt_sacerdotes_party,"start", [(eq,"$talk_context",tc_party_encounter)],
    " My {reg59?lady:lord}, we're only poor clerics trying to bring some light to the people of this land.", "sacerdotes_party_talk",
    [(play_sound,"snd_encounter_farmers")]],
  
  [party_tpl|pt_sacerdotes_party|plyr,"sacerdotes_party_talk",
    [(eq, "$g_player_faith", 2),],
    "Christian cleric, eh? It's time to reunite you with your Creator!", "close_window",
    [
      (call_script, "script_change_troop_renown", "trp_player", 1),
      (call_script, "script_change_player_party_morale", -2),
      (call_script, "script_change_player_relation_with_faction", "fac_christians", -5), #la q designemos
      (call_script, "script_change_player_honor", -3),
      
      (call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
      #(call_script, "script_set_player_relation_with_faction", "$g_encountered_party_faction", -10),
      
      (assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),
      
  ]],
  
  
  [party_tpl|pt_sacerdotes_party|plyr,"sacerdotes_party_talk", [],
    "Pater, I will donate 500 peningas to the families of my fallen men for your aid.", "sacerdote_pary_action",[
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",499),
        (troop_remove_gold, "trp_player", 500),
        (call_script, "script_change_player_party_morale", 2), #1 could do non usable this
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  
  [party_tpl|pt_sacerdotes_party, "sacerdote_pary_action", [],
    "Ego absolvo te a peccatis tuis, in nomine Patris et Filii et Spiritus Sanctii. Amen. Your men will feel better now.", "sacerdotes_party_talk",[]],
  
  
  [party_tpl|pt_sacerdotes_party|plyr,"sacerdotes_party_talk", [], "And I'm only a poor hero on an important mission. Farewell.", "sacerdotes_party_talkle",[]],
  [party_tpl|pt_sacerdotes_party,"sacerdotes_party_talkle", [], "Thank you. Farewell.", "close_window",[(assign, "$g_leave_encounter",1)]],
  #  [anyone|plyr,"sacerdotes_party_talk", [], "Important mission.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  #gaganos religion
  [party_tpl|pt_paganos_party,"start", [(eq,"$talk_context",tc_party_encounter)],
    "Odin is our God! He guides our way. Warrior, what do you need?", "paganos_party_talk",
    [(play_sound,"snd_encounter_farmers")]],
  
  [party_tpl|pt_paganos_party|plyr,"paganos_party_talk",
    [(eq, "$g_player_faith", 1),],
    "Pagan priest? You are scum of the false gods. Die!", "close_window",
    [
      (call_script, "script_change_troop_renown", "trp_player", 1),
      (call_script, "script_change_player_party_morale", -2),
      (call_script, "script_change_player_relation_with_faction", "fac_pagans", -5), #la q designemos
      (call_script, "script_change_player_honor", -3),
      
      (call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
      #(call_script, "script_set_player_relation_with_faction", "$g_encountered_party_faction", -10),
      
      (assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),
      
      
  ]],
  
  
  [party_tpl|pt_paganos_party|plyr,"paganos_party_talk", [],
    "Priest, my men need Odin. I will donate 500 peningas to for your aid in this matter.", "paganos_party_action",[
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",499),
        (troop_remove_gold, "trp_player", 500),
        (call_script, "script_change_player_party_morale", 2), #same here
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  
  [party_tpl|pt_paganos_party, "paganos_party_action", [],
    "I will talk to your men about Odin and his son Thor. That will encourage them to fight proudly by your side, to earn their seats at Walhalla.", "paganos_party_talk",[]],
  
  [party_tpl|pt_paganos_party|plyr,"paganos_party_talk", [], "I need to complete an important mission. Pass on.", "paganos_party_talkle",[]],
  [party_tpl|pt_paganos_party,"paganos_party_talkle", [], "Thank you. Farewell.", "close_window",[(assign, "$g_leave_encounter",1)]],
  #partys paganos y sacerdotes acaba
  #chief dialogo con Cundwalh Coenwalhing sobre tacticas
  [trp_knight_5_3|plyr,"lord_talk", [],
    "I heard that you are a famous strategist.", "Cundwalh_historia",[]],
  
  
  ###followers camp priest
  [trp_saxon_priest,"start", [
      #  (eq, "$talk_context", tc_camp),
    ],
    "Yes?", "sacerdote1_action",[
  ]],
  
  [trp_norse_priest|auto_proceed,"start", [
      ], "{!}Warning: This line should never be displayed.", "pagano1_start",[
      (str_store_string, s11, "@Allt veit ek, Odinn, hvar thu auga falt: i inum maera Mimis brunni...^^ Err... sorry.^^ Yes?"),
      (str_store_string, s12, "@Many men prefer Thor to Odin, but I prefer Loki, he is the smartest of all the gods, but please don't tell anyone."),
      (str_store_string, s13, "@Glad and Gyllir, Gler and Skeidbrimir, Sillfrintopp and Sinir, Gisl and Falhofnir, Gulltopp and Lettfeti. On these horses, the Aesir ride every day, when they go to court at the ashes of Yggdrasil."),
      (store_random_in_range, ":random", 11, 14),
      (str_store_string_reg, s4, ":random"),
  ]],
  [anyone,"pagano1_start", [], "{!}{s4}", "pagano1_action",[]],
  
  ##  [trp_norse_priest,"start", [
  ## # (eq, "$talk_context", tc_camp),
  ##  ],
  ##   "Yes?", "pagano1_action",[
  ##]],
  
  
  [anyone, "Cundwalh_historia", [],
    "That's right! Thanks to God, I am the best commander in Europe. My name has been long known and famous in all of Englaland, dog. I am a champion of West Seaxe. I have single-handedly killed twenty men in the chaos of war, and I have won over twenty battles since I started leading shield walls.", "Cundwalh_historial",[]],
  [anyone, "Cundwalh_historial", [],
    "I've never, ever, suffered a defeat. " +
    "You wish to learn from me, right? Then be good and listen to my words carefully tonight, or I will send one of my men to cut your throat with his seax.", "Cundwalh_talk1",[]],
  
  [anyone|plyr, "Cundwalh_talk1", [],
    "Yes, I'm interested.", "Cundwalh_historia1", []],
  [anyone|plyr, "Cundwalh_talk1", [],
    "No thanks. I have other matters to attend to.", "lord_pretalk", []],
  
  [anyone, "Cundwalh_historia1", [],
    "I have good men, my beadupreat. They are ugly, stupid and cowardly, but they obey orders well. The first thing you need is men that obey orders without thinking too much.", "Cundwalh_historia2", []],
  [anyone, "Cundwalh_historia2", [],
    "Then, you must teach them to advance in column. When they march this way, you travel the countryside without losing anybody. In battle, you must teach them to form ranks (by pressing F4 and F4) or squares (by pressing F4 and F7). It is easy to implement formations if you have a handy stick to beat the clumsy animal who may be unable to fit in properly.", "Cundwalh_historia21", []],
  [anyone, "Cundwalh_historia21", [],
    "It is important that you know how to motivate your troops in battle. You can shout your barbaric war cry or bang your shields (by pressing the key T for your trait), which will undoubtedly scare away enemies surrounding you. You can always order your men to break the current formation (by pressing F4 and F8) so that they can properly charge into the enemy's lines.", "Cundwalh_historia3", []],
  [anyone|plyr,"Cundwalh_historia3", [],
    "Mm, I see. Please continue.", "Cundwalh_historia4",[]],
  [anyone|plyr, "Cundwalh_historia3", [],
    "Stop. I don't need to hear more. Wes gesund.", "lord_pretalk", [
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -3),
  ]],
  
  [anyone,"Cundwalh_historia4", [],
    "Anyway, in my opinion ranks are crap better left to the dirty Welsh. If you really want to win a battle, pay attention! You must use Scildweall (by pressing F4 and F5) with your men. We learned this tactic from the Romans, and a shield wall is a very cohesive tactic for our land. " +
    "This formation is great, a true battle winner, and you should learn it well, dog. Scildweall will allow you to win your battles, fighting shoulder to shoulder with your men. You need to train it until you have sore knees and hands calloused by the use of the spear and shield. Get off your horse if you have one, and join " +
    "your men, leading by example. When the enemy is broken and is fleeing, call your horse if it is still alive (by pressing the H key), mount it and charge the cowards, killing as many as you can to instill fear in your future enemies. You can also try to use the Wecg formation (by pressing F4 and F6) which will bring your men " +
    "into forming a wedge shaped fighting body.", "Cundwalh_historia41", []],
  [anyone, "Cundwalh_historia41", [],
    "Hear me. This formation is difficult to master, so you should use it only with veteran troops. It is designed to break an enemy's Scildweall, but when you use it, you must know that you are playing for all or nothing. It is a risky bet, for, if you fail, your enemies will earn your flank and kill your men as if they were nothing more than dry grass. My personal advice is to use Scildweall against Scildweall, always. No need to take risks, I say. " +
    "That is all, dog. Learn soon, and quickly, because if one day we are in the battlefield as enemies, I will kill you. " +
    "Wes gesund.", "Cundwalh_historia5", []],
  [anyone|plyr, "Cundwalh_historia5", [],
    "Thank you, Lord. I have learned so much.", "lord_pretalk", []],
  [anyone|plyr, "Cundwalh_historia5", [],
    "Bah, someday I'll kill you. Farewell.", "lord_pretalk", [
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -10),
  ]],
  #chief acaba knight_9_9 ensenar tacticas de guerra chief
  
  
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_incriminate_loyal_commander"),
      (check_quest_succeeded, "qst_incriminate_loyal_commander"),
      (quest_get_slot, ":quest_target_troop", "qst_incriminate_loyal_commander", slot_quest_target_troop),
      (str_store_troop_name, s3, ":quest_target_troop"),
      (quest_get_slot, reg5, "qst_incriminate_loyal_commander", slot_quest_gold_reward),
    ],
    "Hah! Our little plot against {s3} worked perfectly, {playername}. " +
    "The fool has lost one of his most valuable retainers, and we are one step closer to bringing him to his knees. " +
    "Here, this purse contains {reg5} peningas, and I wish you to have it. You deserve every bit. " +
    "There could be much more to come, need I remind you, if you've a mind to earn it...", "lord_generic_mission_completed",[
      (call_script, "script_finish_quest", "qst_incriminate_loyal_commander", 100),
      (call_script, "script_change_player_honor", -10),
  ]],
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_incriminate_loyal_commander"),
      (check_quest_failed, "qst_incriminate_loyal_commander")],
    "You weren't able to complete a simple task. I had set up everything. " +
    "The only thing you needed to do was sacrifice a messenger, and we would be celebrating now. " +
    "But no. You were too damned honorable, weren't you?", "close_window",[
      (call_script, "script_end_quest", "qst_incriminate_loyal_commander"),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",-10),
      (call_script, "script_change_player_honor", 3),
  ]],
  #TODO: NO GENERIC MISSION FAILED ANYMORE!!
  
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_meet_spy_in_enemy_town"),
      (check_quest_succeeded, "qst_meet_spy_in_enemy_town"),
    ],
    "Have you brought me any news about that task I gave you? You know the one I mean...", "quest_meet_spy_in_enemy_town_completed",
    []],
  
  [anyone|plyr, "quest_meet_spy_in_enemy_town_completed", [],
    "I have the reports you wanted right here.", "quest_meet_spy_in_enemy_town_completed_2",[]],
  
  [anyone, "quest_meet_spy_in_enemy_town_completed_2", [],
    "Ahh, well done. It's good to have competent {reg59?people:men} on my side. Here is the payment I promised you.", "lord_pretalk",
    [
      (call_script, "script_finish_quest", "qst_meet_spy_in_enemy_town", 100),
  ]],
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_cause_provocation"),
      (check_quest_succeeded, "qst_cause_provocation"),
      (quest_get_slot, ":quest_target_faction", "qst_cause_provocation", slot_quest_target_faction),
      (str_store_faction_name, s13, ":quest_target_faction"),
    ],
    "Brilliant work, {playername}! Whatever you did, the nobles of the {s13} are clamoring for war! " +
    "Soon, the time will come for us to reap the benefits of our hard work, from fields ripe for plunder. " +
    "This war is going to make us rich, mark my words!", "lord_pretalk",
    [
      (try_for_range, ":vassal", active_npcs_begin, active_npcs_end),
        (troop_slot_eq, ":vassal", slot_troop_occupation, slto_kingdom_hero),
        (store_troop_faction, ":vassal_fac", ":vassal"),
        (eq, ":vassal_fac", "$players_kingdom"),
        (neq,  ":vassal", "$g_talk_troop"),
        (store_random_in_range, ":rel_change", -5, 4),
        (call_script, "script_change_player_relation_with_troop", ":vassal", ":rel_change"),
      (try_end),
      (call_script, "script_change_player_honor", -5), #chief aumentada perdida de honor a -15
      (call_script, "script_finish_quest", "qst_cause_provocation", 100),
  ]],
  
  [anyone,"lord_start", [(store_partner_quest, ":lords_quest"),
      (eq, ":lords_quest", "qst_cause_provocation"),
      (check_quest_failed, "qst_cause_provocation"),
    ],
    "You incompetent buffoon! " +
    "What in Hell made you think that getting yourself captured while trying to start a war was a good idea? " +
    "These plans took months to prepare, and now everything's been ruined! I will not forget this, {playername}. " +
    "Oh, be assured that I will not.", "lord_pretalk",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -15),
      (call_script, "script_end_quest", "qst_cause_provocation"),
  ]],
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_collect_debt"),
      (quest_slot_eq, "qst_collect_debt", slot_quest_current_state, 1),
      (quest_get_slot, ":target_troop", "qst_collect_debt", slot_quest_target_troop),
      (str_store_troop_name, s7, ":target_troop"),
      (quest_get_slot, ":total_collected","qst_collect_debt",slot_quest_target_amount),
      (store_div, reg3, ":total_collected", 5),
      (store_sub, reg4, ":total_collected", reg3)],
    "I'm told that you've collected the money owed me from {s7}. Good, it's past time I had it back. " +
    "I believe I promised to give you one-fifth of it all, eh? " +
    "Well, that makes {reg3} peningas, so if you give me my share -- that's {reg4} peningas -- you can keep the rest.", "lord_collect_debt_completed", []],
  
  
  [anyone|plyr,"lord_collect_debt_completed", [(store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", reg4)],
    "Of course, {s65}. {reg4} peningas, all here.", "lord_collect_debt_pay",[]],
  
  [anyone,"lord_collect_debt_pay", [],
    "I must admit I'm impressed, {playername}. I had lost hope of ever getting this money back. " +
    "Please accept my sincere thanks.", "lord_pretalk",[
      (troop_remove_gold, "trp_player", reg4),
      (troop_add_gold, "$g_talk_troop", reg4),
      (call_script, "script_finish_quest", "qst_collect_debt", 100)
  ]],
  
  [anyone|plyr,"lord_collect_debt_completed", [], "I am afraid I don't have the money with me, sir.", "lord_collect_debt_no_pay",[]],
  [anyone,"lord_collect_debt_no_pay", [], "Is this a joke? " +
    "I know full well that {s7} gave you the money, and I want every pening owed to me, {reg59?madam:sir}. " +
    "As far as I'm concerned, I hold you personally in my debt until I see that silver.", "close_window",[
      (call_script, "script_change_debt_to_troop", "$g_talk_troop", reg4),
      (call_script, "script_end_quest", "qst_collect_debt"),
      
      (call_script, "script_objectionable_action", tmt_honest, "str_squander_money"),
  ]],
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_kill_local_merchant"),
      (check_quest_succeeded, "qst_kill_local_merchant"),
      (quest_slot_eq, "qst_kill_local_merchant", slot_quest_current_state, 1)],
    "I heard you got rid of that poxy merchant that was causing me so much grief. " +
    "I can see you're not afraid to get your hands dirty, eh? I like that in a {reg59?woman:man}. " +
    "Here's your reward. Remember, {playername}, stick with me and we'll go a long, long way together.", "close_window",
    [ (call_script, "script_troop_add_gold", "trp_player", 1600),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",40), #chief aumentado a 30
      (call_script, "script_change_player_honor", -5), #chief aumentada perdida de honor a -20
      (add_xp_as_reward, 300),
      (call_script, "script_end_quest", "qst_kill_local_merchant"),
      
      (call_script, "script_objectionable_action", tmt_humanitarian, "str_murder_merchant"),
      
      (assign, "$g_leave_encounter", 1)]],
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_kill_local_merchant"),
      (check_quest_failed, "qst_kill_local_merchant")],
    "Oh, it's you. Enlighten me, how exactly does one lose a simple fight to some poxy, lowborn merchant? " +
    "Truly, if I ever need my guardsmen to take a lesson in how to lie down and die, I'll be sure to come to you. " +
    "Just leave me be, {playername}, I have things to do.", "close_window",
    [(call_script, "script_end_quest", "qst_kill_local_merchant"),
      (assign, "$g_leave_encounter", 1)]],
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_kill_local_merchant"),
      (check_quest_succeeded, "qst_kill_local_merchant"),
      (quest_slot_eq, "qst_kill_local_merchant", slot_quest_current_state, 2)],
    "You! Do you have sawdust between your ears? Did you think that when I said to kill the merchant, " +
    "I meant you to have a nice chat with him and then let him go? What possessed you?", "lord_kill_local_merchant_let_go",[]],
  
  [anyone|plyr,"lord_kill_local_merchant_let_go", [],
    "Sir, I made sure he will not act against you.", "lord_kill_local_merchant_let_go_2",[]],
  
  [anyone,"lord_kill_local_merchant_let_go_2", [],
    "Piffle. You were supposed to remove him, not give him a sermon and send him on his way. " +
    "He had better do as you say, or you'll both regret it. " +
    "Here, this is half the money I promised you. Don't say a word, {playername}. You're lucky to get even that. " +
    "I have little use for {reg59?people:men} who cannot follow orders.", "lord_pretalk",
    [(call_script, "script_troop_add_gold", "trp_player", 1300),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",20), #chief aumentado a 10
      (add_xp_as_reward, 500),
      (call_script, "script_end_quest", "qst_kill_local_merchant"),
      (assign, "$g_leave_encounter", 1)
  ]],
  
  ##  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
  ##                         (eq,":lords_quest","qst_hunt_down_raiders"),
  ##                         (check_quest_failed, "qst_hunt_down_raiders")],
  ##   "I heard that those raiders you were after have got away. Do you have an explanation?", "quest_hunt_down_raiders_failed",[]],
  ##  [anyone|plyr,"quest_hunt_down_raiders_failed", [],  "They were too quick for us my lord. But next time we'll get them", "quest_hunt_down_raiders_failed_2",[]],
  ##  [anyone|plyr,"quest_hunt_down_raiders_failed", [],  "They were too strong and well armed my lord. But we'll be ready for them next time.", "quest_hunt_down_raiders_failed_2",[]],
  ##
  ##  [anyone|plyr,"quest_hunt_down_raiders_failed", [],  "Well, it was a long call anyway. Next, time do make sure that you are better prepared.",
  ##   "lord_pretalk",[(call_script, "script_end_quest", "qst_hunt_down_raiders")]],
  ##
  ##
  ##
  ##  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
  ##                         (eq,":lords_quest","qst_hunt_down_raiders"),
  ##                         (check_quest_succeeded, "qst_hunt_down_raiders")],
  ##   "I heard that you have given those raiders the punishment they deserved. Well done {playername}.\
  ## ", "lord_generic_mission_completed",[(call_script, "script_finish_quest", "qst_hunt_down_raiders", 100),
  ##                                      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",3)]],
  ##
  
  
  ##  [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                         (store_partner_quest,":lords_quest"),
  ##                         (eq,":lords_quest","qst_defend_nobles_against_peasants"),
  ##                         (this_or_next|check_quest_succeeded, "qst_defend_nobles_against_peasants"),
  ##                         (check_quest_failed, "qst_defend_nobles_against_peasants"),
  ##                         (assign, ":num_saved", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
  ##                         (party_count_companions_of_type, ":num_nobles", "p_main_party", "trp_noble_refugee"),
  ##                         (val_add, ":num_saved", ":num_nobles"),
  ##                         (party_count_companions_of_type, ":num_nobles", "p_main_party", "trp_noble_refugee_woman"),
  ##                         (val_add, ":num_saved", ":num_nobles"),
  ##                         (assign, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_saved"),
  ##                         (eq, ":num_saved", "$qst_defend_nobles_against_peasants_num_nobles_to_save")],
  ##   "TODO: You have saved all of them. Good boy.", "lord_generic_mission_completed",
  ##   [(party_remove_members, "p_main_party", "trp_noble_refugee", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
  ##    (party_remove_members, "p_main_party", "trp_noble_refugee_woman", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
  ##    (call_script, "script_finish_quest", "qst_defend_nobles_against_peasants", 100)]],
  ##
  ##  [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                         (store_partner_quest,":lords_quest"),
  ##                         (eq,":lords_quest","qst_defend_nobles_against_peasants"),
  ##                         (this_or_next|check_quest_succeeded, "qst_defend_nobles_against_peasants"),
  ##                         (check_quest_failed, "qst_defend_nobles_against_peasants"),
  ##                         (assign, ":num_saved", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
  ##                         (party_count_companions_of_type, ":num_nobles", "p_main_party", "trp_noble_refugee"),
  ##                         (val_add, ":num_saved", ":num_nobles"),
  ##                         (party_count_companions_of_type, ":num_nobles", "p_main_party", "trp_noble_refugee_woman"),
  ##                         (val_add, ":num_saved", ":num_nobles"),
  ##                         (assign, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_saved"),
  ##                         (lt, ":num_saved", "$qst_defend_nobles_against_peasants_num_nobles_to_save"),
  ##                         (gt, "$qst_defend_nobles_against_peasants_num_nobles_saved", 0)],
  ##   "TODO: You have saved some of them. Half good boy.", "lord_capture_conspirators_half_completed",
  ##   [(party_remove_members, "p_main_party", "trp_noble_refugee", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
  ##    (party_remove_members, "p_main_party", "trp_noble_refugee_woman", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
  ##    (assign, ":ratio", 100),
  ##    (val_mul, ":ratio", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
  ##    (val_div, ":ratio", "$qst_defend_nobles_against_peasants_num_nobles_to_save"),
  ##    (call_script, "script_finish_quest", "qst_defend_nobles_against_peasants", ":ratio")]],
  ##
  ##  [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                         (store_partner_quest,":lords_quest"),
  ##                         (eq,":lords_quest","qst_defend_nobles_against_peasants"),
  ##                         (this_or_next|check_quest_succeeded, "qst_defend_nobles_against_peasants"),
  ##                         (check_quest_failed, "qst_defend_nobles_against_peasants"),
  ##                         (assign, ":num_saved", "$qst_defend_nobles_against_peasants_num_nobles_saved"),
  ##                         (party_count_companions_of_type, ":num_nobles", "p_main_party", "trp_noble_refugee"),
  ##                         (val_add, ":num_saved", ":num_nobles"),
  ##                         (party_count_companions_of_type, ":num_nobles", "p_main_party", "trp_noble_refugee_woman"),
  ##                         (val_add, ":num_saved", ":num_nobles"),
  ##                         (eq, ":num_saved", 0)],
  ##   "TODO: You have saved none of them. Bad boy.", "lord_generic_mission_failed", []],
  ##
  ##
  ##  [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                         (store_partner_quest,":lords_quest"),
  ##                         (eq,":lords_quest","qst_capture_conspirators"),
  ##                         (this_or_next|check_quest_succeeded, "qst_capture_conspirators"),
  ##                         (check_quest_failed, "qst_capture_conspirators"),
  ##                         (party_count_prisoners_of_type, ":num_conspirators", "p_main_party", "trp_conspirator"),
  ##                         (party_count_prisoners_of_type, ":num_conspirator_leaders", "p_main_party", "trp_conspirator_leader"),
  ##                         (store_add, ":sum_captured", ":num_conspirators", ":num_conspirator_leaders"),
  ##                         (ge, ":sum_captured", "$qst_capture_conspirators_num_troops_to_capture")],
  ##   "TODO: You have captured all of them. Good boy.", "lord_generic_mission_completed",
  ##   [(party_remove_prisoners, "p_main_party", "trp_conspirator_leader", "$qst_capture_conspirators_num_troops_to_capture"),
  ##    (party_remove_prisoners, "p_main_party", "trp_spy_partner", "$qst_capture_conspirators_num_troops_to_capture"),
  ##    (call_script, "script_finish_quest", "qst_capture_conspirators", 100)]],
  ##
  ##  [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                         (store_partner_quest,":lords_quest"),
  ##                         (eq,":lords_quest","qst_capture_conspirators"),
  ##                         (this_or_next|check_quest_succeeded, "qst_capture_conspirators"),
  ##                         (check_quest_failed, "qst_capture_conspirators"),
  ##                         (party_count_prisoners_of_type, ":num_conspirators", "p_main_party", "trp_conspirator"),
  ##                         (party_count_prisoners_of_type, ":num_conspirator_leaders", "p_main_party", "trp_conspirator_leader"),
  ##                         (store_add, ":sum_captured", ":num_conspirators", ":num_conspirator_leaders"),
  ##                         (lt, ":sum_captured", "$qst_capture_conspirators_num_troops_to_capture"),
  ##                         (gt, ":sum_captured", 0)],
  ##   "TODO: You have captured some of them. Half good boy.", "lord_capture_conspirators_half_completed",
  ##   [(assign, ":sum_removed", 0),
  ##    (party_remove_prisoners, "p_main_party", "trp_conspirator_leader", "$qst_capture_conspirators_num_troops_to_capture"),
  ##    (val_add, ":sum_removed", reg0),
  ##    (party_remove_prisoners, "p_main_party", "trp_conspirator", "$qst_capture_conspirators_num_troops_to_capture"),
  ##    (val_add, ":sum_removed", reg0),
  ##    (val_mul, ":sum_removed", 100),
  ##    (val_div, ":sum_removed", "$qst_capture_conspirators_num_troops_to_capture"),
  ##    (call_script, "script_finish_quest", "qst_capture_conspirators", ":sum_removed")]],
  ##
  ##  [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                         (store_partner_quest,":lords_quest"),
  ##                         (eq,":lords_quest","qst_capture_conspirators"),
  ##                         (this_or_next|check_quest_succeeded, "qst_capture_conspirators"),
  ##                         (check_quest_failed, "qst_capture_conspirators"),
  ##                         (party_count_prisoners_of_type, ":num_conspirators", "p_main_party", "trp_conspirator"),
  ##                         (party_count_prisoners_of_type, ":num_conspirator_leaders", "p_main_party", "trp_conspirator_leader"),
  ##                         (store_add, ":sum_captured", ":num_conspirators", ":num_conspirator_leaders"),
  ##                         (eq, ":sum_captured", 0)],
  ##   "TODO: You have captured none of them. Bad boy.", "lord_generic_mission_failed", []],
  ##
  ##  [anyone|plyr,"lord_capture_conspirators_half_completed", [],
  ##   "TODO: That's all I can do.", "lord_pretalk", []],
  
  
  [anyone,"lord_start", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_follow_spy"),
      (eq, "$qst_follow_spy_no_active_parties", 1),
      (party_count_prisoners_of_type, ":num_spies", "p_main_party", "trp_spy"),
      (party_count_prisoners_of_type, ":num_spy_partners", "p_main_party", "trp_spy_partner"),
      (gt, ":num_spies", 0),
      (gt, ":num_spy_partners", 0)],
    "Beautiful work, {playername}! You captured both the spy and his handler, just as I'd hoped, " +
    "and the two are now safely ensconced in my dungeon, waiting to be questioned. " +
    "My torturer shall be busy tonight! Anyway, I'm very pleased with your success, {playername}, and I give you " +
    "this purse as a token of my appreciation.", "lord_follow_spy_completed",
    [(party_remove_prisoners, "p_main_party", "trp_spy", 1),
      (party_remove_prisoners, "p_main_party", "trp_spy_partner", 1),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",20), #chief mejorado a 20
      (call_script, "script_troop_add_gold", "trp_player", 2000),
      (add_xp_as_reward, 4000),
      (call_script, "script_end_quest", "qst_follow_spy")]],
  
  [anyone,"lord_start", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_follow_spy"),
      (eq, "$qst_follow_spy_no_active_parties", 1),
      (party_count_prisoners_of_type, ":num_spies", "p_main_party", "trp_spy"),
      (party_count_prisoners_of_type, ":num_spy_partners", "p_main_party", "trp_spy_partner"),
      (gt, ":num_spies", 0),
      (eq, ":num_spy_partners", 0),],
    "Blast and damn you! I wanted TWO prisoners, {playername} -- what you've brought me is one step short of " +
    "useless! I already know everything the spy knows. It was the handler I was after. " +
    "Here, half a job gets you half a reward. Take it and begone.", "lord_follow_spy_half_completed",
    [(party_remove_prisoners, "p_main_party", "trp_spy", 1),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",-10),
      (call_script, "script_troop_add_gold", "trp_player", 1000),
      (add_xp_as_reward, 400),
      (call_script, "script_end_quest", "qst_follow_spy")]],
  
  [anyone,"lord_start", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_follow_spy"),
      (eq, "$qst_follow_spy_no_active_parties", 1),
      (party_count_prisoners_of_type, ":num_spies", "p_main_party", "trp_spy"),
      (party_count_prisoners_of_type, ":num_spy_partners", "p_main_party", "trp_spy_partner"),
      (eq, ":num_spies", 0),
      (gt, ":num_spy_partners", 0),
    ],
    "I asked you for two prisoners, {playername}, not one. Two. Still, I suppose you did capture the spy's handler, " +
    "the more important one of the pair. The spy will not dare return here and will prove quite useless to " +
    "whatever master he served. 'Tis better than nothing. " +
    "However, you'll understand if I pay you half the promised reward for what is but half a success.", "lord_follow_spy_half_completed",
    [(party_remove_prisoners, "p_main_party", "trp_spy_partner", 1),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",10),
      (call_script, "script_troop_add_gold", "trp_player", 1000),
      (add_xp_as_reward, 400),
      (call_script, "script_end_quest", "qst_follow_spy")]],
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_follow_spy"),
      (eq, "$qst_follow_spy_no_active_parties", 1),
      (party_count_prisoners_of_type, ":num_spies", "p_main_party", "trp_spy"),
      (party_count_prisoners_of_type, ":num_spy_partners", "p_main_party", "trp_spy_partner"),
      (eq, ":num_spies", 0),
      (eq, ":num_spy_partners", 0),
    ],
    "Truly, {playername}, you are nothing short of totally incompetent. " +
    "Failing to capture both the spy AND his handler plumbs astonishing new depths of failure. " +
    "Forget any reward I offered you. You've done nothing to earn it.", "lord_follow_spy_failed",
    [
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",-10),
      (call_script, "script_end_quest", "qst_follow_spy"),
  ]],
  
  [anyone|plyr,"lord_follow_spy_half_completed", [],
    "I did my best, {s65}.", "lord_pretalk", []],
  
  [anyone|plyr,"lord_follow_spy_completed", [],
    "Thank you, {s65}.", "lord_pretalk", []],
  
  [anyone|plyr,"lord_follow_spy_failed", [],
    "Hrm. As you like, {s65}.", "lord_pretalk", []],
  
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_bring_back_runaway_serfs"),
      (check_quest_succeeded, "qst_bring_back_runaway_serfs")],
    "Splendid work, {playername}. All the serfs are back, properly cowed, and they're busy preparing for the harvest. " +
    "You certainly earned your reward. Here, take it, with my compliments.", "lord_generic_mission_completed",
    [(call_script, "script_change_player_relation_with_troop","$g_talk_troop", 10),
      (call_script, "script_troop_add_gold", "trp_player", 300),
      (add_xp_as_reward, 300),
      (call_script, "script_end_quest", "qst_bring_back_runaway_serfs"),
      (call_script, "script_objectionable_action", tmt_humanitarian, "str_round_up_serfs"),
  ]],
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_bring_back_runaway_serfs"),
      (check_quest_failed, "qst_bring_back_runaway_serfs"),],
    "{playername}. I have been waiting patiently for my serfs, yet none has returned. Have you an explanation? " +
    "Were you outwitted by simple field hands, or are you merely incompetent? " +
    "Or perhaps you are plotting with my enemies, intending to ruin me...", "lord_bring_back_runaway_serfs_failed", []],
  [anyone|plyr,"lord_bring_back_runaway_serfs_failed", [],
    "Forgive me, {s65}. Those serfs were as slippery as eels.", "lord_bring_back_runaway_serfs_failed_1a", []],
  [anyone|plyr,"lord_bring_back_runaway_serfs_failed", [],
    "Perhaps if you had treated them better...", "lord_bring_back_runaway_serfs_failed_1b", []],
  [anyone,"lord_bring_back_runaway_serfs_failed_1a", [],
    "Humph. That is hardly an excuse for failure, {playername}. " +
    "Now if you will excuse me, I need to recruit new men to work these fields before we all starve.", "lord_pretalk",
    [(call_script, "script_change_player_relation_with_troop","$g_talk_troop",-10),
      (call_script, "script_end_quest", "qst_bring_back_runaway_serfs")]],
  [anyone,"lord_bring_back_runaway_serfs_failed_1b", [],
    "Hah, now you reveal your true colours, traitor! Your words match your actions all too well. I should never have trusted you.", "close_window",
    [(call_script, "script_change_player_relation_with_troop","$g_talk_troop",-15),
      (quest_get_slot, ":home_village", "qst_bring_back_runaway_serfs", slot_quest_object_center),
      (call_script, "script_change_player_relation_with_center",":home_village",15),
      (call_script, "script_end_quest", "qst_bring_back_runaway_serfs"),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_bring_back_runaway_serfs"),
      (check_quest_concluded, "qst_bring_back_runaway_serfs"),
      (assign, reg17, "$qst_bring_back_runaway_serfs_num_parties_returned")],
    "You disappoint me, {playername}. There were three groups of serfs that I charged you to return. Three, not {reg17}. " +
    "I suppose the ones who did come back shall have to work twice as hard to make up for those that got away. " +
    "As for your reward, {playername}, I'll only pay you for the serfs you returned, not the ones you let fly. " +
    "Here. Take it, and let this business be done.", "lord_runaway_serf_half_completed",
    [(store_mul, ":reward", "$qst_bring_back_runaway_serfs_num_parties_returned", 100),
      (val_div, ":reward", 2),
      #	(store_div, ":relation_boost", "$qst_bring_back_runaway_serfs_num_parties_returned", 1),
      #    (call_script, "script_change_player_relation_with_troop","$g_talk_troop", ":relation_boost"),
      (call_script, "script_troop_add_gold", "trp_player", ":reward"),
      (add_xp_as_reward, ":reward"),
      
      
      (call_script, "script_objectionable_action", tmt_humanitarian, "str_round_up_serfs"),
      
      (call_script, "script_end_quest", "qst_bring_back_runaway_serfs"),
  ]],
  
  [anyone|plyr,"lord_runaway_serf_half_completed", [],
    "Thank you, {s65}. You are indeed generous.", "lord_pretalk", []],
  [anyone|plyr,"lord_runaway_serf_half_completed", [],
    "Bah, this proved to be a waste of my time.", "lord_pretalk", []],
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_deal_with_bandits_at_lords_village"),
      (check_quest_succeeded, "qst_deal_with_bandits_at_lords_village")],
    "{playername}, I was told that you crushed the bandits at my village of {s5}. Please know that I am most grateful to you for that. " +
    "Please, let me pay the expenses of your campaign. Here, I hope these {reg14} peningas will be adequate.", "lord_deal_with_bandits_completed",
    [
      (quest_get_slot, reg14, "qst_deal_with_bandits_at_lords_village", slot_quest_gold_reward),
      (quest_get_slot, ":village", "qst_deal_with_bandits_at_lords_village", slot_quest_target_center),
      (call_script, "script_finish_quest", "qst_deal_with_bandits_at_lords_village", 100),
      (str_store_party_name, s5, ":village"),
  ]],
  
  [anyone|plyr, "lord_deal_with_bandits_completed", [],
    "Not a problem, {s65}.", "lord_pretalk",[]],
  [anyone|plyr, "lord_deal_with_bandits_completed", [],
    "Glad to be of service.", "lord_pretalk",[]],
  [anyone|plyr, "lord_deal_with_bandits_completed", [],
    "It was mere child's play.", "lord_pretalk",[]],
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_deal_with_bandits_at_lords_village"),
      (check_quest_concluded, "qst_deal_with_bandits_at_lords_village")],
    "Damn it, {playername}. I heard that you were unable to drive off the bandits from my village of {s5}. Thanks to you, my village now lies in ruins. " +
    "Everyone said that you were a capable warrior, but apparently, they were wrong.", "lord_pretalk",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (call_script, "script_end_quest", "qst_deal_with_bandits_at_lords_village"),
      (quest_get_slot, ":village", "qst_deal_with_bandits_at_lords_village", slot_quest_target_center),
      (str_store_party_name, s5, ":village"),
  ]],
  
  ##########mainquest ashdown battle chief
  [trp_kingdom_8_lord,"lord_start", [ #halfdan
      (eq, "$player_side", 2), #danish
      (check_quest_active, "qst_aescesdun"),
      (quest_slot_eq,"qst_aescesdun",slot_quest_current_state, 2),
      (store_partner_quest,":lords_quest"),
      (eq, ":lords_quest", "qst_learn_where_merchant_brother_is"),
      (check_quest_succeeded, "qst_learn_where_merchant_brother_is"),
      (quest_get_slot, reg13, "qst_learn_where_merchant_brother_is", slot_quest_target_amount),
    ],
    "Ah, {playername}. You bring {reg13} head of cattle, as I requested. Thanks to you, we will soon be ready to move on the Saxons.", "ashdown_2petition",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
      (quest_get_slot, ":quest_target_amount", "qst_learn_where_merchant_brother_is", slot_quest_target_amount),
      #TODO: Change reward
      (store_mul, ":reward", ":quest_target_amount", 50),
      (call_script, "script_troop_add_gold", "trp_player", ":reward"),
      (val_div, ":reward", 5),
      (add_xp_as_reward, ":reward"),
      (call_script, "script_end_quest", "qst_learn_where_merchant_brother_is"),
  ]],
  
  [trp_knight_5_1,"lord_start", [ #Aelfred
      (eq, "$player_side", 1), #West Seaxe
      (check_quest_active, "qst_aescesdun"),
      (quest_slot_eq,"qst_aescesdun",slot_quest_current_state, 2),
      (store_partner_quest,":lords_quest"),
      (eq, ":lords_quest", "qst_learn_where_merchant_brother_is"),
      (check_quest_succeeded, "qst_learn_where_merchant_brother_is"),
      (quest_get_slot, reg13, "qst_learn_where_merchant_brother_is", slot_quest_target_amount),
    ],
    "Ah, {playername}. You bring {reg13} head of cattle, as I requested. Thanks to you, this will help us keep fed a greater number of men.", "ashdown_2petition",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
      (quest_get_slot, ":quest_target_amount", "qst_learn_where_merchant_brother_is", slot_quest_target_amount),
      #TODO: Change reward
      (store_mul, ":reward", ":quest_target_amount", 50),
      (call_script, "script_troop_add_gold", "trp_player", ":reward"),
      (val_div, ":reward", 5),
      (add_xp_as_reward, ":reward"),
      (call_script, "script_end_quest", "qst_learn_where_merchant_brother_is"),
  ]],
  ###############
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq, ":lords_quest", "qst_deliver_cattle_to_army"),
      (check_quest_succeeded, "qst_deliver_cattle_to_army"),
      (quest_get_slot, reg13, "qst_deliver_cattle_to_army", slot_quest_target_amount),
    ],
    "Ah, {playername}. My quartermaster has informed me of your delivery, {reg13} head of cattle, as I requested. I'm impressed.", "lord_deliver_cattle_to_army_thank",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
      (quest_get_slot, ":quest_target_amount", "qst_deliver_cattle_to_army", slot_quest_target_amount),
      #TODO: Change reward
      (store_mul, ":reward", ":quest_target_amount", 100),
      (call_script, "script_troop_add_gold", "trp_player", ":reward"),
      (val_div, ":reward", 5),
      (add_xp_as_reward, ":reward"),
      (call_script, "script_end_quest", "qst_deliver_cattle_to_army"),
      #Reactivating follow army quest
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (setup_quest_text, "qst_follow_army"),
      (str_store_string, s2, "str_follow_army_quest_brief_2"),
      (call_script, "script_start_quest", "qst_follow_army", "$g_talk_troop"),
      (assign, "$g_player_follow_army_warnings", 0),
  ]],
  
  [anyone|plyr, "lord_deliver_cattle_to_army_thank", [],
    "Not a problem, {s65}.", "lord_pretalk",[]],
  [anyone|plyr, "lord_deliver_cattle_to_army_thank", [],
    "Glad to be of service.", "lord_pretalk",[]],
  [anyone|plyr, "lord_deliver_cattle_to_army_thank", [],
    "Mere child's play.", "lord_pretalk",[]],
  
  [anyone,"lord_start", [(store_partner_quest,":lords_quest"),
      (eq, ":lords_quest", "qst_scout_waypoints"),
      (check_quest_succeeded, "qst_scout_waypoints"),
      (str_store_party_name, s13, "$qst_scout_waypoints_wp_1"),
      (str_store_party_name, s14, "$qst_scout_waypoints_wp_2"),
      (str_store_party_name, s15, "$qst_scout_waypoints_wp_3"),
    ],
    "You make a good scout, {playername}. My runner just brought me your reports of the mission to {s13}, {s14} and {s15}. Well done.", "lord_scout_waypoints_thank",
    [
      #TODO: Change reward
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
      #     (call_script, "script_troop_add_gold", "trp_player", 100),
      (add_xp_as_reward, 200),
      (call_script, "script_end_quest", "qst_scout_waypoints"),
      #Reactivating follow army quest
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (setup_quest_text, "qst_follow_army"),
      (str_store_string, s2, "str_follow_army_quest_brief_2"),
      (call_script, "script_start_quest", "qst_follow_army", "$g_talk_troop"),
      (assign, "$g_player_follow_army_warnings", 0),
  ]],
  
  [anyone|plyr, "lord_scout_waypoints_thank", [],
    "A simple task, {s65}.", "lord_pretalk",[]],
  [anyone|plyr, "lord_scout_waypoints_thank", [],
    "Nothing I couldn't handle.", "lord_pretalk",[]],
  [anyone|plyr, "lord_scout_waypoints_thank", [],
    "My pleasure, {s65}.", "lord_pretalk",[]],
  
  
  
  [anyone, "lord_start",
    [
      (check_quest_active, "qst_follow_army"),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshal, "$g_talk_troop"),
      (eq, "$g_random_army_quest", "qst_deliver_cattle_to_army"),
      (quest_get_slot, ":quest_target_amount", "$g_random_army_quest", slot_quest_target_amount),
      (assign, reg3, ":quest_target_amount"),
    ],
    "The army's supplies are dwindling too quickly, {playername}. I need you to bring me {reg3} head of cattle so I can keep the troops fed. I care very little about where you get them. Just bring them to me as soon as you can.", "lord_mission_told_deliver_cattle_to_army",
    [
    ]
  ],
  
  [anyone|plyr,"lord_mission_told_deliver_cattle_to_army", [], "Very well, I can find you some cattle.", "lord_mission_told_deliver_cattle_to_army_accepted",[]],
  [anyone|plyr,"lord_mission_told_deliver_cattle_to_army", [], "Sorry, sir, I have other plans.", "lord_mission_told_deliver_cattle_to_army_rejected",[]],
  
  [anyone,"lord_mission_told_deliver_cattle_to_army_accepted", [], "Excellent! You know what to do, {playername}, now get to it. I need that cattle sooner rather than later.", "close_window",
    [
      (str_clear, s2),
      (str_clear, s13),
      (call_script, "script_end_quest", "qst_follow_army"),
      (quest_get_slot, ":quest_target_amount", "$g_random_army_quest", slot_quest_target_amount),
      (str_store_troop_name_link, s13, "$g_talk_troop"),
      (assign, reg3, ":quest_target_amount"),
      (setup_quest_text, "$g_random_army_quest"),
      (str_store_string, s2, "@{s13} asked you to gather {reg3} head of cattle and deliver them back to him."),
      (call_script, "script_start_quest", "$g_random_army_quest", "$g_talk_troop"),
      #TODO: Change this value
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone, "lord_mission_told_deliver_cattle_to_army_rejected", [], "That... is unfortunate, {playername}. I shall have to find someone else who's up to the task. Please go now. I've work to do.", "close_window",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
      (assign, "$g_leave_encounter",1),]],
  
  
  [anyone,"lord_start",[(check_quest_active,"qst_report_to_army"),
      (quest_slot_eq, "qst_report_to_army", slot_quest_target_troop, "$g_talk_troop"),
      (assign, ":kingdom_at_war", 0),
      (try_for_range, ":kingdom", kingdoms_begin, kingdoms_end),
        (store_relation, ":relation", ":kingdom", "$players_kingdom"),
        (lt, ":relation", 0),
        (assign, ":kingdom_at_war", 1),
      (try_end),
      (eq, ":kingdom_at_war", 0),
    ],
    "Thank you for answering the summons, {playername}. However, as we are now at peace, we do not need your services. You may attend to your other business.", "lord_pretalk",
    [
      (call_script, "script_end_quest", "qst_report_to_army"),
      (quest_set_slot, "qst_report_to_army", slot_quest_giver_troop, "$g_talk_troop"),
      #TODO: Change this value
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
  ]],
  
  [anyone,"lord_start",[
      (check_quest_active,"qst_report_to_army"),
      (quest_slot_eq, "qst_report_to_army", slot_quest_target_troop, "$g_talk_troop"),
    ],
    "Ah, you have arrived at last, {playername}. We've been expecting you. I hope you have brought with you troops of sufficient number and experience.", "lord_report_to_army_asked",
    []],
  
  [anyone|plyr,"lord_report_to_army_asked", [(quest_get_slot, ":quest_target_amount", "qst_report_to_army", slot_quest_target_amount),
      (call_script, "script_party_count_fit_for_battle", "p_main_party"),
      (gt, reg0, ":quest_target_amount"), # +1 for player
    ],
    "I have a company of good, hardened soldiers with me. We are ready to join you.", "lord_report_to_army_completed",
    []],
  
  [anyone|plyr,"lord_report_to_army_asked", [],
    "I don't have the sufficient number of troops yet. I will need some more time.", "lord_report_to_army_continue",
    []],
  
  [anyone,"lord_report_to_army_completed", [], "Excellent. We'll be moving soon. Now -- you are a {reg59?warrior:man} of sound judgment, and we trust that you will do what is necessary to support our campaign. I do not require you to remain close at hand, and I will not count it against you if you believe that your forces would be of better use elsewhere. But if you do choose to remain with me, to support me in battle, that would be appreciated. I may also have additional tasks for you to perform.", "close_window",[
      (call_script, "script_end_quest", "qst_report_to_army"),
      (quest_set_slot, "qst_report_to_army", slot_quest_giver_troop, "$g_talk_troop"),
      #TODO: Change this value
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      #Activating follow army quest
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (setup_quest_text, "qst_follow_army"),
      (str_store_string, s2, "@{s9} wants you to follow his army until further notice."),
      (call_script, "script_start_quest", "qst_follow_army", "$g_talk_troop"),
      (assign, "$g_player_follow_army_warnings", 0),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"lord_report_to_army_continue", [], "Then you'd better hurry. We'll be moving out soon against the enemy and I need every able hand we can muster.", "close_window",
    [(assign, "$g_leave_encounter",1),
      #Must be closed because of not letting player to terminate this quest on the general conversation
  ]],
  
  [anyone, "lord_start",
    [
      (check_quest_active, "qst_follow_army"),
      (faction_slot_eq, "$players_kingdom", slot_faction_marshal, "$g_talk_troop"),
      (eq, "$g_random_army_quest", "qst_scout_waypoints"),
      (str_store_party_name, s13, "$qst_scout_waypoints_wp_1"),
      (str_store_party_name, s14, "$qst_scout_waypoints_wp_2"),
      (str_store_party_name, s15, "$qst_scout_waypoints_wp_3"),
    ],
    "{playername}, I need a volunteer to scout the area. We're sorely lacking on information, " +
    "and I simply must have a better picture of the situation before we can proceed. " +
    "I want you to go to {s13}, {s14} and {s15} and report back whatever you find.", "lord_mission_told_scout_waypoints",
    [
  ]],
  
  [anyone|plyr, "lord_mission_told_scout_waypoints", [], "You've found your volunteer, sir.", "lord_mission_told_scout_waypoints_accepted",[]],
  [anyone|plyr, "lord_mission_told_scout_waypoints", [], "I fear I must decline.", "lord_mission_told_scout_waypoints_rejected",[]],
  
  [anyone,"lord_mission_told_scout_waypoints_accepted", [], "Good {reg59?lass:man}! Simply pass near {s13}, {s14} and {s15} and check out what's there. Make a note of anything you find and return to me as soon as possible.", "close_window",
    [
      (call_script, "script_end_quest", "qst_follow_army"),
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_party_name_link, s13, "$qst_scout_waypoints_wp_1"),
      (str_store_party_name_link, s14, "$qst_scout_waypoints_wp_2"),
      (str_store_party_name_link, s15, "$qst_scout_waypoints_wp_3"),
      (setup_quest_text, "$g_random_army_quest"),
      (str_store_string, s2, "@{s9} asked you to scout {s13}, {s14} and {s15}, and then report back."),
      (call_script, "script_start_quest", "$g_random_army_quest", "$g_talk_troop"),
      #TODO: Change this value
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone,"lord_mission_told_scout_waypoints_rejected", [], "Hm. I'm disappointed, {playername}. Very disappointed. We'll talk later, I need to go and find somebody to scout for us.", "lord_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
  
  
  
  
  ##
  ##  [anyone,"lord_start",[(check_quest_active,"qst_rescue_lady_under_siege"),
  ##                        (quest_slot_eq, "qst_rescue_lady_under_siege", slot_quest_target_troop, "$g_talk_troop"),
  ##                        (quest_slot_eq, "qst_rescue_lady_under_siege", slot_quest_current_state, 1)],
  ##   "I heard that you have rescued my {s7} from the siege of {s5} and brought her to safety.\
  ## I am in your debt for this {playername}. Thank you.", "lord_generic_mission_completed",
  ##   [(quest_get_slot, ":quest_object_troop", "qst_rescue_lady_under_siege", slot_quest_object_troop),
  ##    (try_begin),
  ##      (troop_slot_eq, "$g_talk_troop", slot_troop_daughter, ":quest_object_troop"),
  ##      (str_store_string, s7, "str_daughter"),
  ##    (else_try),
  ##      (str_store_string, s7, "str_wife"),
  ##    (try_end),
  ##    (remove_member_from_party, ":quest_object_troop"),
  ##    (try_begin),
  ##      (is_between, "$g_encountered_party", centers_begin, centers_end),#Lord might be in wilderness
  ##      (troop_set_slot, ":quest_object_troop", slot_troop_cur_center, "$g_encountered_party"),
  ##    (try_end),
  ##    (call_script, "script_finish_quest", "qst_rescue_lady_under_siege", 100),
  ##    (call_script, "script_change_player_relation_with_troop","$g_talk_troop", 4),
  ##    ]],
  ##
  ##### TODO: QUESTS COMMENT OUT END
  [anyone,"lord_generic_mission_thank", [],
    "You have been most helpful, {playername}. My thanks.", "lord_generic_mission_completed",[]],
  
  [anyone|plyr,"lord_generic_mission_completed", [],
    "It was an honour to serve.", "lord_pretalk",[]],
  
  ##  [anyone|plyr,"lord_generic_mission_failed", [],
  ##   "I'm sorry I failed you sir. It won't happen again.", "lord_pretalk",
  ##   [(store_partner_quest,":lords_quest"),
  ##    (call_script, "script_finish_quest", ":lords_quest"),
  ##    ]],
  
  [anyone,"lord_start", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (troop_get_slot, ":cur_debt", "$g_talk_troop", slot_troop_player_debt),
      (gt, ":cur_debt", 0),
      (assign, reg1, ":cur_debt")],
    "I think you owe me {reg1} peningas, {playername}. Do you intend to pay your debt anytime soon?", "lord_pay_debt_2",[]],
  
  [anyone|plyr, "lord_pay_debt_2", [(troop_get_slot, ":cur_debt", "$g_talk_troop", slot_troop_player_debt),
      (store_troop_gold, ":cur_gold", "trp_player"),
      (le, ":cur_debt", ":cur_gold")],
    "That is why I came, {s65}. Here is every pening I owe you.", "lord_pay_debt_3_1", [(troop_get_slot, ":cur_debt", "$g_talk_troop", slot_troop_player_debt),
      (troop_remove_gold, "trp_player", ":cur_debt"),
      (troop_add_gold, "$g_talk_troop", ":cur_debt"),
      (troop_set_slot, "$g_talk_troop", slot_troop_player_debt, 0)]],
  
  [anyone|plyr, "lord_pay_debt_2", [],
    "Alas, I don't have sufficient funds, {s65}, but I'll pay you soon enough.", "lord_pay_debt_3_2", []],
  
  [anyone, "lord_pay_debt_3_1", [],
    "Ah, excellent. You are a {reg59?woman:man} of honour, {playername}. I am satisfied. Your debt to me has been paid in full.", "lord_pretalk", []],
  
  [anyone, "lord_pay_debt_3_2", [],
    "Well, don't keep me waiting much longer.", "lord_pretalk", []],
  
  ##  [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                         (is_between,"$g_talk_troop_faction_relation",0,3),
  ###                         (eq,"$players_kingdom",0),
  ##                         ],
  ##   "Why don't you join us in our cause? You seem to be an able fighter.\
  ## We need {reg59?people:men} like you who will take part in our glory and share the spoils of our victory.", "lord_talk",[]],
  
  
  #Claim center begin
  ##  [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                         (eq,"$g_talk_troop_faction","$players_kingdom"),
  ##                         (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
  ##                         (call_script, "script_get_number_of_unclaimed_centers_by_player"),
  ##                         (gt, reg1, 0),
  ##                         (assign, "$center_to_be_claimed", reg1),
  ##                         (str_store_party_name, s4, "$center_to_be_claimed"),
  ##                         ],
  ##   "I heard that your forces have taken {s4}. I commend you for your victory {playername}.\
  ## But we need to decide what to do with this new castle now.", "lord_claim_center_begin", []],
  
  
  ##  [anyone,"lord_start", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                         (ge,"$g_talk_troop_faction_relation",0),
  ##                         (call_script, "script_get_number_of_unclaimed_centers_by_player"),
  ##                         (gt, reg1, 0),
  ##                         (assign, "$center_wanted_to_be_bought", reg1),
  ##                         (str_store_party_name, s4, "$center_wanted_to_be_bought"),
  ##                         (call_script, "script_get_number_of_hero_centers", "$g_talk_troop"),
  ##                         (assign, ":no_of_owned_centers", reg0),
  ##                         (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
  ##                         (lt, ":no_of_owned_centers", 2),
  ##                         (troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
  ##                         (ge, ":wealth", 6000)],
  ##   "I heard that your forces have taken {s4}. I applaud your victory {playername}, but you know as well as I do that\
  ## as a person of low rank and status you cannot be permitted to hold that castle for yourself.\
  ## It is to your benefit to sell it to a Lord like myself who can hold and protect the castle and the surrounding estates.\
  ## Anyway, I am ready to make you an offer of 5000 peningas, should you decide to sell that castle.", "lord_buy_center", []],
  ##
  ##
  ##  [anyone|plyr,"lord_buy_center", [],
  ##   "I accept your offer sir. The castle is yours for 5000 peningas.", "lord_buy_center_accept", []],
  ##  [anyone|plyr,"lord_buy_center", [],
  ##   "I am afraid I can't accept that offer.", "lord_buy_center_deny", []],
  ##
  ##  [anyone,"lord_buy_center_accept", [],
  ##   "Excellent, {playername}! You have decided wisely.\
  ## Why bother yourself with the necessities of keeping a castle while you can leave all those boring details to noble Lords like me?\
  ## I am sure money will be much more useful to you than a castle would.", "lord_buy_center_accept_2", []],
  ##
  ##  [anyone|plyr,"lord_buy_center_accept_2", [],
  ##   "One day sir, one day I'll have my own castle.", "lord_buy_center_accept_3", []],
  ##  [anyone|plyr,"lord_buy_center_accept_2", [],
  ##   "Everyone needs money sir. I can take another castle anytime.", "lord_buy_center_accept_3", []],
  ##
  ##  [anyone,"lord_buy_center_accept_3", [],
  ##   "Of course, of course, {playername}.  Then let us conclude our deal. Here's the 5000 peningas I offered you.\
  ## I'll have my clerk handle the necessary details.\
  ## I guess from now on, {s4} belongs to me. Well, that worked very well for both of us, I guess.", "lord_pretalk",
  ##   [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
  ##    (val_sub, ":wealth", 6000),
  ##    (troop_set_slot, "$g_talk_troop", slot_troop_wealth, ":wealth"),
  ##    (call_script, "script_troop_add_gold", "trp_player", 5000),
  ##    (party_set_slot, "$center_wanted_to_be_bought", slot_town_lord, "$g_talk_troop"),
  ##    #Changing center faction
  ##    (party_set_faction, "$center_wanted_to_be_bought", "$g_talk_troop_faction"),
  ##    (set_spawn_radius, 1),
  ##    (spawn_around_party, "$center_wanted_to_be_bought", "pt_old_garrison"),
  ##    (assign, ":new_party", reg0),
  ##    (party_set_ai_behavior, ":new_party", ai_bhvr_attack_party),
  ##    (party_set_ai_object, ":new_party", "p_main_party"),
  ##    (party_set_flags, ":new_party", pf_default_behavior, 0),
  ##    (call_script, "script_party_copy", ":new_party", "$center_wanted_to_be_bought"),
  ##    (party_clear, "$center_wanted_to_be_bought"),
  ##
  ##    (faction_get_slot, ":reinforcement_template_archers", "$g_talk_troop_faction", slot_faction_reinforcements_archers),
  ##    (faction_get_slot, ":reinforcement_template_infantry", "$g_talk_troop_faction", slot_faction_reinforcements_infantry),
  ##    (party_add_template, "$center_wanted_to_be_bought", ":reinforcement_template_archers"),
  ##    (party_add_template, "$center_wanted_to_be_bought", ":reinforcement_template_infantry"),
  ##    ]],
  ##
  ##  [anyone,"lord_buy_center_deny", [],
  ##   "As you wish {playername}. But don't forget, the great lords of the country won't like a low born {reg59?woman:man} like you holding such an estate without their consent.\
  ## It is the nature of this world {playername}. Everyone should know their place.", "lord_pretalk", []],
  
  
  [anyone,"lord_start",[
      (eq, "$g_romantic_comment_made", 0),
      (ge, "$g_talk_troop_relation", 20),
      (troop_slot_ge, "trp_player", slot_troop_renown, 250),
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, kingdom_ladies_begin),
      
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (eq, ":is_female", 0),
      
      (assign, ":third_party_introduce", 0),
      
      (try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
        (troop_slot_eq, ":lady", slot_troop_spouse, -1),
        (troop_slot_eq, ":lady", slot_troop_betrothed, -1),
        (troop_slot_eq, ":lady", slot_troop_cur_center, "$g_encountered_party"),
        (neg|troop_slot_ge, ":lady", slot_troop_met, 4),
        
        (call_script, "script_get_kingdom_lady_social_determinants", ":lady"),
        (eq, reg0, "$g_talk_troop"),
        
        (assign, "$marriage_candidate", ":lady"),
        (call_script, "script_npc_decision_checklist_male_guardian_assess_suitor", "$g_talk_troop", "trp_player"),
        (gt, reg0, 0),
        
        (assign, ":third_party_introduce", ":lady"),
      (try_end),
      (gt, ":third_party_introduce", 0),
      (troop_slot_eq, ":third_party_introduce", slot_troop_met, 0),
      
      (call_script, "script_troop_get_family_relation_to_troop", ":third_party_introduce", "$g_talk_troop"),
      (str_store_troop_name, s14, ":third_party_introduce"),
    ],
    "By the way, I hope you get a chance to meet my {s11}, {s14}.", "lord_start",
    [
      (troop_set_slot, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
      (assign, "$g_romantic_comment_made", 1),
  ]],
  
  
  [anyone,"lord_start",[
      (eq, "$g_romantic_comment_made", 0),
      (ge, "$g_talk_troop_relation", 20),
      (troop_slot_ge, "trp_player", slot_troop_renown, 250),
      (assign, ":third_party_introduce", 0),
      
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, kingdom_ladies_begin),
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (eq, ":is_female", 0),
      
      (try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
        (troop_slot_eq, ":lady", slot_troop_spouse, -1),
        (troop_slot_eq, ":lady", slot_troop_betrothed, -1),
        (troop_slot_eq, ":lady", slot_troop_cur_center, "$g_encountered_party"),
        (neg|troop_slot_ge, ":lady", slot_troop_met, 4),
        
        (call_script, "script_get_kingdom_lady_social_determinants", ":lady"),
        (eq, reg0, "$g_talk_troop"),
        
        (assign, "$marriage_candidate", ":lady"),
        (call_script, "script_npc_decision_checklist_male_guardian_assess_suitor", "$g_talk_troop", "trp_player"),
        (gt, reg0, 0),
        
        (troop_slot_ge, ":lady", slot_troop_met, 1),
        
        (store_current_hours, ":hours"),
        (troop_get_slot, ":lady_last_met_hour", ":lady", slot_troop_last_talk_time),
        (val_sub, ":hours", ":lady_last_met_hour"),
        (ge, ":hours", 24),
        
        (assign, ":third_party_introduce", ":lady"),
      (try_end),
      
      (gt, ":third_party_introduce", 0),
      (call_script, "script_troop_get_family_relation_to_troop", ":third_party_introduce", "$g_talk_troop"),
      (str_store_troop_name, s14, ":third_party_introduce"),
      
    ],
    "By the way, I am sure that my {s11}, {s14}, would be delighted were you to pay her a visit. She awaits you in her chambers.", "lord_start",
    [
      (troop_set_slot, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
      (assign, "$g_romantic_comment_made", 1),
      
  ]],
  
  
  
  [anyone,"lord_start", [(party_slot_eq, "$g_encountered_party",slot_town_lord, "$g_talk_troop"),#we are talking to Town's Lord.
      (ge,"$g_talk_troop_faction_relation",0),
      (neq, "$g_ransom_offer_rejected", 1),
      (lt, "$g_encountered_party_2", 0), #town is not under siege
      (hero_can_join_as_prisoner, "$g_encountered_party"),
      (store_random_in_range, ":random_no", 0, 100),
      (lt, ":random_no", 10),#start this conversation with a 10% chance
      (party_get_num_prisoner_stacks,":num_prisoner_stacks","p_main_party"),
      (assign, "$prisoner_lord_to_buy", -1),
      (try_for_range,":i_pris_stack",0,":num_prisoner_stacks"),
        (party_prisoner_stack_get_troop_id, ":t_id", "p_main_party", ":i_pris_stack"),
        (troop_slot_eq, ":t_id", slot_troop_occupation, slto_kingdom_hero),
        (store_troop_faction, ":fac", ":t_id"),
        (store_relation, ":rel", ":fac", "$g_talk_troop_faction"),
        (lt,  ":rel", 0),
        (assign, "$prisoner_lord_to_buy", ":t_id"),
      (try_end),
      (gt, "$prisoner_lord_to_buy", 0), #we have a prisoner lord.
      (assign, ":continue", 1),
      (try_begin),
        (check_quest_active, "qst_capture_enemy_hero"),
        (store_troop_faction, ":prisoner_faction", "$prisoner_lord_to_buy"),
        (quest_slot_eq, "qst_capture_enemy_hero", slot_quest_target_faction, ":prisoner_faction"),
        (assign, ":continue", 0),
      (try_end),
      (eq, ":continue", 1),
      (str_store_troop_name, s3, "$prisoner_lord_to_buy"),
      (assign, reg5, "$prisoner_lord_to_buy"),
      (call_script, "script_calculate_ransom_amount_for_troop", "$prisoner_lord_to_buy"),
      (assign, reg6, reg0),
      (val_div, reg6, 2),
      (assign, "$temp", reg6),
    ],
    "I heard that you have captured our enemy {s3} and he is with you at the moment. " +
    "I can pay you {reg6} peningas if you want to get rid of him. " +
    "You can wait for his family to pay his ransom of course, but there is no telling how long that will take, eh? " +
    "", "lord_buy_prisoner", []],
  
  [anyone|plyr,"lord_buy_prisoner", [],
    "I accept your offer. I'll leave {s3} to you for {reg6} peningas.", "lord_buy_prisoner_accept", []],
  [anyone|plyr,"lord_buy_prisoner", [],
    "I fear I can't accept your offer.", "lord_buy_prisoner_deny", [(assign, "$g_ransom_offer_rejected", 1),]],
  
  [anyone,"lord_buy_prisoner_accept", [],
    "Excellent! Here's your {reg6} peningas. " +
    "I'll send some men to take him to our prison with due haste.", "lord_pretalk", [
      (remove_troops_from_prisoners,  "$prisoner_lord_to_buy", 1),
      (call_script, "script_troop_add_gold", "trp_player", "$temp"),
      (party_add_prisoners, "$g_encountered_party", "$prisoner_lord_to_buy", 1),
      #(troop_set_slot, "$prisoner_lord_to_buy", slot_troop_is_prisoner, 1),
      (troop_set_slot, "$prisoner_lord_to_buy", slot_troop_prisoner_of_party, "$g_encountered_party"),
  ]],
  
  [anyone,"lord_buy_prisoner_deny", [],
    "Mmm. As you wish, {playername}, but you'll not get a better offer. Take it from me.", "lord_pretalk", []],
  
  
  
  [anyone,"lord_start", [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
      
      (check_quest_active, "qst_organize_feast"),
      (quest_slot_eq, "qst_organize_feast", slot_quest_target_center, "$g_encountered_party"),
      
      
      (try_begin),
        (eq, "$g_talk_troop_faction", "fac_kingdom_4"),
        (str_store_string, s5, "str_flagon_of_mead"),
      (else_try),
        (store_mod, ":mode", "$g_talk_troop", 2),
        (eq, ":mode", 0),
        (eq, "$g_talk_troop_faction", "fac_kingdom_3"),
        (str_store_string, s5, "str_skin_of_kumis"),
      (else_try),
        (store_mod, ":mode", "$g_talk_troop", 2),
        (eq, ":mode", 0),
        (eq, "$g_talk_troop_faction", "fac_kingdom_2"),
        (str_store_string, s5, "str_mug_of_kvass"),
      (else_try),
        (str_store_string, s5, "str_cup_of_wine"),
      (try_end),
      
      
      
    ],
    "I lift a {s5} to your health, {playername}! You are most gracious to host us on this occasion. Now, what is it?", "lord_talk",[
      (call_script, "script_internal_politics_rate_feast_to_s9", "trp_household_possessions", 120, "$players_kingdom", 0),
      (assign, ":quality_of_feast", reg0),
      
      (try_begin),
        (ge, ":quality_of_feast", 20),
        (ge, "$g_time_since_last_talk", 24),
        (is_between, "$g_talk_troop_relation", -50, 20),
        (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 5),
      (try_end),
  ]],
  
  
  
  [anyone,"lord_start", [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
      
    ],
    "To your health, {reg59?your Highness:sire}. Long may you reign. What is your bidding?", "lord_talk",[
      (try_begin),
        (this_or_next|party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
        (party_slot_eq, "$g_encountered_party", slot_town_lord, "$g_talk_troop"),
        (ge, "$g_time_since_last_talk", 24),
        (is_between, "$g_talk_troop_relation", 0, 10),
        (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 1),
      (try_end),
      
  ]],
  
  
  
  [anyone,"lord_start", [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
      (neq, "$g_talk_troop_faction", "fac_adventurers"),
    ],
    "What is your bidding?", "lord_talk",[]],
  
  [anyone,"lord_start", [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
      (ge, "$g_encountered_party_relation", 0),
      (party_slot_eq, "$g_encountered_party", slot_town_lord, "$g_talk_troop"),
      (neq, "$talk_context", tc_castle_gate),
    ],
    "I wish to welcome you to my hall on this auspicious occasion. Now, what is it?", "lord_talk",[
      (try_begin),
        (is_between, "$g_talk_troop_relation", 0, 10),
        (ge, "$g_time_since_last_talk", 24),
        (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 5),
      (try_end),
  ]],
  
  
  [anyone,"lord_start", [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
      (ge, "$g_encountered_party_relation", 0),
      (party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord),
      (str_store_troop_name, s4, ":town_lord"),
      
      (neq, "$talk_context", tc_castle_gate),
      
      
      (try_begin),
        (eq, "$g_talk_troop_faction", "fac_kingdom_4"),
        (str_store_string, s5, "str_flagon_of_mead"),
      (else_try),
        (store_mod, ":mode", "$g_talk_troop", 2),
        (eq, ":mode", 0),
        (eq, "$g_talk_troop_faction", "fac_kingdom_3"),
        (str_store_string, s5, "str_skin_of_kumis"),
      (else_try),
        (store_mod, ":mode", "$g_talk_troop", 2),
        (eq, ":mode", 0),
        (eq, "$g_talk_troop_faction", "fac_kingdom_2"),
        (str_store_string, s5, "str_mug_of_kvass"),
      (else_try),
        (str_store_string, s5, "str_cup_of_wine"),
      (try_end),
      
    ],
    "Let us lift a {s5} to the health of our host, {s4}. Now, what is it?", "lord_talk",[]],
  
  #POLITICAL QUESTS RESOLUTIONS
  [anyone, "lord_start",   [
      
      (check_quest_active, "qst_offer_gift"),
      (quest_slot_eq, "qst_offer_gift", slot_quest_target_troop, "$g_talk_troop"),
      (quest_slot_eq, "qst_offer_gift", slot_quest_current_state, 2),
      
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
      (store_random_in_range, ":random", 3),
      (eq, ":random", 0),
      
      (quest_get_slot, ":giver_troop", "qst_offer_gift", slot_quest_giver_troop),
      (str_store_troop_name, s10, ":giver_troop"),
      (call_script, "script_troop_get_family_relation_to_troop", ":giver_troop",  "$g_talk_troop"),
    ],
    "I received the gift, presented to me through my {s11}, {s10}. It was a noble gesture, {reg59?my lady:sir}, and I regret that we ever quarreled.", "close_window",
    [
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
      (store_sub, ":difference", 0, reg0),
      (val_add, ":difference", 5),
      (val_max, ":difference", 5),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", ":difference"),
      (call_script, "script_end_quest", "qst_offer_gift"),
      (assign, "$g_leave_encounter", 1),
      
  ]],
  
  
  
  [anyone,"lord_start",[
      (check_quest_active, "qst_offer_gift"),
      (quest_slot_eq, "qst_offer_gift", slot_quest_target_troop, "$g_talk_troop"),
      (quest_slot_eq, "qst_offer_gift", slot_quest_current_state, 2),
      
      (store_random_in_range, ":random", 3),
      (neq, ":random", 0),
      
      (quest_get_slot, ":giver_troop", "qst_offer_gift", slot_quest_giver_troop),
      (str_store_troop_name, s10, ":giver_troop"),
      (call_script, "script_troop_get_family_relation_to_troop", ":giver_troop",  "$g_talk_troop"),
      
    ],
    "I received the gift, presented to me through my {s11}, {s10}. For {reg4?her:his} sake, I am willing to let bygones be bygones.", "close_window",	[
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
      (store_sub, ":difference", 0, reg0),
      (val_max, ":difference", 2),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", ":difference"),
      (call_script, "script_end_quest", "qst_offer_gift"),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"lord_start",[
      (check_quest_active, "qst_offer_gift"),
      (quest_slot_eq, "qst_offer_gift", slot_quest_target_troop, "$g_talk_troop"),
      (quest_slot_eq, "qst_offer_gift", slot_quest_current_state, 2),
      
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
      
      (quest_get_slot, ":giver_troop", "qst_offer_gift", slot_quest_giver_troop),
      (str_store_troop_name, s10, ":giver_troop"),
      (call_script, "script_troop_get_family_relation_to_troop", ":giver_troop",  "$g_talk_troop"),
      
    ],
    "I received the gift, presented to me through my {s11}, {s10}. Bah! Do you think you can buy my friendship?", "close_window",	[
      (call_script, "script_end_quest", "qst_offer_gift"),
      (assign, "$g_leave_encounter", 1),
      
  ]],
  
  [anyone,"lord_start",[
      (check_quest_active, "qst_offer_gift"),
      (quest_slot_eq, "qst_offer_gift", slot_quest_target_troop, "$g_talk_troop"),
      (quest_slot_eq, "qst_offer_gift", slot_quest_current_state, 2),
      
      (quest_get_slot, ":giver_troop", "qst_offer_gift", slot_quest_giver_troop),
      (str_store_troop_name, s10, ":giver_troop"),
      (call_script, "script_troop_get_family_relation_to_troop", ":giver_troop",  "$g_talk_troop"),
      
    ],
    "I received the gift, presented to me through my {s11}, {s10}. As dear as {reg4?she:he} is to me, however, I cannot forget our differences.", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
      (call_script, "script_end_quest", "qst_offer_gift"),
  ]],
  #generic lord comments - must be far down
  [anyone,"lord_start", [],
    "What is it?", "lord_talk",[]],
  
  [anyone,"lord_pretalk", [
      (lt, "$g_encountered_party_relation", 0),
      (encountered_party_is_attacker),
    ],
    "But enough talking. Yield or fight!", "party_encounter_lord_hostile_attacker_2",[]],
  #lord recruitment changes end
  
  [anyone,"lord_pretalk", [],
    "Anything else?", "lord_talk",[]],
  
  # [anyone,"hero_pretalk", [],
    # "Anything else?", "lord_talk",[]],
  #  [anyone,"lord_start_2", [],
  #   "Yes?", "lord_talk",[]],
  
  #Player lord_talk responses begin
  #mainquest chief lords conversations
  #frisa king chief
  [anyone|plyr,"lord_talk", [ #thiaderd mission chief
      (check_quest_active, "qst_kennemer_mission_3"),
      (quest_slot_eq,"qst_kennemer_mission_3",slot_quest_current_state,3),
      #     (try_for_range, ":cur_troop", kings_begin, kings_end),
      (eq, "$g_talk_troop", "trp_kingdom_4_lord"),
    ],
    "I heard that your feasts are wonderful!", "frisaking_1",[
  ]],
  
  [anyone|plyr,"lord_talk", [ #player denuncia a jarl
      (check_quest_active, "qst_kennemer_mission_3"),
      (quest_slot_eq,"qst_kennemer_mission_3",slot_quest_current_state,4),
      #     (try_for_range, ":cur_troop", kings_begin, kings_end),
      (eq, "$g_talk_troop", "trp_kingdom_4_lord"),
    ],
    "We need to talk about the jarl of Kennemer.", "jarldenunciado1",[
  ]],
  
  [anyone|plyr,"lord_talk", [ #player denuncia a jarl
      (le, "$first_time variable", 0), #no conversation repit in 90 hours
      (check_quest_active, "qst_kennemer_jarl_missions"),
      (quest_slot_eq,"qst_kennemer_jarl_missions",slot_quest_current_state,2),
      #     (try_for_range, ":cur_troop", kings_begin, kings_end),
      (eq, "$g_talk_troop", "trp_kingdom_4_lord"),
    ],
    "I wish to talk about the jarl of Kennemer.", "jarldenunciado1extra",[
      (assign, "$first_time variable", 1), #no conversation repit in 90 hours
  ]],
  
  [anyone|plyr,"lord_talk", [ #player denuncia a jarl
      (le, "$first_time variable", 0), #no conversation repit in 90 hours
      (check_quest_active, "qst_kennemer_jarl_missions"),
      (quest_slot_eq,"qst_kennemer_jarl_missions",slot_quest_current_state,1),
      #     (try_for_range, ":cur_troop", kings_begin, kings_end),
      (eq, "$g_talk_troop", "trp_kingdom_4_lord"),
    ],
    "I wish to talk about the jarl of Kennemer.", "jarldenunciado2extra",[
      (assign, "$first_time variable", 1), #no conversation repit in 90 hours
  ]],
  ####################
  #############Rey horik in grove chief mainquest
  [anyone|plyr,"kinghorik_quest_revenge4", [
    ],
    "Thank you, King Horik. I brought with me Brunhild and Bodo. They are trustworthy.", "kinghorik_quest_revenge51",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge4", [
    ],
    "Let me tell you my story...", "kinghorik_quest_revenge52",[
  ]],
  
  [anyone,"kinghorik_quest_revenge51", [ #king horik escucha
    ],
    "Yes, yes, nice to meet them. Now, to the point. My time is limited.", "kinghorik_quest_revenge52",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge52", [
    ],
    "Recently, the boat I was traveling on was attacked by Vikings of Sven Bull Neck, a man of Sigurd 'Snake in the Eye.'", "kinghorik_quest_revenge53",[
  ]],
  
  [anyone,"kinghorik_quest_revenge53", [ #king horik escucha
    ],
    "{s2}^^That is nothing special. Many jarls in Danmark have people who make themselves Vikings. Even the jarls and I were Vikings once. " +
    "I hope you're not wasting my time... Choose your words carefully, or this conversation is over.", "kinghorik_quest_revenge54",[
      (str_store_string, s2, "@--He seems impatient, even disappointed.--", color_good_news),
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge54", [
    ],
    "Sven Bull Neck has captured my mother, and he has brought her to Sigurd.", "kinghorik_quest_revenge61",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge54", [
    ],
    "Sigurd tried to make the jarl of Kennemer king of Friese in exchange for an army.", "kinghorik_quest_revenge62",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge54", [
    ],
    "My companion Bodo had something important from the king of Asturias that Sigurd wanted.", "kinghorik_quest_revenge63",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge54", [
    ],
    "Sven Bull Neck has a hideout near Ribe, where he took the Woden Ric prisoners.", "kinghorik_quest_revenge64",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge54", [
    ],
    "Sven Bull Neck and Sigurd 'Snake in the Eye' are up to something, and I want to stop them.", "kinghorik_quest_revenge65",[
  ]],
  
  
  [anyone,"kinghorik_quest_revenge61", [ #king horik escucha
    ],
    "{s2}^^Your mother? This is because Sigurd took your mother? You have wasted my time. I will not talk more. It's time for you to go.", "kinghorik_quest_revenge21_2",[
      (str_store_string, s2, "@--He spits, angry.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -15),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_string, s2, "@It seems you will not have the help of the king. You'll have to talk to {s11} 'Snake in the Eye' Ragnarsson directly."),
      (add_quest_note_from_sreg, "qst_revenge_sigurd", 8, s2, 0),
  ]],
  [anyone,"kinghorik_quest_revenge62", [ #king horik escucha
    ],
    "{s2}^^An army? This is your mystery? He is gathering men for Englaland, in the aid of my brothers. I myself have allowed my jarls and hersirs to join the expedition if they wish. Englaland is a rich land, inhabited by habitually weak people, waiting to be dominated and plundered by their betters. " +
    "+You have wasted my time. I will not talk more. It's time for you to go.", "kinghorik_quest_revenge21_2",[
      (str_store_string, s2, "@--He spits, angry.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_string, s2, "@It seems you will not have the help of the king. You'll have to talk to {s11} 'Snake in the Eye' Ragnarsson directly."),
      (add_quest_note_from_sreg, "qst_revenge_sigurd", 8, s2, 0),
  ]],
  [anyone,"kinghorik_quest_revenge64", [ #king horik escucha
    ],
    "{s2}^^You tell me things I already know, and you do not interest me. My patience has a limit, and you have quickly reached it. " +
    "+You have wasted my time. I will not talk more. It's time for you to go.", "kinghorik_quest_revenge21_2",[
      (str_store_string, s2, "@--He spits, angry.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -20),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_string, s2, "@It seems you will not have the help of the king. You'll have to talk to {s11} 'Snake in the Eye' Ragnarsson directly."),
      (add_quest_note_from_sreg, "qst_revenge_sigurd", 8, s2, 0),
  ]],
  
  [anyone,"kinghorik_quest_revenge21_2", [ #king horik no quiere saber nada
    ],
    "Our meeting is over.", "close_window",[
      (str_store_troop_name_link, s10, "$g_talk_troop"),
      (str_store_string, s2, "@{s10} won't support you with Sigurd Ragnarsson."),
      (call_script, "script_start_quest", "qst_danmork_protection", "$g_talk_troop"),
      (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 2),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  
  [anyone,"kinghorik_quest_revenge65", [ #king horik escucha
    ],
    "Sven and Sigurd are hated and feared by many men. The question is if they are up to something that could affect me.", "kinghorik_quest_revenge55",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (talk_info_show, 0),   ]],
  
  [anyone|plyr,"kinghorik_quest_revenge55", [
    ],
    "Sven Bull Neck has my mother, and he has brought her to Sigurd.", "kinghorik_quest_revenge61",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge55", [
    ],
    "Sigurd tried to make the jarl of Kennemer king of Friese in exchange for an army.", "kinghorik_quest_revenge62",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge55", [
    ],
    "My companion Bodo had something important from the king of Asturias that Sigurd wanted.", "kinghorik_quest_revenge63",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge55", [
    ],
    "Sven Bull Neck has a hideout near Ribe, where he took the Woden Ric prisoners.", "kinghorik_quest_revenge64",[
  ]],
  
  [anyone|other(trp_npc6), "kinghorik_quest_revenge63", [ #bodo
    ],
    "I guess I can no longer maintain the secret, but this is not the place, nor are you the person. However, if I do not speak now, the danger is worse and could be terrible.^^The attack on the Woden Ric was no random act of piracy.", "kinghorik_quest_revenge67", [
      ##            (store_conversation_troop, "trp_npc6"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc6"),
  ]],
  
  [anyone|other(trp_npc6), "kinghorik_quest_revenge67", [ #bodo historia. Soy bodo, hijo de, de Cantabria, emisario del rey x de Asturias, y traia un presente a. Este presente es poderoso y podria hacer a Sigurd rey
    ],
    "My name is Bodo Vimaraniz from Malacoria, in Cantabria. I come from King Aldefonso of Asturias. I was sent north with a present for Aethelred, king of West Seaxe. This present and I are the reason Sven Bull Neck attacked the Woden Ric. " +
    "Sigurd Ragnarsson wants this present for himself, because he wants to be the king of Danmark while his brothers are kings in Englaland.", "kinghorik_quest_revenge68_1", [
      ##            (store_conversation_troop, "trp_npc6"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc6"),
  ]],
  
  [anyone,"kinghorik_quest_revenge68_1", [ #king horik habla
    ],
    "I know that Sigurd wants to be king. How could a gift give him my throne?", "kinghorik_quest_revenge68",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
  ]],
  
  [anyone|other(trp_npc6), "kinghorik_quest_revenge68", [ #bodo historia. Soy bodo, hijo de, de Cantabria, emisario del rey x de Asturias, y traia un presente a. Este presente es poderoso y podria hacer a Sigurd rey
    ],
    "The Ragnarssons are powerful men, with lands in many places, like Danmark, Sweoland and now Northhymbre. Right now, it seems that their efforts are against Englaland, and they are, but this means ensuring that Danmark provide easy access to resources and warriors. " +
    "If Sigurd is king here, he will guarantee all that. Moreover, now he can unite the Danish, for the gift I was carrying was the sword of Ragnar Lodbrok. His sons, Bjorn Ironside and Haesten, lost it when a Muslim fleet defeated them south of Al-Andalus.", "kinghorik_quest_revenge69", [
      ##            (store_conversation_troop, "trp_npc6"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc6"),
  ]],
  [anyone|plyr,"kinghorik_quest_revenge69", [
    ],
    "How did you get the sword from the Muslims?", "kinghorik_quest_revenge7",[
  ]],
  [anyone|plyr,"kinghorik_quest_revenge69", [
    ],
    "Bodo, I'm impressed. You know a lot about the Danish. What are you not telling me?", "kinghorik_quest_revenge7",[
  ]],
  [anyone|plyr,"kinghorik_quest_revenge69", [
    ],
    "(Say nothing)", "kinghorik_quest_revenge71",[
  ]],
  
  [anyone|other(trp_npc6), "kinghorik_quest_revenge7", [
    ],
    "It was a gift to my king made by the emir of Al-Andalus in exchange for valuable prisoners. Aethelred, king of West Seaxe, was very interested in this sword, and my king Aldefonso got it for him.", "kinghorik_quest_revenge71", [
      ##            (store_conversation_troop, "trp_npc6"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc6"),
  ]],
  [anyone|other(trp_npc6), "kinghorik_quest_revenge7", [
    ],
    "I have been before in the north, but this is not important now.", "kinghorik_quest_revenge71", [
      ##            (store_conversation_troop, "trp_npc6"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc6"),
  ]],
  [anyone,"kinghorik_quest_revenge71", [ #king horik habla
    ],
    "Ragnar was more than a man. The skalds revere him as god, and the men feed their souls with his legend. Sigurd could carry the sword to the Assembly and claim the merit of recovering it. He might demand to be king and even kill me, and everyone might just forgive him for having recovered his father's sword. " +
    "Ragnar's sword must be destroyed before anyone knows it exists.", "kinghorik_quest_revenge72",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge72", [
    ],
    "Then maybe we can make a deal: sword for support.", "kinghorik_quest_revenge73",[
  ]],
  [anyone|plyr,"kinghorik_quest_revenge72", [
    ],
    "(Brunhild seems to want to say something. Let her.)", "kinghorik_quest_revenge732",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge73", [
    ],
    "I have business with Sigurd and Sven. I want your protection and support when I need it.", "kinghorik_quest_revenge74",[
  ]],
  
  [anyone,"kinghorik_quest_revenge74", [ #king horik habla
    ],
    "Yes, this is what we do. That sword cannot come to light, but we need to be cautious. Sigurd Ragnarsson is a shrewd man, and he won't attack openly. Go see him for the issues you mentioned to me and try to get the sword. " +
    "I do not care if you steal it, buy it, or promise eternal loyalty, so long as he leaves it in your hands. What I want is that you bring me this sword to destroy. " +
    "In return, when you bring the sword, you'll have my protection while in Danmark, and so I will proclaim, and Sigurd Ragnarsson will not dare to go against you. " +
    "Now I must go. I've been too long with you, and I have other matters to attend to. Good luck and farewell.", "kinghorik_quest_revenge8",[
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_string, s2, "@{s11} supports you and promises his protection while you try to get Ragnar's sword for him."),
      (call_script, "script_start_quest", "qst_danmork_protection", "$g_talk_troop"),
      (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 1),
      (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 6),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_string, s2, "@It seems you will have the support of the king. It's time to try your luck with {s11} 'Snake in the Eye' Ragnarsson."),
      (add_quest_note_from_sreg, "qst_revenge_sigurd", 8, s2, 0),
  ]],
  
  [anyone|other(trp_npc3), "kinghorik_quest_revenge732", [
    ],
    "My king, it was I who told my companions to come to see you before we talk to Sigurd 'Snake in the Eye.' I know that he is a dangerous man, as I served in the house of the jarl of Kennemer. " +
    "We ask for your protection and support for our cause, because {playername}'s mother is in the hands of Sigurd 'Snake in the Eye' and Sven Bull Neck.", "kinghorik_quest_revenge75", [
      ##            (store_conversation_troop, "trp_npc3"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc3"),
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", 20),
      (talk_info_show, 0),  ]],
  [anyone,"kinghorik_quest_revenge75", [ #king horik habla
    ],
    "I understand, girl. You have my support, but I want Ragnar's sword. Sigurd will not kill you, so go talk to him. If you need to, tell him that you are under my protection. " +
    "It is important that you succeed in giving me the sword. I do not care if you have to steal it, but bring it to me. " +
    "Now I must go. I've been too long with you, and I have other matters to attend to. Good luck and farewell.", "kinghorik_quest_revenge8",[
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_string, s2, "@{s11} supports you and promises his protection while you try to get Ragnar's sword for him."),
      (call_script, "script_start_quest", "qst_danmork_protection", "$g_talk_troop"),
      (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 1),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 6),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_string, s2, "@It seems you will have the support of the king. It's time to try your luck with {s11} 'Snake in the Eye' Ragnarsson."),
      (add_quest_note_from_sreg, "qst_revenge_sigurd", 8, s2, 0),
  ]],
  
  [anyone|other(trp_npc6), "kinghorik_quest_revenge8", [
      (str_clear, s2),
    ],
    "{s2}^^{playername}, I have lied to the king. Well, it's not totally a lie. Everything is true except the existence of the sword. I know that the Danish give much importance to everything that has to do with Ragnar, and I used that. " +
    "It was a risk, but we needed the king on our side. I hope you understand.", "kinghorik_quest_revenge81", [
      (str_store_string, s2, "@--Bodo grabs your arm to keep you from leaving his side and waits until the king is away before looking into your eyes and speaking.--", color_good_news),
      ##            (store_conversation_troop, "trp_npc6"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc6"),
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge81", [ (neq, "$defect_type", cb6_justice),
    ],
    "The sword was important for getting the king's support. Thank you. Now, tell me the truth.", "kinghorik_quest_revenge82",[
  ]],
  [anyone|plyr,"kinghorik_quest_revenge81", [
    ],
    "No, Bodo! I don't know your game, but do not lie in the future. Now tell me the whole truth.", "kinghorik_quest_revenge84",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge81", [(eq, "$defect_type", cb6_justice),
    ],
    "Lying isn't tolerable, never lie again, Bodo, or I will take action against you. (Justice)", "kinghorik_quest_revenge84",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", -5),
  ]],
  
  [anyone|other(trp_npc3), "kinghorik_quest_revenge82", [
    ],
    "I disagree. How can we now justify to the king that there is no sword? " +
    "Lying only brings problems. Everyone knows that. At least, everyone ought to know that.", "kinghorik_quest_revenge84", [
      ##            (store_conversation_troop, "trp_npc3"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc3"),
      (call_script, "script_change_player_relation_with_troop", "trp_npc3", -5),
  ]],
  
  [anyone|other(trp_npc6), "kinghorik_quest_revenge84", [
      (str_clear, s2),
    ],
    "{s2}^^I am an honorable man. Honor is my law, but I owe allegiance to my king and to the mission that he entrusted to me. It took years of visiting this foreign land since the Rex Ordonio, father of current king of Asturias, sent me. " +
    "This is hard to understand, but Asturias is a small kingdom, where every man must fight as a warrior or die at the hands of our enemies. We fight every year against the power of Al-Andalus. It is a constant front, and we thought our backs were safe until the Vikings arrived. " +
    "Old King Ordonio, and now his son, King Aldefonso, want an alliance with Frankia and West Seaxe to protect ourselves from the Vikings and make the seas safer.", "kinghorik_quest_revenge85", [
      (str_store_string, s2, "@--He seems hurt, puts a hand over his heart, and looks at your eyes.--", color_good_news),
      ##            (store_conversation_troop, "trp_npc6"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc6"),
  ]],
  [anyone|other(trp_npc6), "kinghorik_quest_revenge85", [
      (str_clear, s2),
    ],
    "I carried a letter sealed by my king himself for the king of West Seaxe. It is a letter of alliance that had to be sent in secret, lest it be intercepted. And I failed. " +
    "The letter is now in the hands of Sigurd Ragnarsson, one of the men who tried to protect us. Do you understand the pity of it? " +
    "Not so long ago his brothers, Bjorn Ironside and Halfdan, attacked Gallaecia, the western part of the Kingdom of Asturias.", "kinghorik_quest_revenge86", [
      ##            (store_conversation_troop, "trp_npc6"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc6"),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_string, s2, "@Bodo lied about the sword of King Ragnar. What he was carrying was a letter of alliance for West Seaxe that is now in the hands of {s11}."),
      (add_quest_note_from_sreg, "qst_danmork_protection", 4, s2, 0),
  ]],
  [anyone|other(trp_npc3), "kinghorik_quest_revenge86", [
    ],
    "{playername}, Bodo isn't well, and we shouldn't lose more time here. It is time to talk to Sigurd 'Snake in the Eye.'", "kinghorik_quest_revenge87", [
      ##            (store_conversation_troop, "trp_npc3"), #3 person conversation
      ##            (set_conversation_speaker_troop, "trp_npc3"),
  ]],
  [anyone|plyr,"kinghorik_quest_revenge87", [
    ],
    "We're in rush now, but we'll talk about your mission later, Bodo. Now, let's go.", "close_window",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -2),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),   ]],
  [anyone|plyr,"kinghorik_quest_revenge87", [
    ],
    "Well, let's bother Bodo no more. We're looking for Sigurd.", "close_window",[
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),   ]],
  ###rey support chief acaba
  ###rey thing ###############
  [anyone|plyr,"kinghorik_quest_danmarkprot", [
    ],
    "Sigurd Ragnarsson sent men to kill us at Ulf's farmstead.", "kinghorik_quest_danmarkprot1",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_danmarkprot", [
    ],
    "Sigurd promised to give me Sven and my mother at Ulf's farm, but we were attacked instead.", "kinghorik_quest_danmarkprot2",[
  ]],
  
  [anyone,"kinghorik_quest_danmarkprot2", [ #king horik escucha
    ],
    "Sigurd will not deliver up Sven Bull Neck, his best man. If you believed he would do such a thing, then you're dumber than I thought.", "kinghorik_quest_danmarkprot1",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -2),
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_danmarkprot1", [ #egil
    ],
    "My king, as you've asked me, I've been your eyes and ears. I know all the important information, because in {playername}'s camp there are no secrets. " +
    "As you already know, {playername} is the one who broke Sigurd's plans to put a puppet on the throne of Friese. It was more likely an accident than a deliberate act, as {playername} is looking for Sven Bull Neck, Sigurd's first man, for revenge, because Sven has imprisoned {playername}'s mother. " +
    "When {playername} talked to Sigurd, they agreed that, in exchange for Bodo the Cantabrian, Sigurd would deliver up Sven and {playername}'s mother at Ulf's farm.", "kinghorik_quest_danmarkprot3", [
  ]],
  
  
  [anyone,"kinghorik_quest_danmarkprot3", [ #king horik escucha
      (main_party_has_troop,"trp_npc6"),
    ],
    "Yes, it is more or less what I expected.", "kinghorik_quest_danmarkprot4",[
      (str_store_string, s2, "@--The king seems impatient.--", color_good_news),
  ]],
  
  [anyone,"kinghorik_quest_danmarkprot3", [ #king horik escucha
    ],
    "{s2}^^Yes, I heard that Sigurd holds Bodo prisoner. Bodo will be tortured, and when they finish, Sigurd will kill him and deliver his body to Njord.", "kinghorik_quest_danmarkprot4",[
      (str_store_string, s2, "@--The king seems impatient.--", color_good_news),
      (talk_info_show, 0),   ]],
  
  [anyone|plyr,"kinghorik_quest_danmarkprot4", [
    ],
    "Egil, traitor, you're nothing but a spy!", "kinghorik_quest_danmarkprot41",[
  ]],
  [anyone|plyr,"kinghorik_quest_danmarkprot4", [
    ],
    "--Do not say anything.--", "kinghorik_quest_danmarkprot5",[
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_danmarkprot41", [
    ],
    "{s2}^^I'm no traitor. I'm loyal to my king, and I'm helping you more than you think. " +
    "King Horik has a network of informants in all locations, and he already knew about you, but especially Bodo, before you arrived.", "kinghorik_quest_danmarkprot42", [
      (str_store_string, s2, "@--He seems upset.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -5),
  ]],
  
  [anyone,"kinghorik_quest_danmarkprot42", [ #king horik escucha
    ],
    "Egil, continue. You know that my time and my patience are limited.", "kinghorik_quest_danmarkprot5",[
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_danmarkprot5", [
    ],
    "There is a problem. Sigurd sent Olvir White Hair to kill {playername}. Olvir has died, but not before declaring that Sigurd 'Snake in the Eye' would take his case to the Assembly. " +
    "I'm sure Ulf will be one witness in his favor. By now, my king, many have seen {playername} talking to you. Sigurd could use this against you.", "kinghorik_quest_danmarkprot6", [
  ]],
  
  
  [anyone,"kinghorik_quest_danmarkprot6", [ #king horik escucha
    ],
    "{s2}^^You have traveled with {playername}. What do you think of {reg59?her:him}?", "kinghorik_quest_danmarkprot61",[
      (str_store_string, s2, "@--He remains thoughtful a moment.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_danmarkprot61", [
      (troop_get_slot, ":relation", "trp_npc2", slot_troop_player_relation),
      (ge, ":relation", 15),
    ],
    "I admire {reg59?her:him}. {reg59?She:He} is someone with a very clear mind, tireless goals and favor with the gods. {reg59?Her:His} luck is greater than that of other men and women I have known. " +
    "You can trust {reg59?her:him} to help us advance our agenda.", "kinghorik_quest_danmarkprot7", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_danmarkprot61", [
      (troop_get_slot, ":relation", "trp_npc2", slot_troop_player_relation),
      (le, ":relation", -15),
    ],
    "{reg59?She:He} is a bad leader, stupid, stubborn, and unbearable. Many times I had to restrain myself not to spit in {reg59?her:his} face. But {reg59?her:his} luck is greater than I have known. " +
    "I do not know how, but {reg59?she:he} is always victorious. {reg59?She:He} will help us advance our agenda.", "kinghorik_quest_danmarkprot7", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_danmarkprot61", [
    ],
    "I have not much to say. {reg59?She:He} is someone pretty normal. I have not seen anything special. Well, except for one thing: {reg59?her:his} luck. {reg59?Her:His} luck is greater than I have known. " +
    "I do not know how, but {reg59?she:he} is always victorious. {reg59?She:He} will help us advance our agenda.", "kinghorik_quest_danmarkprot7", [
  ]],
  
  [anyone,"kinghorik_quest_danmarkprot7", [ #king horik escucha
    ],
    "{s2}^^Bodo's mission was not a secret, neither for me nor for Sigurd 'Snake in the Eye,' despite all the means taken to make it so. There's a man in the court of Asturias willing to do anything to finish off their king, Aldefonso. Can you believe it? " +
    "Although that kingdom is so far away, they have the same problems that we do! I knew all about this long before you came to see me for the first time, although I pretended to know nothing.", "kinghorik_quest_danmarkprot8",[
      (str_store_string, s2, "@--He looks directly into your eyes.--", color_good_news),
  ]],
  
  [anyone|plyr,"kinghorik_quest_danmarkprot8", [
    ],
    "I do not like anybody playing with me, even a king.", "kinghorik_quest_danmarkprot81",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_danmarkprot8", [
    ],
    "You laughed at us when we first spoke.", "kinghorik_quest_danmarkprot81",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_danmarkprot8", [
    ],
    "I see. You and Sigurd play a game of intrigues for the throne, and I'm in the middle.", "kinghorik_quest_danmarkprot9",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_danmarkprot8", [
    ],
    "--Say nothing.--", "kinghorik_quest_danmarkprot9",[
  ]],
  
  [anyone,"kinghorik_quest_danmarkprot81", [
    ],
    "Do not be so dramatic, though I like your boldness. I needed to see what Sigurd was willing to risk. Clearly, the stakes are high, and Sigurd is very interested in killing you.", "kinghorik_quest_danmarkprot9",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  
  [anyone,"kinghorik_quest_danmarkprot9", [ #king horik escucha
    ],
    "{s2}^^Sigurd wants my kingdom. He has gathered an army with the excuse of going to help his brothers in Englaland, but I fear he could use these men to take my throne if he gets favor in the Assembly. " +
    "Now he has two options to play for such favor: first, Bodo's letter from the Kingdom of Asturias and second, Olvir White Hair's death.", "kinghorik_quest_danmarkprot10",[
      (str_store_string, s2, "@--He sighs.--", color_good_news),
  ]],
  
  [anyone,"kinghorik_quest_danmarkprot10", [ #king horik escucha
    ],
    "Our fates are crossed, {playername}. The soothsayers told me about you before you came. They said that a {reg59?woman:man} whose luck is greater than that of Sigurd would come, a {reg59?woman:man} who will save my throne. " +
    "You want Sven Bull Neck and your mother, and I want to thwart Sigurd's plans. I'll help you and you help me. From now on, you have my official protection in Danmark.", "kinghorik_quest_danmarkprot11",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 16),
      (call_script, "script_end_quest", "qst_danmork_protection"),
      (add_xp_as_reward,200),
      (call_script, "script_change_troop_renown", "trp_player", 15),
      
  ]],
  
  [anyone|plyr,"kinghorik_quest_danmarkprot11", [
    ],
    "Can you tell me what your plans are?", "kinghorik_quest_danmarkprot111",[
  ]],
  [anyone|plyr,"kinghorik_quest_danmarkprot11", [
    ],
    "You take for granted too many things. I am not in your service. I do not think I need you.", "kinghorik_quest_danmarkprot112",[
  ]],
  [anyone|plyr,"kinghorik_quest_danmarkprot11", [
    ],
    "We will be allies for now, but when this is over, I want nothing more to do with you two.", "kinghorik_quest_danmarkprot113",[
  ]],
  
  
  [anyone,"kinghorik_quest_danmarkprot111", [ #king horik escucha
    ],
    "Well, I'm glad to see you're on my side. Listen now.", "kinghorik_quest_danmarkprot12",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  [anyone,"kinghorik_quest_danmarkprot112", [ #king horik escucha
    ],
    "I see that you are so dense that you need every bit of luck the gods have compensated you with. Now listen closely. You need to go to the Assembly, where you cannot go without my patronage. There will be Sven Bull Neck, the man who wants to accuse you of the death of his brother. If you aren't at the Assembly, you won't be able to defend yourself, " +
    "so you will lose. Then the Assembly will banish you and put you outside the protection of the law. Any and every Dane is free to kill or otherwise mistreat such an outlaw, so, to the contrary, you very much need me if you wish to get your mother back and kill Sven. Now, listen to me.", "kinghorik_quest_danmarkprot12",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone,"kinghorik_quest_danmarkprot113", [ #king horik escucha
    ],
    "Sounds good, and it's just. While our interests run together, we will be allies. Then, you'll be leaving Danmark.", "kinghorik_quest_danmarkprot12",[
  ]],
  
  [anyone,"kinghorik_quest_danmarkprot12", [ #king horik plan
    ],
    "{s2}^^There is a man named Guthrum, who is a faithful man respected in Danmark. I will ask him to lead Sigurd's Vikings to provide support for the invasion of Englaland by the sons of Ragnar. " +
    "However, my proposal will not succeed if Sigurd 'Snake in the Eye' presents Bodo's letter in the Assembly or if he can associate me with the death of Olvir White Hair.", "kinghorik_quest_danmarkprot13",[
      (str_store_string, s2, "@--His hands move quickly as he explains his thoughts.--", color_good_news),
  ]],
  
  [anyone,"kinghorik_quest_danmarkprot13", [ #king horik plan
    ],
    "Unfortunately, the letter has been hidden. My contacts say that Sigurd gave it to Atli Eiriksson, his second man after Sven Bull Neck. Atli sailed from Ribe some time ago, and no one knows his fate. " +
    "Perhaps the Ribe port master knows something, but he will not talk to my people. You have to get this letter soon while I buy loyalties for the Assembly.", "kinghorik_quest_danmarkprot14",[
      (str_clear, s3),
      (str_clear, s10),
      (str_clear, s11),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_troop_name_link, s10, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_town_4"),
      (str_store_string, s2, "@{s10} needs to recover Bodo's letter in order to prevent its use by Sigurd 'Snake in the Eye' to get the Danmark jarls' favor in the Assembly. {s10} told you that a man of Sigurd's called Atli has the letter. " +
      "However, Atli sailed from {s3} some time ago, and no one knows his fate. You should inquire with {s3} port master about this matter."),
      (call_script, "script_start_quest", "qst_bodo_letter", "$g_talk_troop"),
      (quest_set_slot,"qst_bodo_letter",slot_quest_current_state, 1),
  ]],
  
  [anyone|plyr,"kinghorik_quest_danmarkprot14", [
      (store_skill_level, ":trade", "skl_trade", "trp_player"),
      (gt, ":trade", 2),
    ],
    "Getting the information could be expensive. I need more money.", "kinghorik_quest_danmarkprot151",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_danmarkprot14", [
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (gt, ":persuasion", 5),
    ],
    "I'll take care of this, but need some financial help.", "kinghorik_quest_danmarkprot151",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_danmarkprot14", [
    ],
    "The port master and I will have a few words.", "kinghorik_quest_danmarkprot16",[
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_danmarkprot151", [ #bodo
    ],
    "I know the Ribe port master, and he is an ambitious man. We need enough money to purchase the information.", "kinghorik_quest_danmarkprot153", [
  ]],
  
  [anyone,"kinghorik_quest_danmarkprot153", [ #king horik habla
    ],
    "Well, I reserve some of my treasure for these contingencies. You may take 15,000 peningas. I hope it's enough to pay the port master and for other possible expenses.", "kinghorik_quest_danmarkprot16",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (call_script, "script_troop_add_gold", "trp_player", 15000),
  ]],
  
  [anyone, "kinghorik_quest_danmarkprot16", [ #bodo historia. Soy bodo, hijo de, de Cantabria, emisario del rey x de Asturias, y traia un presente a. Este presente es poderoso y podria hacer a Sigurd rey
    ],
    "Also, if you want to keep your head on your neck, I would suggest you talk to Ulf and convince him not to testify against you at the Assembly. " +
    "Another thing that might help would be to have good relations with the jarls of Danmark, so that they will speak well of you at the Assembly. I would recommend you meet them and try to get acquainted", "kinghorik_quest_danmarkprot17", [
      (str_store_troop_name_link, s10, "$g_talk_troop"),
      (str_store_string, s2, "@{s10} suggested that you talk to Ulf at his farmstead to convince him not to testify against you at the Assembly. " +
        "In addition, {s10} said it would be a good idea to have good relations with the jarls of Danmark, so they would speak positively on your behalf " +
        "at the Assembly (>15 relation points for neutral testimony, >30 for positive)."),
      (call_script, "script_start_quest", "qst_ulf_testigo", "$g_talk_troop"),
      (quest_set_slot,"qst_ulf_testigo",slot_quest_current_state, 1),
  ]],
  
  [anyone|plyr,"kinghorik_quest_danmarkprot17", [
      (str_clear, s2),
      (str_clear, s4),
      (str_clear, s9),
      (str_clear, s10),
    ],
    "I surely will. I value my neck.", "kinghorik_quest_danmarkprot181",[
      (try_for_range, ":troop_no", active_npcs_begin, active_npcs_end), #jarls relation check for quest chief
        (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
        (store_troop_faction, ":troop_faction_no", ":troop_no"),
        (eq, ":troop_faction_no", "fac_kingdom_1"),
        (call_script, "script_troop_get_relation_with_troop", "trp_player", ":troop_no"),
        (ge, reg0, 15),
        (str_store_troop_name_link, s9, ":troop_no"),
        (str_store_string, s4, "@{s9} has good relations with you."),
        (str_store_string, s2, "@{!}{s2}^{s4}"),
        (add_quest_note_from_sreg, "qst_ulf_testigo", 5, s2, 0),
      (try_end),
  ]],
  [anyone|plyr,"kinghorik_quest_danmarkprot17", [
      (str_clear, s2),
      (str_clear, s4),
      (str_clear, s9),
      (str_clear, s10),
    ],
    "I think we have nothing more to talk about. Farewell.", "kinghorik_quest_danmarkprot182",[
      (try_for_range, ":troop_no", active_npcs_begin, active_npcs_end), #jarls relation check for quest chief
        (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
        (store_troop_faction, ":troop_faction_no", ":troop_no"),
        (eq, ":troop_faction_no", "fac_kingdom_1"),
        (call_script, "script_troop_get_relation_with_troop", "trp_player", ":troop_no"),
        (ge, reg0, 15),
        (str_store_troop_name_link, s9, ":troop_no"),
        (str_store_string, s4, "@{s9} has good relations with you."),
        (str_store_string, s2, "@{!}{s2}^{s4}"),
        (add_quest_note_from_sreg, "qst_ulf_testigo", 5, s2, 0),
      (try_end),
  ]],
  
  [anyone,"kinghorik_quest_danmarkprot181", [
    ],
    "Your neck is also important to me now, so trust me. Good luck.", "kinghorik_quest_danmarkprot19",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 8),
  ]],
  [anyone,"kinghorik_quest_danmarkprot182", [
    ],
    "You're right. I've spent much time here. Good luck.", "kinghorik_quest_danmarkprot19",[
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_danmarkprot19", [
      (str_clear, s2),
    ],
    "{s2}^^{playername}, we have a mission to fulfill.", "kinghorik_quest_danmarkprot20", [
      (str_store_string, s2, "@--Egil walks away with King Horik for a moment, and you see them speak quietly. Then King Horik leaves, and Egil comes back to you.--", color_good_news),
  ]],
  
  
  [anyone|plyr,"kinghorik_quest_danmarkprot20", [
    ],
    "Very well, but I will not forget you or your betrayal, Egil.", "kinghorik_quest_danmarkprot21",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_danmarkprot20", [
    ],
    "Yes, let us not waste any more time.", "close_window",[
      
      (str_clear, s9),
      (str_store_troop_name_link, s9, "trp_kingdom_1_lord"),
      (str_store_string, s2, "@Note Egil: You chose to ignore that Egil was a spy of {s9} among your men."),
      (add_quest_note_from_sreg, "qst_notes_companions", 6, s2, 0),
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -5),
      (display_message,"@Reginhard thinks that you are a weak leader for not punishing Egil's betrayal."),
      (call_script, "script_change_troop_renown", "trp_player", -15),
      (call_script, "script_change_player_party_morale", -8),
      (display_message,"@Your men think that you are a weak leader for not punishing Egil's betrayal."),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),     ]],
  
  [anyone|other(trp_npc3), "kinghorik_quest_danmarkprot21", [
      (str_clear, s2),
      (str_clear, s3),
    ],
    "{s2}^^You're a liar, Egil. You tricked me, I trusted you. I thought there might be something between us, and all you wanted was information about {playername}. I... we... I thought...^^{s3}", "kinghorik_quest_danmarkprot22", [
      (str_store_string, s2, "@--Brunhild's eyes are a well of tears.--", color_good_news),
      (str_store_string, s3, "@--She runs away from you.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_danmarkprot22", [
      (str_clear, s2),
    ],
    "{s2}^^King Horik is my king and my father. My loyalty is to him above any other. I don't have to give anyone an explanation. " +
    "I didn't use Brunhild. We both had fun. It's her fault if she thought that it was something more. She should've known that someone like me will never marry, and certainly not a Frisian slave. " +
    "You can think whatever you want, but thanks to me, you have the support of my father.", "kinghorik_quest_danmarkprot23", [
      (str_store_string, s2, "@--He seems hurt, puts a hand over his heart, and looks in your eyes.--", color_good_news),
  ]],
  
  [anyone|plyr,"kinghorik_quest_danmarkprot23", [
    ],
    "When this is over, you will walk away. You will go back to your dear father.", "close_window",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -5),
      (str_clear, s9),
      (str_store_troop_name_link, s9, "trp_kingdom_1_lord"),
      (str_store_string, s2, "@Note Egil: You warn Egil that he will have to leave your party after the Assembly, as he was a spy of {s9} among your men."),
      (add_quest_note_from_sreg, "qst_notes_companions", 6, s2, 0),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),   ]],
  [anyone|plyr,"kinghorik_quest_danmarkprot23", [
    ],
    "You'll pay for what you've done to Brunhild. When this is over, I will duel you.", "close_window",[
      (str_clear, s9),
      (str_store_troop_name_link, s9, "trp_kingdom_1_lord"),
      (str_store_string, s2, "@Note Egil: You warn Egil that you will duel him to the death after the Assembly, as he was a spy of {s9} among your men and broke the heart of Brunhild."),
      (add_quest_note_from_sreg, "qst_notes_companions", 6, s2, 0),
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -10),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),   ]],
  [anyone|plyr,"kinghorik_quest_danmarkprot23", [
    ],
    "I do not want to talk about this. It's time to go.", "close_window",[
      (str_clear, s9),
      (str_store_troop_name_link, s9, "trp_kingdom_1_lord"),
      (str_store_string, s2, "@Note Egil: You chose to ignore that Egil was a spy of {s9} among your men."),
      (add_quest_note_from_sreg, "qst_notes_companions", 6, s2, 0),
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -5),
      (display_message,"@Reginhard thinks that you are a weak leader for not punishing Egil's betrayal."),
      (call_script, "script_change_troop_renown", "trp_player", -15),
      (call_script, "script_change_player_party_morale", -8),
      (display_message,"@Your men think that you are a weak leader for not punishing Egil's betrayal."),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),   ]],
  
  ###The Assembly session king
  [anyone,"kinghorik_quest_thething1", [
      (str_clear, s2),
    ],
    "{s2}^^Why have you been so long in coming? Sigurd Ragnarsson is looking strong.", "kinghorik_quest_thething2",[
      (str_store_string, s2, "@--He looks worried.--", color_good_news),
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, 50), #Chief, we will use this hide indicator for judge reactions and juice progress
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething2", [
    ],
    "I had to resolve some issues, but still, I arrived on time.", "kinghorik_quest_thething3",[
  ]],
  [anyone|plyr,"kinghorik_quest_thething2", [
    ],
    "I came as soon as I got your message. Maybe it was your messenger who was delayed?", "kinghorik_quest_thething3",[
  ]],
  
  [anyone,"kinghorik_quest_thething3", [
    ],
    "No matter, I think they are also awaiting your arrival, which means that maybe I should not have sent for you. I suspect they have some ploy to launch. " +
    "Sigurd Ragnarsson has complained of 800 men who cannot board because I will not let him lead them. That much is true, because I proposed that Guthrum lead them. " +
    "The problem is that Guthrum some days ago suffered the misfortune to have been killed on his farm. They accuse outlaws and criminals of burning down his house whilst he was hosting a feast inside. " +
    "I think that it was Sven Bull Neck, the prow man of Sigurd's hird, who did it, but I have no evidence or witnesses. Everything and everyone was burned with the house.", "kinghorik_quest_thething4",[
      (talk_info_show, 0),  ]],
  
  [anyone,"kinghorik_quest_thething4", [
    ],
    "Everything taken together, the situation is quite serious. Since Guthrum is dead, Sigurd is pushing hard to gain control of those 800 men. I fear he wishes to use them to take my throne.", "kinghorik_quest_thething5",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething5", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@Things being as they are, I cannot do anything. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@I see. I don't know what to say. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Guthrum's dead, but we're not. Trust me. I'll help you to get out of this. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Nothing is lost. We have thwarted all Sigurd's plans so far. (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "kinghorik_quest_thething61",[
      (str_clear, s10),
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething5", [
    ],
    "Let's see what happens.", "kinghorik_quest_thething7",[
  ]],
  [anyone|plyr,"kinghorik_quest_thething5", [
    ],
    "I do not care about your problems. I'm here for Bull Neck Sven and my mother.", "kinghorik_quest_thething63",[
  ]],
  
  [anyone,"kinghorik_quest_thething61", [
      (str_clear, s4),
    ],
    "{!}{s4}", "kinghorik_quest_thething7",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s4, "@Yes, the Norns that spin our fates play with us. I hope that their next threads help us."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s4, "@Don't worry about it. I shouldn't try to speak about complex topics with you."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s4, "@I'm not so sure. Your appearance in Danmark has benefited me in some ways, but in others, not so much."),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s4, "@We'll see. Sigurd is the most cunning of all the children of Ragnar."),
      (try_end),
  ]],
  
  [anyone,"kinghorik_quest_thething63", [
    ],
    "My problems are your problems. If Sigurd triumphs, your life will be worth nothing without my protection. The Assembly will name you an outlaw. You will lose everything and have to hide in the woods until someone kills you.", "kinghorik_quest_thething7",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone|other(trp_leader_svenlair), "kinghorik_quest_thething7", [
      (str_clear, s2),
    ],
    "{s2}^^Greetings, {playername}. Sven Bull Neck has permission to speak to the assembly now. Let's see what that rat has to say.", "kinghorik_quest_thething8_1", [
      (str_store_string, s2, "@--Harald seems tense, his features hardened and eyes watchful. He protects his lord as close as his shadow.--", color_good_news),
  ]],
  
  [anyone, "kinghorik_quest_thething8_1", [
      (str_clear, s2),
    ],
    "Silence! Let's see what that snake has to say.", "kinghorik_quest_thething8", [
  ]],
  
  [anyone|other(trp_sven_bull_neck), "kinghorik_quest_thething8", [
      (str_clear, s2),
    ],
    "{s2}^^Men of Danmark, you know me. When I was little more than a child, I was with Ragnar when he sacked Frankia with 120 ships and more than 4,000 men, an adventure that the skalds still relate. " +
    "I am the man who led 400 Vikings in West Seaxe, the strongest kingdom in Englaland, to obtain great fame and wealth. Therefore, men fear me across Friese, Englaland, and Frankia, but here in Danmark, they rightfully respect and love me.", "kinghorik_quest_thething81", [
      (str_store_string, s2, "@--Sven Bull Neck appears to be a determined man, confident, and seemingly a born leader. He is tall and strong and possesses a strong voice. " +
      "At long last, you see him face to face. He looks just as your mind remembers him as he attacked the Woden Ric and kidnapped your mother. Finally, right before you is the man who has so damaged you.--", color_good_news),
  ]],
  
  [anyone|other(trp_sven_bull_neck), "kinghorik_quest_thething81", [
      (str_clear, s2),
    ],
    "I had a brother, Olvir White Hair, a better man than me. He was a man of honor, loved by the gods, but in the prime of life, he was murdered. Now the king protects his murderer. " +
    "I have never demanded anything of the Assembly, but now I call for justice. Is it right that his murderer be here, among us, or that a king protect evil? Shall murderers go unpunished in this land?^^{s2}", "kinghorik_quest_thething82", [
      (str_store_string, s2, "@--Sven Bull Neck has tears in his eyes as he points with an accusing finger at you.--", color_good_news),
      
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
      (val_add, ":basic_stamina", 10),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      (display_message,"@The judges nod at the words of Sven Bull Neck. This makes your situation more complicated."),
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_thething82", [
      (str_clear, s2),
    ],
    "{s2}^^It's what we expected. They use you to attack King Horik and undermine his authority.", "kinghorik_quest_thething83", [
      (str_store_string, s2, "@--Egil whispers.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething83", [
      (str_clear, s2),
    ],
    "{s2}^^Everyone knows your worth, Sven Bull Neck, and the feats you've done in your past, but your words seem to indicate that a king could support a murderer. This charge is very grave. The Assembly shall now listen to King Horik's response.", "kinghorik_quest_thething85", [
      (str_store_string, s2, "@--One judge, near the big rock, looks first at Sven and Jarl Sigurd, then at you and King Horik. Then he speaks.--", color_good_news),
  ]],
  
  [anyone,"kinghorik_quest_thething85", [
    ],
    "Sven insults me. I have never protected nor will ever protect a murderer. If that were what I was doing, it was in ignorance. {playername} came to me for protection as a free {reg59?lady:man}, and I gave it to {reg59?her:him} after {reg59?she:he} proved {reg59?her:his} worth. " +
    "The story {reg59?she:he} told me about the death of Olvir White Hair is quite different.", "kinghorik_quest_thething86",[
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething86", [
    ],
    "Now, it is time for the accused to speak on this matter.", "kinghorik_quest_thething9", [
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething9", [
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (gt, ":persuasion", 5),
    ],
    "You decide to discredit Sven Bull Neck. (Persuasion)", "kinghorik_quest_thething90",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething9", [
    ],
    "You decide to appeal to the crowd's sympathy by mentioning your mother's kidnapping.", "kinghorik_quest_thething91",[
  ]],
  [anyone|plyr,"kinghorik_quest_thething9", [
    ],
    "You think it better to describe events without mentioning your mother's kidnapping.", "kinghorik_quest_thething92",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething90", [
    ],
    "My name is {playername}. Olvir White Hair tried to kill me at the behest of his brother, Sven Bull Neck. I was at peace on Ulf's farm, where I had gone by agreement with Sigurd Ragnarsson, present here today. Olvir White Hair came there with several men to try to kill me. As I always take strong issue with such a project, it was Olvir who died. " +
    "I ask you, why did Sven send Olvir if he is the one who wants to get rid of me? I think it's because he fears me. Despite all of his bold words, he is in fact a coward who attacks defenseless ships and hides behind the cloak of his lord.", "kinghorik_quest_thething90_1",[
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
      (val_sub, ":basic_stamina", 10),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      (display_message,"@The judges nod at your words. Your situation seems to improve before your eyes."),
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething91", [
    ],
    "My name is {playername}, and I'm no murderer. Olvir's death was self-defense. Sven Bull Neck had kidnapped my mother, but Sigurd Ragnarsson promised to give her back to me at Ulf's farm. Instead, he sent Olvir White Hair to kill me. Although Olvir White Hair fought hard during the battle, he was wounded and died.", "kinghorik_quest_thething94",[
  ]],
  [anyone|plyr,"kinghorik_quest_thething92", [
    ],
    "My name is {playername}, and I'm no murderer. Olvir's death was self-defense. I was at Ulf's farm, waiting for Sigurd Ragnarsson's messenger. Instead, Olvir White Hair came and attacked me, but he was mortally wounded during the battle.", "kinghorik_quest_thething95",[
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_thething90_1", [
      (str_clear, s2),
    ],
    "{s2}^^Well spoken. I think you've left him speechless.", "kinghorik_quest_thething95", [
      (str_store_string, s2, "@--Egil whispers.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_sven_bull_neck", -10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", 10),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  
  [anyone|other(trp_sven_bull_neck), "kinghorik_quest_thething94", [ #madre
      (str_clear, s2),
    ],
    "{reg59?Her:His} mother was bounty from off the shores of Friese. When I was raiding, I attacked a ship called the Woden Ric. " +
    "She was my slave, as was my right, but I found that she is a seidr. Now she advises me -- as my wife.^^{s2}", "kinghorik_quest_thething95", [
      (str_store_string, s2, "@--Sven Bull Neck smiles.--", color_good_news),
      
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
      (val_add, ":basic_stamina", 5),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      (display_message,"@The judges nod at the words of Sven Bull Neck. This makes your situation more complicated."),
  ]],
  
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething95", [
    ],
    "We have heard both parties. It is time to call the witnesses.", "kinghorik_quest_thething10", [
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_thething10", [
      (str_clear, s2),
    ],
    "{s2}^^I am Egil. You all know me here, and may the gods damn me if I lie. I was at Ulf's farm when Olvir White Hair came. My father, King Horik, is always concerned about what happens in this land. He compelled me to travel with {playername}. " +
    "Olvir White Hair came with many men. I swear it was he who started the fight. Olvir died a good death, but he was the one who caused the melee. {playername} isn't guilty of murder.", "kinghorik_quest_thething11", [
      (str_store_string, s2, "@--Egil comes forward before the judges.--", color_good_news),
  ]],
  
  [anyone|other(trp_sven_bull_neck), "kinghorik_quest_thething11", [ #madre
      (this_or_next|troop_has_item_equipped,"$g_player_troop","itm_sword_of_war"),
      (player_has_item,"itm_sword_of_war"),
    ],
    "Unfortunately for you, I can show that you are a liar. Olvir did not die a good death, " +
    "for the murderer has Olvir's sword. {reg59?She:He} did not let my brother hold the sword in his last moments, denying him Walhalla. Egil is a liar, and his testimony is not valid.", "kinghorik_quest_thething11_1", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
      (val_add, ":basic_stamina", 20),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      (display_message,"@The judges nod at the words of Sven Bull Neck. This makes your situation more complicated."),
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething11", [
      (str_clear, s2),
    ],
    "{s2}^^We have heard from a witness. Thank you, Egil. Sven Bull Neck, do you have any witnesses?", "kinghorik_quest_thething12", [
      (str_store_string, s2, "@--The judges confer among themselves for a moment, and then the spokesman speaks.--", color_good_news),
      
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
      (val_sub, ":basic_stamina", 20),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      (display_message,"@The judges nod at the words of Egil. This makes your situation improve before your eyes."),
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething11_1", [
      (str_clear, s2),
    ],
    "{s2}^^Egil has lied. Therefore, his testimony is not valid. Sven Bull Neck, do you have any witnesses?", "kinghorik_quest_thething12", [
      (str_store_string, s2, "@--The judges confer among themselves for a moment, and then the spokesman speaks.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  
  [anyone|other(trp_sven_bull_neck), "kinghorik_quest_thething12", [ #madre
    ],
    "I had an important witness, Ulf Thorirsson, but he has not come to the Assembly. " +
    "Another man told me how my brother was killed, but he will not testify in this case.", "kinghorik_quest_thething13", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
      (val_sub, ":basic_stamina", 20),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      (display_message,"@The judges shake their heads. This makes your situation improve before your eyes."),
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething13", [ #opinion jarls
      (str_clear, s2),
    ],
    "We would like to hear from the jarls in attendance. What are your opinions?", "kinghorik_quest_thething13_1", [
  ]],
  
  [anyone|other(trp_knight_1_2), "kinghorik_quest_thething13_1", [ #opinion jarls
      (str_clear, s4),
    ],
    "{!}{s4}.", "kinghorik_quest_thething13_2", [
      (call_script, "script_troop_get_player_relation", "trp_knight_1_2"),
      (assign, ":relation", reg0),
      #    (troop_get_slot, ":relation", "trp_knight_1_2", slot_troop_player_relation),
      (try_begin),
        (gt, ":relation", 80),
        (str_store_string, s4, "@I know {playername}, I would put my hand in the fire for {reg59?her:his} innocence.", color_good_news),
        
        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
        (val_sub, ":basic_stamina", 20),
        (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
        (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
        (display_message,"@The judges nod at his words. This makes your situation improve very much before your eyes."),
      (else_try),
        (gt, ":relation", 30),
        (str_store_string, s4, "@In my opinion, {playername} is innocent.", color_good_news),
        
        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
        (val_sub, ":basic_stamina", 10),
        (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
        (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
        (display_message,"@The judges nod at his words. This makes your situation improve before your eyes."),
      (else_try),
        (gt, ":relation", 15),
        (str_store_string, s4, "@I do not have enough information to assess for or against.", color_good_news),
      (else_try),
        (str_store_string, s4, "@In my opinion, {playername} is guilty of murdering Olvir White Hair.", color_good_news),
        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
        (val_add, ":basic_stamina", 10),
        (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
        (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
        (display_message,"@The judges nod at his words. This makes your situation more complicated."),
      (try_end),
  ]],
  
  [anyone|other(trp_knight_1_1), "kinghorik_quest_thething13_2", [ #opinion jarls
      (str_clear, s4),
    ],
    "{!}{s4}.", "kinghorik_quest_thething13_3", [
      (call_script, "script_troop_get_player_relation", "trp_knight_1_1"),
      (assign, ":relation", reg0),
      #   (troop_get_slot, ":relation", "trp_knight_1_1", slot_troop_player_relation),
      (try_begin),
        (gt, ":relation", 80),
        (str_store_string, s4, "@I know {playername}, I would put my hand in the fire for {reg59?her:his} innocence.", color_good_news),
        
        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
        (val_sub, ":basic_stamina", 20),
        (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
        (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
        (display_message,"@The judges nod at his words. This makes your situation improve very much before your eyes."),
      (else_try),
        (gt, ":relation", 30),
        (str_store_string, s4, "@In my opinion, {playername} is innocent.", color_good_news),
        
        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
        (val_sub, ":basic_stamina", 10),
        (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
        (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
        (display_message,"@The judges nod at his words. This makes your situation improve before your eyes."),
      (else_try),
        (gt, ":relation", 15),
        (str_store_string, s4, "@I do not have enough information to assess for or against.", color_good_news),
      (else_try),
        (str_store_string, s4, "@In my opinion, {playername} is guilty of murdering Olvir White Hair.", color_good_news),
        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
        (val_add, ":basic_stamina", 10),
        (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
        (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
        (display_message,"@The judges nod at his words. This makes your situation more complicated."),
      (try_end),
  ]],
  
  [anyone|other(trp_knight_1_3), "kinghorik_quest_thething13_3", [ #opinion jarls
      (str_clear, s4),
    ],
    "{!}{s4}.", "kinghorik_quest_thething13_4", [
      (call_script, "script_troop_get_player_relation", "trp_knight_1_3"),
      (assign, ":relation", reg0),
      #    (troop_get_slot, ":relation", "trp_knight_1_3", slot_troop_player_relation),
      (try_begin),
        (gt, ":relation", 80),
        (str_store_string, s4, "@I know {playername}, I would put my hand in the fire for {reg59?her:his} innocence.", color_good_news),
        
        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
        (val_sub, ":basic_stamina", 20),
        (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
        (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
        (display_message,"@The judges nod at his words. This makes your situation improve very much before your eyes."),
      (else_try),
        (gt, ":relation", 30),
        (str_store_string, s4, "@In my opinion, {playername} is innocent.", color_good_news),
        
        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
        (val_sub, ":basic_stamina", 10),
        (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
        (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
        (display_message,"@The judges nod at his words. This makes your situation improve before your eyes."),
      (else_try),
        (gt, ":relation", 15),
        (str_store_string, s4, "@I do not have enough information to assess for or against.", color_good_news),
      (else_try),
        (str_store_string, s4, "@In my opinion, {playername} is guilty of murdering Olvir White Hair.", color_good_news),
        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
        (val_add, ":basic_stamina", 10),
        (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
        (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
        (display_message,"@The judges nod at his words. This makes your situation more complicated."),
      (try_end),
  ]],
  
  [anyone|other(trp_knight_1_4), "kinghorik_quest_thething13_4", [ #opinion jarls
      (str_clear, s4),
    ],
    "{!}{s4}.", "kinghorik_quest_thething13_5", [
      (call_script, "script_troop_get_player_relation", "trp_knight_1_4"),
      (assign, ":relation", reg0),
      #   (troop_get_slot, ":relation", "trp_knight_1_4", slot_troop_player_relation),
      (try_begin),
        (gt, ":relation", 80),
        (str_store_string, s4, "@I know {playername}, I would put my hand in the fire for {reg59?her:his} innocence.", color_good_news),
        
        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
        (val_sub, ":basic_stamina", 20),
        (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
        (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
        (display_message,"@The judges nod at his words. This makes your situation improve very much before your eyes."),
      (else_try),
        (gt, ":relation", 30),
        (str_store_string, s4, "@In my opinion, {playername} is innocent.", color_good_news),
        
        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
        (val_sub, ":basic_stamina", 10),
        (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
        (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
        (display_message,"@The judges nod at his words. This makes your situation improve before your eyes."),
      (else_try),
        (gt, ":relation", 15),
        (str_store_string, s4, "@I do not have enough information to assess for or against.", color_good_news),
      (else_try),
        (str_store_string, s4, "@In my opinion, {playername} is guilty of murdering Olvir White Hair.", color_good_news),
        (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
        (val_add, ":basic_stamina", 10),
        (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
        (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
        (display_message,"@The judges nod at his words. This makes your situation more complicated."),
      (try_end),
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething13_5", [
      (str_clear, s2),
    ],
    "{s2}^^Invoking the wisdom of Odin, we are ready to give a verdict.", "kinghorik_quest_thething14", [
      (str_store_string, s2, "@--The judges confer among themselves for a long time, and then the spokesman speaks.--", color_good_news),
  ]],
  
  [anyone|other(trp_knight_1_5), "kinghorik_quest_thething14", [
      (str_clear, s2),
    ],
    "I, Sigurd, son of Ragnar Lodbrok, ask permission to speak, because this case is nothing more than a branch of a big tree, and a branch may hide the real problem.", "kinghorik_quest_thething14_1", [
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething14_1", [
    ],
    "Speak then, Jarl Sigurd, son of Ragnar, whose memory we all cherish, and who awaits us among the hosts of the gods, preparing for Ragnarok.", "kinghorik_quest_thething14_2", [
  ]],
  
  [anyone|other(trp_knight_1_5), "kinghorik_quest_thething14_2", [
      (str_clear, s2),
    ],
    "{s2}^^When my father was alive, this assembly of free men would not have had much consideration for a bandit who had killed a good man like Olvir White Hair. However, times change -- rather, some men have caused that change. Now this Thing, this Assembly, is but a toy in the hands of a king. " +
    "That {reg59?woman:man}, {playername} is only a pawn of larger forces.", "kinghorik_quest_thething14_3", [
      (str_store_string, s2, "@--Sigurd steps forward, attracting everyone's attention. He is a respected and feared man, and the shadow left by his father is still long.--", color_good_news),
  ]],
  
  [anyone|other(trp_leader_svenlair), "kinghorik_quest_thething14_3", [
      (str_clear, s2),
    ],
    "{s2}^^My king, Sigurd 'Snake in the Eye' is not here to deal with {playername}; he wants you. He wants the throne, as we feared.", "kinghorik_quest_thething14_4", [
      (str_store_string, s2, "@--While Sigurd continues his speech, Harald approaches King Horik, his face tense and his voice soft.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_thething14_4", [
      (str_clear, s2),
    ],
    "{s2}^^Father, we should cut short Sigurd's speech. {playername} must admit {reg59?her:his} guilt and be punished by the Assembly! " +
    "{reg59?She:He} must be sacrificed to end this ploy now, or you may lose your throne. Sigurd 'Snake in the Eye' is a shrewd man. He would not openly attack you in the Assembly if he did not have the upper hand.", "kinghorik_quest_thething14_5", [
      (str_store_string, s2, "@--Egil moves his hands nervously, his forehead beaded with sweat.--", color_good_news),
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething14_5", [
    ],
    "Egil, damn traitor, I will not admit any guilt. I'm innocent.", "kinghorik_quest_thething14_6",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -10),
  ]],
  [anyone|plyr,"kinghorik_quest_thething14_5", [
    ],
    "If this is what you need to do, I will say I am guilty to save the king.", "kinghorik_quest_thething14_6",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
      (call_script, "script_change_player_party_morale", -10),
      (display_message,"@Your men think that you are a weak leader for accepting being a scapegoat."),
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething14_5", [
      (try_begin),
        (eq, "$defect_type", cb6_prudence),
        (str_store_string, s10, "@Do not rush to action, King Horik. Sigurd has nothing; Atli is dead. (Wisdom)"),
      (else_try),
        (eq, "$defect_type", cb6_fortitude),
        (str_store_string, s10, "@We will be allowed to reply to Sigurd and can trust in the Assembly. (Fortitude)"),
      (else_try),
        (eq, "$defect_type", cb6_temperance),
        (str_store_string, s10, "@Egil, this is the time to show your father the strength of your nerve. (Temperance)"),
      (else_try),
        (eq, "$defect_type", cb6_justice),
        (str_store_string, s10, "@I would accept my punishment without hesitation if I were guilty, but I am not. (Justice)"),
      (try_end),
    ],
    "{!}{s10}", "kinghorik_quest_thething14_7",[
      (str_clear, s10),
  ]],
  
  [anyone,"kinghorik_quest_thething14_7", [
      (str_clear, s4),
    ],
    "{!}{s4}", "kinghorik_quest_thething15",[
      (try_begin),
        (eq, "$defect_type", cb6_prudence),
        (str_store_string, s4, "@You speak wisely. I approve and agree with your words. We must not do anything that would cost us the respect of the Assembly. The balance of power is very delicate, and here the jarls are very important. We need to see what Sigurd has against us."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (else_try),
        (eq, "$defect_type", cb6_fortitude),
        (str_store_string, s4, "@The Assembly's decision will rest on the position of power between parties. Hence, we must not do anything that would cost us the respect of the Assembly. The balance of power is very delicate, and here the jarls are very important. We need to see what Sigurd has against us."),
        (call_script, "script_change_player_relation_with_troop", "trp_npc2", -5),
      (else_try),
        (eq, "$defect_type", cb6_temperance),
        (str_store_string, s4, "@Egil, listen to {playername} and learn. We must not do anything that would cost us the respect of the Assembly. The balance of power is very delicate, and here the jarls are very important. We need to see what Sigurd has against us."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
        (call_script, "script_change_player_relation_with_troop", "trp_npc2", 5),
      (else_try),
        (eq, "$defect_type", cb6_justice),
        (str_store_string, s4, "@You are right. Moreover, we must not do anything that would cost us the respect of the Assembly. The balance of power is very delicate, and here the jarls are very important. We need to see what Sigurd has against us."),
        (call_script, "script_change_player_honor", 1),
      (try_end),
  ]],
  
  [anyone,"kinghorik_quest_thething14_6", [
    ],
    "Let's remain calm here. We must not do anything that would cost us the respect of the Assembly. The balance of power is very delicate, and here the jarls are very important. We need to see what Sigurd has against us.", "kinghorik_quest_thething15",[
  ]],
  
  [anyone|other(trp_knight_1_5), "kinghorik_quest_thething15", [
      (str_clear, s2),
      (str_clear, s3),
    ],
    "{s2}^^Sven had a witness, Ulf Thorirsson, who would have agreed that Olvir was murdered, but King Horik sent {playername} to Ulf's farm to silence him. " +
    "I had another man, Atli Eiriksson, who was very faithful and dear to me. I entrusted him with the mission of protecting important evidence for this Assembly, but King Horik sent {playername} to kill him.^^{s3}", "kinghorik_quest_thething15_1", [
      (str_store_string, s2, "@--Sigurd's face seems imperturbable. Even the movements of his body are fully controlled even as he releases a speech that is able to dethrone a king.--", color_good_news),
      (str_store_string, s3, "@--Everyone starts talking at the words of Sigurd. A lot of tension fills the air. Finally, the judges ask for calm.--", color_good_news),
  ]],
  
  [anyone, "kinghorik_quest_thething15_1", [
      (str_clear, s2),
    ],
    "{s2}^^Sigurd Ragnarsson, you talk a lot, insult and offend my honor, but you lack evidence or witnesses. This will not end well for you.", "kinghorik_quest_thething15_2", [
      (str_store_string, s2, "@--King Horik's face is livid.--", color_good_news),
  ]],
  
  [anyone|other(trp_knight_1_1), "kinghorik_quest_thething15_2", [
    ],
    "Let him finish. All of us here want to know what is happening.", "kinghorik_quest_thething15_31", [
  ]],
  
  [anyone, "kinghorik_quest_thething15_31", [
    ],
    "I just defend my honor!", "kinghorik_quest_thething15_3", [
  ]],
  
  [anyone|other(trp_knight_1_6), "kinghorik_quest_thething15_3", [
    ],
    "Yes, he has the right and permission to speak. If he proves what he speaks of, it may be time to change the kingship.", "kinghorik_quest_thething15_4", [
  ]],
  
  [anyone|other(trp_knight_1_3), "kinghorik_quest_thething15_4", [
    ],
    "King Horik is a good king. You'd better be able to prove this, Sigurd.", "kinghorik_quest_thething15_5", [
  ]],
  
  [anyone|other(trp_knight_1_5), "kinghorik_quest_thething15_5", [
    ],
    "Everything will come in time, but first I want to continue with my assertion that the problem is much bigger than we think. " +
    "Eight hundred Vikings are ready to embark for Englaland in aid of my brothers. We could have been talking about more than 1200 men, for the jarl of Kennemer promised me more than 400, but King Horik sent {playername} to Friese to sabotage this treaty. " +
    "As if that were not enough, the king then proposed that Guthrum lead these men, when I was the one that made all effort to gather them and get the boats and provisions...", "kinghorik_quest_thething15_6", [
  ]],
  
  [anyone|other(trp_knight_1_5), "kinghorik_quest_thething15_6", [
    ],
    "Everything will come in time, but first I want to continue with my assertion that the problem is much bigger than we think. " +
    "Eight hundred Vikings are ready to embark for Englaland in aid of my brothers. We could have been talking about more than 1200 men, for the jarl of Kennemer promised me more than 400, but King Horik sent {playername} to Friese to sabotage this treaty. " +
    "As if that were not enough, the king then proposed that Guthrum lead these men, when I was the one that made all effort to gather them and get the boats and provisions...", "kinghorik_quest_thething15_7", [
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething15_7", [
    ],
    "Sigurd Ragnarsson, your accusation is very serious. Do you have any evidence or witnesses who can confirm what you say?", "kinghorik_quest_thething15_8", [
  ]],
  
  [anyone|other(trp_knight_1_5), "kinghorik_quest_thething15_8", [
    ],
    "Yes, there is a man who has traveled with {playername} all that time, who is among us right now, willing to testify at this Assembly. His name is Reginhard, and he is a servant of the jarl of Kennemer.", "kinghorik_quest_thething16", [
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething16", [
    ],
    "Reginhard, approach. Do you confirm that the words of Sigurd Ragnarsson are true?", "kinghorik_quest_thething16_2", [
  ]],
  
  [anyone|other(trp_npc8), "kinghorik_quest_thething16_2", [
      (str_clear, s2),
    ],
    "{s2}^^I... well... yes, right. I met {playername} in Friese when {reg59?she:he} tried to gain the trust of the jarl of Kennemer by killing Thiaderd, a person that I loved. " +
    "Then, {reg59?she:he} betrayed the jarl of Kennemer and came to Danmark, where {reg59?she:he} has pursued Sven Bull Neck and Sigurd Ragnarsson, as {reg59?she:he} hates them as enemies. So Olvir and Atli were killed, and {reg59?she:he} allied with King Horik. I swear it is the truth.", "kinghorik_quest_thething16_3", [
      (str_store_string, s2, "@--Reginhard seems uncomfortable when all eyes turn to him. He especially tries to avoid your eyes.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_thething16_3", [
      (str_clear, s2),
    ],
    "{s2}^^Reginhard? Why?", "kinghorik_quest_thething16_4", [
      (str_store_string, s2, "@--Egil suffers a nervous attack and shouts.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc8), "kinghorik_quest_thething16_4", [ (eq, "$thiader_family", 1), #everybody kill
      (str_clear, s2),
    ],
    "{s2}^^{playername} is a murderer. Thiaderd was like a brother to me, and {playername} killed him and all his family! Even his son! I promised that one day I would avenge Thiaderd, and that day has come. " +
    "I just want to be happy, have a farm, wife, and children, but {playername} brings only misfortune wherever {reg59?she:he} goes. I need to feel protected, and Sigurd has promised me everything that I wish for.", "kinghorik_quest_thething16_5", [
      (str_store_string, s2, "@--Reginhard looks sad.--", color_good_news),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
      (val_add, ":basic_stamina", 60),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      (display_message,"@The judges nod at the words of Reginhard. This makes your situation very complicated."),
  ]],
  
  [anyone|other(trp_npc8), "kinghorik_quest_thething16_4", [
      (str_clear, s2),
    ],
    "{s2}^^My quarrel is not with you, Egil. Thiaderd was like a brother to me, and {playername} lied to me in order to take him and kill him. I won {playername}'s trust and promised that one day I would avenge Thiaderd's death, and that day has come. " +
    "I just want to be happy, have a farm, wife, and children, but {playername} brings only misfortune wherever {reg59?she:he} goes. I need to feel protected, and Sigurd has promised me everything that I wish for.", "kinghorik_quest_thething16_5", [
      (str_store_string, s2, "@--Reginhard looks down and speaks quietly.--", color_good_news),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
      (val_add, ":basic_stamina", 30),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      (display_message,"@The judges nod at the words of Reginhard. This makes your situation very complicated."),
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething16_5", [
    ],
    "Reginhard, you know me. You know how I treat traitors. We will meet again.", "kinghorik_quest_thething17_1",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -20),
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething16_5", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@I have always treated you well. I do not understand what has happened. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@You know that I had no choice with Thiaderd, Olvir or anyone else. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Wherever you may hide from now on, I will find you and kill you. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@You betrayed Thiaderd, and now you are betraying me. You are a curse, Reginhard. (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "kinghorik_quest_thething17_2",[
      (str_clear, s10),
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething16_5", [
    ],
    "As you said once, 'Gaed a wyrd swa hio scel!' Fate always goes as she must.", "kinghorik_quest_thething18",[
  ]],
  
  [anyone|other(trp_npc8), "kinghorik_quest_thething17_1", [
      (str_clear, s2),
    ],
    "I do not think so. We will never see one another again. I'll have my farm, my wife and the protection of a jarl. You'll be dead or an outlaw.", "kinghorik_quest_thething18", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -10),
  ]],
  
  [anyone|other(trp_npc8),"kinghorik_quest_thething17_2", [
      (str_clear, s4),
    ],
    "{!}{s4}", "kinghorik_quest_thething18",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s4, "@What happened is that Thiaderd is dead, and I have to live with that. Now at least I know he will be avenged."),
        (call_script, "script_change_player_relation_with_troop", "trp_npc8", -10),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s4, "@I'm... sorry. I do what I have to do."),
        (call_script, "script_change_player_relation_with_troop", "trp_npc8", 5),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s4, "@I do not think so. We will never see one another again. I'll have my farm, my wife and the protection of a jarl. You'll be dead or an outlaw."),
        (call_script, "script_change_player_relation_with_troop", "trp_npc8", -20),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s4, "@I am damned... For this reason, I need to begin a new life far away from you or Friese."),
      (try_end),
  ]],
  
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething18", [
    ],
    "King Horik, Sigurd Ragnarsson has made very serious allegations, supported by a witness. What do you say in your defense?", "kinghorik_quest_thething19", [
  ]],
  
  [anyone, "kinghorik_quest_thething19", [
      (str_clear, s2),
    ],
    "{s2}^^I do not know this man named Reginhard. I suspect he is a liar bought by Sigurd, as he seems to have some sort of dispute with {playername}. " +
    "At any rate, his testimony is not against me but against {playername}, since he in no way has mentioned me or shown that I have helped {playername} in any misdeeds. " +
    "If this is all that Sigurd Ragnarsson has against me, I ask this Assembly for compensation for the insult to my honor.", "kinghorik_quest_thething20", [
      (str_store_string, s2, "@--King Horik clears his throat.--", color_good_news),
  ]],
  
  [anyone|other(trp_knight_1_5), "kinghorik_quest_thething20", [
      (str_clear, s2),
    ],
    "{s2}^^The gods know that you were eliminating my evidence and witnesses. When you sent your dog after Atli Eiriksson and Ulf Thorirsson, " +
    "this man was with {playername}. He can testify that you were involved.", "kinghorik_quest_thething20_1", [
      (str_store_string, s2, "@--For a few seconds, Sigurd loses composure.--", color_good_news),
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething20_1", [
    ],
    "I say Reginhard is a liar blinded by hatred for me. It's his word against mine.", "kinghorik_quest_thething20_2",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -20),
      (call_script, "script_change_player_honor", -5),
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
      (val_sub, ":basic_stamina", 10),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      (display_message,"@The judges nod at your words. This makes your situation improve before your eyes."),
  ]],
  [anyone|plyr,"kinghorik_quest_thething20_1", [
    ],
    "First of all, Reginhard's first master was Thiaderd, not the jarl of Kennemer. (Persuasion)", "kinghorik_quest_thethingdialogextend1",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", -20),
  ]],
  #### dialog extend
  [anyone|plyr,"kinghorik_quest_thethingdialogextend1", [
    ],
    "Reginhard betrayed his first master, Thiaderd, as now he betrays me. Would any man keep a known enemy in his hird? This man has just demonstrated that he cannot be trusted.", "kinghorik_quest_thething20_2",[
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
      (val_sub, ":basic_stamina", 20),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      (display_message,"@The judges nod at your words. This makes your situation improve before your eyes."),
  ]],
  #####
  [anyone|plyr,"kinghorik_quest_thething20_1", [
    ],
    "This man, Reginhard, tells the truth. Everything happened as he described.", "kinghorik_quest_thething20_3",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", 20),
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_thething20_3", [
    ],
    "What? I was in {playername}'s hird, too, and I swear to the gods that these men lie. I demand a death duel against them if they allege these things.", "kinghorik_quest_thething20_4", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -20),
  ]],
  [anyone|other(trp_leader_svenlair), "kinghorik_quest_thething20_4", [
    ],
    "I, Harald Haraldsson, second Egil in this challenge.", "kinghorik_quest_thething20_5", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -20),
  ]],
  [anyone|other(trp_npc8), "kinghorik_quest_thething20_5", [
    ],
    "Oh, my god, what are you doing, {playername}? Are you mad? I have betrayed you, so why do I have your support?", "kinghorik_quest_thething20_6", [
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething20_6", [
    ],
    "Because deep down you're a good person and my friend.", "kinghorik_quest_thething20_7",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", 40),
  ]],
  [anyone|plyr,"kinghorik_quest_thething20_6", [
    ],
    "Because King Horik now removes himself from my actions in order to protect himself.", "kinghorik_quest_thething20_7",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -20),
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -10),
  ]],
  [anyone|plyr,"kinghorik_quest_thething20_6", [
    ],
    "I'm not sure why I said that.", "kinghorik_quest_thething20_7",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething20_7", [
    ],
    "Silence! We do not tolerate anyone making a mockery of this Assembly.", "kinghorik_quest_thething20_2", [
      (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga), #juice variable
      (val_add, ":basic_stamina", 10),
      (val_max, ":basic_stamina", 1), #siempre va a restar un minimo de 1
      (agent_set_slot, "$g_talk_agent", slot_agent_fatiga, ":basic_stamina"), #se la aplicamos al agente
      (display_message,"@The judges seem annoyed."),
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething20_2", [
    ],
    "Now, this is a very delicate matter that may affect the stability of the kingdom. The judges shall retire to deliberate for a moment.", "kinghorik_quest_thething21", [
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething21", [
    ],
    "-- You watch as the judges get behind the big rock before entering a heated discussion. All around you, everyone engages in energetic conversations. Some jarls support King Horik; others Jarl Sigurd Ragnarsson. " +
    "This Assembly may either be the solution to civil war or the trigger to start one. Everything depends on the judges' decision.^^" +
    "You realize that no one approaches you; everyone avoids you like the plague. You are aware also that nobody gave you the opportunity to present the case of the abduction of your mother. You feel you have not been more than a piece in a game of Hneftalf between the powerful men of Danmark. --", "kinghorik_quest_thething22",[
  ]],
  [anyone|plyr,"kinghorik_quest_thething22", [
    ],
    "-- The judges are slow to come to a decision. You're not sure how much time has passed, but it seems it takes them very, very long. Many men around you have decided to sit on the ground, and there are even merchants distributing food and mead. " +
    "Reginhard remains in the same spot, silent and without moving a muscle, as if carved in granite. Egil doesn't look at you, either. He is among the men around King Horik, advising and encouraging him.^^" +
    "Finally, the judges return from behind the large rock. --", "kinghorik_quest_thething23",[
  ]],
  [anyone|other(trp_paganop_1), "kinghorik_quest_thething23", [
    ],
    "Odin Fjolnsvidr, Odin Sanngetall, father of gods and the Scyldings. We, elected by our peers, call upon your wisdom to guide our words. " +
    "May our judgment reach your ears, and may those who do not comply with it be punished by Hel. We have decided the following:", "kinghorik_quest_thething24", [
  ]],
  [anyone|other(trp_npc12), "kinghorik_quest_thething24", [ (agent_get_slot, ":basic_stamina", "$g_talk_agent", slot_agent_fatiga),  (ge, ":basic_stamina", 50),
    ],
    "In the case of the death of Olvir White Hair, Sven Bull Neck shall receive wergild of 4800 peningas. {playername}, can you pay this wergild now?", "kinghorik_quest_thething25_1", [
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething24", [
    ],
    "In the case of the death of Olvir White Hair, this Assembly rules that {playername} acted in self-defense and declares him innocent.", "kinghorik_quest_thething25_2", [
  ]],
  
  [anyone|other(trp_sven_bull_neck), "kinghorik_quest_thething25_1", [
    ],
    "This is an outrage! 4800 peningas for the life of my brother? This should be paid with blood!", "kinghorik_quest_thething26", [
  ]],
  [anyone|other(trp_knight_1_5), "kinghorik_quest_thething26", [
      (str_clear, s2),
    ],
    "{s2}^^Sven Bull Neck accepts the decision of the Assembly.", "kinghorik_quest_thething27", [
      (str_store_string, s2, "@--Sigurd Ragnarsson pushes Sven back and takes the floor.--", color_good_news),
  ]],
  #
  [anyone|other(trp_sven_bull_neck), "kinghorik_quest_thething25_2", [
    ],
    "What? This is not justice! This Assembly pisses on the grave of my brother!", "kinghorik_quest_thething26_2", [
  ]],
  [anyone|other(trp_knight_1_5), "kinghorik_quest_thething26_2", [
      (str_clear, s2),
    ],
    "{s2}^^Sven Bull Neck accepts the decision of the Assembly.", "kinghorik_quest_thething30_2", [
      (str_store_string, s2, "@--Sigurd Ragnarsson pushes Sven back and takes the floor.--", color_good_news),
  ]],
  #
  [anyone|other(trp_npc12), "kinghorik_quest_thething27", [
    ],
    "{playername}, can you pay this wergild now?", "kinghorik_quest_thething28", [
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething28", [(store_troop_gold,":money","trp_player"),(ge,":money",4800),
    ],
    "I have the money.", "kinghorik_quest_thething30",[
      (troop_remove_gold,"trp_player",4800),
  ]],
  [anyone|plyr,"kinghorik_quest_thething28", [
    ],
    "No, I don't have this money.", "kinghorik_quest_thething29",[
  ]],
  
  [anyone,"kinghorik_quest_thething29", [
      (call_script, "script_troop_get_player_relation",  "$g_talk_troop"),
      (assign, ":relation_to_king", reg0),
      #	 (troop_get_slot, ":relation_to_king", "$g_talk_troop", slot_troop_player_relation), #rey amigo
      (ge, ":relation_to_king", 30),
    ],
    "I respect the finding of this Assembly, although I do not share it. I will pay the wergild of {playername}.", "kinghorik_quest_thething30",[
  ]],
  #sino buenas relaciones con el rey
  [anyone|other(trp_npc12),"kinghorik_quest_thething29", [
    ],
    "Will anyone pay wergild for this {reg59?lady:man}, or shall {reg59?she:he} be declared outlaw. {reg59?She:He} will lose everything that {reg59?she:he} owns and shall be removed from the protection of the law, even if killed.", "kinghorik_quest_thething29_2",[
  ]],
  [anyone|other(trp_npc6),"kinghorik_quest_thething29_2", [
    ],
    "We, the members of {reg59?her:his} hird, will pay this wergild, in order that {playername} may remain free to continue leading us.", "kinghorik_quest_thething30",[
      (call_script, "script_change_player_party_morale", -40),
      (call_script, "script_change_troop_renown", "trp_player", -100),
      (display_message,"@Your men think that you are a poor leader to need them to pay your wergild."),
  ]],
  #
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething30", [
    ],
    "Then the Assembly accepts the money and gives it to Sven Bull Neck. The price for spilt blood has been satisfied. Before gods and men, this quarrel has ended between these two men.", "kinghorik_quest_thething31", [
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething30_2", [
    ],
    "Well, the Assembly has spoken. Before gods and men, this quarrel has ended between these two men.", "kinghorik_quest_thething31", [
  ]],
  
  [anyone|other(trp_paganop_1), "kinghorik_quest_thething31", [
    ],
    "Odin, Thor and Frey have heard what is here decided. May they punish any who do not fulfill their oaths.", "kinghorik_quest_thething31_2", [
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething31_2", [
    ],
    "Regarding the case of the witness called Reginhard, who has been accused of lying, the gods must decide his culpability. As the accusation is grave, this Assembly has decided that {playername} and Reginhard will engage in a holmgang, a duel to the death, on the island called Short, within six days. Two will go, but only one return. " +
    "If one of them fails to show up, {reg59?he or she:he} will be declared nithingr, coward, less than a man, and this will be told by skalds and messengers to all men in Danmark and abroad.", "kinghorik_quest_thething33", [
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething33", [
    ],
    "I accept the decision of the Assembly.", "kinghorik_quest_thething33_4",[
      (str_store_string, s2, "@The Assembly has decreed a duel to the death to decide whether Reginhard is guilty of lying or not. You've decided to take on Reginhard in order to punish him for his betrayal and for tarnishing the names of you and the king."),
      (call_script, "script_start_quest", "qst_the_holmgang", "trp_npc12"),
      (quest_set_slot,"qst_the_holmgang",slot_quest_current_state, 1), #reginhard enemy
      (troop_set_slot, "trp_npc8", slot_troop_occupation, 0),
      (troop_set_slot, "trp_npc8", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc8"),
  ]],
  [anyone|plyr,"kinghorik_quest_thething33", [
    ],
    "I refuse to kill Reginhard.", "kinghorik_quest_thething33_1",[
  ]],
  
  [anyone|other(trp_npc2), "kinghorik_quest_thething33_1", [
    ],
    "Do you wish to be a nithingr? Nobody will follow you. Everybody will be free to kill you. Moreover, you are agreeing with Reginhard, who has betrayed us. I argue that Reginhard is a liar, and if you do not face him, giving the reason, I say that you're a liar too.", "kinghorik_quest_thething33_2", [
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething33_2", [
    ],
    "The decisions of the Assembly cannot be gainsaid. They are backed by the gods and the free men of Danmark. The sentence is a duel to discover the lie. " +
    "{playername}, you must choose: fight against Reginhard or defend him against Egil.", "kinghorik_quest_thething33_3", [
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething33_3", [
    ],
    "I will fight against Reginhard.", "kinghorik_quest_thething33_4",[
      
      (str_store_string, s2, "@The Assembly has decreed a duel to the death to decide whether Reginhard is guilty of lying or not. You've decided to take on Reginhard to punish him for his betrayal and for tarnishing your name and that of the king."),
      (call_script, "script_start_quest", "qst_the_holmgang", "trp_npc12"),
      (quest_set_slot,"qst_the_holmgang",slot_quest_current_state, 1), #reginhard enemy
      (troop_set_slot, "trp_npc8", slot_troop_occupation, 0),
      (troop_set_slot, "trp_npc8", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc8"),
  ]],
  
  [anyone|plyr,"kinghorik_quest_thething33_3", [
    ],
    "I will fight against Egil.", "kinghorik_quest_thething33_4",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -50), #egil is son of rey horik
      (call_script, "script_change_player_relation_with_troop", "trp_npc8", 50),
      (call_script, "script_change_player_relation_with_troop", "trp_npc2", -50),
      (str_store_string, s2, "@The Assembly has decreed a duel to the death to decide whether Reginhard is guilty of lying or not. You've decided to defend Reginhard and fight against Egil."),
      (call_script, "script_start_quest", "qst_the_holmgang", "trp_npc12"),
      (quest_set_slot,"qst_the_holmgang",slot_quest_current_state, 2), #Egil enemy
      (call_script, "script_change_player_honor", 20),
      (call_script, "script_change_player_party_morale", -10),
      (call_script, "script_change_troop_renown", "trp_player", -15),
      (display_message,"@Your men think that you are a weak leader to let Reginhard live and defend him despite his betrayal."),
      (troop_set_slot, "trp_npc2", slot_troop_occupation, 0),
      (troop_set_slot, "trp_npc2", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc2"),
  ]],
  
  [anyone|other(trp_npc8), "kinghorik_quest_thething33_4", [
    ],
    "I accept the decision of the Assembly too. I'm no liar, but I regret having been a traitor. I am very sorry, {playername}.", "kinghorik_quest_thething33_5", [
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething33_5", [ #menu para duelo
    ],
    "Well, when this Assembly is over, the important men of Danmark will come get you and take you to Short Island to face your opponent.", "kinghorik_quest_thething33_6", [
  ]],
  
  [anyone|other(trp_paganop_1), "kinghorik_quest_thething33_6", [
    ],
    "Odin, Thor and Frey have heard what has here been decided. May they punish any who do not fulfill their oaths.", "kinghorik_quest_thething33_7", [
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething33_7", [
    ],
    "This Assembly has also decided on a last major issue. The accusations and insults between King Horik and Jarl Sigurd can cause serious damage to Danmark. Therefore, this assembly of free men, which is above jarls and kings and answers only to the gods, has decided that a reconciliation between the two must occur. " +
    "King Horik will give Jarl Sigurd a position on his council and among his most beloved men. Moreover, King Horik will pay 15.000 peningas in compensation for all the efforts made by the Sigurd in organizing the expedition.", "kinghorik_quest_thething34", [
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething34", [
      (str_clear, s2),
    ],
    "{s2}^^In return, Jarl Sigurd shall remain by King Horik, advising him and not leaving Danmark. Therefore, Jarl Sigurd Ragnarsson must relinquish control over the fleet that shall relieve his brethren. " +
    "This fleet will be lead by two other men: Sven Bull Neck, on the part of Jarl Sigurd, and Harald Haraldsson, on the part of King Horik. The fleet will depart for Englaland in a few days without further delay.", "kinghorik_quest_thething35", [
      (str_store_string, s2, "@--He clears his throat.--", color_good_news),
  ]],
  
  [anyone|other(trp_npc12), "kinghorik_quest_thething35", [
      (str_clear, s2),
    ],
    "It is furthermore our decision that {playername} shall join as advisor of Harald Haraldsson, as long as the gods give {reg59?her:him} the victory in the holmgang. " +
    "Otherwise, Egil takes {playername}'s place and hird. One or the other should meet with me in the mead hall of Ribe once the holmgang is over.", "kinghorik_quest_thething36_1", [
      
      (str_store_party_name_link, s3, "p_town_4"),
      (str_store_string, s2, "@The Assembly has decreed that you join the fleet that Danmark will send to Englaland in support of Ragnar's sons. As soon as the holmgang is over, assuming you are the winner, you must meet Asbjorn in the mead hall of {s3}."),
      (call_script, "script_start_quest", "qst_the_fleet", "trp_npc12"),
      (quest_set_slot,"qst_the_fleet",slot_quest_current_state, 1), # empieza quest, pero asbjorn no esta en taberna hasta final duelo
  ]],
  
  [anyone|other(trp_town_4_mayor), "kinghorik_quest_thething36_1", [ #menu para duelo
      (str_clear, s2),
    ],
    "{s2}^^The Assembly, representing the gods and freemen of Danmark, has spoken.^" +
    "These are the two parties, right? King Horik? Jarl Sigurd?", "kinghorik_quest_thething36", [
      (str_store_string, s2, "@--Another judge takes the floor. He shifts his gaze from one party to the next until his eyes rest on you.--", color_good_news),
  ]],
  
  [anyone, "kinghorik_quest_thething36", [
      (str_clear, s2),
    ],
    "I accept the judgment of the Assembly. I will fulfill my part as has been decreed. I swear that I will uphold and enforce it.^^{s2}", "kinghorik_quest_thething37", [
      (str_store_string, s2, "@--King Horik quickly accepts more control over the actions of Jarl Sigurd.--", color_good_news),
  ]],
  
  [anyone|other(trp_knight_1_5), "kinghorik_quest_thething37", [
    ],
    "{s2}^^I also accept the decision of the Assembly. I swear that I will uphold and enforce it.", "kinghorik_quest_thething38", [
      (str_store_string, s2, "@--Sigurd Ragnarsson shows no sign of either satisfaction or dissatisfaction.--", color_good_news),
  ]],
  
  [anyone|other(trp_paganop_1), "kinghorik_quest_thething38", [
    ],
    "Odin, Thor and Frey have heard what has been decided here. May they punish anyone who does not fulfill his oath. This Assembly has ended. Everyone may leave now.", "close_window", [
      (add_xp_as_reward,300),
      (quest_set_slot,"qst_the_thing",slot_quest_current_state, 8),
      (call_script, "script_end_quest", "qst_the_thing"),
      (jump_to_menu, "mnu_the_thing"),
      (finish_mission),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  ##  ##thing acaba
  ####alfred the great of wessex mainquest
  [anyone|plyr,"alfredthegreat1", [
    ],
    "(You bow before him)", "alfredthegreat21",[
  ]],
  [anyone|plyr,"alfredthegreat1", [
    ],
    "(Do not bow to him)", "alfredthegreat22",[
  ]],
  
  [anyone, "alfredthegreat21", [
      (str_clear, s2),
    ],
    "{s2}^^Regards, Danish envoy. What do your masters want now?", "alfredthegreat3", [
      (str_store_string, s2, "@--Aelfred of West Seaxe is a small man, bony, with straight hair and a prominent jaw. He doesn't stand out as much as other men, but there is something remarkable in his appearance.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (call_script, "script_change_troop_renown", "trp_player", -15),
  ]],
  [anyone, "alfredthegreat22", [
      (str_clear, s2),
    ],
    "{s2}^^You are a proud {reg59?woman:man}, but you should know that an envoy should be courteous and take full advantage of diplomacy. What do your masters want now?", "alfredthegreat3", [
      (str_store_string, s2, "@--Aelfred of West Seaxe is a small man, bony, with straight hair and a prominent jaw. He doesn't stand out as much as other men, but there is something remarkable in his appearance.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (call_script, "script_change_troop_renown", "trp_player", 15),
  ]],
  [anyone|plyr,"alfredthegreat3", [
    ],
    "I have a letter for you from Bjorn, son of Ragnar.", "alfredthegreat41",[
  ]],
  [anyone|plyr,"alfredthegreat3", [
    ],
    "I have a letter for you from Bjorn. They know they will lose and want a truce.", "alfredthegreat42",[
  ]],
  [anyone|plyr,"alfredthegreat3", [
    ],
    "I have a letter for you from Bjorn. They are still willing to negotiate.", "alfredthegreat43",[
  ]],
  #
  [anyone, "alfredthegreat41", [
      (str_clear, s2),
    ],
    "{s2}^^The Danish want to meet with us to negotiate the terms of their retreat. This is good news.", "alfredthegreat5", [
      (str_store_string, s2, "@--He takes the letter and reads it slowly. He looks at you when he finishes.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  #
  [anyone, "alfredthegreat42", [
      (str_clear, s2),
    ],
    "{s2}^^The Danish want to meet with us to negotiate the terms of their retreat. Thank you for the information about their weakness, " +
    "but I think we are still interested in this deal.", "alfredthegreat5", [
      (str_store_string, s2, "@--He takes the letter and reads it slowly. He looks at you when he finishes.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (call_script, "script_change_player_party_morale", -5),
      (call_script, "script_change_player_honor", -5),
      (display_message,"@Your men think that you relay information to the Saxons, in disrespect to your agreement with Bjorn."),
  ]],
  
  [anyone, "alfredthegreat43", [
      (str_clear, s2),
    ],
    "{s2}^^While I admire your loyalty to your masters, do not treat me like a fool. We have received news of the disaster of the fleet sent from Danmark, and in the north, the Danish have many problems with Picts. " +
    "However, we have our own problems right now, so this deal is good for us.", "alfredthegreat5", [
      (str_store_string, s2, "@--He takes the letter and reads it slowly. He looks at you when he finishes.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (call_script, "script_change_player_party_morale", 5),
      (call_script, "script_change_troop_renown", "trp_player", 5),
      (display_message,"@Your men think that you have acted boldly with respect to your promise to Bjorn."),
  ]],
  
  #
  [anyone|other(trp_saxon_level3_landed), "alfredthegreat5", [
    ],
    "But my lord, that means they are defeated. We should attack and finish them.", "alfredthegreat6", [
  ]],
  [anyone, "alfredthegreat6", [
    ],
    "Do not underestimate the enemy, Uthred. We will take this opportunity to make peace.", "alfredthegreat7", [
  ]],
  
  [anyone|plyr,"alfredthegreat7", [
    ],
    "It's a good opportunity to avoid further bloodshed on either side.", "alfredthegreat81",[
  ]],
  [anyone|plyr,"alfredthegreat7", [
    ],
    "You can annihilate us now, but next year the Danish will return with more men.", "alfredthegreat82",[
  ]],
  [anyone|plyr,"alfredthegreat7", [
    ],
    "(Say nothing)", "alfredthegreat83",[
  ]],
  
  [anyone, "alfredthegreat81", [
    ],
    "Sod is paet thu segst! I'm glad to see that we agree. The Danish have many men in Snotingaham yet, and the walls are high. Even if we could win this battle, I'm not sure we'd want to. " +
    "In addition, the winter could see us still besieging this place, and we are far from home. As hard as it would be for them to starve inside, it would be harder for us to starve outside.", "alfredthegreat9", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone, "alfredthegreat82", [
    ],
    "You are a soldier, not a leader. When the lives of others depend on you, you must weigh your options carefully. Not everything is resolved with blood. " +
    "The Danish have many men in Snotingaham yet, and the walls are high. Even if we could win this battle, I'm not sure we'd want to. " +
    "In addition, the winter could see us still besieging this place, and we are far from home. As hard as it would be for them to starve inside, it would be harder for us to starve outside.", "alfredthegreat9", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone, "alfredthegreat83", [
    ],
    "The Danish have many men in Snotingaham yet, and the walls are high. Even if we could win this battle, I'm not sure we'd want to. " +
    "In addition, the winter could see us still besieging this place, and we are far from home. As hard as it would be for them to starve inside, it would be harder for us to starve outside.", "alfredthegreat9", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
  ]],
  [anyone, "alfredthegreat9", [
    ],
    "Well, go back to your jarl, Bjorn Ragnarsson, and tell him that we are ready to negotiate their way out of Snotingaham and lasting peace. " +
    "I give notice to my men not to attack you. Beod ge gesunde.", "close_window", [
      #(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (quest_set_slot,"qst_the_messengersn",slot_quest_current_state, 7),
      (call_script, "script_succeed_quest", "qst_the_messengersn"),
      (jump_to_menu, "mnu_nothingam_siege_al"),
      (finish_mission),
  ]],
  ####Jarl Halfdan Ragnarsson
  [anyone|plyr,"ragnarssons_1", [
    ],
    "Jarl Bjorn Ragnarsson sends me.", "ragnarssons_2_1",[
      (talk_info_show, 0),  ]],
  [anyone|plyr,"ragnarssons_1", [
    ],
    "I cannot talk about this.", "ragnarssons_2_2",[
      (talk_info_show, 0),   ]],
  
  [anyone|other(trp_norse_level0_companion), "ragnarssons_2_1", [
      (str_clear, s2),
    ],
    "{s2}^^It is nice to hear. Bjorn Jarnsida, Ironside, is a legend, possibly the Ragnarsson most loved by Odin. Just have out your news. What is happening?", "ragnarssons_3", [
      (str_store_string, s2, "@--His face, tired and dirty, shines at the news, as if he'd received a little joy.--", color_good_news),
      # (call_script, "script_change_troop_renown", "trp_player", 3),
      (call_script, "script_change_player_honor", 3),
      (display_message,"@The morale of the defenders improves at your words."),
  ]],
  [anyone|other(trp_norse_level0_companion), "ragnarssons_2_2", [
      (str_clear, s2),
    ],
    "{s2}^^I see. Just have out your news. What is happening?", "ragnarssons_3", [
      (str_store_string, s2, "@--His face, thin and dirty after so long a siege, looks even more tired.--", color_good_news),
      #(call_script, "script_change_troop_renown", "trp_player", -3),
      (display_message,"@The morale of the defenders falls at your words."),
  ]],
  [anyone|plyr,"ragnarssons_3", [
    ],
    "The reinforcements that were coming from Danmark were destroyed for treason.", "ragnarssons_3_1",[
  ]],
  [anyone|plyr,"ragnarssons_3", [
    ],
    "Jarl Bjorn wants to negotiate your surrender with the Saxons.", "ragnarssons_3_2",[
  ]],
  [anyone|plyr,"ragnarssons_3", [
    ],
    "We have destroyed Saxon foragers!", "ragnarssons_3_3",[
  ]],
  [anyone|plyr,"ragnarssons_3", [
    ],
    "I cannot talk about this.", "ragnarssons_3_4",[
  ]],
  
  [anyone|other(trp_norse_level0_companion), "ragnarssons_3_1", [
      (str_clear, s2),
    ],
    "{s2}^^But this is terrible! Our leaders told us that reinforcements were on the way and that we could then easily defeat the Saxons. By Thor! This changes everything!", "ragnarssons_4", [
      (str_store_string, s2, "@--His face shows alarm.--", color_good_news),
      (call_script, "script_change_player_honor", 3),
      #  (call_script, "script_change_troop_renown", "trp_player", -3),
      (display_message,"@The morale of the defenders falls at your words."),
  ]],
  [anyone|other(trp_norse_level0_companion), "ragnarssons_3_2", [
    ],
    "I do not believe that! Bjorn would never deliver us to the Saxons. You're a liar!", "ragnarssons_4", [
      #  (call_script, "script_change_troop_renown", "trp_player", -3),
      (display_message,"@The morale of the defenders falls at your words."),
  ]],
  [anyone|other(trp_norse_level0_companion), "ragnarssons_3_3", [
    ],
    "Well, lovely news! I hope they pay dearly for this siege.", "ragnarssons_4", [
      #  (call_script, "script_change_troop_renown", "trp_player", -3),
      (display_message,"@The morale of the defenders improves at your words."),
  ]],
  [anyone|other(trp_norse_level0_companion), "ragnarssons_3_4", [
    ],
    "I see. I do not understand the secrecy. News always helps to improve morale, but I guess that you have orders about it, so I do not insist.", "ragnarssons_4", [
  ]],
  
  [anyone, "ragnarssons_4", [
      (str_clear, s2),
    ],
    "{!}{s2}", "ragnarssons_5", [
      (str_store_string, s2, "@--Three men, well-armed warriors, have approached while you were talking.--", color_good_news),
  ]],
  [anyone, "ragnarssons_5", [
    ],
    "Enough talk here. Ulf, go back to the wall, and take your men with you. My brothers and I want to be alone with the newcomer.", "ragnarssons_6", [
  ]],
  [anyone, "ragnarssons_6", [
    ],
    "Heill, messenger! My name is Halfdan, and these here are my brothers, Ivar and Hubbi. We rejoiced much when they told us that a messenger had passed through the Mercian lines. What news do you bring us?", "ragnarssons_7", [
  ]],
  
  [anyone|plyr,"ragnarssons_7", [
    ],
    "Your bother, Bjorn, sent me to inform you that the reinforcements from Danmark are lost because Sven Bull Neck turned his men against the rest. " +
    "There will be no reinforcements. Bjorn Ironside wants to convene a meeting with the Saxon and Mercian leaders to restore Snotingaham to them in exchange for them letting you back north with your armies.^^" +
    "This seax, which belonged to Ragnar, certifies that I come from your brother and speak the truth.", "ragnarssons_8",[
  ]],
  [anyone|other(trp_knight_8_14), "ragnarssons_8", [ #hubbi
    ],
    "Damn Bjorn! He's old and had his glory, but now begrudges us ours. The Saxons and the Angles are weak peoples. If it were me, I would attack their camps and put them to flight like the mice they are.", "ragnarssons_9", [
  ]],
  [anyone|other(trp_knight_8_13), "ragnarssons_9", [ #Ivar
    ],
    "No more nonsense, Hubbi. We have but one man for every five Saxons. To fight outside these walls is only foolishness...^^" +
    "You, messenger, listen. I am Ivar Ragnarsson. Men call me Inn Beinlaussi, the Boneless. " +
    "If Sven Bull Neck has betrayed us and destroyed our reinforcements as you say, I will hunt him down to sacrifice to the gods with the Blood Eagle. " +
    "But if you're lying, that will be your fate.", "ragnarssons_10", [
  ]],
  [anyone,"ragnarssons_10", [
    ],
    "I apologize for my brothers, messenger. Being locked up here affects us all.", "ragnarssons_11",[
  ]],
  
  [anyone|plyr,"ragnarssons_11", [
    ],
    "Do not worry, Jarl Halfdan. I understand this is a difficult situation.", "ragnarssons_12_1",[
  ]],
  [anyone|plyr,"ragnarssons_11", [
    ],
    "Hubbi is right. You should go out and kill these dirty Saxons.", "ragnarssons_12_2",[
  ]],
  [anyone|plyr,"ragnarssons_11", [
    ],
    "Ivar is right. It would be suicidal, and stupid to go out.", "ragnarssons_12_3",[
  ]],
  [anyone|plyr,"ragnarssons_11", [
    ],
    "I'm just a messenger. Ivar's words are not to my liking at all. He should watch his tongue.", "ragnarssons_12_4",[
  ]],
  #
  [anyone|other(trp_knight_8_13), "ragnarssons_12_1", [ #Ivar
      (str_clear, s2),
    ],
    "{!}{s2}", "ragnarssons_14_1", [
      (str_store_string, s2, "@--Ivar looks at you with intelligent eyes, studying you, trying to measure the utility or risk you represent.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_knight_8_13", -10),
  ]],
  
  [anyone|other(trp_knight_8_14), "ragnarssons_14_1", [ #hubbi
    ],
    "Puf. Another coward tries to win our sympathies. Anyway, Halfdan, do what you want.", "ragnarssons_14_2", [
      (call_script, "script_change_player_relation_with_troop", "trp_knight_8_14", -10),
  ]],
  
  [anyone,"ragnarssons_14_2", [
    ],
    "I see that you are an intelligent person, messenger. Well, I guess it's time to send an answer to Bjorn. Tell him that our answer is 'yes.' We will join the meeting he will arrange with the Saxons. We will accept whatever terms they offer, anything to get out of this gods-forsaken hole.", "ragnarssons_13",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
  ]],
  #
  [anyone|other(trp_knight_8_13), "ragnarssons_12_2", [ #Ivar
      (str_clear, s2),
    ],
    "{!}{s2}", "ragnarssons_13_1", [
      (str_store_string, s2, "@--Ivar looks at you with eyes cold as ice, weighing whether your words are a joke. " +
      "His mouth twists into a cruel grin, and his sharp face muscles tighten. He looks like he will say something, but then he shuts up. You do not know if that's good or if he just added you to a private list of enemies.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_knight_8_13", -30),
  ]],
  [anyone|other(trp_knight_8_14), "ragnarssons_13_1", [ #hubbi
    ],
    "I like you, messenger. Keep things clear and direct. We two are simple people.", "ragnarssons_13_2", [
      (call_script, "script_change_player_relation_with_troop", "trp_knight_8_14", 40),
  ]],
  [anyone,"ragnarssons_13_2", [
    ],
    "Well, my brothers may have different views, but this is the answer you shall take to Bjorn. Tell him that our answer is 'yes.' We will join the meeting he will arrange with the Saxons. We will accept whatever terms they offer, anything to get out of this gods-forsaken hole.", "ragnarssons_13",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  ##
  #
  [anyone|other(trp_knight_8_13), "ragnarssons_12_3", [ #Ivar
      (str_clear, s2),
    ],
    "{s2}^^That much is obvious, messenger, but I'm glad others see it as clearly as I do.", "ragnarssons_15_1", [
      (str_store_string, s2, "@--Ivar looks at you with eyes cold as ice, examining you and evaluating you.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_knight_8_13", 20),
  ]],
  [anyone|other(trp_knight_8_14), "ragnarssons_15_1", [ #hubbi
    ],
    "Be careful whose side you choose, messenger. Ivar is not accommodating even to his friends, whereas I kill all that oppose me.", "ragnarssons_15_2", [
      (call_script, "script_change_player_relation_with_troop", "trp_knight_8_14", -30),
  ]],
  [anyone,"ragnarssons_15_2", [
    ],
    "Let's calm down here now! Messenger, my brothers may have different views, but this is the answer you shall take to Bjorn. Tell him that our answer is 'yes.' We will join the meeting he will arrange with the Saxons. We will accept whatever terms they offer, anything to get out of this gods-forsaken hole.", "ragnarssons_13",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  ##
  #
  [anyone|other(trp_knight_8_13), "ragnarssons_12_4", [ #Ivar
      (str_clear, s2),
    ],
    "{!}{s2}", "ragnarssons_16_1", [
      (str_store_string, s2, "@--Ivar smiles, but the smile has little that is friendly in it. His thin lips simply curve up, conveying contempt and threat at the same time.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_knight_8_13", -30),
  ]],
  
  [anyone|other(trp_knight_8_14), "ragnarssons_16_1", [ #hubbi
    ],
    "Ha! You are bold, messenger. Few people dare to speak so to Ivar. Just a tip: watch your back from now on. Ha ha!", "ragnarssons_16_2", [
      (call_script, "script_change_player_relation_with_troop", "trp_knight_8_14", 10),
  ]],
  
  [anyone,"ragnarssons_16_2", [
    ],
    "Well, I guess it's time to send an answer to Bjorn. Tell him that our answer is 'yes.' We will join the meeting he arranges with the Saxons. We will accept whatever terms they offer, anything to get out of this gods-forsaken hole.", "ragnarssons_13",[
  ]],
  #
  
  [anyone|plyr,"ragnarssons_13", [
    ],
    "Very well, I will go back to Bjorn. Good luck.", "ragnarssons_14",[
  ]],
  [anyone|plyr,"ragnarssons_13", [
    ],
    "Hm. I expected some kind of reward as a messenger.", "ragnarssons_15",[
  ]],
  [anyone,"ragnarssons_14", [
    ],
    "Good luck to you, too. I fear the return will not be as easy as the way in. The Angles of Mierce have seen you and have brought more men into the woods.", "close_window",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
      (str_store_troop_name_link, s11, "trp_knight_8_7"),
      (str_store_string, s2, "@Return to {s11} and tell him that his brothers accepted meeting with the Saxons."),
      (add_quest_note_from_sreg, "qst_the_messengersn", 4, s2, 0),
      (quest_set_slot,"qst_the_messengersn",slot_quest_current_state, 4),
      (jump_to_menu, "mnu_nothingam_siege2"),
      (finish_mission),
  ]],
  [anyone,"ragnarssons_15", [
    ],
    "Sure! Take this money and our wishes for good luck. I fear the return will not be as easy as the way in. The Angles of Mierce have seen you and have brought more men into the woods.", "close_window",[
      (call_script, "script_troop_add_gold", "trp_player", 3400),
      (str_store_troop_name_link, s11, "trp_knight_8_7"),
      (str_store_string, s2, "@Return to {s11} and tell him that his brothers accepted meeting with the Saxons."),
      (add_quest_note_from_sreg, "qst_the_messengersn", 4, s2, 0),
      (quest_set_slot,"qst_the_messengersn",slot_quest_current_state, 4),
      (jump_to_menu, "mnu_nothingam_siege2"),
      (finish_mission),
  ]],
  
  #########rey thing acaba
  #############################
  
  
  #kennemer jarl
  
  #muy enfadado
  [anyone|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0), #kennemer jarl no quiere salvar doccinga
      (check_quest_active, "qst_kennemer_mission_3"),
      (this_or_next|quest_slot_eq,"qst_kennemer_mission_3",slot_quest_current_state, 4),
      (quest_slot_eq,"qst_kennemer_mission_3",slot_quest_current_state, 5),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (eq, ":town_lord", "$g_talk_troop"),
      (str_store_troop_name,s11,"$g_talk_troop"),
    ],
    "{s11}, I saved Doccinga from Sven...", "kennemerjarl_muy angry",[
      (str_clear, s11),
  ]],
  
  
  [anyone,"kennemerjarl_muy angry", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0), #
      (str_clear, s11),
      (str_clear, s2),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (eq, ":town_lord", "$g_talk_troop"),
      (str_store_troop_name,s11,"$g_talk_troop"),
    ],
    "{s2}^^What mission did I give you? Shouldn't you be busy killing the king? And what have you done instead? Went to the aid of Doccinga, knowing that was not going to please me. " +
    "You killed the very men who were to support me to take the crown after you had killed the king. You have betrayed me, your jarl. I swear upon my name, {s11}, you will pay dearly for it!", "kennemerjarl_enemistad1",[
      (str_store_string, s2, "@--He takes you aside, his lips curved down, his face is deep red, and he looks at you with fury.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
  ]],
  ##
  [anyone|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0), #kennemer jarl no quiere salvar doccinga
      (check_quest_active, "qst_doccinga_assault"),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (eq, ":town_lord", "$g_talk_troop"),
      (store_and, reg0, "$option_switches", option_1),
      (eq, reg0, 0),
    ],
    "My Lord, Doccinga is going to be attacked by Sven Bull Neck! They need troops.", "kennemerjarl_doccingacano",[
  ]],
  [anyone|plyr,"lord_talk", [(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),  #rey no puede salvar doccinga
      (check_quest_active, "qst_doccinga_assault"),
      #     (try_for_range, ":cur_troop", kings_begin, kings_end),
      (eq, "$g_talk_troop", "trp_kingdom_4_lord"),
      (store_and, reg0, "$option_switches", option_1),
      (eq, reg0, 0),
    ],
    "Doccinga is going to be attacked by Sven Bull Neck! They need help!", "king_doccingacano",[
  ]],
  ##
  [anyone|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0), #thiaderd mission chief
      (check_quest_active, "qst_kennemer_mission_2"),
      (quest_slot_eq,"qst_kennemer_mission_2",slot_quest_current_state, 6),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (eq, ":town_lord", "$g_talk_troop"),
      (str_store_troop_name,s11,"$g_talk_troop"),
    ],
    "{s11}, I have returned from the Thiaderd mission.", "kennemerjarl_thiaderdm1",[
      (str_clear, s11),
  ]],
  
  
  [anyone|plyr,"lord_talk", [(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active, "qst_kennemer_mission_1"),
      (quest_slot_eq,"qst_kennemer_mission_1",slot_quest_current_state, 3),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (eq, ":town_lord", "$g_talk_troop"),
      (str_store_troop_name,s11,"$g_talk_troop"),
    ],
    "{s11}, I went back to the monastery and made things right, in your name.", "kennemerjarl_juicio_1",[
      (str_clear, s11),
  ]],
  
  [anyone|plyr,"lord_talk", [(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (neg|check_quest_finished, "qst_recruit_an_army"),
      (check_quest_succeeded, "qst_recruit_an_army"),
      #(check_quest_active, "qst_recruit_an_army"),
      (call_script, "script_party_count_members_with_full_health", "p_main_party"),
      (ge, reg0, 15),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (eq, ":town_lord", "$g_talk_troop"),
      (str_store_troop_name,s11,"$g_talk_troop"),
    ],
    "{s11}, I have warriors that you asked me for.", "kennemerjarl_recruit_back1",[
      (str_clear, s11),
  ]],
  [anyone|plyr,"lord_talk", [(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active, "qst_kennemer_mission_1"),
      (quest_slot_eq,"qst_kennemer_mission_1",slot_quest_current_state, 4),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (eq, ":town_lord", "$g_talk_troop"),
      (str_store_troop_name,s11,"$g_talk_troop"),
    ],
    "{s11}, I went back to the monastery and made things right, in your name.", "kennemerjarl_juicio_2",[
      (str_clear, s11),
  ]],
  ###king horik of danmark chief
  [trp_kingdom_1_lord|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),#king horik
      (check_quest_active,"qst_revenge_sigurd"),
      (quest_slot_eq,"qst_revenge_sigurd",slot_quest_current_state, 5),
    ],
    "I come from Friese. I need to talk to you about an important issue.", "kinghorik_quest_revenge1",[
  ]],
  ####
  ###king horik of danmark chief
  [trp_kingdom_1_lord|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),#king horik
      (check_quest_active,"qst_danmork_protection"),
      (quest_slot_eq,"qst_danmork_protection",slot_quest_current_state, 14),
    ],
    "King Horik, we were attacked at Ulf's farm.", "kinghorik_quest_thing1",[
  ]],
  ####
  ###king horik of danmark bodo letter chief, ulf testigo y empieza the Assembly
  [trp_kingdom_1_lord|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),#king horik
      (check_quest_active,"qst_bodo_letter"),
      (quest_slot_eq,"qst_bodo_letter",slot_quest_current_state, 4),
    ],
    "King Horik, we met Atli Eiriksson.", "kinghorik_quest_atlieiriksson1",[
  ]],
  [trp_kingdom_1_lord|plyr,"lord_talk", [(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0), #king horik
      (check_quest_active,"qst_ulf_testigo"),
      (quest_slot_eq,"qst_ulf_testigo",slot_quest_current_state, 4),
    ],
    "Ulf Thorirsson will not testify against me at the Assembly.", "kinghorik_ulf_testigo1",[
      (str_clear, s2),
      (str_clear, s4),
      (str_clear, s9),
      (str_clear, s10),
      (try_for_range, ":troop_no", active_npcs_begin, active_npcs_end), #jarls relation check for quest chief
        (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
        (store_troop_faction, ":troop_faction_no", ":troop_no"),
        (eq, ":troop_faction_no", "fac_kingdom_1"),
        (call_script, "script_troop_get_relation_with_troop", "trp_player", ":troop_no"),
        (ge, reg0, 15),
        (str_store_troop_name_link, s9, ":troop_no"),
        (str_store_string, s4, "@{s9} has good relations with you."),
        (str_store_string, s2, "@{!}{s2}^{s4}"),
        (add_quest_note_from_sreg, "qst_ulf_testigo", 5, s2, 0),
      (try_end),
  ]],
  [trp_kingdom_1_lord|plyr,"lord_talk", [(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0), #king horik
      ##          (check_quest_succeeded, "qst_ulf_testigo"),
      ##          (check_quest_succeeded, "qst_bodo_letter"),
      (quest_slot_eq, "qst_bodo_letter", slot_quest_current_state, 5),
      (quest_slot_eq, "qst_ulf_testigo", slot_quest_current_state, 5),
    ],
    "I've done everything. I think I'm ready to go to the Assembly.", "kinghorik_thething1",[
  ]],
  ####
  
  
  ###king of wessex Brytenwalda Aethelred Aethelwulfing
  [trp_kingdom_5_lord|plyr,"lord_talk", [(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (eq, "$player_side", 1), #wessex
      (check_quest_active,"qst_the_alliance"),
    ],
    "I have an important letter for you.", "aethelredbodoletter_1",[
  ]],
  
  #Halfdan - Ashdown
  [trp_kingdom_8_lord|plyr,"lord_talk", [
      # (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (eq, "$player_side", 2), #danish
      (check_quest_active, "qst_aescesdun"),
      (quest_slot_eq,"qst_aescesdun",slot_quest_current_state, 1),
    ],
    "I recently returned from Douar-an-Enez, and I received your urgent message.", "halfdan_ad_1",
    []],
  
  [trp_kingdom_8_lord|plyr,"lord_talk", [
      # (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (eq, "$player_side", 2), #danish
      (check_quest_active, "qst_aescesdun"),
      (quest_slot_eq,"qst_aescesdun",slot_quest_current_state, 3),
    ],
    "I'm ready to join the army and attack the Saxons.", "halfdan_bt_1",
    []],
  
  ####Alfred the great Aetheling Aelfred Aethelwulfing
  #Alfred - Ashdown
  [trp_knight_5_1|plyr,"lord_talk", [
      # (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (eq, "$player_side", 1), #wessex
      (check_quest_active, "qst_aescesdun"),
      (quest_slot_eq,"qst_aescesdun",slot_quest_current_state, 1),
    ],
    "I recently returned from Douar-an-Enez, and I received your urgent message.", "aelfred_ad_1",
    []],
  [trp_knight_5_1|plyr,"lord_talk", [
      # (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (eq, "$player_side", 1), #wessex
      (check_quest_active, "qst_aescesdun"),
      (quest_slot_ge,"qst_aescesdun",slot_quest_current_state, 3),
    ],
    "I'm ready to join the army and defend West Seaxe.", "aelfred_bt_1",
    []],
  
  
  [trp_knight_5_1|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (eq, "$player_side", 1), #wessex
      (check_quest_active,"qst_the_alliance"),
      (quest_get_slot, ":quest_current_state", "qst_the_alliance", slot_quest_current_state),
      (le, ":quest_current_state", 10),
    ],
    "I have an important letter for you.", "aelfredbodoletter_1",[
  ]],
  [trp_knight_5_1|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active,"qst_the_alliance"),
      (quest_get_slot, ":quest_current_state", "qst_the_alliance", slot_quest_current_state),
      (ge, ":quest_current_state", 11),
      (eq, "$players_kingdom", "$g_talk_troop_faction"),
    ],
    "Yes, I've joined West Seaxe and returned, as you requested.", "aelfredbodoletter_1_1",[
  ]],
  
  [trp_knight_5_1|plyr,"lord_talk", [
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (eq, "$player_side", 1), #wessex
      (check_quest_active, "qst_welsh_and_pictish"),
      (check_quest_succeeded, "qst_welsh_and_pictish"),
    ],
    "I conquered Din Bych and kept it in my power for twenty days, as agreed.", "aethelred_wp_1",
    []],
  
  ###Jarl Rathbarth Ragnarsson
  [trp_knight_8_2|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (eq, "$player_side", 2), #danish
      (check_quest_active,"qst_the_alliance"),
      (quest_get_slot, ":quest_current_state", "qst_the_alliance", slot_quest_current_state),
      (le, ":quest_current_state", 10),
    ],
    "I have an important letter for you.", "raethbarthbodoletter_1",[
  ]],
  
  [trp_knight_8_2|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active,"qst_the_alliance"),
      (quest_get_slot, ":quest_current_state", "qst_the_alliance", slot_quest_current_state),
      (ge, ":quest_current_state", 11),
      (eq, "$players_kingdom", "$g_talk_troop_faction"),
    ],
    "Yes, I've joined Northhymbre and returned, as you requested.", "raethbarthbodoletter_1_1",[
  ]],
  
  
  [trp_knight_8_2|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active,"qst_sven_traitor"),
      (quest_slot_eq,"qst_sven_traitor",slot_quest_current_state,1),
    ],
    "Jarl Raethbarth, I have important news for you.", "raethbarth_1",[
  ]],
  
  [trp_knight_8_2|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active,"qst_sven_traitor"),
      (quest_slot_eq,"qst_sven_traitor",slot_quest_current_state, 4), #despues de nothingaham
    ],
    "Bjorn sent me back to you.", "raethbarthbjorn_1",[
  ]],
  
  [trp_knight_8_2|plyr,"lord_talk", [
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (eq, "$player_side", 2), #danish
      (check_quest_active, "qst_welsh_and_pictish"),
      (check_quest_succeeded, "qst_welsh_and_pictish"),
    ],
    "I conquered Dun Taruo and kept it in my power for twenty days, as agreed.", "raethbarth_wp_1",
    []],
  ###Jarl Bjorn Ragnarsson
  [trp_knight_8_7|plyr,"lord_talk", [
      (check_quest_active, "qst_the_messengersn"),
      (check_quest_succeeded, "qst_the_messengersn"),
    ],
    "The Saxons agree to meet with you to sign a truce.", "jarlbjornnegtruce_1",[
      (assign, "$g_lord_hide", -1), #lords back to world hide lords
  ]],
  
  [trp_knight_8_7|plyr,"lord_talk", [
      (check_quest_active,"qst_the_messengersn"),
      (quest_slot_eq,"qst_the_messengersn",slot_quest_current_state, 5),
    ],
    "I talked to your siblings. They are willing to negotiate with the Saxons.", "jarlbjornneg_1",[
  ]],
  
  [trp_knight_8_7|plyr,"lord_talk", [
      (check_quest_active,"qst_sven_traitor"),
      (quest_slot_eq,"qst_sven_traitor",slot_quest_current_state, 21),
    ],
    "Jarl Bjorn, I'm what's left of the reinforcements sent by Danmark.", "jarlbjorn_1",[
  ]],
  
  [trp_knight_8_7|plyr,"lord_talk", [
      (check_quest_active, "qst_wessex_foragers"),
      (check_quest_succeeded, "qst_wessex_foragers"),
    ],
    "Jarl Bjorn, the Saxon foragers were hunted and slain.", "jarlbjornwf_1",[
  ]],
  
  #####Sigurd
  ###
  [trp_knight_1_5|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),#kennemer jarl story
      (check_quest_active,"qst_collect_smen"),
      (party_get_num_companion_stacks, ":num_stacks","p_main_party"),
      (assign, ":num_men", 0),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_size, ":stack_size","p_main_party",":i_stack"),
        (val_add, ":num_men", ":stack_size"),
      (try_end),
      (gt, ":num_men", 200), # se muestra si el player tiene por lo menos 600 hombres
    ],
    "I have more than two hundred men here for you.", "sigurd_quest_collect1",[
  ]],
  
  
  [trp_knight_1_5|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),#Sigurd no
      (check_quest_active,"qst_revenge_sigurd"),
      (quest_slot_eq,"qst_revenge_sigurd",slot_quest_current_state, 5),
    ],
    "I come from Friese. I am looking for Sven Bull Neck and my mother. Where are they?", "sigurd_quest_revenge1",[
  ]],
  [trp_knight_1_5|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),#Sigurd ok
      (check_quest_active,"qst_danmork_protection"),
      (quest_slot_eq,"qst_danmork_protection",slot_quest_current_state, 2),
      # (quest_slot_eq,"qst_revenge_sigurd",slot_quest_current_state, 6),
    ],
    "Sigurd, it's time to talk. I can cause you a lot of damage if you do not listen to me.", "sigurd_quest_revenge_horik0",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
  ]],
  [trp_knight_1_5|plyr,"lord_talk", [ (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),#Sigurd ok
      (check_quest_active,"qst_danmork_protection"),
      (quest_slot_eq,"qst_danmork_protection",slot_quest_current_state, 1),
      (quest_slot_eq,"qst_revenge_sigurd",slot_quest_current_state, 6),
    ],
    "Sigurd, it's time to talk. I'm not an ordinary man; I have the support of King Horik.", "sigurd_quest_revenge_horik",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
  ]],
  ######respuestas
  [anyone,"sigurd_quest_revenge1", [
    ],
    "I do not care who you are or what your motives may be. Here in Danmark, you're a nobody, someone insignificant. You have neither credentials nor support. I say it only once: get out of my presence, rat.", "lord_pretalk",[
      #(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"sigurd_quest_revenge_horik0", [
      (str_clear, s2),
      (str_clear, s4),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (str_store_troop_name,s4,":town_lord"),
    ],
    "{s2}^^I see. I was hoping to avoid this, but I am tired of trying. Your mere presence offends my sight. Of course I know your name, {playername}; {s4} sent me news about you. The {reg59?lady:man} who would kill King Hrorik Hemmingsson and help us take Friese. " +
    "I was happy to hear this, but then I got more news from the jarl yesterday. '{playername} is a traitor,' said the messenger. 'Be careful. {reg59?She:He} wants Sven Bull Neck and comes to talk to you. {reg59?She:He} has destroyed our plans in Friese, protected Doccinga and killed your Vikings. When you see {reg59?her:him}, kill {reg59?her:him}.' " +
    "You are perhaps too bold to come here.", "sigurd_quest_revenge2",[
      (str_store_string, s2, "@--He looks carefully at you for a few seconds, watching you with an eye surrounded by a serpent.--", color_good_news),
  ]],
  
  [anyone,"sigurd_quest_revenge_horik", [
      (str_clear, s2),
      (str_clear, s4),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (str_store_troop_name,s4,":town_lord"),
    ],
    "{s2}^^You are persistent! I was hoping to avoid this, but you name names... none other than that of King Horik.^^Of course I know your name, {playername}; {s4} sent me news about you. The {reg59?lady:man} who would kill King Hrorik Hemmingsson and help us take Friese. " +
    "I was happy to hear this, but then I got more news from the jarl yesterday. '{playername} is a traitor,' said the messenger. 'Be careful. {reg59?She:He} wants Sven Bull Neck and comes to talk to you. {reg59?She:He} has destroyed our plans in Friese, protected Doccinga and killed your Vikings. When you see {reg59?her:him}, kill {reg59?her:him}.' " +
    "You are perhaps too bold to come here.", "sigurd_quest_revenge2",[
      (str_store_string, s2, "@--He looks carefully at you for a few seconds, watching you with an eye surrounded by a serpent.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone|plyr,"sigurd_quest_revenge2", [ #
    ],
    "My issues are not with you. I just want to find Sven Bull Neck and my mother.", "sigurd_quest_revenge31",[
  ]],
  
  [anyone|plyr,"sigurd_quest_revenge2", [ #
    ],
    "I did not know the jarl's plans, so I defended Doccinga. I am loyal to your cause.", "sigurd_quest_revenge32",[
  ]],
  
  [anyone,"sigurd_quest_revenge31", [
      (str_clear, s4),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (str_store_troop_name,s4,":town_lord"),
    ],
    "How stupid can you be? Sven Bull Neck is not just any man but my favorite, the man who stands in the prow of my own personal ship. " +
    "You and I have nothing to talk about. Get out now, while my obligation to hear you in peace still weighs down my sword.", "sigurd_quest_revenge4",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 8),
      (call_script, "script_end_quest", "qst_revenge_sigurd"),
      #(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"sigurd_quest_revenge32", [
      (str_clear, s4),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (str_store_troop_name,s4,":town_lord"),
    ],
    "Your loyalty is too strange and too late. You're just the rat that thwarted my plans in Friese. {s4} had promised me six hundred men for the expedition to Englaland. " +
    "Now I have exactly none.", "sigurd_quest_revenge322",[
  ]],
  
  [anyone|plyr,"sigurd_quest_revenge322", [ #kennemer jarl story
    ],
    "Sorry, but I just want to know where Sven Bull Neck is.", "sigurd_quest_revenge31",[
  ]],
  
  [anyone|plyr,"sigurd_quest_revenge322", [ #kennemer jarl story
    ],
    "I will recruit six hundred men for you.", "sigurd_quest_revenge33",[
  ]],
  
  [anyone,"sigurd_quest_revenge33", [
      (str_clear, s4),
    ],
    "{s4}^^I do hope you're not teasing me and that it is not Loki speaking with your mouth. " +
    "Frankly, I doubt you're able to recruit six hundred men, but if you recruit more than two hundred, come back here, and we will talk. Maybe you will get to chat with my friend, Sven.", "lord_pretalk",[
      (str_store_string, s4, "@--He looks suspiciously at you.--", color_good_news),
      (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 8),
      (call_script, "script_end_quest", "qst_revenge_sigurd"),
      
      (str_clear, s11),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_string, s2, "@Collect more than two hundred men for Sigurd Ragnarsson."),
      (call_script, "script_start_quest", "qst_collect_smen", "$g_talk_troop"),
      (display_message, "@Collect two hundred men for {s11}."),
  ]],
  
  ###
  ###collect men
  [anyone,"sigurd_quest_collect1", [
      (str_clear, s2),
    ],
    "{s2}^^One of my hersirs will take care of your men. Well, now they are MY men. I really did not expect someone like you to be able to do this, but here you are. " +
    "I see that you will do anything to find Sven Bull Neck and your mother.", "sigurd_quest_collect1",[
      # (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 50),
      (str_store_string, s2, "@--He looks surprised.--", color_good_news),
      
      (party_get_num_companion_stacks, ":num_companion_stacks","p_main_party"),
      (try_for_range_backwards, ":stack_no", 0, ":num_companion_stacks"),
        (party_stack_get_troop_id, ":stack_troop","p_main_party",":stack_no"),
        (party_stack_get_size, ":stack_size", "p_main_party", ":stack_no"),
        (neg|troop_is_hero, ":stack_troop"),
        (party_remove_members, "p_main_party", ":stack_troop", ":stack_size"),
      (try_end),
      
      (add_xp_as_reward,3000),
      (call_script, "script_succeed_quest", "qst_collect_smen"),
      (call_script, "script_end_quest", "qst_collect_smen"),
  ]],
  
  [anyone|plyr,"sigurd_quest_collect1", [ #
    ],
    "Yes. Sven Bull Neck attacked the ship on which I was traveling and kidnapped my mother. He had mistaken the person because of an object she was carrying. " +
    "Sven Bull Neck has to pay for this, and I must rescue my mother.", "sigurd_quest_collect2",[
  ]],
  
  [anyone,"sigurd_quest_collect2", [
    ],
    "Your mother is the woman touched by the gods? Yes, Sven brought her to me, as I had asked. She was carrying an object, a letter from overseas that had to be intercepted. " +
    "I talked to her, yes... She spoke about a man called Bodo, who had given her the letter on a ship called the Woden Ric. So do you know that name?", "sigurd_quest_revenge5",[
  ]],
  
  ###
  
  ###
  
  [anyone|plyr,"sigurd_quest_revenge4", [
      (str_clear, s10),
    ],
    "{!}{s10}", "sigurd_quest_revenge41",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@You don't trust me! I understand, but it is very important for me to see my mother. " +
          "Sven Bull Neck attacked the ship on which I was traveling and kidnapped my mother. He had mistaken the person because of an object she was carrying. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@I think you misunderstood me. I'm not leaving here without my mother. " +
          "Sven Bull Neck attacked the ship on which I was traveling and kidnapped my mother. He had mistaken the person because of an object she was carrying. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@I'm not an ordinary {reg59?woman:man} either. Let me see Sven Bull Neck and my mother, or I will become your worst enemy. " +
          "Sven Bull Neck attacked the ship on which I was traveling and kidnapped my mother. He had mistaken the person because of an object she was carrying. Where is she? (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@I think that we have started on the wrong foot. Tell me where Sven Bull Neck is, and I will not bother you further. I just want to find my mother. " +
          "Sven Bull Neck attacked the ship on which I was traveling and kidnapped my mother. He had mistaken the person because of an object she was carrying. (Sanguine)"),
      (try_end),
  ]],
  
  [anyone,"sigurd_quest_revenge41", [
      (str_clear, s4),
    ],
    "{!}{s4}", "sigurd_quest_revenge5",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s4, "@Your mother is the woman touched by the gods? Yes, Sven brought her to me, as I had asked. She was carrying an object, a letter from overseas that had to be intercepted. " +
        "I talked to her, yes... She spoke about a man called Bodo, who had given her the letter on a ship called the Woden Ric. Do you recognize that name?"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s4, "@Your mother is the woman touched by the gods? Yes, Sven brought her to me, as I had asked. She was carrying an object, a letter from overseas that had to be intercepted. " +
        "I talked to her, yes... She spoke about a man called Bodo, who had given her the letter on a ship called the Woden Ric. Do you recognize that name?"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s4, "@You destroy my plans in Doccinga and now threaten me? You're either a complete idiot or as crazy as your mother. You're lucky I'm still interested in your answers. Yes, Sven brought a woman touched for the gods to me, as I had asked. She was carrying an object, a letter from overseas that had to be intercepted. " +
        "I talked to her, yes... She spoke about a man called Bodo, who had given her the letter on a ship called the Woden Ric. Do you recognize that name?"),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s4, "@Your mother is the woman touched by the gods? Yes, Sven brought her to me, as I had asked. She was carrying an object, a letter from overseas that had to be intercepted. " +
        "I talked to her, yes... She spoke about a man called Bodo Vimaraniz, who had given her the letter on a ship called the Woden Ric. Do you recognize that name?"),
      (try_end),
  ]],
  
  [anyone|plyr,"sigurd_quest_revenge5", [ #
    ],
    "No, I do not know who he is. Should I?", "sigurd_quest_revenge51",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", 5),
  ]],
  [anyone|plyr,"sigurd_quest_revenge5", [ #
    ],
    "Yes, he was also traveling in the Woden Ric.", "sigurd_quest_revenge52",[
  ]],
  
  [anyone,"sigurd_quest_revenge51", [
    ],
    "Lying! Why do you lie? You say that you traveled on the same boat with your mother, and she says she met Bodo on the same boat. " +
    "That man, Bodo, is very important to me, but Sven made the mistake of leaving him in his hideout. Now Bodo is gone because someone rescued him. I suspect I know who this someone is! " +
    "Bodo is so important, that I would gladly trade him for Sven Bull Neck and you mother, who still lives only because Sven has taken a liking to her.", "sigurd_quest_revenge6",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  
  [anyone,"sigurd_quest_revenge52", [
    ],
    "I know, your mother told me. " +
    "That man, Bodo, is very important to me, but Sven made the mistake of leaving him in his hideout. Now Bodo is gone because someone rescued him. I suspect I know who this someone is! " +
    "Bodo is so important, that I would gladly trade him for Sven Bull Neck and you mother, who still lives only because Sven has taken a liking to her.", "sigurd_quest_revenge6",[
  ]],
  
  [anyone|plyr,"sigurd_quest_revenge6", [ #
    ],
    "You tell me where Sven Bull Neck and my mother are, and Bodo is yours.", "sigurd_quest_revenge61",[
  ]],
  
  [anyone|plyr,"sigurd_quest_revenge6", [ #
    ],
    "I do not know where Bodo is.", "sigurd_quest_revenge62",[
  ]],
  
  [anyone,"sigurd_quest_revenge61", [
    ],
    "Then we have a deal. I suppose Bodo is with you, so I will send two men to get him. You people keep quiet, for I have hundreds of warriors ready to attack on my order. " +
    "If they take Bodo without complications, there will be no problems. I hope this will be how it goes, for a fight would not benefit any of us.", "sigurd_quest_revenge71",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone,"sigurd_quest_revenge71", [
      (str_clear, s4),
      (str_clear, s3),
      (str_clear, s10),
    ],
    "{s4}^^As for my part, there is a farm near Skyfa belonging to a man that is loyal to me. Go there, and Sven Bull Neck and your mother will meet you there. " +
    "{playername}, remember that there are laws in Danmark, and if you cause any damage to Sven, you will have to pay...", "sigurd_quest_revenge8",[
      # (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 50),
      (str_store_string, s4, "@--He looks at you. His eyes, his hard features, and even the wrinkles on his face communicate extreme seriousness.--", color_good_news),
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_castle_49"),
      (str_store_string, s2, "@{s9} accepted your deal. You gave Bodo to him, and he told you he would send Sven Bull Neck and your mother to a farm near {s3}."),
      (call_script, "script_start_quest", "qst_revenge_exchange", "$g_talk_troop"),
      (quest_set_slot,"qst_revenge_exchange",slot_quest_current_state, 1),
      (enable_party, "p_farmland"), #farm para emboscada, Sven meeting chief
  ]],
  
  [anyone,"sigurd_quest_revenge62", [
    ],
    "I'm too old to swallow your lies. Bodo means too much to me, and I know you know where he is. What I do not know is if you have hidden him among your people or elsewhere. So here is the deal:", "sigurd_quest_revenge72",[
  ]],
  
  [anyone,"sigurd_quest_revenge72", [
      (str_clear, s4),
      (str_clear, s3),
      (str_clear, s10),
    ],
    "{s4}^^There is a farm near Skyfa belonging to a man that is loyal to me. Go there, and Sven Bull Neck and your mother will meet you there. " +
    "If Bodo is there, my men will exchange Sven Bull Neck and your mother for him. If Bodo is not there, your mother will die before your eyes, and I will send Sven away to a place where you will never find him.", "sigurd_quest_revenge82",[
      # (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 50),
      (str_store_string, s4, "@--He looks at you. His eyes, his hard features, and even the wrinkles on his face communicate extreme seriousness.--", color_good_news),
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_castle_49"),
      (str_store_string, s2, "@{s9} has proposed a deal: to exchange Bodo for Sven Bull Neck and you mother at a farm near {s3}."),
      (call_script, "script_start_quest", "qst_revenge_exchange", "$g_talk_troop"),
      (quest_set_slot,"qst_revenge_exchange",slot_quest_current_state, 2),
      (enable_party, "p_farmland"), #farm para emboscada, Sven meeting chief
  ]],
  
  [anyone|plyr,"sigurd_quest_revenge8", [
    ],
    "Have your men follow me. I will tell Bodo farewell and give him to them.", "close_window",[
      (str_clear, s11),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_string, s2, "@Note Bodo: you chose to deliver Bodo to {s11} in exchange for your mother."),
      (add_quest_note_from_sreg, "qst_notes_companions", 5, s2, 0),
      (jump_to_menu,"mnu_entregar_bodo"),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  
  [anyone|plyr,"sigurd_quest_revenge82", [
    ],
    "I will go to that farm near Skyfa. Farewell.", "sigurd_quest_revenge82_1",[
      (str_clear, s11),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_string, s2, "@Note Bodo: you chose to be loyal to Bodo and not deliver him to {s11} at the exchange at the farm."),
      (add_quest_note_from_sreg, "qst_notes_companions", 5, s2, 0),
  ]],
  
  [anyone,"sigurd_quest_revenge82_1", [
    ],
    "Well, I think we have nothing to talk about.", "close_window",[
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  ###
  [trp_knight_1_5|plyr,"lord_talk", [
    ],
    "I would like to know more about you.", "sigurd_story1",[
  ]],
  
  [anyone,"sigurd_story1", [
    ],
    "My name is Sigurdr ormr i auga, Sigurd 'Snake in the Eye,' son of Ragnar Lodbrok and Aslaug, lord of Sjaelland, Skane, and other lands. " +
    "To learn more, ask other men, as fame is measured by what others say about you.", "lord_pretalk",[
  ]],
  
  ###
  ###
  [trp_knight_4_3|plyr,"lord_talk", [
      (call_script, "script_troop_get_player_relation",  "$g_talk_troop"),
      (assign, ":relation", reg0),
      #    (troop_get_slot, ":relation", "$g_talk_troop", slot_troop_player_relation),
      (gt, ":relation", 12),
    ],
    "I would like to know more about you.", "kennemerjarl_story1",[
  ]],
  
  [anyone,"kennemerjarl_story1", [
    ],
    "There is not much to tell you. I am the son of Harald the Younger and nephew of King Horik. My father with my uncle and Gotrik conquered this land.^" +
    "One may say that my uncle Hrorik, the king, serves Lothar, king of the Franks, but really, my uncle does what he wants. " +
    "The only thing is that we should not attack the land of the Franks. This I heed very little, and occasionally I organize some expedition for plunder or pay against the Franks.^^" +
    "There is no need to talk over my head, and there are more pressing problems, such as the rebellion of some Frisians. My uncle would sooner kill them all, but he is still too weak.", "lord_pretalk",[
  ]],
  ###
  [anyone|plyr,"lord_talk", [
      (check_quest_active, "qst_kennemer_jarl"),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (eq, ":town_lord", "$g_talk_troop"),
      (str_store_troop_name,s11,"$g_talk_troop"),
    ],
    "{s11}, Thonkrik from Doccinga told me that you could help me.", "kennemerjarl_1",[
      (str_clear, s11),
  ]],
  
  #no quiere involucrarse en doccinga ca
  [anyone,"king_doccingacano", [
    ],
    "I sent men there weeks ago. I will try to send more men soon, but I need to gain time. If you help Doccinga, I will be grateful.", "lord_pretalk",[
      (val_or, "$option_switches", option_1),
  ]],
  [anyone,"kennemerjarl_doccingacano", [
    ],
    "That's neither my problem nor yours. It is the king's problem.", "lord_pretalk",[
      (val_or, "$option_switches", option_1),
  ]],
  ###
  
  [anyone,"kennemerjarl_1", [
      (call_script, "script_troop_get_player_relation",  "$g_talk_troop"),
      (assign, ":relation", reg0),
      #   (troop_get_slot, ":relation", "$g_talk_troop", slot_troop_player_relation),
      (gt, ":relation", 9),
    ],
    "Thonkrik is a good man, and you are a good friend. What do you need?", "kennemerjarl_2",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2), #cambido chief
      (call_script, "script_end_quest", "qst_kennemer_jarl"),
  ]],
  
  [anyone,"kennemerjarl_1", [
    ],
    "Thonkrik is a good man, one of the few Frisians who have gained my esteem. If you come in his name, I will listen to you!", "kennemerjarl_2",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2), #cambido chief
      (call_script, "script_end_quest", "qst_kennemer_jarl"),
  ]],
  
  [anyone|plyr,"kennemerjarl_2", [
    ],
    "Do you know the Woden Ric? I traveled on this ship with my mother, but we were attacked by Sven Bull Neck.", "kennemerjarl_3",[
  ]],
  
  [anyone,"kennemerjarl_3", [
    ],
    "Sven the Bloody attacks merchant ships near our shores, waiting for us to pay him every spring, but not this year! Do not worry. I'm gathering troops to hunt for him. Now, I have things to do...", "kennemerjarl_4",[
  ]],
  
  
  [anyone|plyr,"kennemerjarl_4", [
    ],
    "I desire to join the hunt. My goal is to avenge the death of my mother.", "kennemerjarl_51",[
  ]],
  
  [anyone|plyr,"kennemerjarl_4", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@Sven is my goal too. I want to join the hunt. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@Sven is mine! I want him dead! I need to join the hunt. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@No, you listen to me! I want to make Sven pay for what he did. Give me the men! (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Yes! Those are just the words I wanted to hear. Attack him at sea! (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "kennemerjarl_52",[
      (str_clear, s10),
  ]],
  
  [anyone,"kennemerjarl_52", [
      # (str_clear, s1), #falla
      (str_clear, s2),
    ],
    "{!}{s2}", "kennemerjarl_6",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        #(str_store_string, s1, "@--He looks at you interested.--", color_good_news),
        (str_store_string, s2, "@Your goal? Who are you? Do you have ships and men?"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        #	(str_store_string, s1, "@--He smiles contemptuously.--", color_good_news),
        (str_store_string, s2, "@Yours? Sven is a murderer, but he isn't an idiot. He will be waiting for us, and his men are veteran Vikings. If you want to attack him, go ahead, but I hope you have many men and ships."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1), #cambido chief
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        #	(str_store_string, s1, "@--He purses his lips angrily a few seconds before speaking.--", color_good_news),
        (str_store_string, s2, "@Beware! You may be in my house, but the hospitality you enjoy has a limit. Watch your words!^^Now, you'll have to find your own men and boats to undertake such an expedition."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -2), #cambido chief
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        #	(str_store_string, s1, "@--He smiles.--", color_good_news),
        (str_store_string, s2, "@Your enthusiasm gladdens me. I wish my men thought alike, but they are too afraid of Sven. How many men and ships can you bring to the hunt?"),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2), #cambido chief
      (try_end),
  ]],
  
  [anyone, "kennemerjarl_51", [
      (str_clear, s1),
    ],
    "{s1}^^I am not sure... How many men and ships do you have?", "kennemerjarl_6", [
      (str_store_string, s1, "@--He looks into your eyes, taken by surprise.--", color_good_news),
  ]],
  
  [anyone|plyr,"kennemerjarl_6", [
    ],
    "My arms are my men, and my courage is my ships. Together we will kill Sven Bull Neck.", "kennemerjarl_71",[
  ]],
  
  [anyone|plyr,"kennemerjarl_6", [
    ],
    "In truth, I lost everything, but I do not lack the courage to achieve my revenge.", "kennemerjarl_72",[
  ]],
  
  [anyone|plyr,"kennemerjarl_6", [
    ],
    "I am just one {reg59?woman:man}, sir, but I will give my eternal loyalty to you.", "kennemerjarl_73",[
  ]],
  
  [anyone, "kennemerjarl_71", [],
    "Yes, yes, I see... Well, look, I'm very busy. Why don't you come see me later? In ten years, for example?", "kennemerjarl_8", [
  ]],
  
  [anyone, "kennemerjarl_72", [],
    "Well, I understand your desire for revenge, but I cannot help you... I need men and ships ready to fight, not desperate, poorly equipped orphans-in-mourning.", "kennemerjarl_8", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2), #cambido chief
  ]],
  
  [anyone, "kennemerjarl_73", [],
    "Your loyalty does not interest me. Tell you what... You look like a good {reg59?woman:man}. Why not ask Thonkrik from Doccinga for {reg59?a good man to marry:a job digging the moat} and try to rebuild your life?", "kennemerjarl_8", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 4), #cambido chief
  ]],
  
  [anyone|plyr,"kennemerjarl_8", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@This hunt is my life now, sir. I can be very persistent. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@Sir, I have lost everything... I have only revenge to live for now... (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@I shall not leave until you give me a chance. I'll sit in your door until you do. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@You just cannot see it now, but you need me, sir. I'm not afraid of Sven! (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "kennemerjarl_91",[
      (str_clear, s10),
  ]],
  
  [anyone|plyr,"kennemerjarl_8", [
    ],
    "I thought that surely you would understand the demands of honor in cases such as mine.", "kennemerjarl_92",[
  ]],
  
  [anyone,"kennemerjarl_91", [
      #  (str_clear, s1), #falla
      (str_clear, s2),
    ],
    "{!}{s2}", "kennemerjarl_92",[
      #	(str_store_string, s1, "@--He places his index finger against his lips for silence.--"),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s2, "@Alright! Alright! I see... Well I have an idea. Listen to me."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1), #cambido chief
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s2, "@Oh, by Thor! This isn't necessary, is it, {reg59?woman:man}? Alright, I will give you one opportunity."),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s2, "@Yes, yes, you are very serious. Well, I have an idea."),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s2, "@Someone who is not afraid of Sven is a fool, but maybe I should give you a chance to prove your worth."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -2), #cambido chief
      (try_end),
  ]],
  
  [anyone, "kennemerjarl_92", [
      (str_clear, s11),
    ],
    "Are you indeed so motivated by honor? Alright, I can do this: I'll give you a place among the men who will face Sven if you prove your worth.", "kennemerjarl_93", [
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_string, s2, "@You have offered your services to {s11}, in exchange for allowing you join the hunt for Sven Bull Neck. {s11} has asked you to prove your worth."),
      
      (call_script, "script_start_quest", "qst_kennemer_jarl_missions", "$g_talk_troop"),
  ]],
  
  [anyone, "kennemerjarl_93", [
      (str_clear, s1),
    ],
    "{s1}^^There is a problem I need to solve. Not far from here is a monastery of Christians, Odin damn them, who have sent a request to intercede in a land property dispute.^" +
    "Honestly, I care very little about their problems, but the king wants Christian priests happy, to avoid Frisian rebellions.", "kennemerjarl_94", [
      (str_store_string, s1, "@--He makes the sign of Odin to ward off bad luck.--"),
  ]],
  
  [anyone, "kennemerjarl_94", [],
    "Anyway, my men are busy, protecting important things like the people on the coast, so you go in my name and make the arrangement that best suits my interests.^" +
    "The most important thing is to keep the monks quiet. I do not want them stirring up the people versus rightful Danish dominion.", "kennemerjarl_95", [
  ]],
  
  [anyone|plyr,"kennemerjarl_95", [
    ],
    "Thank you, my lord. I will not disappoint you.", "kennemerjarl_10",[
  ]],
  
  [anyone|plyr,"kennemerjarl_95", [
    ],
    "Is there a reward?", "kennemerjarl_10",[
  ]],
  
  [anyone|plyr,"kennemerjarl_95", [
    ],
    "It will be done quickly. Farewell.", "kennemerjarl_10",[
  ]],
  
  [anyone, "kennemerjarl_10", [
      (str_clear, s11),
      (str_clear, s2),
    ],
    "Are you still here, {reg59?woman:man}? You have a mission! Complete it, and your revenge on Sven will be that much closer. Now, get out!", "lord_pretalk", [
      (str_clear, s3),
      (str_clear, s11),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_village_150"),
      (str_store_string, s2, "@{s11} wants the problem of land property solved at a nearby monastery. Talk to the abbot of Willibrord Monastery, near {s3}."),
      
      (call_script, "script_start_quest", "qst_kennemer_mission_1", "$g_talk_troop"),
      (str_store_string, s2, "@Note: The jarl has asked you to solve this issue in his best interests, by which he meant not to upset the monks."),
      (add_quest_note_from_sreg, "qst_kennemer_mission_1", 0, s2, 0),
      
      (quest_set_slot,"qst_kennemer_mission_1",slot_quest_current_state, 0),
      #(change_screen_notes, 4),
  ]],
  #mission 1 monasterio acaba below
  [anyone, "kennemerjarl_juicio_1", [],
    "Yes, I know. The monastery sent a messenger with the news. They are happy with your decision and promise to speak well of me to the people. Take this reward, and thank you!", "kennemerjarl_juicio_3", [
      (call_script, "script_end_quest", "qst_kennemer_mission_1"),
      (add_xp_as_reward,100),
      (call_script, "script_troop_add_gold", "trp_player", 400),
      (call_script, "script_change_troop_renown", "trp_player", 2),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone, "kennemerjarl_juicio_2", [],
    "Yes, I know. The monastery sent a messenger with the news. They are very unhappy and blame me for sending you. They say that everyone will know that I am unjust! Damn you!", "kennemerjarl_juicio_4", [
      (call_script, "script_end_quest", "qst_kennemer_mission_1"),
      (add_xp_as_reward,500),
      (call_script, "script_change_troop_renown", "trp_player", 2),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -3),
  ]],
  
  [anyone|plyr,"kennemerjarl_juicio_3", [
    ],
    "What about our deal? May I join the hunt now?", "kennemerjarl_juicio_5",[
  ]],
  
  [anyone|plyr,"kennemerjarl_juicio_4", [
    ],
    "No one can think that you are unfair when justice has been done.", "kennemerjarl_juicio_41",[
  ]],
  
  [anyone, "kennemerjarl_juicio_41", [],
    "Oho! A {reg59?lady:gentleman} with values. Justice is all very nice, but this world isn't right and won't recognize it. That land wasn't important, but good relations with monastery are. Do not upset me again.", "kennemerjarl_juicio_42", [
  ]],
  
  [anyone|plyr,"kennemerjarl_juicio_42", [
    ],
    "What about our deal? May I join the hunt now?", "kennemerjarl_juicio_5",[
  ]],
  
  [anyone, "kennemerjarl_juicio_5", [],
    "Err, not just yet. Now I need you to do something else to prove your worth, this time as a warrior. There is a rebellious Frisian, called Thiaderd, who has been causing me a headache, and I do not have the time right now to take care of him.^^" +
    "I'll give you permission to recruit on my land. Also, I will send a letter to the king so he may likewise allow you to recruit men in Friese.", "kennemerjarl_juicio_6_old", [
      (try_for_range, ":center_no", centers_begin, centers_end),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (eq, ":center_faction", "fac_kingdom_4"),
        (party_set_slot,":center_no",recruit_permission_need, 0), #ahora le deja
      (try_end),
      
      ##          (try_for_range, ":cur_village", villages_begin, villages_end),
      ##                (store_faction_of_party, ":center_faction", ":cur_village"),
      ##                (eq, ":center_faction", "fac_kingdom_4"),
      ##                 (party_set_slot,":cur_village",recruit_permission_need, 0), #el resto no puede reclutar. Player can recruit - no necesary elder conversation, although he will have to pay soborn
      ##         (try_end),
  ]],
  
  
  [anyone,"kennemerjarl_juicio_6_old", [
    ],
    "This is what I want you to do. Take this silver and recruit fifteen men. The cheapest are village idlers or refugees at the monastery. Sometimes spare men are available at farmsteads. Once you have men, come back here, and I will tell you how to find Thiaderd.", "kennemerjarl_juicio_6_final",[
      (call_script, "script_change_player_party_morale", 90),
      (call_script, "script_change_troop_renown", "trp_player", 18),
      (call_script, "script_troop_add_gold", "trp_player", 1400), #dinero inicial, 1000 o 1500
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_string, s2, "@{s9} sent you to recruit fifteen men in Friese villages and towns. As soon as you have raised this force, return to talk to him."),
      (call_script, "script_start_quest", "qst_recruit_an_army", "$g_talk_troop"),
  ]],
  [anyone, "kennemerjarl_juicio_6_final", [
    ],
    "--He scratches his nose--^^Well, good luck. Now, you have things to do.", "lord_pretalk", [
  ]],
  
  ###sigue to reginhard part
  [anyone, "kennemerjarl_recruit_back1", [],
    "Well, you again have proven useful. As I mentioned before, there is a rebellious Frisian called Thiaderd who has been a headache for me. I do not have the time right now to take care of him. You'll do it for me!^^" +
    "Oh, and here is some money to equip yourself better. I can't allow people to think that I employ such shabby help.", "kennemerjarl_juicio_6_new", [
      (call_script, "script_change_troop_renown", "trp_player", 9),
      (add_xp_as_reward,500),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
      (call_script, "script_end_quest", "qst_recruit_an_army"),
  ]],
  
  [anyone|plyr,"kennemerjarl_juicio_6_new", [
    ],
    "I like the sound of this.", "kennemerjarl_juicio_61",[
  ]],
  
  [anyone|plyr,"kennemerjarl_juicio_6_new", [
    ],
    "I do not like what you offer.", "kennemerjarl_juicio_61",[
  ]],
  
  [anyone, "kennemerjarl_juicio_61", [],
    "To tell you the truth, I don't care if you like it or not. You offered your services, and I offered you a job.^" +
    "Do this for me, and your revenge upon Sven will be closer. Take this money and travel to Dorestad. There is a man there who knows all about this. His name is Reginhard, and I hear that he cowers in the mead hall between the prostitutes and the other drunks.^" +
    "He would not talk to my men, but maybe you can find out where the rebel is hiding and kill him. Thiaderd must die.", "kennemerjarl_juicio_7", [
      (call_script, "script_troop_add_gold", "trp_player", 850),
  ]],
  
  [anyone|plyr,"kennemerjarl_juicio_7", [
    ],
    "It shall be done. Farewell.", "kennemerjarl_juicio_71",[
  ]],
  
  [anyone|plyr,"kennemerjarl_juicio_7", [
    ],
    "I do not like this mission, but I keep my part of the deal. Farewell.", "kennemerjarl_juicio_71",[
  ]],
  
  
  [anyone, "kennemerjarl_juicio_71", [
      (str_clear, s11),
      (str_clear, s2),
      (str_clear, s3),
    ],
    "Are you still here? You have a mission! I would see you on it, {reg59?madame:sir}!", "kennemerjarl_juicio_71_fin", [
      (str_clear, s3),
      (str_clear, s11),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_town_11"),
      (call_script, "script_change_player_party_morale", 90),
      (str_store_string, s2, "@{s11} wants Thiaderd dead. You need to talk to Reginhard at {s3}'s mead hall. He knows where Thiaderd is hiding."),
      
      (call_script, "script_start_quest", "qst_kennemer_mission_2", "$g_talk_troop"),
      (quest_set_slot,"qst_kennemer_mission_2",slot_quest_current_state, 0)
  ]],
  
  [anyone, "kennemerjarl_juicio_71_fin", [
    ],
    "--He scratches his nose--", "lord_pretalk", [
  ]],
  ###thiaderd mission chief
  [anyone, "kennemerjarl_thiaderdm1", [],
    "I am very happy. The news of Thiaderd's death came before you.^^" +
    "I must say that I doubted your abilities, but certainly you're smarter than I thought. Moreover, you have proven to be someone trustworthy and loyal. Take this money as compensation for your efforts. " +
    "It is a pity that you didn't kill Reginhard, too, but I guess you need a pet in your party. However, I do not want him around me, so keep that rat away when you come to see me.", "kennemerjarl_thiaderdm2", [
      (call_script, "script_end_quest", "qst_kennemer_mission_2"),
      (add_xp_as_reward,300),
      (call_script, "script_troop_add_gold", "trp_player", 1200),
      (call_script, "script_change_troop_renown", "trp_player", 4),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  
  [anyone, "kennemerjarl_thiaderdm2", [(str_clear, s2),],
    "{s2}^^Well, well... I must confess something. I've been waiting for someone like you for a long time. " +
    "You are a person that can find solutions and accomplish what is ordered. That is very important. Sometimes I feel like I'm surrounded by dolts.^^" +
    "Now, there is a delicate subject I want to talk to you about -- one that can make you rich.", "kennemerjarl_thiaderdm3", [
      (str_store_string, s2, "@--His eyes show joy, and he pats your back with confidence.--", color_good_news),
  ]],
  
  
  [anyone|plyr,"kennemerjarl_thiaderdm3", [
    ],
    "Wealth, I do not care about. I just want Sven.", "kennemerjarl_thiaderdm41",[
  ]],
  
  [anyone|plyr,"kennemerjarl_thiaderdm3", [
    ],
    "I like what I hear! Please continue...", "kennemerjarl_thiaderdm42",[
  ]],
  
  [anyone, "kennemerjarl_thiaderdm41", [],
    "That much I know! But the two are related. Listen to the whole story and see for yourself.", "kennemerjarl_thiaderdm42", [
  ]],
  
  [anyone,"kennemerjarl_thiaderdm42", [
    ],
    "To be honest, I have the men to hunt Sven, who's near Doccinga. I'm hoping that you'll join us in his capture...^" +
    "However, we have a problem: the king. The king, my uncle, does not want to attack Sven Bull Neck. He fears his master, Jarl Sigurd, called 'Snake in the Eye,' one of the oldest sons of Ragnar, called Lodbrok in Norse -- Hairy Breeches.", "kennemerjarl_thiaderdm5",[
      (assign, "$option_switches", 0),
  ]],
  
  [anyone|plyr,"kennemerjarl_thiaderdm5", [
      (store_and, reg0, "$option_switches", option_1),
      (eq, reg0, 0),
    ],
    "These names say nothing to me. Who are Sigurd and his father, Ragnar? Should I fear them?", "kennemerjarl_thiaderdm52",[
  ]],
  
  [anyone|plyr,"kennemerjarl_thiaderdm5", [
    ],
    "You have kept all this information hidden until now?", "kennemerjarl_thiaderdm51",[
  ]],
  
  [anyone|plyr,"kennemerjarl_thiaderdm5", [
    ],
    "I am listening. Please continue.", "kennemerjarl_thiaderdm6",[
  ]],
  
  [anyone, "kennemerjarl_thiaderdm51", [],
    "You must understand, it is not so easy. It is a sensitive issue, and you were a stranger that the sea had just brought to us. Now it's different. I think you're someone I can trust.", "kennemerjarl_thiaderdm6", [
  ]],
  
  [anyone, "kennemerjarl_thiaderdm52", [],
    "Ragnar Sigurdsson was a man who became a legend, a king who ruled part of Danmark and whose ships caused fear wherever they were spotted. Ragnar died years ago, but he had many sons, many of whom are invading Englaland right now.^" +
    "Sigurd 'Snake in the Eye' Ragnarsson is one of his oldest sons, by the princess Aslaug. He is old now, but still a man to be feared and a respected Danish jarl.^" +
    "Yes, you should fear him if you do not have the support of a powerful king or jarl. I can be that man if you help me.", "kennemerjarl_thiaderdm5", [
      (val_or, "$option_switches", option_1),
  ]],
  
  [anyone,"kennemerjarl_thiaderdm6", [
      # (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
      (faction_get_slot, ":leader_no", "fac_kingdom_4", slot_faction_leader),
      (str_store_troop_name, s10, ":leader_no"),
      #(str_store_faction_name, s11, ":faction_no"),
    ],
    "Here is the deal: kill my uncle {s10}, and I will take the kingdom for myself. Then I'll have the necessary resources and men to hunt Sven Bull Neck and attack his master, Sigurd 'Snake in the Eye.' " +
    "Additionally, I will give you the title of 'jarl' in this land, plus the men and money to be powerful.", "kennemerjarl_thiaderdm7",[
      (str_clear, s9),
      (str_clear, s11),
      (str_store_troop_name_link, s9, "trp_knight_1_5"),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_string, s2, "@{s11} told me that Sven Bull Neck is Sigurd 'Snake in the Eye' Ragnarsson's vassal. I should talk to {s9} if I ever travel to Danmark."),
      
      (call_script, "script_start_quest", "qst_revenge_sigurd", "$g_talk_troop"),
      (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 0),
  ]],
  
  
  [anyone|plyr,"kennemerjarl_thiaderdm7", [
    ],
    "You want to become king, using me? No, I don't trust you! I am not your assassin!", "kennemerjarl_thiaderdm71",[
  ]],
  
  [anyone|plyr,"kennemerjarl_thiaderdm7", [
    ],
    "We had a deal. Thiaderd is dead. Your part is to give me what I need to hunt Sven.", "kennemerjarl_thiaderdm71",[
  ]],
  
  [anyone|plyr,"kennemerjarl_thiaderdm7", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@Your king has not wronged me, but you do. It seems you can't help me hunt Sven. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@Every time I finish a mission, you invent a new one! Meanwhile Sven lives. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Jarl? You promise much, but your king would give the same for this information. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@'Jarl?' I like that, but if I do all the dirty work, 'king' would be better! (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "kennemerjarl_thiaderdm74",[
      (str_clear, s10),
  ]],
  
  [anyone|plyr,"kennemerjarl_thiaderdm7", [
    ],
    "I accept your proposal. I will kill your king.", "kennemerjarl_thiaderdm9",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2), #cambido chief
  ]],
  
  [anyone, "kennemerjarl_thiaderdm71", [],
    "No more deals, lies or missions! Just this one condition, and everything will be yours. What is your answer?", "kennemerjarl_thiaderdm8", [
  ]],
  
  
  [anyone,"kennemerjarl_thiaderdm74", [
      (str_clear, s2),
    ],
    "{!}{s2}", "kennemerjarl_thiaderdm8",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s2, "@I can only help you if you help me. It's so easy, but if I am not king, I won't have an army or resources to hunt Sven. You decide."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1), #cambido chief
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s2, "@The difference is that now you have earned my trust, and I ask for only one more thing: kill the king and Sven will be yours."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1), #cambido chief
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s2, "@The king will not believe you, for you are a stranger to him. If you ever say something, I will tell him you're a liar, and he will order you killed."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -3),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s2, "@I admire your ambition, but here there can only be one king, and the Danish in Friese will only accept someone like me, who is known and trusted."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1), #cambido chief
      (try_end),
  ]],
  
  [anyone|plyr, "kennemerjarl_thiaderdm8", [
      (faction_get_slot, ":leader_no", "fac_kingdom_4", slot_faction_leader),
      (str_store_troop_name, s10, ":leader_no"),
    ],
    "I accept. I will kill {s10}.", "kennemerjarl_thiaderdm9", [
  ]],
  
  [anyone|plyr, "kennemerjarl_thiaderdm8", [
    ],
    "No, you will have to find another assassin. I will hunt Sven Bull Neck on my own.", "kennemerjarl_thiaderdm91", [
  ]],
  
  [anyone, "kennemerjarl_thiaderdm9", [
      (faction_get_slot, ":leader_no", "fac_kingdom_4", slot_faction_leader),
      (str_store_troop_name, s10, ":leader_no"),
    ],
    "I was sure I would hear that answer, for I have not misled you. {s10} is not just any man. Everyone fears him, not the least because he is always accompanied by an escort of faithful warriors. " +
    "His death should be public, in the sight of those who fear him. The ideal time would be during a feast. I do not care if you use poison or a dagger, but two things are very important...", "kennemerjarl_thiaderdm9a", [
  ]],
  
  [anyone, "kennemerjarl_thiaderdm9a", [
      (str_clear, s2),
    ],
    "Firstly, if you are caught, do not mention my name. You must appear to be acting alone. Even beforehand, we should not be seen together. If we happen to meet, we must pretend not to know each other.^^Secondly and more importantly, do not get caught!^^" +
    "Once you are done, do not come here. Hide in the mountains, where Thiaderd's camp was, and I will send for you when things are calm and I am the king. " +
    "Now go and make me king.", "kennemerjarl_salida", [
      (str_clear, s3),
      (str_clear, s9),
      (str_clear, s11),
      (str_store_troop_name_link, s9, "trp_kingdom_4_lord"),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_town_11"),
      (str_store_string, s2, "@{s11} wants me to kill his king, {s9}, his own uncle, in order to ascend to the throne of {s3} and give me men and resources to hunt Sven."),
      
      (call_script, "script_start_quest", "qst_kennemer_mission_3", "$g_talk_troop"),
      (quest_set_slot,"qst_kennemer_mission_3",slot_quest_current_state, 1),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 4),
      (call_script, "script_change_player_party_morale", 90),
  ]],
  
  [anyone, "kennemerjarl_thiaderdm91", [
      (faction_get_slot, ":leader_no", "fac_kingdom_4", slot_faction_leader),
      (str_store_troop_name, s10, ":leader_no"),
    ],
    "You're dumber than I thought. It's quite beyond you, with your resources, to find Sven. Even if you do, he will kill you easily. If you decide to change your mind, remember this: " +
    "{s10} must die in public, in the sight of those who fear him, ideally at a feast. I do not care if you use poison or a dagger, but two things are very important...", "kennemerjarl_thiaderdm91a", [
  ]],
  
  [anyone, "kennemerjarl_thiaderdm91a", [
      (str_clear, s2),
    ],
    "Firstly, if you are caught, do not mention my name. You must appear to be acting alone. Even beforehand, we should not be seen together. If we happen to meet, we must pretend not to know each other.^^Secondly and more importantly, do not get caught!^^" +
    "Once you are done, do not come here. Hide in the mountains, where Thiaderd's camp was, and I will send for you when things are calm and I am the king. " +
    "If you are smart, you'll do it and leave Friese quickly. Otherwise, you will have to face the consequences.", "kennemerjarl_salida", [
      (str_clear, s3),
      (str_clear, s9),
      (str_clear, s11),
      (str_store_troop_name_link, s9, "trp_kingdom_4_lord"),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_town_11"),
      (str_store_string, s2, "@{s11} wants me to kill his king, {s9}, his own uncle, in order to have free access to the throne of {s3} and give me men and resources to hunt Sven."),
      
      (call_script, "script_start_quest", "qst_kennemer_mission_3", "$g_talk_troop"),
      (quest_set_slot,"qst_kennemer_mission_3",slot_quest_current_state, 1),
      (call_script, "script_change_player_party_morale", 90),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -2),
  ]],
  
  [anyone|plyr,"kennemerjarl_salida", [],
    "Very well.", "lord_pretalk",[]],
  
  ###doccinga assault mosqueo
  [anyone|plyr, "kennemerjarl_enemistad1", [
    ],
    "Beware, Jarl! Those were Sven's men. You are the traitor, and I am your enemy now.", "kennemerjarl_enemistad2", [
      (str_clear, s2),
      (str_clear, s9),
      (str_clear, s11),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_troop_name_link, s9, "trp_knight_4_3"),
      (str_store_string, s2, "@Note 3: You have chosen to become an enemy of {s9} for his betrayal and alliance with {s11}, Sven Bull Neck's patron. You know he will send assassins after your head."),
      (add_quest_note_from_sreg, "qst_notes_frisa", 6, s2, 0),
  ]],
  
  [anyone|plyr,"kennemerjarl_enemistad1", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@I did not know your plans. Doccinga asked me for help, and so I went. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@Calm down and tell me what the problem is. We are civilized people. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@There is only one traitor, and that's you. Damned dog! It will cost you dearly. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@These Vikings were few and weak. You were a fool to think they would help you. (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "kennemerjarl_enemistad3",[
      (str_clear, s10),
      (str_clear, s2),
      (str_clear, s9),
      (str_clear, s11),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_troop_name_link, s9, "trp_knight_4_3"),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s2, "@Note 3: You chose not to become an open enemy of {s9} for his betrayal and alliance with {s11}, Sven Bull Neck's patron."),
        (add_quest_note_from_sreg, "qst_notes_frisa", 6, s2, 0),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s2, "@Note 3: You chose not to become an open enemy of {s9} for his betrayal and alliance with {s11}, Sven Bull Neck's patron."),
        (add_quest_note_from_sreg, "qst_notes_frisa", 6, s2, 0),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s2, "@Note 3: You chose to become an enemy of {s9} for his betrayal and alliance with {s11}, Sven Bull Neck's patron. You know he will send assassins for your head."),
        (add_quest_note_from_sreg, "qst_notes_frisa", 6, s2, 0),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s2, "@Note 3: You chose to become an enemy of {s9} for his betrayal and alliance with {s11}, Sven Bull Neck's patron. You know he will send assassins for your head."),
        (add_quest_note_from_sreg, "qst_notes_frisa", 6, s2, 0),
      (try_end),
  ]],
  
  [anyone|plyr,"kennemerjarl_enemistad1", [
    ],
    "I have served you well. In return, you lied to me about Sven, and now you threaten me.", "kennemerjarl_enemistad4",[
      (str_clear, s2),
      (str_clear, s9),
      (str_clear, s11),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_troop_name_link, s9, "trp_knight_4_3"),
      (str_store_string, s2, "@Note 3: You chose not to openly become the enemy of {s9} for his betrayal and alliance with {s11}, Sven Bull Neck's patron."),
      (add_quest_note_from_sreg, "qst_notes_frisa", 6, s2, 0),
  ]],
  
  [anyone, "kennemerjarl_enemistad2", [       (str_clear, s2),
    ],
    "Yes, I'm sure of that. To honor services provided, I will give you a few hours to pack your things and leave. Then you will have assassins after you, for I will put a price on your head. You'll have to sleep with one eye open and a knife under your pillow.^" +
    "If you do not leave Friese or we meet in person, I will kill you with my bare hands.", "kennemerjarl_enemistad21", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -60),
      (str_store_string, s2, "@Leave Friese: Your relationship with the jarl has ended badly. You are now enemies. He will send assassins after you, and he will not have compassion if he finds you in his way."),
      (add_quest_note_from_sreg, "qst_kennemer_jarl_missions", 5, s2, 1),
      (quest_set_slot,"qst_kennemer_jarl_missions",slot_quest_current_state, 1), #Jarl enemigo
  ]],
  
  [anyone, "kennemerjarl_enemistad4", [       (str_clear, s2),
    ],
    "Yes. These men were going to take and fortify the village, then wait for more troops from Danmark. Now that's impossible. You've ended my dreams. " +
    "Sigurd 'Snake in the Eye' will think I'm a traitor and will want my head because of you. Go away! You're no longer welcome here. If we meet again, I do not know if I will be able to control myself and not kill you.^^" +
    "I recommend you leave Friese.", "kennemerjarl_enemistad21", [
      (str_store_string, s2, "@Leave Friese. Your relationship with the jarl has ended badly. He accused you of ruining his plans to take the throne. It is best not to cross paths with him again for a long time -- or until you are able to regain his friendship."),
      (add_quest_note_from_sreg, "qst_kennemer_jarl_missions", 5, s2, 1),
      (quest_set_slot,"qst_kennemer_jarl_missions",slot_quest_current_state, 2), #Jarl descontento pero no enemigo malvado.
  ]],
  
  [anyone,"kennemerjarl_enemistad3", [
      (str_clear, s4),
      (str_clear, s2),
    ],
    "{!}{s4}", "kennemerjarl_enemistad21",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s4, "@You were wrong. These men were going to take and fortify the village, then wait for more troops from Danmark. Now that's impossible. You've ended my dreams. " +
          "Sigurd 'Snake in the Eye' will think I'm a traitor and will want my head because of you. Go away! You're no longer welcome here. If we meet again, I do not know if I will be able to control myself and not kill you.^^" +
        "I recommend you leave Friese."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
        (str_store_string, s2, "@Leave Friese. Your relationship with the jarl has ended badly. He accused you of ruining his plans to take the throne. It is best not to cross paths with him again for a long time -- or until you are able to regain his friendship."),
        (add_quest_note_from_sreg, "qst_kennemer_jarl_missions", 5, s2, 1),
        (quest_set_slot,"qst_kennemer_jarl_missions",slot_quest_current_state, 2), #Jarl descontento pero no enemigo malvado.
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s4, "@There's nothing to talk about. These men were going to take and fortify the village, then wait for more troops from Danmark. Now that's impossible. You've ended my dreams. " +
          "Sigurd 'Snake in the Eye' will think I'm a traitor and will want my head because of you. Go away! You're no longer welcome here. If we meet again, I do not know if I will be able to control myself and not kill you.^^" +
        "I recommend you leave Friese."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
        (str_store_string, s2, "@Leave Friese. Your relationship with the jarl has ended badly. He accuses you of ruining his plans to take the throne. It is best not to cross paths with him again for a long time -- or until you are able to regain his friendship."),
        (add_quest_note_from_sreg, "qst_kennemer_jarl_missions", 5, s2, 1),
        (quest_set_slot,"qst_kennemer_jarl_missions",slot_quest_current_state, 2), #Jarl descontento pero no enemigo malvado.
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s4, "@You are bold, rat, to talk to me like that after what you've done. To honor services provided, I will give you a few days head start. Then you will have assassins after you, for I will put a price on your head. You'll have to sleep with one eye open and a knife under your pillow.^" +
        "If you do not leave Friese or we meet in person, I will kill you with my bare hands."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -70),
        (str_store_string, s2, "@Leave Friese. Your relationship with the jarl has ended badly. You are now enemies. He will send assassins after you, and he will not have compassion if he finds you in his way."),
        (add_quest_note_from_sreg, "qst_kennemer_jarl_missions", 5, s2, 1),
        (quest_set_slot,"qst_kennemer_jarl_missions",slot_quest_current_state, 1), #Jarl enemigo
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s4, "@No, you are a fool. These men were going to take and fortify the village, then wait for more troops from Danmark. Now that's impossible. You've ended my dreams. " +
          "Sigurd 'Snake in the Eye' will think I'm a traitor and he will want my head because of you. To honor services provided, I will give you a few days head start. Then you will have assassins after you, for I will put a price on your head. You'll have to sleep with one eye open and a knife under your pillow.^" +
        "If you do not leave Friese or we meet in person, I will kill you with my bare hands."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
        (str_store_string, s2, "@Leave Friese. Your relationship with the jarl has ended badly. You are now enemies. He will send assassins after you, and he will not have compassion if he finds you in his way."),
        (add_quest_note_from_sreg, "qst_kennemer_jarl_missions", 5, s2, 1),
        (quest_set_slot,"qst_kennemer_jarl_missions",slot_quest_current_state, 1), #Jarl enemigo
      (try_end),
  ]],
  
  [anyone|plyr,"kennemerjarl_enemistad21",
    [
      ], "Someday, we will meet again, and I'll kill you.", "kennemerjarl_enemistad22",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
      (call_script, "script_end_quest", "qst_kennemer_mission_3"),
      (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 1),
  ]],
  
  [anyone|plyr,"kennemerjarl_enemistad21",
    [
      ], "I must leave now.", "kennemerjarl_enemistad22_f",[
      (call_script, "script_end_quest", "qst_kennemer_mission_3"),
      (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 1),
  ]],
  
  [anyone,"kennemerjarl_enemistad22", [],
    "I'm looking forward to that day, scum!", "lord_pretalk",[]],
  [anyone,"kennemerjarl_enemistad22_f", [],
    "Very well.", "lord_pretalk",[]],
  ###kennemor lord chief mainquest acaba
  ###frisa king mainquest
  [anyone, "frisaking_1", [],
    "Glad to hear it! I see that my reputation as host is thriving...", "frisaking_2", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
  ]],
  
  [anyone|plyr,"frisaking_2", [
    ],
    "I would like to join one of these special feasts and see it for myself.", "frisaking_3",[
  ]],
  
  [anyone|plyr,"frisaking_2", [
    ],
    "I'm not really here to talk about your feasts. The jarl of Kennemer wants you dead.", "frisaking_4",[
  ]],
  
  [anyone, "frisaking_3", [],
    "You don`t look like somebody of sufficient quality for that.", "frisaking_41", [
  ]],
  
  [anyone|plyr,"frisaking_41", [
    ],
    "Then what could I do in order to participate in them? They are so famous!", "frisaking_5",[
  ]],
  
  [anyone, "frisaking_5", [
      (store_and, reg0, "$option_switches", option_1),
      (eq, reg0, 0),  #not told about invasion of Doccinga
    ],
    "Well, you look like a resolute {reg59?woman:man}. Maybe you can help me with problems in Doccinga. Go and investigate what is happening for me. " +
    "When you come back, we'll talk about feasts.", "lord_pretalk", [
      (str_store_party_name_link, s3, "p_village_150"),
      (str_store_string, s2, "@Investigate events in {s3}."),
      (add_quest_note_from_sreg, "qst_kennemer_mission_3", 5, s2, 0),
      (quest_set_slot,"qst_kennemer_mission_3",slot_quest_current_state, 31),
  ]],
  
  [anyone, "frisaking_5", [
      (store_and, reg0, "$option_switches", option_1),
      (neq, reg0, 0),  #told about invasion of Doccinga
    ],
    "Well, you look like a resolute {reg59?woman:man}. Maybe you can help me with Doccinga. Go and help defend the village. " +
    "When you come back, we'll talk about feasts.", "lord_pretalk", [
      (str_store_party_name_link, s3, "p_village_150"),
      (str_store_string, s2, "@Help defend {s3}."),
      (add_quest_note_from_sreg, "qst_kennemer_mission_3", 5, s2, 0),
      (quest_set_slot,"qst_kennemer_mission_3",slot_quest_current_state, 31),
  ]],
  
  [anyone, "frisaking_4", [],
    "You accuse one of my dearest jarls of treason? I see. Someone is trying to create problems with my jarls and sends me a stranger with rumors. Perhaps they think that I'm an idiot and that I will give credibility to these hoaxes? " +
    "Listen carefully, rat. Your word is not worth anything. Only evidence is important. Now, get the hell out, and give thanks that I do not separate your head from your neck.", "lord_pretalk", [
      
      (str_store_party_name_link, s3, "p_village_150"),
      (str_store_string, s2, "@The king does not believe you. You need evidence of treason. Maybe Thonkrik from {s3} can help you."),
      (add_quest_note_from_sreg, "qst_kennemer_mission_3", 5, s2, 0),
      
      (quest_set_slot,"qst_kennemer_mission_3",slot_quest_current_state, 31),
      
  ]],
  ###
  ####denuncia al jarl of kennemer chief
  [anyone, "jarldenunciado1", [],
    "Heill, {playername}! I heard about your help to Doccinga. Thank you for your support, vinr. The attack was unexpected, and I did not have my men ready. Please, accept these gifts for your courage.", "jarldenunciado12", [
  ]],
  
  [anyone|plyr,"jarldenunciado12", [
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (str_store_troop_name,s11,":town_lord"),
    ],
    "Thank you, my Lord, and I hate to disturb you, but {s11} is a traitor.", "jarldenunciado11",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
      (call_script, "script_troop_add_gold", "trp_player", 800),
      (str_clear, s11),
  ]],
  
  [anyone|plyr,"jarldenunciado12", [
    ],
    "Your gifts are welcome. Now I must go.", "jarldenunciado4",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
      (call_script, "script_troop_add_gold", "trp_player", 800),
  ]],
  
  [anyone|plyr,"jarldenunciado12", [
    ],
    "I'm not your vassal; I am your equal. I do not want those gifts. Farewell.", "jarldenunciado4",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (call_script, "script_change_troop_renown", "trp_player", 6),
  ]],
  
  [anyone, "jarldenunciado11", [
      (str_clear, s11),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (str_store_troop_name,s11,":town_lord"),
    ],
    "You remember that {s11} is my nephew? We talked about it before.", "jarldenunciado13", [
  ]],
  
  [anyone|plyr,"jarldenunciado13", [
    ],
    "I know, so I am sorry to say that your nephew has conspired with Sven Bull Neck against you.", "jarldenunciado14",[
  ]],
  
  [anyone|plyr,"jarldenunciado13", [
    ],
    "I understand, but prefer not to continue. I have no way to prove it. Farewell.", "jarldenunciado4",[
  ]],
  
  [anyone, "jarldenunciado14", [
    ],
    "Sven Bull Neck is the dog of Jarl Sigurd 'Snake in the Eye,' one of the oldest sons of Ragnar Lodbrok. You're talking about very feared and dangerous people, {playername}. " +
    "My nephew is reckless and daring, and our kingdom is at a difficult moment with Frisian revolts. He thinks I'm weak for not exterminating the Frisians and attacking the Franks who support them. In fact, we aren't as strong now as in the past. " +
    "However, I don't think he is a traitor. Do you have evidence?", "jarldenunciado15", [
  ]],
  
  [anyone|plyr,"jarldenunciado15", [
    ],
    "No, but he asked me to kill you.", "jarldenunciado16",[
  ]],
  
  [anyone, "jarldenunciado16", [
    ],
    "It's your word against his. Nothing leads me to believe you. Go in peace now, and do not return to my court with snares.", "lord_pretalk", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (quest_set_slot,"qst_kennemer_mission_3",slot_quest_current_state, 5), #
  ]],
  
  [anyone,"jarldenunciado4", [
    ],
    "Well...", "lord_pretalk",[
      (quest_set_slot,"qst_kennemer_mission_3",slot_quest_current_state, 5), #
  ]],
  ###
  
  [anyone, "jarldenunciado1extra", [],
    "I know what you're going to tell me. My nephew warned me about your tricks to discredit him, {playername}. You are not welcome in my house, and I don't want to hear your lies.", "lord_pretalk", [
  ]],
  
  [anyone, "jarldenunciado2extra", [],
    "I know what you're going to tell me. My nephew warned me about your tricks to discredit him, {playername}. You are hated in my house, and I don't want to hear your lies. " +
    "My nephew promised me to give you a few days to leave Friese. Then you will be declared an enemy of Friese.", "lord_pretalk", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  ###
  ###king horik of danmark chief
  [anyone,"kinghorik_quest_revenge1", [ #king horik
    ],
    "You have my interest. I am listening to you.", "kinghorik_quest_revenge2",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_revenge2", [
    ],
    "I need to talk about Sigurd.", "kinghorik_quest_revenge21",[
  ]],
  [anyone|plyr,"kinghorik_quest_revenge2", [
    ],
    "Forgive me. I do not want to distract you from your tasks. We'll talk another day.", "kinghorik_quest_revenge22",[
  ]],
  [anyone,"kinghorik_quest_revenge22", [ #king horik
    ],
    "I do not like others to waste my time.", "lord_pretalk",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone,"kinghorik_quest_revenge21", [ #king horik
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (ge, ":player_renown", 270),
    ],
    "This is a delicate subject about which I do not like to talk, but I've heard about you. Your renown precedes you, " +
    "so I will listen. Follow me to a nearby grove with your nearest companions, and we will talk...", "kinghorik_quest_revengegrove",[
  ]],
  
  [anyone,"kinghorik_quest_revenge21", [ #king horik
      (gt, "$player_honor", 60),
    ],
    "This is a delicate subject about which I do not like to talk, but I've heard about you. Your reputation precedes you, " +
    "so I will listen. Follow me to a nearby grove with your nearest companions, and we will talk...", "kinghorik_quest_revengegrove",[
  ]],
  
  [anyone,"kinghorik_quest_revenge21", [ #king horik
      (eq,"$talk_context",tc_party_encounter),
      (call_script, "script_troop_get_player_relation",  "$g_talk_troop"),
      (assign, ":relation_to_king", reg0),
      #   (troop_get_slot, ":relation_to_king", "$g_talk_troop", slot_troop_player_relation),
      (gt, ":relation_to_king", 20),
    ],
    "This is a delicate subject about which I do not like to talk, but I've heard about you. Your renown precedes you, " +
    "so I will listen. Follow me to a nearby grove with your nearest companions, and we will talk...", "kinghorik_quest_revengegrove",[
  ]],
  
  [anyone,"kinghorik_quest_revenge21", [
      (call_script, "script_troop_get_player_relation",  "$g_talk_troop"),
      (assign, ":relation_to_king", reg0),
      (gt, ":relation_to_king", 20),
    ],
    "Lower your voice, this is not the place. Wait till I leave this site with my army and ask me on the road.", "lord_pretalk",[
  ]],
  
  [anyone,"kinghorik_quest_revenge21", [ #king horik no quiere saber nada
    ],
    "Sigurd Ragnarsson is one of my jarls, and we have nothing to talk about. You understand?", "kinghorik_quest_revenge21_1",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 7),
      (str_clear, s11),
      (str_store_troop_name_link, s11, "trp_knight_1_5"),
      (str_store_string, s2, "@It seems you will not have the help of the king. You'll have to talk to {s11} 'Snake in the Eye' directly."),
      (add_quest_note_from_sreg, "qst_revenge_sigurd", 8, s2, 0),
  ]],
  
  [anyone,"kinghorik_quest_revenge21_1", [ #king horik no quiere saber nada
    ],
    "Are we finished, or do you need something else?", "lord_pretalk",[
      (str_clear, s9),
      (str_clear, s10),
      (str_store_troop_name_link, s9, "trp_knight_1_5"),
      (str_store_troop_name_link, s10, "$g_talk_troop"),
      (str_store_string, s2, "@{s10} won't support you with {s9}."),
      (call_script, "script_start_quest", "qst_danmork_protection", "$g_talk_troop"),
      (quest_set_slot,"qst_danmork_protection",slot_quest_current_state, 2),
      # (finish_mission),
      # (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  
  [anyone|plyr,"kinghorik_quest_revengegrove", [
    ],
    "Thank you, King Horik.", "close_window",[
      # (quest_set_slot,"qst_revenge_sigurd",slot_quest_current_state, 7),
      (jump_to_menu,"mnu_arboleda_conrey"),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone|plyr,"kinghorik_quest_revengegrove", [
    ],
    "Thanks, King Horik.", "close_window",[
      (jump_to_menu,"mnu_arboleda_conrey"),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  ####
  [anyone,"kinghorik_quest_thing1", [(eq,"$talk_context",tc_party_encounter),
    ],
    "Lower your voice. Come. Follow me. Let us talk in private.", "close_window",[
      (jump_to_menu,"mnu_arboleda_conrey2"),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"kinghorik_quest_thing1", [
    ],
    "Lower your voice, this is not the place. Wait till I leave this site with my army and ask me on the road.", "lord_pretalk",[
  ]],
  ########Bodo letter
  
  [anyone,"kinghorik_quest_atlieiriksson1", [
    ],
    "That is good news. Where was he?", "kinghorik_quest_atlieiriksson2",[
  ]],
  [anyone|plyr,"kinghorik_quest_atlieiriksson2", [
    ],
    "We found Atli Eiriksson and his men in a cave in Northvegr, near Hordaland. Sigurd 'Snake in the Eye' sent him there to hide and protect Bodo's letter. Now Atli Eiriksson and his men are dead, but they burned the letter during the fighting. You no longer have to fear that Sigurd 'Snake in the Eye' can use it against you at the Assembly.", "kinghorik_quest_atlieiriksson3",[
  ]],
  [anyone,"kinghorik_quest_atlieiriksson3", [
    ],
    "Atli is dead? He was Sigurd Ragnarsson's second man, after Sven Bull Neck. Wherever you go, you leave just corpses. I wanted Sigurd quiet, with no weapons to use against me, nor motives for revenge. " +
    "I hope you killed everybody in that cave, or he may present as a witness against you for killing Atli. I will not be able to protect you from banishment in that case.", "kinghorik_quest_atlieiriksson4",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_atlieiriksson4", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@I did not want to kill Atli, but I had no alternative. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@I am aware of the seriousness of this danger. You do not need to remind me. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@I did this for you. Without me, the letter would be Sigurd's, to take the throne. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Come on, sire, I left no witnesses. The Assembly will not blame me for anything. (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "kinghorik_quest_atlieiriksson51",[
      (str_clear, s10),
  ]],
  
  [anyone|plyr,"kinghorik_quest_atlieiriksson4", [
    ],
    "Well, what's done is done. We must keep looking forward.", "kinghorik_quest_atlieiriksson52",[
  ]],
  
  [anyone|plyr,"kinghorik_quest_atlieiriksson4", [
    ],
    "As I fall, so will you. So be sure to protect me.", "kinghorik_quest_atlieiriksson53",[
  ]],
  
  [anyone,"kinghorik_quest_atlieiriksson51", [
      (str_clear, s4),
    ],
    "{!}{s4}", "kinghorik_quest_atlieiriksson6",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s4, "@I see. Well, it is your neck."),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s4, "@Well, if Ulf doesn't testify against you and some jarls support you, you might have a chance."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s4, "@Mark my words, {reg59?woman:man}. If Sigurd gets this throne, your life won't be worth anything. Do not tell me what you do for me when you are in fact protecting only your interests."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -3),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s4, "@Remember that I am the king when you address me."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -2),
      (try_end),
  ]],
  [anyone,"kinghorik_quest_atlieiriksson52", [
    ],
    "I see. Well, it is your neck.", "kinghorik_quest_atlieiriksson6",[
  ]],
  [anyone,"kinghorik_quest_atlieiriksson53", [
    ],
    "It is not advisable to push away the hand that protects you. I am the only person preventing you from getting killed. If you ever threaten me, I'll be the one killing you, with my bare hands.", "kinghorik_quest_atlieiriksson6",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  [anyone,"kinghorik_quest_atlieiriksson6", [
    ],
    "Well, the important thing is that the letter has been destroyed. Finish what you have to do before the Assembly.", "lord_pretalk",[
      (quest_set_slot,"qst_bodo_letter",slot_quest_current_state, 5),
      (call_script, "script_end_quest", "qst_bodo_letter"),
      (add_xp_as_reward,1000),
      (call_script, "script_change_troop_renown", "trp_player", 15),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_1", 6),
      
  ]],
  ##ulf testigo
  [anyone,"kinghorik_ulf_testigo1", [
      (str_clear, s2),
      (str_clear, s4),
      (str_clear, s9),
      (str_clear, s10),
      (try_for_range, ":troop_no", active_npcs_begin, active_npcs_end), #jarls relation check for quest chief
        (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
        (store_troop_faction, ":troop_faction_no", ":troop_no"),
        (eq, ":troop_faction_no", "fac_kingdom_1"),
        (call_script, "script_troop_get_relation_with_troop", "trp_player", ":troop_no"),
        (ge, reg0, 15),
        (str_store_troop_name_link, s9, ":troop_no"),
        (str_store_string, s4, "@{s9} has good relations with you."),
        (str_store_string, s2, "@{!}{s2}^{s4}"),
        (add_quest_note_from_sreg, "qst_ulf_testigo", 5, s2, 0),
      (try_end),
    ],
    "Glad to hear that. Did you improve your relations with the jarls of my kingdom?^^" +
    "--Current good relations:^{s2}--", "kinghorik_ulf_testigo2",[
  ]],
  [anyone|plyr,"kinghorik_ulf_testigo2", [
    ],
    "I did what I could.", "kinghorik_ulf_testigo31",[
  ]],
  [anyone|plyr,"kinghorik_ulf_testigo2", [
    ],
    "No. I need more time. I want to go and improve my relations with the jarls.", "kinghorik_ulf_testigo32",[
  ]],
  [anyone,"kinghorik_ulf_testigo32", [
    ],
    "Well, do what you must and return when ready. But do not take too long, as the Assembly will start shortly.", "lord_pretalk",[
  ]],
  [anyone,"kinghorik_ulf_testigo31", [
    ],
    "Well, frankly I'm surprised at how effective you've been. When you're ready for the Assembly, let me know.", "lord_pretalk",[
      (quest_set_slot,"qst_ulf_testigo",slot_quest_current_state, 5),
      (call_script, "script_end_quest", "qst_ulf_testigo"),
      (add_xp_as_reward,400),
      (call_script, "script_change_troop_renown", "trp_player", 5),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_1", 5),
  ]],
  
  #  The Assembly chief
  [anyone,"kinghorik_thething1", [
    ],
    "I see. In that case, now everything is in the hands of the gods. The Assembly lasts several days. I recommend you take advantage of these days to gain popularity and reputation with the people of this country.", "kinghorik_thething2",[
      (quest_set_slot,"qst_bodo_letter",slot_quest_current_state, 6),
      (quest_set_slot,"qst_ulf_testigo",slot_quest_current_state, 6),
  ]],
  [anyone,"kinghorik_thething2", [
    ],
    "I'll send a messenger as soon as your presence is required. Be ready.", "lord_pretalk",[
      (str_store_troop_name_link, s10, "$g_talk_troop"),
      (str_store_string, s2, "@It seems that everything is ready for your trial. {s10} will send a messenger to warn you as soon as your presence is required by the Assembly."),
      (call_script, "script_start_quest", "qst_the_thing", "$g_talk_troop"),
      (quest_set_slot,"qst_the_thing",slot_quest_current_state, 1), #empieza quest grande que cambiara rumbo historia chief
      # (assign, "$g_leave_encounter",1),
  ]],
  ###Jarl Bjorn Ragnarsson dialogos
  ###truce
  [anyone,"jarlbjornnegtruce_1", [
    ],
    "That is good news! We will negotiate a withdrawal with them now, but in the future, we will return and make West Seaxe pay dearly for their weakness. " +
    "You've done a great service to me and my brothers. Allow me to reward you with friendship and silver.", "jarlbjornnegtruce_2",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
      (add_xp_as_reward,1200),
      (call_script, "script_troop_add_gold", "trp_player", 6000),
      (call_script, "script_change_troop_renown", "trp_player", 15),
      (call_script, "script_change_player_party_morale", 5),
      
      (quest_get_slot, ":quest_target_party", "qst_the_messengersn", slot_quest_target_party),
      (try_begin),
        (eq, ":quest_target_party", "pt_wessex_patrol"),
        (party_is_active, ":quest_target_party"),
        (remove_party, ":quest_target_party"),
      (try_end),
      
      (call_script, "script_end_quest", "qst_the_messengersn"),
  ]],
  [anyone,"jarlbjornnegtruce_2", [
    ],
    "For my part, I do not need anything else. You should return to Rathbarth.", "jarlbjornnegtruce_3",[
      (party_set_extra_icon, "p_castle_9", 0, 0, 0, 0, 0), #quita icono asedio
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_8", 50),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_5", 20),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_7", 20),
      
      (str_clear, s9),
      (str_clear, s11),
      (str_store_troop_name_link, s11, "trp_knight_8_2"),
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_string, s2, "@{s9} wants you back with {s11}."),
      (add_quest_note_from_sreg, "qst_sven_traitor", 8, s2, 0),
      (quest_set_slot,"qst_sven_traitor",slot_quest_current_state, 4),
      ##(change_screen_notes, 4),
  ]],
  [anyone|trp_player,"jarlbjornnegtruce_3", [
    ],
    "Very well.", "lord_pretalk",[
  ]],
  #messenger
  [anyone,"jarlbjornneg_1", [
    ],
    "I can imagine that Halfdan imposed his opinion. I had hoped to be mindful of his reasons and I'm glad I did so.^^" +
    "Now it is necessary to contact the Saxons. I have prepared a letter for them where we offer a truce to cover our retreat to Northhymbre and to summon them to a meeting outside Snotingaham's gate to discuss the details.^^" +
    "My informants tell me that one of the Saxon chieftains, Aelfred, patrols around Snotingaham every day. Meet with him and give him my letter.", "jarlbjornneg_2",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
  ]],
  
  [anyone|plyr,"jarlbjornneg_2", [
    ],
    "Who is Aelfred?", "jarlbjornneg_31",[
  ]],
  [anyone|plyr,"jarlbjornneg_2", [
    ],
    "Why not take the letter to the Mercians? We are in their kingdom.", "jarlbjornneg_32",[
  ]],
  [anyone|plyr,"jarlbjornneg_2", [
    ],
    "The king of West Seaxe is Aethelred. Why not give the letter to him?", "jarlbjornneg_33",[
  ]],
  
  [anyone,"jarlbjornneg_31", [
    ],
    "Aelfred, or I should say Aetheling Aelfred Aethelwulfing, is the brother of West Seaxe's king. I have heard that he is a just man and easier to deal with than his brother. " +
    "Moreover, his opinion carries great weight among the Saxon jarls.", "jarlbjornneg_4",[
  ]],
  [anyone,"jarlbjornneg_32", [
    ],
    "Do not kid yourself. The Saxons are the real power here. The Angles of Mierce are very weak. Without the support of West Seaxe, Mierce would be under our feet by now. " +
    "It will be the Saxons who make the decision to accept the ceasefire or not, and in this case, Aelfred is our man. He is more reasonable than his brother.", "jarlbjornneg_4",[
  ]],
  [anyone,"jarlbjornneg_33", [
    ],
    "Aethelred is a warrior, and we need a diplomat. Anyway, in such matters he seeks advice from his brother, Aelfred.", "jarlbjornneg_4",[
  ]],
  
  [anyone|plyr,"jarlbjornneg_4", [
    ],
    "Well, I'll be back soon.", "jarlbjornneg_51",[
  ]],
  [anyone|plyr,"jarlbjornneg_4", [
    ],
    "Humph. I expected a reward for my services.", "jarlbjornneg_52",[
  ]],
  
  [anyone,"jarlbjornneg_51", [
    ],
    "Remember this: when you get to Snotingaham, introduce yourself as a peace emissary from the sons of Ragnar and ask for audience with Aelfred. " +
    "Tell him we're willing to an honorable way out of this siege without bloodshed, and we are willing to meet at the gates of Snotingaham to address this issue.^^" +
    "Be firm! Tell him only that we are willing to negotiate, or we will bring more men from the north, and they will pay dearly in lives of Saxons and Mercians. Good luck.", "lord_pretalk",[
      (add_xp_as_reward,800),
      (str_clear, s9),
      (str_clear, s11),
      (str_store_party_name_link, s3, "p_castle_9"),
      (str_store_troop_name_link, s9, "trp_knight_8_7"),
      (str_store_troop_name_link, s11, "trp_knight_5_1"),
      (str_store_string, s2, "@{s9} wants you to meet {s11} of West Seaxe in {s3} and give him a letter calling for a truce."),
      (add_quest_note_from_sreg, "qst_the_messengersn", 5, s2, 0),
      (assign,"$saxon_ambush",1),
      (quest_set_slot,"qst_the_messengersn",slot_quest_current_state, 6),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_5", -10),
      #(change_screen_notes, 4),
  ]],
  [anyone,"jarlbjornneg_52", [
    ],
    "Yes, I quite forgot I was talking to a merchant. I usually reward my faithful with silver as a symbol of our bond, but I understand that you are not that kind of person. " +
    "Well, here's your prize, and there will be more if you complete your task. Now...", "jarlbjornneg_51",[
      (call_script, "script_troop_add_gold", "trp_player", 5000),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -20),
  ]],
  
  #quest general
  [anyone,"jarlbjorn_1", [
    ],
    "My brother, Sigurd, promised us a thousand men. Where are they?", "jarlbjorn_2",[
  ]],
  
  [anyone|plyr,"jarlbjorn_2", [
    ],
    "They are dead or lost. Sigurd Ragnarsson, under orders of the Assembly, sent a fleet led by Sven Bull Neck and Harald Haraldsson, but Sven pitted his followers against the followers of Harald, and there was a massacre. " +
    "I fear that Harald's followers are all dead but me, and Sven's are severely depleted.", "jarlbjorn_3",[
  ]],
  
  [anyone,"jarlbjorn_3", [
      (str_clear, s2),
    ],
    "{s2}^^Sven was always difficult to handle, so I never understood Sigurd's predilection for him. Now this puts us in a difficult situation here in Snotingaham. If I ever meet Sven again, I will kill him with my bare hands. " +
    "We are at a disadvantage compared to the men of West Seaxe and Mierce. So far, we have managed to keep them at bay thanks to our reputation, but every day they become more daring and eventually will storm Snotingaham. Then all will be lost. " +
    "We have to restore their fear in order to make a deal that will let our people escape Snotingaham. Without reinforcements, retreat is the only option.", "jarlbjorn_4",[
      (str_store_string, s2, "@--You perceive that your news has disturbed him deeply.--", color_good_news),
  ]],
  
  [anyone|plyr,"jarlbjorn_4", [
    ],
    "I thought Englaland would be an easy target for a Viking army.", "jarlbjorn_5_1",[
  ]],
  [anyone|plyr,"jarlbjorn_4", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@I guess you've weighed all the options before making your decision. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@So all is not lost! (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Retreat is dishonorable. Were I running this army, I would lead it to victory. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Come, come. Retreat? Are you a coward? (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "jarlbjorn_5_2",[
      (str_clear, s10),
  ]],
  
  [anyone,"jarlbjorn_5_1", [
    ],
    "West Seaxe and Mierce are two powerful kingdoms, which makes nothing easy. We need many more men before facing them, especially now that both kings have united against us. Luckily, these alliances are fleeting. If we retreat now and focus our interest on weaker kingdoms, there will be another opportunity to go against Mierce or even West Seaxe. For now, there's always Pictland, poor, stony prospect though it be!", "jarlbjorn_5_3",[
  ]],
  [anyone|plyr,"jarlbjorn_5_3", [
      (str_clear, s10),
    ],
    "{!}{s10}", "jarlbjorn_5_2",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@I guess you've weighed all the options before making your decision. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@So all is not lost! (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Retreat is dishonorable. Were I running this army, I would lead it to victory. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Come, come. Retreat? Are you a coward? (Sanguine)"),
      (try_end),
  ]],
  
  [anyone,"jarlbjorn_5_2", [
      (str_clear, s4),
    ],
    "{!}{s4}", "jarlbjorn_6",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s4, "@We must be realistic. Otherwise, we may lose everything we've got."),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s4, "@You need not be so dramatic. Nothing has been lost, dammit! I'm just posing the most logical strategy."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -15),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s4, "@Well, I happen to like people with guts. Listen carefully, because I think this will interest you."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s4, "@No, I'd rather be a clever man than a dead one. And watch your words! Remember that you're talking to one of the sons of Ragnar. If all of Northhymbre could not answer for insulting our family, what chance do you think you would have?"),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (try_end),
  ]],
  [anyone,"jarlbjorn_6", [
    ],
    "This land is rich, and its people fear us. That fear is what now keeps them from attacking us, but they are losing it. We must regain the initiative.^^" +
    "West Seaxe, especially, has become very bold, and Saxon foragers even get close to our lines. There is a group there now, around Snotingaham. I want you to go and punish them. " +
    "This will send a clear message to our enemies and undermine their confidence.", "jarlbjorn_7",[
  ]],
  [anyone|plyr,"jarlbjorn_7", [
    ],
    "I see. Very well, I'll take care of them.", "jarlbjorn_9",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  [anyone|plyr,"jarlbjorn_7", [
    ],
    "Why should I do this?", "jarlbjorn_8",[
  ]],
  [anyone,"jarlbjorn_8", [
    ],
    "Because you have come to reinforce this army. I am the chief here, and I give you an order.", "jarlbjorn_9",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  [anyone,"jarlbjorn_9", [
    ],
    "When you're done with these men, come back here.", "jarlbjorn_9_pre",[
      (quest_set_slot,"qst_sven_traitor",slot_quest_current_state, 3), #next stage
      (set_spawn_radius,5),
      #(spawn_around_party,"p_castle_9","pt_wessex_foragers"),
      (spawn_around_party,"p_bjorn_camp","pt_wessex_foragers"), #bjorn camp
      
      (quest_set_slot, "qst_wessex_foragers", slot_quest_target_party, reg0),
      (store_num_parties_destroyed,"$qst_troublesome_bandits_eliminated","pt_wessex_foragers"),
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_castle_9"),
      (str_store_string, s2, "@{s9} wants you hunt and destroy the West Seaxe foraging party near {s3}."),
      (call_script, "script_start_quest", "qst_wessex_foragers", "$g_talk_troop"),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_1", 10),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_8", 10),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_5", -10),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_7", -10),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"jarlbjorn_9_pre", [
    ],
    "I always reward warriors who do their job well.", "lord_pretalk",[
  ]],
  
  #quest foragers
  
  [anyone,"jarlbjornwf_1", [
    ],
    "I have heard about your deeds. You have given those foragers the punishment they deserved. " +
    "You are really as good as I had guessed. " +
    "Here is your reward: 900 peningas.", "jarlbjornwf_2",[
      (call_script, "script_troop_add_gold", "trp_player", 900),
      (assign, ":xp_reward", 150),
      (val_mul, ":xp_reward", 2),
      (add_xp_as_reward, ":xp_reward"),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_8", 5),
      (call_script, "script_change_troop_renown", "trp_player", 6),
      (call_script, "script_end_quest", "qst_wessex_foragers"),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  
  [anyone,"jarlbjornwf_2", [
    ],
    "I think you're someone who knows how to do things. It's time to take another step. I want you to pass through the enemy lines and take a message to my brothers. " +
    "Tell them about the betrayal of Sven and that we will not have reinforcements from Danmark. Tell them I'm going to arrange a meeting with the Saxons to negotiate our retreat from Snotingaham.", "jarlbjornwf_3",[
  ]],
  
  [anyone|plyr,"jarlbjornwf_3", [
    ],
    "I go now.", "jarlbjornwf_4",[
  ]],
  [anyone|plyr,"jarlbjornwf_3", [
    ],
    "Why would your brothers believe me and accept surrender?", "jarlbjornwf_4_1",[
  ]],
  [anyone,"jarlbjornwf_4_1", [
    ],
    "Because I'll give you an object that they will recognize and give validity to you as my envoy to them. I am Bjorn, of the sons of Ragnar, and my brothers listen to what I say. " +
    "Do not worry. They will listen to and respect you.", "jarlbjornwf_4",[
  ]],
  [anyone,"jarlbjornwf_4", [
    ],
    "Wait. I'm going to give you a seax that belonged to our father, Ragnar. This is also my gift to you for the service you're providing to us. My brothers will recognize the weapon and listen to your words. " +
    "The Mercians are more careless in their vigilance. Try to approach at night around their flank. Good luck.", "close_window",[
      (troop_add_item, "trp_player","itm_ragnar_seax",0),
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_castle_9"),
      (str_store_string, s2, "@{s9} wants you deliver a message to his brothers in {s3}, advising them that no reinforcements from Danmark are coming and that Bjorn will request a meeting with the Saxons for a truce and retreat from Mierce."),
      (call_script, "script_start_quest", "qst_the_messengersn", "$g_talk_troop"),
      (quest_set_slot, "qst_the_messengersn", slot_quest_current_state, 1), #active menu in siege
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  #ocultar lords, mision infiltracion
  ###Jarl Rathbarth Ragnarsson dialogos
  [anyone,"raethbarth_1", [
    ],
    "Judging by your face, I'm afraid the news is not good, but please speak.", "raethbarth_2",[
  ]],
  [anyone|plyr,"raethbarth_2", [
    ],
    "I have bad news about the Vikings sent from Danmark in support of the Ragnarssons' invasion of Mercia. " +
    "The fleet initially consisted of 30 boats and about 800 men, but Sven Bull Neck pitted his followers against the followers of Harald Haraldsson, and there was a massacre. " +
    "I fear that Sven will lie to you, but you will see that he will bring considerably less men, many of them wounded from the fight.", "raethbarth_3",[
  ]],
  
  [anyone,"raethbarth_3", [
      (str_clear, s2),
    ],
    "{s2}^^Sven Bull Neck is the man that stands in the prow of my brother Sigurd's langskip. Your accusations are serious. However, we have not heard anything about the fleet or Sven so far. These men sent from Danmark are crucial to win the battle against the Saxons in Snotingaham. " +
    "Without them, we are in a difficult situation.", "raethbarth_4",[
      (str_store_string, s2, "@--You perceive your news has disturbed him deeply. He snorts like a bull before answering.--", color_good_news),
  ]],
  
  [anyone,"raethbarth_4", [
    ],
    "For now, I cannot do anything else. I need you and your men to come to Bjorn near Snotingaham. Any reinforcement is better than none. " +
    "Bjorn is my brother and has led men to support my other brothers besieged in Mierce: Halfdan, Ivarr and Hubbi. You will find him camped north of the town. All the support you can lend will be welcome. " +
    "Meanwhile, I promise you that I will investigate this matter of the fleet and Sven's treason. If he is guilty, he will pay with his life.", "raethbarth_5",[
  ]],
  
  [anyone|plyr,"raethbarth_5", [
    ],
    "No, you mustn't kill him. Sven is mine.", "raethbarth_6_1",[
      (str_clear, s9),
      (str_clear, s11),
      (str_store_troop_name_link, s11, "trp_knight_8_7"),
      (str_store_troop_name, s9, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_castle_9"),
      (str_store_string, s2, "str_s9_wants_you_to_meet_with_s11"),
      (add_quest_note_from_sreg, "qst_sven_traitor", 7, s2, 0),
      (quest_set_slot,"qst_sven_traitor",slot_quest_current_state, 2),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (enable_party, "p_bjorn_camp"),
  ]],
  [anyone|plyr,"raethbarth_5", [
    ],
    "I see. Kill him.", "raethbarth_6_2",[
      (str_clear, s9),
      (str_clear, s11),
      (str_store_troop_name_link, s11, "trp_knight_8_7"),
      (str_store_troop_name, s9, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_castle_9"),
      (str_store_string, s2, "str_s9_wants_you_to_meet_with_s11"),
      (add_quest_note_from_sreg, "qst_sven_traitor", 7, s2, 0),
      (quest_set_slot,"qst_sven_traitor",slot_quest_current_state, 2),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
      (enable_party, "p_bjorn_camp"),
  ]],
  [anyone|plyr,"raethbarth_5", [
    ],
    "There is a woman with Sven Bull Neck. I do not want anything to happen to her.", "raethbarth_6_3",[
      (str_clear, s9),
      (str_clear, s11),
      (str_store_troop_name_link, s11, "trp_knight_8_7"),
      (str_store_troop_name, s9, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_castle_9"),
      (str_store_string, s2, "str_s9_wants_you_to_meet_with_s11"),
      (add_quest_note_from_sreg, "qst_sven_traitor", 7, s2, 0),
      (quest_set_slot,"qst_sven_traitor",slot_quest_current_state, 2),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (enable_party, "p_bjorn_camp"),
  ]],
  
  [anyone,"raethbarth_6_1", [
    ],
    "So, I see this is personal for you. If Sven is guilty, I will give him to you so you can deal with him.", "lord_pretalk",[
  ]],
  [anyone,"raethbarth_6_2", [
    ],
    "That's exactly what will happen if he is guilty. I do not tolerate traitors.", "lord_pretalk",[
  ]],
  [anyone,"raethbarth_6_3", [
    ],
    "So be it. If Sven is guilty, I'll take care of him and keep the woman safe until you return.", "lord_pretalk",[
  ]],
  
  ###Jarl Rathbarth Ragnarsson entrega carta de bodo
  
  [anyone|plyr,"raethbarthbodoletter_1", [
    ],
    "This is the letter that your brother Sigurd tried so earnestly to get. I will give it to you, transcribed and decoded, so you can understand the seriousness of the danger you're facing.", "raethbarthbodoletter_2",[
  ]],
  
  [anyone,"raethbarthbodoletter_2", [
      (str_clear, s2),
    ],
    "{s2}^^You are a great friend of the Danish, and especially the sons of Ragnar. I must say that I knew of the existence of the alliance that unites West Seaxe, Asturias and Frankia, but I hadn't known that they had come so far. " +
    "Asturias is going to send ships and men, and not any men but veterans of the wars with the Moors.", "raethbarthbodoletter_3",[
      (str_store_string, s2, "@--He looks into your eyes with deep concern and then calls a servant to read the letter aloud to the end. Then Rathbarth looks at you and smiles.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 50),
      (call_script, "script_change_player_relation_with_troop", "trp_kingdom_8_lord", 30),
      (call_script, "script_change_player_relation_with_troop", "trp_knight_8_7", 30),
      (call_script, "script_change_player_relation_with_troop", "trp_knight_8_13", 10),
      (call_script, "script_change_player_relation_with_troop", "trp_knight_8_14", 10),
  ]],
  
  [anyone,"raethbarthbodoletter_3", [
      (str_clear, s3),
    ],
    "{s3}^^Frankia may have also mobilized men and ships. If West Seaxe receives these men, it will change the balance of power across the north. Sorry, I'm thinking out loud. " +
    "Take this reward for serving me so well.", "raethbarthbodoletter_4",[
      (str_store_string, s3, "@--He bites his lower lip a few seconds, thinking.--", color_good_news),
      (call_script, "script_troop_add_gold", "trp_player", 12000),
      (call_script, "script_change_troop_renown", "trp_player", 10),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_1", 10), #danmark
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_8", 30), #northumbria
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_5", -10), #wessex
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_7", -10), #mierce
      
      (str_store_string, s2, "@Info:"),
      (call_script, "script_start_quest", "qst_notes_englaland", "trp_player"),
      
      (str_clear, s9),
      (str_store_troop_name_link, s9, "trp_knight_8_2"),
      (str_store_string, s2, "@Note 1: You gave the letter to Ragnar's sons. {s9} thanked you, and now you're helping him."),
      (add_quest_note_from_sreg, "qst_notes_englaland", 4, s2, 0),
      (add_quest_note_from_sreg, "qst_the_alliance", 5, s2, 0),
  ]],
  
  [anyone|plyr,"raethbarthbodoletter_4", [
    ],
    "Thank you. Could I do anything else to help?", "raethbarthbodoletter_51",[
  ]],
  [anyone|plyr,"raethbarthbodoletter_4", [
    ],
    "I could go to Friese and learn about the Franks' movements.", "raethbarthbodoletter_52",[
  ]],
  [anyone|plyr,"raethbarthbodoletter_4", [
    ],
    "I could destroy the warriors from Asturias.", "raethbarthbodoletter_53",[
  ]],
  [anyone|plyr,"raethbarthbodoletter_4", [
    ],
    "I have to take care of Sven. Is there any news of him?", "raethbarthbodoletter_54",[
  ]],
  
  [anyone,"raethbarthbodoletter_51", [
      (str_clear, s2),
    ],
    "{s2}^^You are helping us a lot already. I really do not know how to thank you. You know that I sent men to discover the whereabouts of Sven Bull Neck. He will pay for what he did... " +
    "Now I ask you something else...", "raethbarthbodoletter_6",[
      (str_store_string, s2, "@--He rests a hand on your shoulder.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  
  [anyone,"raethbarthbodoletter_52", [
    ],
    "I'm not sure we can get information in Friese. It might be best to go Frankia directly... but this is something we cannot decide right now, you and me.", "raethbarthbodoletter_6",[
  ]],
  
  [anyone,"raethbarthbodoletter_53", [
      (str_clear, s2),
    ],
    "{s2}^^My brother Bjorn could tell you some stories about the warriors of Asturias, and even in Al-Andalus, where he lost most of his ships. " +
    "We are talking about 600 men versed in war. You should give up this matter.", "raethbarthbodoletter_6",[
      (str_store_string, s2, "@--He laughs loudly.--", color_good_news),
  ]],
  
  [anyone,"raethbarthbodoletter_54", [
    ],
    "I have sent men to look for Sven Bull Neck in every corner of Englaland. " +
    "I can tell you that he survived his battle with Harald Haraldsson, but has not been seen since. Some say he's traveling south with his men.", "raethbarthbodoletter_6",[
  ]],
  
  ##      [anyone,"raethbarthbodoletter_6", [(eq, "$players_kingdom", "$g_talk_troop_faction"),
  ##       ],
  ##   "I will send messengers to my brothers to join them soon. We will discuss this letter and make a decision. I have to ask you something. I need you go north, to the territory of the Kingdom of Alban. \
  ##The Picts never cease to cause us problems, and I need someone to punish them.", "raethbarthbodoletter_7",[
  ##     (add_xp_as_reward,600),
  ##     (call_script, "script_end_quest", "qst_the_alliance"), #quest end.
  ##                                 ]],
  
  [anyone,"raethbarthbodoletter_6", [
    ],
    "I will send a messenger to my brother, Jarl Halfdan Ragnarsson, for a meeting. We will discuss this letter and make a decision soon. Meanwhile, go yourself to talk to the him and offer him your allegiance. You are a person of great ability. You must enter the service of Northhymbre for us to reward you fully as you deserve.", "raethbarthbodoletter_91",[
      
      (assign, "$g_invite_faction_lord", "trp_kingdom_8_lord"),
      (str_store_troop_name,s1,"$g_invite_faction_lord"),
      (setup_quest_text,"qst_join_faction"),
      
      (str_store_troop_name_link, s3, "$g_invite_faction_lord"),
      (str_store_faction_name_link, s4, "fac_kingdom_8"),
      (quest_set_slot, "qst_join_faction", slot_quest_giver_troop, "$g_invite_faction_lord"),
      #(quest_set_slot, "qst_join_faction", slot_quest_expiration_days, 30),
      (quest_set_slot, "qst_join_faction", slot_quest_failure_consequence, 0),
      
      (str_clear, s9),
      (str_store_troop_name_link, s9, "trp_knight_8_2"),
      (str_store_string, s2, "@{s9} wants you find and speak with {s3} of the {s4} to give him your oath of homage. Then, he wants you to return for an assignment."),
      (add_quest_note_from_sreg, "qst_the_alliance", 6, s2, 0),
      (call_script, "script_start_quest", "qst_join_faction", "$g_invite_faction_lord"),
      (call_script, "script_report_quest_troop_positions", "qst_join_faction", "$g_invite_faction_lord", 3),
      (quest_set_slot, "qst_the_alliance", slot_quest_current_state, 12),
  ]],
  
  [anyone,"raethbarthbodoletter_91", [
    ],
    "Halfdan is a clever man who will appreciate your worth.^^After that, return to me, for I already have a task for you..", "lord_pretalk",[
      #  (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  ########
  [anyone,"raethbarthbodoletter_1_1", [
    ],
    "Ah, {playername}. I am honored that you have joined us. Now, as I mentioned, I already have something to ask of you.^^ I need you go north, to the territory of the Kingdom of Alban. " +
    "The Picts never cease to cause us problems, and we need someone to punish them.", "raethbarthbodoletter_7",[
      (add_xp_as_reward,600),
      (call_script, "script_end_quest", "qst_the_alliance"), #quest end.
  ]],
  
  [anyone|plyr,"raethbarthbodoletter_7", [
    ],
    "What is it you need done?", "raethbarthbodoletter_81",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone|plyr,"raethbarthbodoletter_7", [
    ],
    "I'm sorry. My priority is Sven Bull Neck.", "raethbarthbodoletter_82",[
  ]],
  
  [anyone,"raethbarthbodoletter_81", [
    ],
    "I want to secure our rear. We cannot take any action against the south, Asturians or Franks if the Picts can raise an army and attack Jorvik.^" +
    "Recruit an army and conquer Dun Taruo. Keep it in your power for at least twenty days, so that Alban will think that we plan to attack the heart of their kingdom. " +
    "If you want to keep it, it's yours, but we need twenty days to secure a deal with Alban.", "raethbarthbodoletter_9",[
      
      (str_store_party_name_link, s3, "p_castle_37"),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_string, s2, "@As he rejoins his brothers to decide what to do about the letter of Bodo, {s11} has asked you to go to the Kingdom of Alban, conquer {s3} and keep it twenty days to weaken the Picts and secure the rear of the Danish in Northhymbre."),
      (call_script, "script_start_quest", "qst_welsh_and_pictish", "$g_talk_troop"),
      (quest_set_slot,"qst_welsh_and_pictish",slot_quest_current_state, 1),
      (quest_set_slot, "qst_welsh_and_pictish", slot_quest_target_amount, 20),
  ]],
  [anyone,"raethbarthbodoletter_82", [
    ],
    "I promised you Sven Bull Neck, so he will be yours, but I need time to find him. I will have more resources and time if you can help me in this matter.", "raethbarthbodoletter_81",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone,"raethbarthbodoletter_9", [
    ],
    "Good luck. When you've accomplished your mission, I'm sure I can give you an answer on Sven Bull Neck and about what I decide with my brothers.", "close_window",[
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  ###despues nothingaham
  [anyone,"raethbarthbjorn_1", [
    ],
    "Glad to hear that everything went well. Come back in a few days and talk.", "close_window",[
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  ###
  ####rathbarth despues de ataque a los pictos
  [anyone,"raethbarth_wp_1", [
    ],
    "I am pleased to hear that. The Picts are warlike people, and I was not sure you made it.", "raethbarth_wp_2",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
      (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 10),
      (call_script, "script_end_quest", "qst_welsh_and_pictish"),
  ]],
  
  [anyone,"raethbarth_wp_2", [
    ],
    "I have good news for you, too. Sven Bull Neck was seen in East Engle. I guess he has been there because it's a kingdom that gave us supplies, horses and support when we first got to Englaland -- " +
    "mostly out of fear on the part of their weak king. East Engle is a land that belongs to us by his weakness.^^" +
    "The bad part is that by now Sven Bull Neck has left East Engle for West Seaxe. He is trying to run away from you. As he must know I have your back, he has sought out the strongest enemy we have.", "raethbarth_wp_3",[
  ]],
  
  [anyone|plyr,"raethbarth_wp_3", [
    ],
    "Still, I do not understand why he betrayed Sigurd.", "raethbarth_wp_41",[
  ]],
  
  [anyone|plyr,"raethbarth_wp_3", [
    ],
    "I must go to West Seaxe immediately.", "raethbarth_wp_5",[
  ]],
  
  [anyone,"raethbarth_wp_41", [
      (str_clear, s2),
    ],
    "{s2}^^I think I can answer that. A messenger from my brother Sigurd came to us shortly after your arrival -- unfortunately too late. " +
    "Sigurd told us that we had to be careful with Sven Bull Neck. Apparently, someone killed his brother, Olvir White Hair, very dear to Sven, and the Assembly will not punish the guilty party. Sven thought that Sigurd had broken his word to him by not defending his right to revenge. " +
    "So just before leaving with the fleet, Sven Bull Neck renounced his oath to Sigurd and promised to take revenge on his own.", "raethbarth_wp_42",[
      (str_store_string, s2, "@--He takes a deep breath.--", color_good_news),
  ]],
  
  [anyone|plyr,"raethbarth_wp_42", [
    ],
    "I am the one who killed Olvir, but I did it in self-defense.", "raethbarth_wp_43",[
      (call_script, "script_change_player_honor", 5),
  ]],
  [anyone|plyr,"raethbarth_wp_42", [
    ],
    "I am the one who killed Olvir. He was a dog that deserved what he got.", "raethbarth_wp_43",[
      (call_script, "script_change_player_honor", -5),
  ]],
  [anyone|plyr,"raethbarth_wp_42", [
    ],
    "(Say nothing)", "raethbarth_wp_5",[
  ]],
  
  [anyone,"raethbarth_wp_43", [
    ],
    "The messenger did not mention your name in his story, but I imagine there are many troubles between you and Sven. That can only end in blood.", "raethbarth_wp_5",[
  ]],
  [anyone,"raethbarth_wp_5", [
    ],
    "Sven Bull Neck is now an outlaw and an enemy of the Danish -- especially the sons of Ragnar. However, West Seaxe is a strong and large kingdom. Sven Bull Neck could just hide there, and you would never find him. " +
    "However, he has two things that West Seaxe needs -- ships and good sailors -- so I think I know where they will send him.", "raethbarth_wp_6",[
  ]],
  
  [anyone|plyr,"raethbarth_wp_6", [
      (store_attribute_level,":intelligence","trp_player",ca_intelligence),
      (ge, ":intelligence", 16),
    ],
    "To meet the ships from the Kingdom of Asturias and to lead them to West Seaxe. Right?", "raethbarth_wp_71",[
      (add_xp_as_reward,200),
  ]],
  
  [anyone|plyr,"raethbarth_wp_6", [
    ],
    "Tell me what you know.", "raethbarth_wp_72",[
  ]],
  
  [anyone|plyr,"raethbarth_wp_6", [
    ],
    "Where he goes, I will go to seek him.", "raethbarth_wp_73",[
  ]],
  
  [anyone,"raethbarth_wp_71", [
      (str_clear, s2),
    ],
    "{s2}^^I like the people who serve me to be smart. You're absolutely right.", "raethbarth_wp_72",[
      (str_store_string, s2, "@--He smiles, pleased.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone,"raethbarth_wp_73", [
    ],
    "This obsession is your bane...", "raethbarth_wp_72",[
  ]],
  
  [anyone,"raethbarth_wp_72", [
    ],
    "During the time you were busy in the Kingdom of Alban, I met with my brothers, and we sent fast ships south for more information. Almost certainly, the Asturian fleet has left port. " +
    "The letter you gave us mentioned that they are meeting with people sent from West Seaxe in Frankia, in a village called Douar-an-Enez. " +
    "There is a man called Bodo, once your companion, who is now with the Saxons, " +
    "so we must assume that the Saxons have the same information as we do. My feeling is that West Seaxe will send Sven Bull Neck and Bodo to Douar-an-Enez soon, if they have not already done so.", "raethbarth_wp_8",[
  ]],
  
  
  [anyone|plyr,"raethbarth_wp_8", [
    ],
    "Bodo will not work with Sven. He hates him as much as I do.", "raethbarth_wp_91",[
  ]],
  
  [anyone|plyr,"raethbarth_wp_8", [
    ],
    "Then I must go to Douar-an-Enez.", "raethbarth_wp_9",[
  ]],
  
  [anyone,"raethbarth_wp_91", [
    ],
    "Maybe. I do not know so well as you this Bodo, but now he is not with you but with our enemies, and I know that you are finished with him. We cannot take the risk.", "raethbarth_wp_9",[
  ]],
  
  [anyone,"raethbarth_wp_9", [
    ],
    "These men from Asturias are very important, and we could use them on our side against West Seaxe. There is a traitor among them, a man named Silo, who was a prisoner of my brother Bjorn when he was in those lands. Bjorn freed him after earning his loyalty. " +
    "That man has been passing us information in exchange for silver, much silver. Use Silo to gain favor with the Asturians, to pit them against West Seaxe and join us. But if you fail to convince them, kill them all.", "raethbarth_wp_10",[
      (str_store_party_name_link, s3, "p_town_27"),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_string, s2, "@The time to meet with the troops from the Kingdom of Asturias has arrived. Bodo's letter indicates that they will dock at {s3}, and {s11} wants you go there and meet with them. " +
        "There is a traitor. Use him to gain favor with the Asturian troops and bring them to the side of the sons of Ragnar. But if you fail to convince them, {s11} wants them destroyed.^^" +
      "But before you leave Englaland, you must go to {s3} and talk to the old captain at the port, as {s11} has gathered men and ships to help you in Douar-an-Enez."),
      (call_script, "script_start_quest", "qst_douar_an_enez", "$g_talk_troop"),
      (quest_set_slot,"qst_douar_an_enez",slot_quest_current_state, 1),
  ]],
  
  [anyone,"raethbarth_wp_10", [
    ],
    "Finish everything you have pending, as you will be out several weeks. We have gathered men and have prepared ships for them. They await you in {s3}. Ask the old captain at the port. He is the man who deals with hiring sailors. " +
    "Above all, remember that it is very important that this Asturian army never helps West Seaxe.", "close_window",[
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  ###########################################33
  #######################
  ###Brytenwalda Aethelred Aethelwulfing entrega carta bodo
  [anyone,"aethelredbodoletter_1", [
    ],
    "A letter? I am not a scribe. Talk to my brother Aelfred.", "lord_pretalk",[
      (str_store_troop_name_link, s11, "trp_knight_5_1"),
      
      (str_store_string, s2, "@The king wants no letters. You have been sent to speak to his brother, {s11}."),
      (add_quest_note_from_sreg, "qst_the_alliance", 4, s2, 0),
  ]],
  
  ###Aetheling Aelfred Aethelwulfing alfred entrega carta de bodo
  
  [anyone|plyr,"aelfredbodoletter_1", [
    ],
    "This is the letter that old 'Snake in the Eye' so earnestly tried to get. " +
    "My partner, Bodo, brought it here from Asturias. It proposes to send an army from Asturias, around the coast of Frankia, to West Seaxe, under the terms of the alliance. " +
    "The blood of many innocents stains this letter, particularly that of the passengers of the Woden Ric, the boat where this matter started. I hope that their sacrifice will save other lives.", "aelfredbodoletter_2",[
  ]],
  
  [anyone,"aelfredbodoletter_2", [
      (str_clear, s2),
    ],
    "{s2}^^.", "aelfredbodoletter_2_1",[
      (str_store_string, s2, "@--He takes the letter from your hands, and you see his fingers are stained with ink. Aelfred reads the letter slowly, absorbing with interest all that it contains. " +
      "After reading it, without saying anything, Aelfred calls Bodo and takes him aside a few meters, where they talk a long time. --", color_good_news),
  ]],
  
  [anyone|plyr,"aelfredbodoletter_2_1", [
    ],
    "--From where you are, you can hear nothing, but you can see their lips move as Bodo gestures to put emphasis on his words. Aelfred remains calm, patiently listening and questioning. " +
    "He is a young man, short and slight, but he reputedly has a hot temper that he hides very well. " +
    "Finally, both return to your side.--", "aelfredbodoletter_3",[
  ]],
  
  [anyone,"aelfredbodoletter_3", [
    ],
    "{playername}, West Seaxe thanks you for bringing this letter. Bodo has told me everything, and I know all the hardships you've been through because of this mission and, " +
    "even more personally, the kidnapping of your mother. " +
    "How may we reward you?", "aelfredbodoletter_4",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 40),
      (call_script, "script_change_player_relation_with_troop", "trp_kingdom_5_lord", 20),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", 20),
      
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_1", -10), #danmark
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_8", -10), #northumbria
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_5", 30), #wessex
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_7", 10), #mierce
      
      (str_store_string, s2, "@Info:"),
      (call_script, "script_start_quest", "qst_notes_englaland", "trp_player"),
      
      (str_clear, s9),
      (str_store_troop_name_link, s9, "trp_knight_5_1"),
      (str_store_string, s2, "@Note 1: You gave the letter to West Seaxe. {s9} thanked you, and now you're helping him."),
      (add_quest_note_from_sreg, "qst_notes_englaland", 4, s2, 0),
      (add_quest_note_from_sreg, "qst_the_alliance", 5, s2, 0),
  ]],
  
  [anyone|plyr,"aelfredbodoletter_4", [
    ],
    "Doing the right thing is reward enough for me.", "aelfredbodoletter_51",[
  ]],
  [anyone|plyr,"aelfredbodoletter_4", [
    ],
    "I do have a request. Help me find a Dane called Sven Bull Neck.", "aelfredbodoletter_52",[
  ]],
  [anyone|plyr,"aelfredbodoletter_4", [
    ],
    "I want you to help me find a Dane called Sven Bull Neck and expect a suitable reward.", "aelfredbodoletter_53",[
  ]],
  [anyone|plyr,"aelfredbodoletter_4", [
    ],
    "I did this for Bodo. I do not expect a reward.", "aelfredbodoletter_54",[
  ]],
  
  [anyone,"aelfredbodoletter_51", [
      (str_clear, s2),
    ],
    "{s2}^^This is not very common: selfless people willing to help for the sake of doing good. I am sure that God, our Father, who sees everything, is saving a place in paradise for you.", "aelfredbodoletter_6",[
      (str_store_string, s2, "@--For a moment, he shows surprise.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 40),
      (call_script, "script_change_troop_renown", "trp_player", 10),
      (call_script, "script_change_player_honor", 10),
  ]],
  
  [anyone,"aelfredbodoletter_52", [
    ],
    "West Seaxe has informants across Englaland. If Sven Bull Neck appears somewhere, soon we'll know. As soon as I know something, I'll let you know.", "aelfredbodoletter_6",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 30),
      (call_script, "script_change_troop_renown", "trp_player", 15),
  ]],
  
  [anyone,"aelfredbodoletter_53", [
      (str_clear, s2),
    ],
    "{s2}^^I see. Take this silver. About Sven Bull Neck, West Seaxe has informants across Englaland. If Sven Bull Neck appears somewhere, soon we'll know.", "aelfredbodoletter_6",[
      (str_store_string, s2, "@--He studies you slowly, like examining a horse.--", color_good_news),
      (call_script, "script_troop_add_gold", "trp_player", 12000),
      (call_script, "script_change_troop_renown", "trp_player", 10),
  ]],
  
  [anyone,"aelfredbodoletter_54", [
    ],
    "Well, friendship is one of the most cherished virtues among the Saxons. By helping him, you have helped West Seaxe. " +
    "Take this reward and know that as soon as we know anything of the whereabouts of Sven Bull Neck, we'll let you know.", "aelfredbodoletter_6",[
      (call_script, "script_troop_add_gold", "trp_player", 6000),
      (call_script, "script_change_troop_renown", "trp_player", 10),
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", 50),
  ]],
  
  
  [anyone,"aelfredbodoletter_6", [
    ],
    "I will send a messenger to my brother, the king, for a meeting. We will discuss this letter and make a decision soon.^^Meanwhile, go yourself to talk to the king and offer him your allegiance. You are a person of great ability. You must enter the service of West Seaxe for us to reward you fully as you deserve.", "aelfredbodoletter_91",[
      
      (assign, "$g_invite_faction_lord", "trp_kingdom_5_lord"),
      (str_store_troop_name,s1,"$g_invite_faction_lord"),
      (setup_quest_text,"qst_join_faction"),
      
      (str_store_troop_name_link, s3, "$g_invite_faction_lord"),
      (str_store_faction_name_link, s4, "fac_kingdom_5"),
      (quest_set_slot, "qst_join_faction", slot_quest_giver_troop, "$g_invite_faction_lord"),
      # (quest_set_slot, "qst_join_faction", slot_quest_expiration_days, 180),
      (quest_set_slot, "qst_join_faction", slot_quest_failure_consequence, 0),
      
      (str_clear, s9),
      (str_store_troop_name_link, s9, "trp_knight_5_1"),
      (str_store_string, s2, "@{s9} wants you to find and speak with {s3} of the {s4}, to give him your oath of homage. Then, he wants you to return for an assignment."),
      (add_quest_note_from_sreg, "qst_the_alliance", 6, s2, 0),
      (call_script, "script_start_quest", "qst_join_faction", "$g_invite_faction_lord"),
      (call_script, "script_report_quest_troop_positions", "qst_join_faction", "$g_invite_faction_lord", 3),
      (quest_set_slot, "qst_the_alliance", slot_quest_current_state, 12),
  ]],
  
  [anyone,"aelfredbodoletter_91", [
    ],
    "My brother is a good man. I am sure he will accept you.^^After that, return to me, for I already have a task for you.", "close_window",[
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  ##
  
  [anyone,"aelfredbodoletter_1_1", [
    ],
    "Ah, {playername}. I am honored that you have joined us. Now, as I mentioned, I already have something to ask of you.^^We have received repeated requests from the lands of the Welsh for help. " +
    "Things are very hectic there. Because of our confrontation with the Danish, we were unable to give the attention the problem deserves. I want you go there on behalf of West Seaxe and impose peace.", "aelfredbodoletter_7",[
      (add_xp_as_reward,600),
      (call_script, "script_end_quest", "qst_the_alliance"), #quest end.
  ]],
  
  
  [anyone|plyr,"aelfredbodoletter_7", [
    ],
    "What you need me to do?", "aelfredbodoletter_81",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone|plyr,"aelfredbodoletter_7", [
    ],
    "I am sorry. My priority is Sven Bull Neck.", "aelfredbodoletter_82",[
  ]],
  
  [anyone,"aelfredbodoletter_82", [
    ],
    "You can be sure that, when you return from this mission, we will have news about Sven Bull Neck for you. Sven Bull Neck is a man known for his outbursts of rage, so our informers will soon hear something.", "aelfredbodoletter_81",[
  ]],
  
  
  [anyone,"aelfredbodoletter_81", [
    ],
    "I want you go there and take a fortress called Din Bych. Put your flag there for twenty days to demonstrate to the Welsh that we are ready to take their land by force if they are not able to keep peace among themselves.", "aelfredbodoletter_9",[
      
      (str_store_party_name_link, s3, "p_castle_41"),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_string, s2, "@{s11} has asked you to go to the land of the Welsh. You are to conquer {s3} and keep it twenty days."),
      (call_script, "script_start_quest", "qst_welsh_and_pictish", "$g_talk_troop"),
      (quest_set_slot,"qst_welsh_and_pictish",slot_quest_current_state, 1),
      (quest_set_slot, "qst_welsh_and_pictish", slot_quest_target_amount, 20),
  ]],
  
  [anyone,"aelfredbodoletter_9", [
    ],
    "Good luck. The first time we met in Snotingaham, I never thought that you would be important to West Seaxe, but now you've done us a big favor.", "lord_pretalk",[
      #  (assign, "$g_leave_encounter",1),
  ]],
  
  ########################
  ####alfred aelfred despues de ataque a los britones
  [anyone,"aethelred_wp_1", [
    ],
    "I am pleased to hear that. The Welsh are warlike people, and I was not sure you made it.", "aethelred_wp_2",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
      (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 10),
      (call_script, "script_end_quest", "qst_welsh_and_pictish"),
  ]],
  
  [anyone,"aethelred_wp_2", [
    ],
    "I have good news for you, too. Sven Bull Neck was spotted in East Engle. I guess he was there because that kingdom gave the Danish supplies, horses and support when they first arrived in Englaland. " +
    "It's a poor kingdom with a king whose weakness only helped the plague that has fallen upon us.^^" +
    "The bad part is that Sven Bull Neck has since left East Engle and now serves Northhymbre. He is trying to run away from you. As he must know that West Seaxe has received you, he surrounds himself with our enemies.", "aethelred_wp_3",[
  ]],
  
  [anyone|plyr,"aethelred_wp_3", [
    ],
    "Still, I do not understand why they give them shelter when he killed King Horik's man.", "aethelred_wp_41",[
  ]],
  
  [anyone|plyr,"aethelred_wp_3", [
    ],
    "Then I must go to Northhymbre.", "aethelred_wp_5",[
  ]],
  
  [anyone,"aethelred_wp_41", [
      (str_clear, s2),
    ],
    "{s2}^^The sons of Ragnar rule Northhymbre, not the king of Danmark, Horik, and from what I know, Sven Bull Neck is the prow man of Sigurd 'Snake in the Eye,' one of the most dangerous of the Ragnarssons.", "aethelred_wp_42",[
      (str_store_string, s2, "@--He takes a deep breath.--", color_good_news),
  ]],
  
  [anyone|plyr,"aethelred_wp_42", [
    ],
    "Someday Sigurd and I will settle our accounts.", "aethelred_wp_43",[
      (call_script, "script_change_player_honor", -5),
  ]],
  [anyone|plyr,"aethelred_wp_42", [
    ],
    "Sigurd may be in Danmark, but he has long arms.", "aethelred_wp_43",[
  ]],
  [anyone|plyr,"aethelred_wp_42", [
    ],
    "(Say nothing)", "aethelred_wp_5",[
  ]],
  
  [anyone,"aethelred_wp_43", [
    ],
    "I think you, Sven and Sigurd have many problems among you, and this can only end in blood.", "aethelred_wp_5",[
  ]],
  [anyone,"aethelred_wp_5", [
    ],
    "Well, Sven Bull Neck is a problem, but Northhymbre is full of Danes, and they are strong. Sven Bull Neck could just hide there, and you would never find him. " +
    "However, the Ragnarssons need him to prove his worth. I think I know where they will send him.", "aethelred_wp_6",[
  ]],
  
  [anyone|plyr,"aethelred_wp_6", [
      (store_attribute_level,":intelligence","trp_player",ca_intelligence),
      (ge, ":intelligence", 16),
    ],
    "To meet the ships from the Kingdom of Asturias and destroy them. Right?", "aethelred_wp_71",[
      (add_xp_as_reward,200),
  ]],
  
  [anyone|plyr,"aethelred_wp_6", [
    ],
    "Tell me what you know.", "aethelred_wp_72",[
  ]],
  
  [anyone|plyr,"aethelred_wp_6", [
    ],
    "Wherever he goes, I will go and find him.", "aethelred_wp_73",[
  ]],
  
  [anyone,"aethelred_wp_71", [
      (str_clear, s2),
    ],
    "{s2}^^I like that the people who serve be smart. You're right.", "aethelred_wp_72",[
      (str_store_string, s2, "@--He smiles, pleased.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone,"aethelred_wp_73", [
    ],
    "This obsession must be giving you headaches...", "aethelred_wp_72",[
  ]],
  
  [anyone,"aethelred_wp_72", [
    ],
    "During the time you were busy with the Welsh, I met with my brother. Almost certainly, the Asturian fleet has left port. " +
    "The letter you gave us mentioned that they will meet our people in Frankia, near a village called Douar-an-Enez. " +
    "I fear that, in some way, the sons of Ragnar have obtained this information.", "aethelred_wp_8",[
  ]],
  
  
  [anyone|plyr,"aethelred_wp_8", [
    ],
    "A man, Reginhard, betrayed me. Perhaps he mentioned this to Sigurd.", "aethelred_wp_91",[
  ]],
  
  [anyone|plyr,"aethelred_wp_8", [
    ],
    "I remember Sigurd mentioned a traitor in Asturias. Somebody called Silo.", "aethelred_wp_9_1",[
  ]],
  
  [anyone,"aethelred_wp_91", [
    ],
    "Maybe. It shows your poor judgment when it comes to choosing companions.", "aethelred_wp_9",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  
  [anyone|plyr,"aethelred_wp_9", [
    ],
    "That's not fair! I remember Sigurd mentioned a traitor in Asturias. Perhaps the information came to them from there.", "aethelred_wp_9_1",[
  ]],
  
  [anyone,"aethelred_wp_9_1", [
    ],
    "If there is a traitor in the fleet of the Kingdom of Asturias, you must find and kill him. These men from Asturias are very important. Do not fail us.^^" +
    "Finish everything you have pending, as you will be out for several weeks. We have gathered men and have prepared ships for them. They await you in {s3}. Ask the old captain at the port. He is the man who deals with hiring sailors.", "aethelred_wp_10",[
      (str_store_party_name_link, s3, "p_town_12"),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_string, s2, "@The time to meet with the troops from the Kingdom of Asturias has arrived. Bodo's letter indicates that they will dock at {s3}, and {s11} wants you go there and meet with them. " +
        "There is a traitor. You have to expose him and destroy him diplomatically, without breaking relations with the Asturians.^^" +
      "{s11} has gathered men and ships to help you in Douar-an-Enez. You must go to {s3} and talk to the old captain at the port."),
      (call_script, "script_start_quest", "qst_douar_an_enez", "$g_talk_troop"),
      (quest_set_slot,"qst_douar_an_enez",slot_quest_current_state, 1),
  ]],
  
  [anyone,"aethelred_wp_10", [
    ],
    "Above all, remember that it is very important that this Asturian army reach West Seaxe.", "lord_pretalk",[
      # (assign, "$g_leave_encounter",1),
  ]],
  
  ##########aelfred despues de Douar-an-Enez
  [anyone,"aelfred_ad_1", [
      (str_clear, s3),
    ],
    "{s3}^^Yes, it's true. The news preceded you. It seems that the Danish surprised you. " +
    "The army was lost, the best that we had right now, and all this work and diplomatic expense has been for nothing.", "aelfred_ad_2",[
      (str_store_string, s3, "@--He snaps his fingers.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      
      (str_store_troop_name_link, s11, "trp_kingdom_5_lord"),
      (str_store_string, s2, "@You must enter the service of {s11}, ready for the battle ahead."),
      (quest_set_slot,"qst_aescesdun",slot_quest_current_state, 2),
  ]],
  
  [anyone|plyr,"aelfred_ad_2", [
    ],
    "I admit my failure.", "aelfred_ad_31",[
  ]],
  [anyone|plyr,"aelfred_ad_2", [
    ],
    "Thanks to my victory in Douar-an-Enez, you have 600 Danish less attacking West Seaxe.", "aelfred_ad_32",[
  ]],
  
  [anyone,"aelfred_ad_31", [
      (str_clear, s2),
    ],
    "{s2}^^Look, it's not worth worrying about what could be and was not. Now we have problems that are more serious.", "aelfred_ad_4",[
      (str_store_string, s2, "@--He looks at you condescendingly.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone,"aelfred_ad_32", [
      (str_clear, s2),
    ],
    "{s2}^^I would not call it a victory. The news I received was that there was dissension in the camp of the Asturians. I distinctly remember asking you neutralize the traitor as soon as possible. " +
    "If you had followed my instruction, you would have defeated the Danish and today we would have 500 veterans here to help. " +
    "Well, forget it. Now we have problems that are more serious.", "aelfred_ad_4",[
      (str_store_string, s2, "@--He looks at you condescendingly.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone,"aelfred_ad_4", [
    ],
    "We are in dire straits. The Danish became strong in Readingum, and they resisted our attempt to drive them away. " +
    "My brother, King Aethelred, is convinced that God was not on our side and is trying to regain his favor by praying as much as he can. I think we need more men AND God's favor to defeat the Danish. That's why I was so desperate to see you. " +
    "Ahm, did I say 'desperate?' Well, I meant I need your help, for you have proven to be a resourceful {reg59?lady:man}.", "aelfred_ad_5",[
  ]],
  [anyone,"aelfred_ad_5", [
      (str_clear, s2),
      (assign, ":quest_target_amount",12),
      (quest_set_slot, "qst_learn_where_merchant_brother_is", slot_quest_target_amount, ":quest_target_amount"),
      (quest_get_slot, ":quest_target_amount", "qst_learn_where_merchant_brother_is", slot_quest_target_amount),
      (assign, reg3, ":quest_target_amount"),
    ],
    "{s2}^^The Danish are preparing to advance to our meeting. They know that if we are defeated, West Seaxe will be at their mercy, and they will do the same thing here that they did in East Engle and Northhymbre. " +
    "After the defeat at Readingum, many men were scattered, and I sent out thegns to gather them and also to raise the fyrd in the villages to cover our losses. " +
    "We need food to feed all these people. I need you to bring me {reg3} head of cattle so I can keep the troops fed. I care very little about where you get them. Just bring them to me as soon as you can.", "aelfred_ad_6",[
      (str_store_string, s2, "@--He scratches his chin thoughtfully. He is a very thin young man of only twenty years, but already commands respect.--", color_good_news),
  ]],
  
  [anyone|plyr,"aelfred_ad_6", [
    ],
    "Well, I'll get the cattle while you gather your men. It's time to end the Danish.", "aelfred_ad_71",[
  ]],
  [anyone|plyr,"aelfred_ad_6", [
    ],
    "I'm tired of being a peon for West Seaxe.", "aelfred_ad_72",[
  ]],
  [anyone|plyr,"aelfred_ad_6", [
    ],
    "Sven was not in Douar-an-Enez. I cannot take search for cattle; I have to find him.", "aelfred_ad_73",[
  ]],
  
  [anyone,"aelfred_ad_71", [
    ],
    "Well, I knew I could count on you.", "lord_pretalk",[
      (quest_get_slot, ":quest_target_amount", "qst_learn_where_merchant_brother_is", slot_quest_target_amount),
      (str_clear, s2),
      (str_clear, s13),
      (str_store_troop_name_link, s13, "$g_talk_troop"),
      (assign, reg3, ":quest_target_amount"),
      (setup_quest_text, "qst_learn_where_merchant_brother_is"),
      (str_store_string, s2, "@{s13} asked you to gather {reg3} head of cattle and deliver them in Aescesdun. Then, back to him. "),
      (call_script, "script_start_quest", "qst_learn_where_merchant_brother_is", "$g_talk_troop"),
      #TODO: Change this value
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
      # (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone,"aelfred_ad_72", [
    ],
    "Look, I'm usually not so expressive, but I will tell you that you are very important to West Seaxe. I understand that none of this is easy. " +
    "Moreover, Sven Bull Neck is in the enemy army. Fighting on our side is the best way to reach him. Well, do something! West Seaxe needs you because we are in a situation of life or death, so we will reward you for this service. " +
    "I'll pay 10,000 peningas from my own treasure. Do you agree?", "aelfred_ad_74",[
  ]],
  
  [anyone,"aelfred_ad_73", [
    ],
    "Sven Bull Neck is among our enemies, ready to pillage West Seaxe. That makes our interests coincide. " +
    "Well, West Seaxe needs you in any case because we are in a life or death situation. We will reward you for this service. " +
    "I'll pay 10,000 peningas from my own treasure. Do you agree?", "aelfred_ad_74",[
  ]],
  
  [anyone|plyr,"aelfred_ad_74", [
    ],
    "Your money is not necessary. I will do this to have your support to hunt to Sven Bull Neck.", "aelfred_ad_71",[
  ]],
  [anyone|plyr,"aelfred_ad_74", [
    ],
    "Glad to know that I will be rewarded at last. Pay me, and I'll bring you cattle.", "aelfred_ad_75",[
  ]],
  
  [anyone,"aelfred_ad_75", [
    ],
    "Take your money. Now bring the cattle. Good luck.", "lord_pretalk",[
      (str_clear, s2),
      (str_clear, s13),
      (call_script, "script_troop_add_gold", "trp_player", 10000),
      (call_script, "script_change_troop_renown", "trp_player", -15),
      (quest_get_slot, ":quest_target_amount", "qst_learn_where_merchant_brother_is", slot_quest_target_amount),
      (str_store_troop_name_link, s13, "$g_talk_troop"),
      (assign, reg3, ":quest_target_amount"),
      (setup_quest_text, "qst_learn_where_merchant_brother_is"),
      (str_store_string, s2, "@{s13} asked you to gather {reg3} head of cattle and deliver them in Aescesdun. Then, back to him."),
      (call_script, "script_start_quest", "qst_learn_where_merchant_brother_is", "$g_talk_troop"),
      #TODO: Change this value
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      #(assign, "$g_leave_encounter",1),
  ]],
  
  ###aelfred ready for Ashdown
  [anyone,"aelfred_bt_1", [
      (str_clear, s3),
    ],
    "{s3}^^The Danish have gotten underway. They are approaching quickly. My brother is praying for victory, and we're ready. " +
    "If God is on our side, we will win and save West Seaxe. Otherwise, we perish. I do not say such things very often, but thank you for everything, {playername}, especially for joining your destiny to ours.", "aelfred_bt_2",[
      (str_store_string, s3, "@--He puts his hand on your shoulder and looks into your eyes.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
      
      (str_store_troop_name_link, s11, "trp_knight_5_1"),
      (str_store_string, s2, "@You've joined your army to that of {s11}, which awaits the arrival of the great Danish army. It seems that the fate of West Seaxe will be decided soon."),
      (quest_set_slot,"qst_aescesdun",slot_quest_current_state, 4),
      (enable_party, "p_mega_danishrmy"),
  ]],
  [anyone|plyr,"aelfred_bt_2", [
    ],
    "Do not worry, sir. Danish are the ones who should be afraid of us.", "aelfred_bt_31",[
  ]],
  [anyone|plyr,"aelfred_bt_2", [
    ],
    "Soon Sven and I will see each other and finish what he started on the Woden Ric.", "aelfred_bt_32",[
  ]],
  [anyone|plyr,"aelfred_bt_2", [
    ],
    "Thanks are not necessary. It is a pleasure to serve you.", "aelfred_bt_33",[
  ]],
  
  [anyone,"aelfred_bt_31", [
    ],
    "Well said. They will pay dearly for their ill-considered invasion. Now let's go to the men.", "close_window",[
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",10),
      (jump_to_menu, "mnu_the_speech_l"),
      (finish_mission, 2),
  ]],
  
  [anyone,"aelfred_bt_32", [
    ],
    "Sure, we'll help you with that! Now let's go to the men.", "close_window",[
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",5),
      (jump_to_menu, "mnu_the_speech_l"),
      (finish_mission, 2),
  ]],
  [anyone,"aelfred_bt_33", [
    ],
    "Do you always say what others want to hear? Leave it. Now let's go to the men.", "close_window",[
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",-5),
      (jump_to_menu, "mnu_the_speech_l"),
      (finish_mission, 2),
  ]],
  
  ################Halfdan despues de Douar-an-Enez
  [anyone,"halfdan_ad_1", [
      (str_clear, s3),
    ],
    "{s3}^^Yes, it's true. The news preceded you. It seems that the Saxons surprised you. " +
    "Fortunately, you got the win and ended up with the enemy army. The Danish are in debt to you, {playername}. Let me reward you!", "halfdan_ad_2",[
      (str_store_string, s3, "@--He pats your back.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (call_script, "script_troop_add_gold", "trp_player", 12000),
      
      (str_store_troop_name_link, s11, "trp_kingdom_8_lord"),
      (str_store_string, s2, "@You must enter the service of {s11} and prepare for the battle ahead."),
      (quest_set_slot,"qst_aescesdun",slot_quest_current_state, 2),
  ]],
  
  [anyone|plyr,"halfdan_ad_2", [
    ],
    "It was a tough battle, and there were many casualties.", "halfdan_ad_31",[
  ]],
  [anyone|plyr,"halfdan_ad_2", [
    ],
    "Thanks to my victory today, the Saxons have many men less to defend West Seaxe.", "halfdan_ad_32",[
  ]],
  
  [anyone,"halfdan_ad_31", [
      (str_clear, s2),
    ],
    "{s2}^^Now they enjoy the pleasures of Walhalla. Do not weep for the dead; they do not want to hear it.", "halfdan_ad_4",[
      (str_store_string, s2, "@--Halfdan laughs loudly.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  [anyone,"halfdan_ad_32", [
      (str_clear, s2),
    ],
    "{s2}^^Yes, fate smiles upon us. The Norns weave the threads in our favor. We Danes hold East Engle and Northhymbre, and will soon add West Seaxe, " +
    "and you, my friend, have become part of the fate of the sons of Ragnar. If my father had known you, he would have adopted you.", "halfdan_ad_4",[
      (str_store_string, s2, "@--Halfdan laughs loudly.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  [anyone,"halfdan_ad_4", [
    ],
    "Well, let's deal with the important things. Soon we leave Readingum to attack the Saxons. With every day that passes, they receive more men and become stronger. We must attack them and destroy them quickly. " +
    "Then West Seaxe will be ours. They are afraid of us, very afraid, but Saxons are bold people with a strong king, not like those Angles. We will precipitate the battle and kill their king, along with that Aelfred, brother of the king, who is equally or more dangerous though he is little more than a boy.", "halfdan_ad_5",[
  ]],
  [anyone,"halfdan_ad_5", [
      (str_clear, s2),
      (assign, ":quest_target_amount",12),
      (quest_set_slot, "qst_learn_where_merchant_brother_is", slot_quest_target_amount, ":quest_target_amount"),
      (quest_get_slot, ":quest_target_amount", "qst_learn_where_merchant_brother_is", slot_quest_target_amount),
      (assign, reg3, ":quest_target_amount"),
    ],
    "{s2}^^More immediately, we need meat for our warriors. I need you to bring me {reg3} head of cattle so I can keep the troops fed. " +
    "I care very little about where you get them. Just bring them to me as soon as you can.", "halfdan_ad_6",[
      (str_store_string, s2, "@--He confidently tousles your hair.--", color_good_news),
  ]],
  
  [anyone|plyr,"halfdan_ad_6", [
    ],
    "Well, I'll get the cattle. I will kill Sven and take my share of the booty in West Seaxe.", "halfdan_ad_71",[
  ]],
  [anyone|plyr,"halfdan_ad_6", [
    ],
    "Do not take so many liberties. We are not friends.", "halfdan_ad_72",[
  ]],
  [anyone|plyr,"halfdan_ad_6", [
    ],
    "Sven was not in Douar-an-Enez. I cannot look for cattle; I have to find Sven Bull Neck.", "halfdan_ad_73",[
  ]],
  
  [anyone,"halfdan_ad_71", [
    ],
    "Now you're talking! Hurry up! I want to get going soon.", "close_window",[
      (str_clear, s2),
      (str_clear, s13),
      (quest_get_slot, ":quest_target_amount", "qst_learn_where_merchant_brother_is", slot_quest_target_amount),
      (str_store_troop_name_link, s13, "$g_talk_troop"),
      (assign, reg3, ":quest_target_amount"),
      (setup_quest_text, "qst_learn_where_merchant_brother_is"),
      (str_store_string, s2, "@{s13} asked you to gather {reg3} head of cattle and deliver them in Readingum. Then, back to him."),
      (call_script, "script_start_quest", "qst_learn_where_merchant_brother_is", "$g_talk_troop"),
      #TODO: Change this value
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"halfdan_ad_72", [
    ],
    "Oh, I see. You think like a Viking now. I can pay for the service you give. I will give you 8000 peningas now. Do you agree?", "halfdan_ad_74",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -15),
  ]],
  
  [anyone,"halfdan_ad_73", [
    ],
    "Sven Bull Neck is with our enemies, ready to defend West Seaxe. That makes our interests coincide. " +
    "Well, I will reward you for this service. " +
    "I'll pay 8000 peningas. Do you agree?", "halfdan_ad_74",[
  ]],
  
  [anyone|plyr,"halfdan_ad_74", [
    ],
    "Do not worry about the money; it is not necessary. It was but a joke! I'm really with you.", "halfdan_ad_71",[
  ]],
  [anyone|plyr,"halfdan_ad_74", [
    ],
    "Glad to know that I will be rewarded at last. Pay me, and I'll bring cattle.", "halfdan_ad_75",[
  ]],
  
  [anyone,"halfdan_ad_75", [
    ],
    "Take your money. Now bring the cattle. Good luck.", "close_window",[
      (str_clear, s2),
      (str_clear, s13),
      (call_script, "script_troop_add_gold", "trp_player", 8000),
      (call_script, "script_change_troop_renown", "trp_player", -15),
      #(quest_get_slot, ":giver_troop", "qst_learn_where_merchant_brother_is", slot_quest_giver_troop),
      # (quest_set_slot,"qst_learn_where_merchant_brother_is",slot_quest_giver_troop, "$g_talk_troop"),
      
      (quest_get_slot, ":quest_target_amount", "qst_learn_where_merchant_brother_is", slot_quest_target_amount),
      (str_store_troop_name_link, s13, "$g_talk_troop"),
      (assign, reg3, ":quest_target_amount"),
      (setup_quest_text, "qst_learn_where_merchant_brother_is"),
      (str_store_string, s2, "@{s13} asked you to gather {reg3} head of cattle and deliver them back to him."),
      (call_script, "script_start_quest", "qst_learn_where_merchant_brother_is", "$g_talk_troop"),
      #TODO: Change this value
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  
  ###halfdan ready for Ashdown
  [anyone,"halfdan_bt_1", [
      (str_clear, s3),
    ],
    "{s3}^^Everything is ready. It's time to get going. If West Seaxe falls, Englaland will be finished, and our people will take these fertile lands for themselves. " +
    "We'll all be rich men, and our fame will rival of the heroes of the sagas, {playername}.", "halfdan_bt_2",[
      (str_store_string, s3, "@--He hugs you tightly, like a bear.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
      
      (str_store_troop_name_link, s11, "trp_kingdom_8_lord"),
      (str_store_string, s2, "@You've joined your army to that of {s11}, which is ready to march on the Saxons in Aescesdun. It seems that the fate of West Seaxe will be decided soon."),
      (quest_set_slot,"qst_aescesdun",slot_quest_current_state, 4),
      (enable_party, "p_mega_danishrmy"),
  ]],
  [anyone|plyr,"halfdan_bt_2", [
    ],
    "West Seaxe is waiting!", "halfdan_bt_31",[
  ]],
  [anyone|plyr,"halfdan_bt_2", [
    ],
    "Soon Sven and I will see each other and finish what he started on the Woden Ric.", "halfdan_bt_32",[
  ]],
  [anyone|plyr,"halfdan_bt_2", [
    ],
    "I'm ready to shake the roots of Yggdrasill.", "halfdan_bt_33",[
  ]],
  
  [anyone,"halfdan_bt_31", [
    ],
    "Well said! Now let's go to the men.", "close_window",[
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",5),
      (jump_to_menu, "mnu_the_speech_l"),
      (finish_mission, 2),
  ]],
  [anyone,"halfdan_bt_32", [
    ],
    "You should forget this obsession you have! It is your bane. Now let's go to the men.", "close_window",[
      (jump_to_menu, "mnu_the_speech_l"),
      (finish_mission, 2),
  ]],
  [anyone,"halfdan_bt_33", [
    ],
    "That sounds poetic! You must have the soul of a skald, seidr's son! Now let's go to the men.", "close_window",[
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",1),
      (jump_to_menu, "mnu_the_speech_l"),
      (finish_mission, 2),
  ]],
  
  #########both halfdan and aelfred quest
  
  [anyone,"ashdown_2petition", [
    ],
    "Collect all the men that you can and come see me when you're ready.", "lord_pretalk",[
      (quest_set_slot,"qst_aescesdun",slot_quest_current_state, 3),
      #  (assign, "$g_leave_encounter",1),
  ]],
  
  ####aelfred and halfdan after aescendun battle
  [anyone,"svenbn_hunting1_1", [
    ],
    "We owe you a lot, my people and I. When you finish your vendetta with Sven, you will always have a place back here with us.", "svenbn_hunting1",[
      (quest_set_slot,"qst_aescesdun",slot_quest_current_state, 21),
      (call_script, "script_succeed_quest", "qst_aescesdun"),
      (call_script, "script_end_quest", "qst_aescesdun"),
      
      (add_xp_as_reward,2000),
      (call_script, "script_troop_add_gold", "trp_player", 10000),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (call_script, "script_change_player_party_morale", 8),
      (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 30),
  ]],
  
  [anyone|plyr, "svenbn_hunting1", [(eq, "$player_side", 1), #wessex
    ],
    "Aelfred, without your initiative, this victory would not have been possible.", "svenbn_hunting2",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
  ]],
  [anyone|plyr, "svenbn_hunting1", [(eq, "$player_side", 2), #danish
    ],
    "This victory was the work of all, Halfdan.", "svenbn_hunting2",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
  ]],
  
  [anyone|plyr, "lord_deal_with_bandits_completed", [],
    "Again, Sven Bull Neck escapes.", "svenbn_hunting21",[]],
  [anyone|plyr, "lord_deal_with_bandits_completed", [],
    "A good fight! I'll finish with Sven and return to you with the spoils.", "svenbn_hunting22",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
  ]],
  
  [anyone,"svenbn_hunting2", [
    ],
    "Well, let us leave compliments for another time. Now I go to gather men. The enemy is not completely defeated and we have to exploit this victory.", "svenbn_hunting3",[
  ]],
  
  [anyone,"svenbn_hunting21", [
    ],
    "That's over. My men have control of Readingum. Now I go to gather men. The enemy is not completely defeated and we have to exploit this victory.", "svenbn_hunting3",[
  ]],
  
  [anyone,"svenbn_hunting22", [
    ],
    "We'll be waiting. Now, do not delay but go to meet Sven. Now I go to gather men. The enemy is not completely defeated and we have to exploit this victory.", "svenbn_hunting3",[
  ]],
  
  
  [anyone,"svenbn_hunting3", [(eq, "$player_side", 2), #danish
    ],
    "Good luck, {playername}, broedr. I never knew anyone with your luck or your destiny. Surely, you're soguligr, a worthy subject for sagas. Far thu vel!", "close_window",[
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_string, s2, "@{s9} told you that Sven Bull Neck has gone to Readingum, where he has taken over. It's time to finish what started on the Woden Ric. Sven Bull Neck cannot escape again. Go to Readingum."),
      (call_script, "script_start_quest", "qst_svenbn_final", "$g_talk_troop"),
      (quest_set_slot, "qst_svenbn_final", slot_quest_current_state, 1),
      (finish_mission, 1),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  [anyone,"svenbn_hunting3", [ #West Seaxe
    ],
    "Good luck, {playername}. God is with you, because without His help it would be impossible that someone might do the deeds that you have done. Wes gesund!", "close_window",[
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_string, s2, "@{s9} told you that Sven Bull Neck has gone to Readingum, where he has taken over. It's time to finish what started on the Woden Ric. Sven Bull Neck cannot escape again. Go to Readingum."),
      (call_script, "script_start_quest", "qst_svenbn_final", "$g_talk_troop"),
      (quest_set_slot, "qst_svenbn_final", slot_quest_current_state, 1),
      (finish_mission, 1),
      (eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),
  ]],
  #########
  
  ###########################################
  
  
  #mainquest acaba
  
  [anyone,"reclutar_permiso1", [
    ],
    "{!}{s10}", "lord_talk",[
      (str_store_string, s10, "@You already have my permission to do this. Please do not keep bothering me with the same matter."),
      (try_begin),
        (lt, "$g_talk_troop_faction_kingdom_relation", 0), #bad relations with faction or war
        (str_store_string, s10, "@You are an enemy of my kingdom."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
      (else_try),
        (lt, "$g_talk_troop_relation", 0), #1 condition , bad relation = no permision +10 relation need, these are his lands, renown is important but minimum relation too.
        (str_store_string, s10, "@You must earn my trust if you want to recruit men in my land. Now, our relations are bad."),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
      (else_try),
        (neg|troop_slot_ge, "trp_player", slot_troop_renown, 150),
        (str_store_string, s10, "@I don't know if I trust you enough to take men from my land and lead them into battle. Prove yourself first, then come back and ask again.^^(150 or more Renown)"),
      (else_try),
        (le, "$g_talk_troop_relation", 4), #2 condition , relation
        (str_store_string, s10, "@No. I do not know who you are. You must earn my trust if you want to recruit men in my land.^^(150 or more Renown and 5 or more positive relation needed)"),
      (else_try),
        (try_for_range, ":center_no", centers_begin, centers_end),
          (party_get_slot, ":town_lord", ":center_no", slot_town_lord),
          (eq, ":town_lord", "$g_talk_troop"),
          
          (neg|party_slot_eq, ":center_no", recruit_permission_need, 0), #chief lord permission need to
          (neg|party_slot_eq, ":center_no", recruit_permission_need, 3),
          (str_store_string, s10, "@Well, I've come to know you, and it pleases me to allow it. Therefore, I hereby give notice that, if a man wants to join you, he will be free to do so, provided, as ever, that he is free of commitments to another lord."),
          (party_set_slot,":center_no",recruit_permission_need, 0), #ahora le deja
        (try_end),
      (try_end),
  ]],
  ###chief acaba
  #Political quests begin
  [anyone|plyr,"lord_talk", [
      (check_quest_active, "qst_offer_gift"),
      (quest_slot_eq, "qst_offer_gift", slot_quest_giver_troop, "$g_talk_troop"),
      
      (quest_get_slot, ":target_troop", "qst_offer_gift", slot_quest_target_troop),
      (str_store_troop_name, s4, ":target_troop"),
      (player_has_item, "itm_vc_furs"),
      (player_has_item, "itm_jewelry"),
    ],
    "I have acquired everything for {s4}'s gift.", "offer_gift_quest_complete",[
  ]],
  
  [anyone,"offer_gift_quest_complete", [
      (quest_get_slot, ":target_troop", "qst_offer_gift", slot_quest_target_troop),
      (troop_get_type, reg4, ":target_troop"),
      (val_mod, reg4, 2),
    ],
    "Ah, let me take those. I hope that this will mend the quarrel between you two. You may wish to speak to {reg4?her:him}, and see if I had any success.", "close_window",[
      (quest_set_slot, "qst_offer_gift", slot_quest_current_state, 2),
      (quest_set_slot, "qst_offer_gift", slot_quest_expiration_days, 365),
      (troop_remove_item, "trp_player", "itm_vc_furs"),
      (troop_remove_item, "trp_player", "itm_jewelry"),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  
  [anyone|plyr,"lord_talk", [
      (check_quest_active, "qst_intrigue_against_lord"),
      (neg|check_quest_succeeded, "qst_intrigue_against_lord"),
      (neg|check_quest_failed, "qst_intrigue_against_lord"),
      
      (quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop), #was qst_offer_gift
      (store_faction_of_troop, ":target_troop_faction", ":target_troop"),
      (faction_slot_eq, ":target_troop_faction", slot_faction_leader, "$g_talk_troop"),
    ],
    "My lord -- there is something I wish to tell you in confidence, about one of your vassals.", "intrigue_quest_state_complaint",[
  ]],
  
  [anyone,"intrigue_quest_state_complaint", [
      (assign, ":continue", 1),
      (try_begin),
        (call_script, "script_cf_troop_can_intrigue", "$g_talk_troop", 1),
        (assign, ":continue", 0),
      (try_end),
      (eq, ":continue", 1),
    ],
    "Whatever you have to say, I would ask you to wait until we are alone.", "lord_pretalk",[
  ]],
  
  [anyone,"intrigue_quest_state_complaint", [
    ],
    "What is it? I value your opinion, although I hope that you are not trying to sow dissension among my vassals. ", "intrigue_quest_state_complaint_plyr",[
      
      (quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
      (call_script, "script_troop_get_relation_with_troop", ":target_troop", "$g_talk_troop"),
      (assign, reg4, reg0),
      (str_store_troop_name, s4, ":target_troop"),
      (assign, reg5, "$g_talk_troop_effective_relation"),
      
      (try_begin),
        (eq, "$cheat_mode", 1),
        (display_message, "str_intrigue_success_chance"),
      (try_end),
  ]],
  
  
  
  [anyone|plyr,"intrigue_quest_state_complaint_plyr", [
      (check_quest_active, "qst_intrigue_against_lord"),
      (quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
      (str_store_troop_name, s4, ":target_troop"),
      (troop_get_slot, ":reputation_string", ":target_troop", slot_lord_reputation_type),
      (val_add, ":reputation_string", "str_lord_derogatory_default"),
      (str_store_string, s5, ":reputation_string"),
    ],
    "My liege -- {s4} is widely held by your vassals to be {s5}, and a liability to your realm", "lord_intrigue_quest_complaint_stated",[
  ]],
  
  [anyone|plyr,"intrigue_quest_state_complaint_plyr", [
    ],
    "Actually, my liege, never mind.", "lord_pretalk",[
      (call_script, "script_fail_quest", "qst_intrigue_against_lord"),
  ]],
  
  [anyone,"lord_intrigue_quest_complaint_stated", [
      (store_random_in_range, ":random", -50, 50),
      (store_add, ":score", "$g_talk_troop_effective_relation", ":random"),
      
      (quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
      (call_script, "script_troop_get_relation_with_troop", ":target_troop", "$g_talk_troop"),
      (ge, ":score", reg0),
      
    ],
    "Hmm... This is troubling to hear. Although I do not encourage my vassals to speak ill of each other, I value your opinion. Perhaps I should think twice about granting {s4} any further fiefs or offices...", "lord_pretalk",[
      (quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", ":target_troop", -10),
      (call_script, "script_succeed_quest", "qst_intrigue_against_lord"),
  ]],
  
  [anyone,"lord_intrigue_quest_complaint_stated", [
    ],
    "Sow discord among my vassals, will you? With everything else going on, do you think I appreciate my nobles turning on each other like quarreling dogs? Let me ask you this -- did someone put you up this?", "intrigue_quest_state_complaint_failed",[
      (call_script, "script_fail_quest", "qst_intrigue_against_lord"),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -5),
  ]],
  
  [anyone|plyr,"intrigue_quest_state_complaint_failed", [
    ],
    "I stand by my words, my liege.", "intrigue_quest_state_accept_blame",[
      (call_script, "script_change_player_honor", 1),
  ]],
  
  [anyone|plyr,"intrigue_quest_state_complaint_failed", [
      (quest_get_slot, ":giver_troop", "qst_intrigue_against_lord", slot_quest_giver_troop),
      (quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
      
      (str_store_troop_name, s4, ":giver_troop"),
      (str_store_troop_name, s5, ":target_troop"),
    ],
    "Yes, sire -- {s4} put me up to denouncing {s5}!", "intrigue_quest_state_deflect_blame",[
      (quest_get_slot, ":giver_troop", "qst_intrigue_against_lord", slot_quest_giver_troop),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", ":giver_troop", -5),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 4),
      (call_script, "script_change_player_honor", -2),
  ]],
  
  [anyone,"intrigue_quest_state_accept_blame", [
    ],
    "Indeed. You may stand by your words, but keep them to yourself. I will not have you undercutting my faithful follower {s4}.", "lord_pretalk",[
  ]],
  
  [anyone,"intrigue_quest_state_deflect_blame", [
    ],
    "I thought as much. Here's some advice for you, {reg59?lassie:lad} -- don't meddle in the quarrels of others. Now, enough of this.", "lord_pretalk",[
  ]],
  
  [anyone|plyr,"lord_talk", [
      (check_quest_active, "qst_denounce_lord"),
      (neg|check_quest_succeeded, "qst_denounce_lord"),
      (neg|check_quest_failed, "qst_denounce_lord"),
      
      (quest_slot_eq, "qst_denounce_lord", slot_quest_target_troop, "$g_talk_troop"),
      
      
      (troop_get_slot, ":reputation_string", "$g_talk_troop", slot_lord_reputation_type),
      (val_add, ":reputation_string", "str_lord_derogatory_default"),
      (str_store_string, s4, ":reputation_string"),
    ],
    "I want to tell you something -- we have had enough of your {s4} ways", "lord_denounce_1",[
  ]],
  
  [anyone,"lord_denounce_1", [
    ],
    "I'm sorry... What did you say?", "lord_denounce_2",[
  ]],
  
  [anyone|plyr,"lord_denounce_2", [
      
      (troop_get_slot, ":reputation_string", "$g_talk_troop", slot_lord_reputation_type),
      (val_add, ":reputation_string", "str_lord_derogatory_result"),
      (str_store_string, s4, ":reputation_string"),
      
    ],
    "You heard me. You will {s4}", "lord_denounce_3",[
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -15),
      
      
      (store_div, ":impact", "$g_talk_troop_relation", 10),
      (val_add, ":impact", 1),
      (val_max, ":impact", 1),
      (val_mul, ":impact", -1),
      
      #Change his respect level, slightly.  In the future game, there should be more sophisticated metrics for this
      (try_for_range, ":other_lord", active_npcs_begin, active_npcs_end),
        (neq, "$g_talk_troop", ":other_lord"),
        (store_faction_of_troop, ":other_lord_faction",":other_lord"),
        (eq, ":other_lord_faction", "$g_talk_troop_faction"),
        (call_script, "script_troop_get_relation_with_troop", ":other_lord", "$g_talk_troop"),
        (lt, reg0, 15),
        (call_script, "script_troop_change_relation_with_troop", ":other_lord", "$g_talk_troop", ":impact"),
      (try_end),
  ]],
  
  [anyone|plyr,"lord_denounce_2", [
    ],
    "Never mind. You must have misheard me.", "lord_pretalk",[
  ]],
  
  
  [anyone,"lord_denounce_3", [
      (ge, "$g_talk_troop_relation", 10),
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
    ],
    "Why would you say such a thing? To insult me like this, in spite of our friendship -- how much crueler is a knife in my back from an erstwhile friends, than the sword of a sworn foe. I do not know what game you are playing, but I want no part of it. Go away. I do not want to look at you.", "close_window",[
      (call_script, "script_succeed_quest", "qst_denounce_lord"),
  ]],
  
  [anyone,"lord_denounce_3", [
      (troop_slot_ge, "trp_player", slot_troop_renown, 300),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
    ],
    "Humph. Really? Is that your opinion, or did one of my rivals put those words in your mouth? Never mind. I will not play your game. Go away, and take your intrigues with you.", "close_window",[
      (call_script, "script_succeed_quest", "qst_denounce_lord"),
  ]],
  
  [anyone,"lord_denounce_3", [
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
    ],
    "I will not have you shame me in public, {reg59?my lady:sir}. Retract your words, or meet me on the duelling ground.", "lord_denounce_4",[
  ]],
  
  [anyone,"lord_denounce_3", [
    ],
    "Is that so? Well, hear this -- you're a snake, and a knave, and -- if you don't meet me on the duelling ground -- a coward. What say you to that? Do you retract your words, or shall we cross swords?", "lord_denounce_4",[
  ]],
  
  [anyone|plyr,"lord_denounce_4", [
    ],
    "It would be a pleasure to fight you.", "lord_respond_to_insult_challenge_duel_confirm",[
  ]],
  
  [anyone|plyr,"lord_denounce_4", [
    ],
    "I spoke rashly. I retract my words.", "lord_denounce_retract",[
      (call_script, "script_fail_quest", "qst_denounce_lord"),
      
  ]],
  
  [anyone,"lord_denounce_retract", [
    ],
    "I thought as much. Now, be gone from here.", "lord_pretalk",[
  ]],
  
  
  [anyone|plyr,"lord_talk", [
      (eq, "$g_comment_has_rejoinder", 1),
      (assign, "$g_comment_has_rejoinder", 0),
      (str_store_string, s9, "$g_rejoinder_to_last_comment"),
    ],
    "{!}{s9}", "lord_respond_to_insult",[
      
      (try_begin),
        (troop_get_type, ":is_female", "trp_player"),
        (val_mod, ":is_female", 2),
        (eq, ":is_female", 1),
        (unlock_achievement, ACHIEVEMENT_SASSY),
      (try_end),
  ]],
  
  
  #lord recruitment changes begin
  
  
  ##### TODO: QUESTS COMMENT OUT BEGIN
  
  
  #lord recruitment changes begin
  [anyone|plyr,"lord_talk",[
      (check_quest_active, "qst_resolve_dispute"),
      (quest_get_slot, ":lord_1", "qst_resolve_dispute", slot_quest_target_troop),
      (quest_get_slot, ":lord_2", "qst_resolve_dispute", slot_quest_object_troop),
      
      (assign, ":other_lord", 0),
      (try_begin),
        (eq, ":lord_1", "$g_talk_troop"),
        (quest_slot_eq, "qst_resolve_dispute", slot_quest_target_state, 0),
        (assign, "$g_other_lord", ":lord_2"),
        (assign, ":other_lord", ":lord_2"),
        
      (else_try),
        (eq, ":lord_2", "$g_talk_troop"),
        (quest_slot_eq, "qst_resolve_dispute", slot_quest_object_state, 0),
        (assign, "$g_other_lord", ":lord_1"),
        (assign, ":other_lord", ":lord_1"),
        
      (try_end),
      (gt, ":other_lord", 0),
      (str_store_troop_name, s11, "$g_other_lord"),
    ],
    "I wish to address your quarrel with {s11}", "lord_quarrel_intervention_1",
    []],
  
  
  
  [anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (encountered_party_is_attacker),
      (neg|is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (store_and, reg0, "$option_switches", lord_option_private),
      (eq, reg0, 0),
    ],
    "Stay your hand! There is something I must say to you in private.", "lord_recruit_1_relation",
    []],
  ###gifts to player's kingdom lords. Dark ages rings to vassals
  [anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (eq, "$g_talk_troop_faction", "$players_kingdom"),
    ],
    "(Gift warrior rings and bracelets valued at 5000 peningas)", "lord_gift_improverelation",
    [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",4999),
        (troop_remove_gold, "trp_player", 5000),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  
  [anyone, "lord_gift_improverelation", [], "Thank you, I am proud to receive these awards.", "lord_pretalk",[]],
  
  
  ####
  [anyone|plyr,"lord_talk",
    [(check_quest_active, "qst_track_down_bandits"),
      (neg|check_quest_succeeded, "qst_track_down_bandits"),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 1),
      
      
      ], "I am hunting a group of bandits with the following description... Have you seen them?", "lord_bandit_information",[]],
  [anyone,"lord_bandit_information", [
      (call_script, "script_get_manhunt_information_to_s15", "qst_track_down_bandits"),
      ], "{!}{s15}", "lord_pretalk",[]],
  
  
  [anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (eq, "$g_talk_troop_faction", "$players_kingdom"),
      (faction_slot_eq, "$players_kingdom", slot_faction_political_issue, 1),
    ],
    "Who do you think should be made the marshal of our realm?", "lord_internal_politics_cur_stance",
    []],
  
  [anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (eq, "$g_talk_troop_faction", "$players_kingdom"),
      (faction_get_slot, ":political_issue", "$players_kingdom", slot_faction_political_issue),
      (is_between, ":political_issue", centers_begin, centers_end),
      (str_store_party_name, s4, ":political_issue"),
    ],
    "Who do you think should receive the fief of {s4}?", "lord_internal_politics_cur_stance",
    []],
  
  
  [anyone|plyr,"lord_talk",[(troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
      (neq, "$g_talk_troop_faction", "$players_kingdom"),
      (faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
      #							(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
      (faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
      (str_store_troop_name, s4, ":faction_leader"),
      (str_store_faction_name, s5, "$players_kingdom"),
    ],
    "I need you to renounce your allegiance to {s4} and join the {s5} now, my husband.", "lord_husband_auto_recruit",
    []],
  
  
  [anyone,"lord_husband_auto_recruit",
    [
      (is_between, "$g_encountered_party", centers_begin, centers_end),
      (neg|party_slot_eq, "$g_encountered_party", slot_town_lord, "$g_talk_troop"),
    ],
    "Ask me again when we are outside of these walls, my wife.", "lord_pretalk",
    []],
  
  
  [anyone,"lord_husband_auto_recruit",
    [],
    "As you wish, my wife.", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
      (call_script, "script_change_troop_faction", "$g_talk_troop", "$players_kingdom"),
      
      (try_begin), #Actually, perhaps do provocation rather than war
        (ge, "$g_talk_troop_faction_kingdom_relation", 0),
        
        (try_begin),
          (eq, "$cheat_mode", 1),
          (display_message, "str_lord_recruitment_provokes_home_faction"),
        (try_end),
        
        (call_script, "script_add_log_entry", logent_border_incident_troop_suborns_lord, "trp_player", -1, "$g_talk_troop","$g_talk_troop_faction"),
        (store_add, ":slot_provocation_days", "$players_kingdom", slot_faction_provocation_days_with_factions_begin),
        (val_sub, ":slot_provocation_days", kingdoms_begin),
        (faction_set_slot, "$g_talk_troop_faction", ":slot_provocation_days", 30),
        
        (faction_get_slot, ":other_liege", "$g_talk_troop_faction", slot_faction_leader),
        (call_script, "script_troop_change_relation_with_troop", "trp_player", ":other_liege", -13),
      (try_end),
      
      (try_begin),
        (faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
        (call_script, "script_change_player_right_to_rule", 5),
      (try_end),
  ]],
  #chief permission need to recruit in land
  [anyone|plyr,"lord_talk", [
      (assign, ":continue", 0),
      (assign, ":owner", 0),
      (try_for_range, ":center_no", centers_begin, centers_end),
        (party_get_slot, ":town_lord", ":center_no", slot_town_lord),
        (eq, ":town_lord", "$g_talk_troop"),
        (val_add, ":owner", 1),
        (try_begin),
          (this_or_next|party_slot_eq, ":center_no", recruit_permission_need, 3),
          (party_slot_eq, ":center_no", recruit_permission_need, 0), #chief lord permission need to
          (val_add, ":continue", 1),
        (try_end),
      (try_end),
      (assign,"$temp", ":owner"),
      #		(assign, reg31, ":continue"),
      #		(assign, reg32, ":owner"),
      #		(display_message, "@Owner is {reg32}, cont is {reg31}"),
      (assign, "$temp2", ":continue"),
      (gt,"$temp",0),
      (lt, "$temp2", "$temp"),
    ],
    "I would like to ask permission to recruit men in your land.", "reclutar_permiso1",[]],
  
  
  [anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (store_and, reg0, "$option_switches", lord_option_private),
      (eq, reg0, 0),
    ],
    "There is a matter that I would like to discuss in private.", "lord_recruit_1_relation",
    []],
  [anyone|plyr,"lord_talk",[
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active, "qst_blank_quest_15"),
      (neg|check_quest_succeeded, "qst_blank_quest_15"),
      (neg|check_quest_failed, "qst_blank_quest_15"),
      (quest_get_slot, ":quest_target_troop", "qst_blank_quest_15", slot_quest_target_troop),
      #										(str_store_troop_name, s44, ":quest_target_troop"),
      #										(display_message, "@Reveal_ass2 troop is {s44}"),
      (eq,"$g_talk_troop",":quest_target_troop"),
      #(troop_get_slot, "$g_talk_troop_party", "$g_talk_troop", slot_troop_leaded_party),
      #(party_get_attached_to, ":attached_to", "$g_talk_troop_party"),
      #(neg|is_between, ":attached_to", walled_centers_begin, walled_centers_end),
    ],
    "I've heard a rumor that you were behind a recent attempt to murder me.", "lord_reveal", [(assign, "$info_inquired",0),]],
  
  
  [anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (neg|encountered_party_is_attacker),
      (neg|is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (neq, "$g_talk_troop_faction", "fac_player_supporters_faction"),
      (neq, "$g_talk_troop_faction", "fac_adventurers"),
      #other requirements
      (store_and, reg0, "$option_switches", lord_option_private),
      (eq, reg0, 0),
    ],
    "There is something which I would like to discuss with to you in private.", "lord_recruit_1_relation",
    []],
  
  
  [anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (troop_slot_ge, "$g_talk_troop", slot_troop_intrigue_impatience, 1),
      (eq, "$cheat_mode", 1),
      
      #other requirements
      
    ],
    "CHEAT -- Reset lord decision seed and intrigue impatience", "lord_talk",
    [
      (troop_set_slot, "$g_talk_troop", slot_troop_intrigue_impatience, 0),
      (store_random_in_range, ":random", 0, 9999),
      (troop_set_slot, "$g_talk_troop", slot_troop_temp_decision_seed, ":random"),
  ]],
  
  [anyone|plyr,"lord_talk",[(eq, "$cheat_mode", 1),
    ],
    "CHEAT -- Let's duel (insult)", "lord_respond_to_insult_challenge_duel",
    [
  ]],
  
  
  
  #Respond to insult
  [anyone,"lord_respond_to_insult", [
      (eq, "$g_last_comment_copied_to_s42", "str_comment_intro_female_sadistic_admiring"),
      ], "Hah! I admire a quick tongue. Perhaps someday I shall remove it, with tongs, to admire it at greater leisure, but today, at least, I shall salute your wit and courage.", "lord_pretalk", [
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 10), #cambiado chief
      (call_script, "script_change_troop_renown", "trp_player", 8), #cambiado chief
  ]],
  
  
  [anyone,"lord_respond_to_insult", [
      (this_or_next|eq, "$g_last_comment_copied_to_s42", "str_comment_intro_female_pitiless_admiring"),
      (this_or_next|eq, "$g_last_comment_copied_to_s42", "str_comment_intro_female_common_upstanding"),
      (this_or_next|eq, "$g_last_comment_copied_to_s42", "str_comment_intro_female_noble_upstanding"),
      (this_or_next|eq, "$g_last_comment_copied_to_s42", "str_comment_intro_female_common_martial"),
      (eq, "$g_last_comment_copied_to_s42", "str_comment_intro_female_badtempered_admiring"),
      ], "I meant no offense, madame.", "lord_pretalk", [
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -6), #cambido chief
      (call_script, "script_change_troop_renown", "trp_player", 8), #cambido chief
  ]],
  
  
  [anyone,"lord_respond_to_insult", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_leaded_party, "$g_encountered_party"),
      (store_party_size_wo_prisoners, ":lord_party_size", "$g_talk_troop_party"),
      (store_party_size_wo_prisoners, ":player_party_size", "p_main_party"),
      (val_mul, ":player_party_size", 3),
      (val_div, ":player_party_size", 2),
      (gt, ":lord_party_size", ":player_party_size"),
      (neq, "$players_kingdom",  "$g_talk_troop_faction"),
    ], "Are you trying to provoke me? Well, I would have you know that I am under no obligation to duel women, commoners, rebels, or brigands. I could, however, order my men to seize you and horsewhip you. Would you like them to do that?", "lord_respond_to_insult_challenge_battle",
    [
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -15), #cambido chief
      (call_script, "script_change_troop_renown", "trp_player", 8), #cambido chief
  ]],
  
  [anyone,"lord_respond_to_insult", [
    ], "Are you trying to provoke me? Well, I would have you know that I am under no obligation to duel women, commoners, rebels, or brigands. However, in your case, I would be delighted to make an exception. Are you ready for a lesson in deference to your betters, {reg59?girl:varlot}?", "lord_respond_to_insult_challenge_duel",
    [
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -15), #cambido chief
      (call_script, "script_change_troop_renown", "trp_player", 8), #cambido chief
  ]],
  
  [anyone,"lord_respond_to_insult", [
    ], "Are you trying to provoke me? Well, I would have you know that I am under no obligation to duel women, commoners, rebels, or brigands. You are lucky that I am in a good mood, because I am perfectly within my rights to order my men to seize you and horsewhip you. Now begone -- I have had enough of you.", "close_window",
    [
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -15), #cambido chief
      (call_script, "script_change_troop_renown", "trp_player", 8), #cambido chief
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  [anyone|plyr,"lord_respond_to_insult_challenge_battle", [
    ], "I would like to see them try.", "lord_respond_to_insult_challenge_battle_confirm",
    [
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -15), #cambido chief
      (call_script, "script_change_troop_renown", "trp_player", 8), #cambido chief
  ]],
  
  [anyone|plyr,"lord_respond_to_insult_challenge_battle", [
    ], "This is not worth the shedding of blood.", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"lord_respond_to_insult_challenge_battle_confirm", [
    ], "Enough of your insolence! At {reg59?her:him}, lads!", "close_window",
    [
      (assign, "$g_private_battle_with_troop", "$g_talk_troop"),
      (assign, "$cant_leave_encounter", 1),
      (assign, "$encountered_party_friendly", 0),
      (jump_to_menu, "mnu_simple_encounter"),
  ]],
  
  [anyone|plyr,"lord_respond_to_insult_challenge_duel", [
    ], "I am ready to teach you one.", "lord_respond_to_insult_challenge_duel_confirm",
    [
      (str_store_troop_name_link, s13, "$g_talk_troop"),
      (setup_quest_text, "qst_duel_avenge_insult"),
      (str_store_string, s2, "str_you_intend_to_challenge_s13_to_force_him_to_retract_an_insult"),
      
      (call_script, "script_start_quest", "qst_duel_avenge_insult", "$g_talk_troop"),
      (quest_set_slot, "qst_duel_avenge_insult", slot_quest_target_troop, "$g_talk_troop"),
      
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -15),
  ]],
  
  [anyone|plyr,"lord_respond_to_insult_challenge_duel", [
    ], "This is not worth the shedding of blood.", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  [anyone,"lord_respond_to_insult_challenge_duel_confirm", [
    ], "So be it. Defend yourself!", "close_window",
    [
      (call_script, "script_set_up_duel_with_troop", "$g_talk_troop"),
  ]],
  
  
  
  [anyone,"lord_quarrel_intervention_1", [
      
      (str_store_string, s14, "str_general_quarrel"),
      (assign, "$temp", "$g_other_lord"),
      
      (assign, ":specific_quarrel_found", 0),
      (store_add, ":log_entries_plus_one", "$num_log_entries", 1),
      (try_for_range, ":log_entry_no", 1, ":log_entries_plus_one"),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_ruler_intervenes_in_quarrel),
        (troop_slot_eq, "trp_log_array_troop_object", ":log_entry_no", "$temp"),
        (troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$g_talk_troop"),
        (troop_slot_eq, "trp_log_array_faction_object", ":log_entry_no", "$g_talk_troop_faction"),
        
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s14, reg0),
        (assign, ":specific_quarrel_found", 1),
      (else_try),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lord_protests_marshal_appointment),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
        (troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$temp"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s14, reg0),
        (assign, ":specific_quarrel_found", 1),
      (else_try),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lord_blames_defeat),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
        (troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$temp"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s14, reg0),
        (assign, ":specific_quarrel_found", 1),
      (else_try),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_troop_feels_cheated_by_troop_over_land),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
        (troop_slot_eq, "trp_log_array_troop_object", ":log_entry_no",  "$temp"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s14, reg0),
        (assign, ":specific_quarrel_found", 1),
      (else_try),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lords_quarrel_over_woman),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
        (troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$temp"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s14, reg0),
        (assign, ":specific_quarrel_found", 1),
      (else_try),
        (troop_slot_eq, "trp_log_array_entry_type",  ":log_entry_no", logent_lords_quarrel_over_woman),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$temp"),
        (troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$g_talk_troop"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s14, reg0),
        (assign, ":specific_quarrel_found", 1),
      (try_end),
      
      (try_begin),
        (eq, ":specific_quarrel_found", 0),
        (call_script, "script_troop_describes_quarrel_with_troop_to_s14", "$g_talk_troop", "$temp"),
      (try_end),
      
    ],
    "{!}{s14}", "lord_quarrel_intervention_2",
    []],
  
  
  [anyone|plyr,"lord_quarrel_intervention_2",[],
    "Ah, well. It sounds like you're in the right, then.", "lord_quarrel_intervention_3a",
    [
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_other_lord", -20),
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 10),
      (try_begin),
        (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
        (call_script, "script_add_log_entry", logent_ruler_intervenes_in_quarrel, "trp_player",  "$g_other_lord", "$g_talk_troop", "fac_player_supporters_faction"),
      (try_end),
      (call_script, "script_end_quest", "qst_resolve_dispute"),
      
  ]],
  
  [anyone|plyr,"lord_quarrel_intervention_2",[
      (faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
    ],
    "Whatever your differences, I want you to settle them.", "lord_quarrel_intervention_3b",
    []],
  
  [anyone|plyr,"lord_quarrel_intervention_2",[
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
    ],
    "Could you not be convinced to settle your differences?", "lord_quarrel_intervention_3b",
    []],
  
  
  [anyone|plyr,"lord_quarrel_intervention_2",[],
    "On second thought, I want nothing to do with this.", "lord_pretalk",
    [
      (call_script, "script_abort_quest", "qst_resolve_dispute", 1),
      
  ]],
  
  [anyone,"lord_quarrel_intervention_3a", [
    ], "I'm glad that you think so.", "lord_pretalk",
    []],
  
  [anyone,"lord_quarrel_intervention_3b", [
      (store_random_in_range, ":random", 0, 21),
      (le, ":random", "$g_talk_troop_effective_relation"),
      (str_store_troop_name, s11, "$g_other_lord"),
      
    ], "For the sake of our friendship, I defer to your judgment. I will try to make amends with {s11}.", "lord_quarrel_intervention_4",
    [
      (try_begin),
        (quest_slot_eq, "qst_resolve_dispute", slot_quest_target_troop, "$g_talk_troop"),
        (quest_set_slot, "qst_resolve_dispute", slot_quest_target_state, 1),
      (else_try),
        (quest_slot_eq, "qst_resolve_dispute", slot_quest_object_troop, "$g_talk_troop"),
        (quest_set_slot, "qst_resolve_dispute", slot_quest_object_state, 1),
      (try_end),
  ]],
  
  [anyone,"lord_quarrel_intervention_3b", [
      #fails reconciliation test
      (str_store_troop_name, s11, "$g_other_lord"),
    ], "I will not reconcile with {s11}. I know my rights.", "lord_pretalk",
    [
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -15),
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_other_lord", 10),
      (try_begin),
        (eq, "$players_kingdom", "fac_player_supporters_faction"),
        (call_script, "script_add_log_entry", logent_ruler_intervenes_in_quarrel, "trp_player",  "$g_talk_troop", "$g_other_lord", "fac_player_supporters_faction"),
      (try_end),
      (call_script, "script_end_quest", "qst_resolve_dispute"),
  ]],
  
  [anyone,"lord_quarrel_intervention_4", [
      (quest_slot_eq, "qst_resolve_dispute", slot_quest_object_state, 1),
      (quest_slot_eq, "qst_resolve_dispute", slot_quest_target_state, 1),
    ], "Let it be as though our quarrel never occurred.", "lord_pretalk",
    [
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "$g_other_lord", 20),
      (call_script, "script_succeed_quest", "qst_resolve_dispute"),
      (call_script, "script_end_quest", "qst_resolve_dispute"),
      (call_script, "script_change_player_honor", 3),
      (call_script, "script_change_troop_renown", "trp_player",  25),
      (add_xp_as_reward, 1000),
      
  ]],
  
  [anyone,"lord_quarrel_intervention_4", [
      (str_store_troop_name, s11, "$g_other_lord"),
    ], "I suppose that you should speak to {s11}, and see if he will do the same for me.", "lord_pretalk",
    [
  ]],
  
  
  [anyone,"lord_internal_politics_cur_stance", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_stance_on_faction_issue, "trp_player"),
    ],
    "I had already made up my mind to support you.", "lord_internal_politics_cur_stance_plyr_response",
    [
  ]],
  
  
  
  [anyone,"lord_internal_politics_cur_stance", [
      (call_script, "script_npc_decision_checklist_take_stand_on_issue", "$g_talk_troop"),
      (eq, reg0, -1),
    ],
    "I am unable to decide at this time", "lord_internal_politics_cur_stance_plyr_response",
    [
  ]],
  
  
  [anyone,"lord_internal_politics_cur_stance", [
    ],
    "I support {s15}. {s10}", "lord_internal_politics_cur_stance_plyr_response",
    [
      (call_script, "script_npc_decision_checklist_take_stand_on_issue", "$g_talk_troop"),
      (assign, ":supported_candidate", reg0),
      (assign, ":explainer_string", reg1),
      (troop_set_slot, "$g_talk_troop", slot_troop_stance_on_faction_issue, ":supported_candidate"),
      
      (str_store_string, s10, ":explainer_string"),
      (try_begin),
        (eq, ":supported_candidate", "$g_talk_troop"),
        (str_clear, s10),
      (try_end),
      (call_script, "script_troop_describes_troop_to_s15", "$g_talk_troop", ":supported_candidate"),
      
  ]],
  
  [anyone|plyr,"lord_internal_politics_cur_stance_plyr_response", [
      (troop_slot_eq, "trp_player", slot_troop_stance_on_faction_issue, -1),
      (eq, "$player_has_homage", 1),
    ],
    "Let me tell you whom I support...", "lord_internal_politics_plyr_choose_candidate",
    [
      
  ]],
  
  [anyone|plyr,"lord_internal_politics_cur_stance_plyr_response", [
      (eq, "$cheat_mode", 1),
      (eq, "$player_has_homage", 1),
    ],
    "CHEAT -- Reset support", "lord_internal_politics_cur_stance_plyr_response",
    [
      (troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
  ]],
  
  
  [anyone,"lord_internal_politics_plyr_choose_candidate", [
    ],
    "Whom do you support?", "lord_internal_politics_plyr_choose_candidate_select",
    [
  ]],
  
  [anyone|plyr,"lord_internal_politics_plyr_choose_candidate_select", [
    ],
    "I would like to nominate myself for that honor", "lord_internal_politics_pretalk",
    [
      (troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, "trp_player"),
  ]],
  
  [anyone|plyr,"lord_internal_politics_plyr_choose_candidate_select", [
      (troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
      (neq, ":spouse", "$g_talk_troop"),
      
      (is_between, ":spouse", active_npcs_begin, active_npcs_end),
      (troop_slot_eq, ":spouse", slot_troop_occupation, slto_kingdom_hero),
      (store_faction_of_troop, ":spouse_faction", ":spouse"),
      (eq, ":spouse_faction", "$players_kingdom"),
      (str_store_troop_name, s4, ":spouse"),
      
    ],
    "I support my husband, {s4}", "lord_internal_politics_pretalk",
    [
      (troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
      
      (troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, ":spouse"),
  ]],
  
  [anyone|plyr,"lord_internal_politics_plyr_choose_candidate_select", [
      (str_store_troop_name, s4, "$g_talk_troop"),
    ],
    "I would support you, {s4}", "lord_internal_politics_support_acknowledge",
    [
  ]],
  
  [anyone|plyr,"lord_internal_politics_plyr_choose_candidate_select", [
      
      (troop_get_slot, ":talk_troop_choice", "$g_talk_troop", slot_troop_stance_on_faction_issue),
      (is_between, ":talk_troop_choice", active_npcs_begin, active_npcs_end),
      (str_store_troop_name, s4, ":talk_troop_choice"),
      (neq, ":talk_troop_choice", "$g_talk_troop"),
    ],
    "I would support your choice, {s4}", "lord_internal_politics_support_same_acknowledge",
    [
  ]],
  
  [anyone|plyr,"lord_internal_politics_plyr_choose_candidate_select", [
    ],
    "Never mind", "lord_pretalk",
    [
  ]],
  
  
  
  [anyone,"lord_internal_politics_support_acknowledge", [
      (troop_get_slot, ":supported_candidate", "$g_talk_troop", slot_troop_stance_on_faction_issue),
      (neq, "$g_talk_troop", ":supported_candidate"),
      
    ],
    "That is most gracious of you, but I do not seek the honor, and I decline your support.", "lord_pretalk",
    [
      (troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
  ]],
  
  
  [anyone,"lord_internal_politics_support_acknowledge", [
      (lt, "$g_talk_troop_effective_relation", -5),
    ],
    "I do not trust you, and I do not need your support.", "lord_pretalk",
    [
      (troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
  ]],
  
  [anyone,"lord_internal_politics_support_acknowledge", [
    ],
    "That is most gracious of you", "lord_pretalk",
    [
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 3),
      (troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, "$g_talk_troop"),
  ]],
  
  
  
  [anyone,"lord_internal_politics_support_same_acknowledge", [
      (lt, "$g_talk_troop_effective_relation", -5),
    ],
    "You may tell him that yourself. I do not trust you, and I will have no part in any game that you are playing.", "lord_pretalk",
    [
      (troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
  ]],
  
  [anyone,"lord_internal_politics_support_same_acknowledge", [
      (troop_get_slot, ":talk_troop_choice", "$g_talk_troop", slot_troop_stance_on_faction_issue),
      (call_script, "script_troop_get_relation_with_troop", "trp_player", ":talk_troop_choice"),
      (lt, reg0,  -5),
      (str_store_troop_name, s4, ":talk_troop_choice"),
    ],
    "Given your relation with {s4}, I do not think that he would welcome your support.", "lord_pretalk",
    [
      (troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
  ]],
  
  [anyone,"lord_internal_politics_support_same_acknowledge", [
      (troop_get_slot, ":talk_troop_choice", "$g_talk_troop", slot_troop_stance_on_faction_issue),
      (str_store_troop_name, s4, ":talk_troop_choice"),
    ],
    "I will tell {s4}. He will no doubt be grateful for your support.", "lord_pretalk",
    [
      (troop_get_slot, ":talk_troop_choice", "$g_talk_troop", slot_troop_stance_on_faction_issue),
      (call_script, "script_troop_change_relation_with_troop", "trp_player", ":talk_troop_choice", 2),
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 1),
      (troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, ":talk_troop_choice"),
      
  ]],
  
  
  
  
  # [anyone|plyr|repeat_for_troops,"lord_internal_politics_plyr_choose_candidate_select", [
      # (store_repeat_object, ":candidate"),
      # (eq, 1, 0),
      # (troop_slot_eq, ":candidate", slot_troop_occupation, slto_kingdom_hero),
      # (store_faction_of_troop, ":candidate_faction", ":candidate"),
      # (eq, ":candidate_faction", "$players_kingdom"),
      # (neg|troop_slot_eq, "trp_player", slot_troop_spouse, ":candidate"),
      # (str_store_troop_name, s4, ":candidate"),
    # ],
    # "I support {s4}", "lord_internal_politics_pretalk",
    # [
      # (store_repeat_object, ":candidate"),
      # (troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, ":candidate"),
  # ]],
  
  
  [anyone,"lord_internal_politics_pretalk", [
    ],
    "Ah. Most interesting.", "lord_internal_politics_cur_stance_plyr_response",
    [
  ]],
  
  
  
  [anyone|plyr,"lord_internal_politics_cur_stance_plyr_response", [
      (eq, "$player_has_homage" ,1),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_stance_on_faction_issue, "$g_talk_troop"),
      (neg|troop_slot_ge, "trp_player", slot_troop_stance_on_faction_issue, active_npcs_begin),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_stance_on_faction_issue, "trp_player"),
    ],
    "Can I convince you to support me instead?", "lord_internal_politics_plyr_request_support",
    [
  ]],
  
  [anyone|plyr,"lord_internal_politics_cur_stance_plyr_response", [
    ],
    "Anyway, enough of politics for the time being.", "lord_pretalk",
    [
  ]],
  
  
  [anyone,"lord_internal_politics_plyr_request_support", [
      (troop_slot_ge, "trp_player", slot_troop_controversy, 25),
      (this_or_next|faction_slot_eq, "$players_kingdom", slot_faction_political_issue, 1),
      (troop_slot_ge, "trp_player", slot_troop_controversy, 50),
    ],
    "You have engendered too much controversy to be a viable candidate right now. I would advise you to wait a little while before seeking any further honors for yourself.", "lord_pretalk",
    [
  ]],
  
  [anyone,"lord_internal_politics_plyr_request_support", [
      (troop_get_slot, ":current_candidate", "$g_talk_troop", slot_troop_stance_on_faction_issue),
      (gt, ":current_candidate", 0),
      (str_store_troop_name, s4, ":current_candidate"),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":current_candidate"),
      (ge, reg0, "$g_talk_troop_effective_relation"),
    ],
    "I am sorry. I would not wish to strain my relationship with {s4}", "lord_pretalk",
    [
  ]],
  
  [anyone,"lord_internal_politics_plyr_request_support", [
      (faction_get_slot, ":faction_issue", "$players_kingdom", slot_faction_political_issue),
      (is_between, ":faction_issue", centers_begin, centers_end),
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (assign, ":total_faction_renown", ":player_renown"),
      
      (try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
        (store_faction_of_troop, ":active_npc_faction", ":active_npc"),
        (eq, ":active_npc_faction", "$players_kingdom"),
        
        (troop_get_slot, ":renown", ":active_npc", slot_troop_renown),
        (val_add, ":total_faction_renown", ":renown"),
      (try_end),
      
      (assign, ":total_faction_center_value", 0),
      (assign, ":center_points_held_by_player", 0),
      (try_for_range, ":center", centers_begin, centers_end),
        (store_faction_of_party, ":center_faction", ":center"),
        (eq, ":center_faction", "$players_kingdom"),
        
        (assign, ":center_value", 1),
        (try_begin),
          (is_between, ":center", towns_begin, towns_end),
          (assign, ":center_value", 2),
        (try_end),
        
        (val_add, ":total_faction_center_value", ":center_value"),
        
        (party_slot_eq, ":center", slot_town_lord, "trp_player"),
        (val_add, ":center_points_held_by_player", ":center_value"),
      (try_end),
      (val_max, ":total_faction_center_value", 1),
      (val_max, ":center_points_held_by_player", 1),
      
      (store_div, ":average_renown_per_center_point", ":total_faction_renown", ":total_faction_center_value"),
      (store_div, ":player_renown_per_center_point", ":player_renown", ":center_points_held_by_player"),
      
      (store_mul, ":threshhold", ":average_renown_per_center_point", 3),
      (val_div, ":threshhold", 4),
      (lt, ":player_renown_per_center_point", ":threshhold"),
      
    ],
    "You have already been well rewarded with fiefs appropriate to your accomplishments, I would say.", "lord_pretalk",
    [
  ]],
  
  [anyone,"lord_internal_politics_plyr_request_support", [
      (faction_slot_eq, "$players_kingdom", slot_faction_political_issue, 1),
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (lt, ":player_renown", 400),
    ],
    "I think you would need to prove yourself further before you are eligible for that position.", "lord_pretalk",
    [
  ]],
  
  #You already have too many holdings
  [anyone,"lord_internal_politics_plyr_request_support", [
      (lt, "$g_talk_troop_effective_relation", 10),
    ],
    "Hmm... That is too much to ask, given the state of our relationship. ", "lord_pretalk",
    [
  ]],
  
  [anyone,"lord_internal_politics_plyr_request_support", [
    ],
    "I would support you with pleasure. ", "lord_pretalk",
    [
      (troop_set_slot, "$g_talk_troop", slot_troop_stance_on_faction_issue, "trp_player"),
  ]],
  
  [anyone,"lord_internal_politics_plyr_request_support", [
    ],
    "{!}[Placeholder - sorry, not yet]", "lord_pretalk",
    [
  ]],
  
  [anyone,"lord_recruit_1_relation", [
      (troop_slot_ge, "$g_talk_troop", slot_troop_intrigue_impatience, 100),
    ],
    "I am a bit weary of talking politics. Perhaps at a later date", "lord_pretalk",
    [
      (troop_get_slot, reg3, "$g_talk_troop", slot_troop_intrigue_impatience),
      (try_begin),
        (eq, "$cheat_mode", 1),
        (display_message, "str_intrigue_impatience=_reg3_must_be_less_than_100"),
      (try_end),
      (val_or, "$option_switches", lord_option_private),
  ]],
  
  #lord proximity
  [anyone,"lord_recruit_1_relation", [ #can't use the nearby scripts, because it would include the player party
      (assign, ":continue", 1),
      (try_begin),
        (call_script, "script_cf_troop_can_intrigue", "$g_talk_troop", 1),
        (assign, ":continue", 0),
      (try_end),
      
      (eq, ":continue", 1),
      
      (str_store_string, s12, "str_youll_have_to_speak_to_me_at_some_other_time_then"),
      (try_begin),
        (lt,"$g_encountered_party_relation",0),
        (encountered_party_is_attacker),
        (str_store_string, s12, "str_this_is_no_time_for_words"),
      (try_end),
      (try_begin),
        (eq, "$cheat_mode", 1),
        (display_message, "str_lord_not_alone"),
      (try_end),
    ],
    "{!}{s12}", "lord_pretalk",[(val_or, "$option_switches", lord_option_private)]],
  
  
  
  [anyone,"lord_recruit_1_relation", [
      
      (is_between, "$supported_pretender", pretenders_begin, pretenders_end),
      (troop_slot_eq, "$supported_pretender", slot_troop_original_faction, "$g_talk_troop_faction"),
      (troop_get_type, reg3, "$supported_pretender"),
      (val_mod, reg3, 2),
      (str_store_troop_name, s16, "$supported_pretender"),
      (eq, "$skip_lord_assumes_argument", 0),
      
    ],
    "You have raised the standard of rebellion on behalf of {s16}. Have you come to plead {reg3?her:his} case?", "lord_recruit_pretender",[
      (val_or, "$option_switches", lord_option_private),
  ]],
  
  [anyone|plyr,"lord_recruit_pretender", [
    ],
    "I have.", "lord_recruit_3_dilemma_1",[
      (troop_set_slot, "$g_talk_troop", slot_lord_recruitment_candidate, "$supported_pretender"),
  ]],
  
  [anyone|plyr,"lord_recruit_pretender", [
    ],
    "No, that's not it. There's another issue I wish to discuss.", "lord_recruit_1_relation",[
      (assign, "$skip_lord_assumes_argument", 1),
  ]],
  
  
  
  
  
  #relation
  [anyone,"lord_recruit_1_relation",
    [
      (try_begin),
        (troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
        
        (assign, ":willingness_to_intrigue", 20),
        
        (str_store_string, s13, "str_of_course_my_wife"),
        (str_store_string, s14, "str_perhaps_not_our_marriage_has_become_a_bit_strained_dont_you_think"),
        (str_store_string, s15, "str_why_is_that_my_wife_actually_our_marriage_has_become_such_that_i_prefer_to_have_a_witness_for_all_of_our_converations"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
        
        (assign, ":willingness_to_intrigue", 6),
        
        (str_store_string, s13, "str_all_right_then_what_do_you_have_to_say_out_with_it"),
        (str_store_string, s14, "str_bah__im_in_no_mood_for_whispering_in_the_corner"),
        (str_store_string, s15, "str_bah_i_dont_like_you_that_much_im_not_going_to_go_plot_with_you_in_some_corner"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
        (assign, ":willingness_to_intrigue", 8),
        
        (str_store_string, s13, "str_well__now_what_do_you_have_to_propose"),
        (str_store_string, s14, "str_trying_our_hand_at_intrigue_are_we_i_think_not"),
        (str_store_string, s15, "str_hah_i_trust_you_as_a_i_would_a_serpent_i_think_not"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
        (assign, ":willingness_to_intrigue", -10),
        
        (str_store_string, s13, "str_i_do_not_like_to_conduct_my_business_in_the_shadows_but_sometimes_it_must_be_done_what_do_you_have_to_say"),
        (str_store_string, s14, "str_i_would_prefer_to_conduct_our_affairs_out_in_the_open"),
        (str_store_string, s15, "str_do_not_take_this_amiss_but_with_you_i_would_prefer_to_conduct_our_affairs_out_in_the_open"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
        (assign, ":willingness_to_intrigue", 4),
        
        (str_store_string, s13, "str_hmm_you_have_piqued_my_interest_what_do_you_have_to_say"),
        (str_store_string, s14, "str_em_lets_keep_our_affairs_out_in_the_open_for_the_time_being"),
        (str_store_string, s15, "str_em_lets_keep_our_affairs_out_in_the_open_for_the_time_being"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
        (assign, ":willingness_to_intrigue", 0),
        
        (str_store_string, s13, "str_thats_sensible__the_world_is_full_of_churls_who_poke_their_noses_into_their_betters_business_now_tell_me_what_it_is_that_you_have_to_say"),
        (str_store_string, s14, "str_what_do_you_take_me_for_a_plotter"),
        (str_store_string, s15, "str_hah_i_trust_you_as_a_i_would_a_serpent_i_think_not"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
        (assign, ":willingness_to_intrigue", -10),
        
        (str_store_string, s13, "str_well_i_normally_like_to_keep_things_out_in_the_open_but_im_sure_someone_like_you_would_not_want_to_talk_in_private_unless_heshe_had_a_good_reason_what_is_it"),
        (str_store_string, s14, "str_surely_we_can_discuss_whatever_you_want_to_discuss_out_here_in_the_open_cant_we"),
        (str_store_string, s15, "str_surely_we_can_discuss_whatever_you_want_to_discuss_out_here_in_the_open_cant_we"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
        (assign, ":willingness_to_intrigue", -5),
        
        (str_store_string, s13, "str_im_a_simple__man_not_one_for_intrigue_but_id_guess_that_you_have_something_worthwhile_to_say_what_is_it"),
        (str_store_string, s14, "str_forgive_me_but_im_not_one_for_going_off_in_corners_to_plot"),
        (str_store_string, s15, "str_please_do_not_take_this_amiss_but_i_do_not_trust_you"),
      (else_try),
        (troop_slot_ge, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
        (assign, ":willingness_to_intrigue", 10),
        
        (str_store_string, s13, "str_certainly_playername_what_is_it"),
        (str_store_string, s14, "str_forgive_me_but_id_prefer_to_keep_our_conversations_in_the_open"),
        (str_store_string, s15, "str_please_do_not_take_this_amiss_but_im_not_sure_you_and_i_are_still_on_those_terms"),
      (try_end),
      
      (assign, ":continue", 0),
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      
      (try_begin),
        (lt, "$g_talk_troop_relation", -5),
        (try_begin),
          (eq, "$cheat_mode", 1),
          (display_message, "str_persuasion__relation_less_than_5"),
        (try_end),
        (str_store_string, s12, "str_s15"),
      (else_try),
        (store_add, ":score", ":persuasion", "$g_talk_troop_relation"),
        (val_add, ":score", ":willingness_to_intrigue"),
        
        (options_get_campaign_ai, ":reduce_campaign_ai"), #chief moto
        (try_begin),
          (eq, ":reduce_campaign_ai", 0), #hard
          (val_sub, ":score", 5),
        (else_try),
          (eq, ":reduce_campaign_ai", 1), #medium
        (else_try),
          (eq, ":reduce_campaign_ai", 2), #easy
          (val_add, ":score", 5),
        (try_end),
        
        (lt, ":score", 10),
        
        (str_store_string, s12, "str_s14"),
        (try_begin),
          (eq, "$cheat_mode", 1),
          (display_message, "str_persuasion__2__lord_reputation_modifier__relation_less_than_10"),
        (try_end),
        
        #		(str_store_string, s12, "str_s14"),
      (else_try),
        (str_store_string, s12, "str_s13"),
        (assign, ":continue", 1),
      (try_end),
      
      (eq, ":continue", 0),
    ],
    "{!}{s12}", "lord_pretalk",[(val_or, "$option_switches", lord_option_private)]],
  
  [anyone,"lord_recruit_1_relation", [],
    "{!}{s12}", "lord_recruit_2",[]],
  
  #check for discontent
  
  [anyone|plyr,"lord_recruit_2", [
    ],
    "What do you think, in general terms, about kings, lords, and politics?", "lord_recruit_2_philosophy",[
  ]],
  
  
  
  
  [anyone|plyr,"lord_recruit_2", [
      (neq, "$campaign_type", camp_storyline),
      (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, "trp_player"),
      (neq, "$players_kingdom", "fac_player_supporters_faction"),
      (troop_get_type, ":type", "$g_talk_troop"),
      (val_mod, ":type", 2),
      (eq, ":type", 0),
      (faction_get_slot, ":faction_leader", "$g_encountered_party_faction", slot_faction_leader),
      (str_store_troop_name, s11, ":faction_leader"),
    ],
    "My husband, I believe that you should rethink your allegiance to {s11}", "lord_spouse_leave_faction",[
  ]],
  
  [anyone,"lord_spouse_leave_faction", [
      (faction_get_slot, ":faction_liege", "$g_talk_troop_faction", slot_faction_leader),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":faction_liege"),
      (gt, reg0, 25),
      (str_store_troop_name, s9, ":faction_liege"),
    ],
    "{s9} has always been a good liege to me, but I will hear you out. What do you suggest we do?", "lord_spouse_leave_faction_2",[]],
  
  [anyone,"lord_spouse_leave_faction", [
      (faction_get_slot, ":faction_liege", "$g_talk_troop_faction", slot_faction_leader),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":faction_liege"),
      (gt, reg0, -5),
      (str_store_troop_name, s9, ":faction_liege"),
    ],
    "I see no particular reason to abandon {s9}, but I will heed your advice. What do you suggest we do?", "lord_spouse_leave_faction_2",[]],
  
  [anyone,"lord_spouse_leave_faction", [
      (faction_get_slot, ":faction_liege", "$g_talk_troop_faction", slot_faction_leader),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":faction_liege"),
      (str_store_troop_name, s9, ":faction_liege"),
    ],
    "Yes -- as a liege, {s9} is a great disappointment. What do you suggest we do?", "lord_spouse_leave_faction_2",[]],
  
  
  #  [anyone|plyr,"lord_spouse_leave_faction_2", [
  #  ],
  #   "Perhaps we should find another liege", "lord_spouse_leave_faction_other_liege",[]],
  
  [anyone|plyr,"lord_spouse_leave_faction_2", [
    ],
    "I believe you should be king, my husband!", "lord_spouse_leave_faction_husband_king",[]],
  
  [anyone|plyr,"lord_spouse_leave_faction_2", [
    ],
    "I am the rightful queen of the Northlands", "lord_spouse_leave_faction_proclaim_queen",[]],
  
  [anyone|plyr,"lord_spouse_leave_faction_2", [
    ],
    "Never mind", "lord_pretalk",[]],
  
  [anyone,"lord_spouse_leave_faction_husband_king", [
      (assign, ":lord_has_fortress", 0),
      (try_for_range, ":walled_center", walled_centers_begin, walled_centers_end),
        (this_or_next|party_slot_eq, ":walled_center", slot_town_lord, "trp_player"),
        (party_slot_eq, ":walled_center", slot_town_lord, "$g_talk_troop"),
        (assign, ":lord_has_fortress", 1),
      (try_end),
      (eq, ":lord_has_fortress", 0),
    ],
    "Perhaps someday, my wife -- but before I declare myself king, I should like for one of us to hold a fortress which could serve as our court before we declare ourselves publically.",
    "lord_pretalk",[]],
  
  [anyone,"lord_spouse_leave_faction_proclaim_queen", [
      (assign, ":lord_has_fortress", 0),
      (try_for_range, ":walled_center", walled_centers_begin, walled_centers_end),
        (this_or_next|party_slot_eq, ":walled_center", slot_town_lord, "trp_player"),
        (party_slot_eq, ":walled_center", slot_town_lord, "$g_talk_troop"),
        (assign, ":lord_has_fortress", 1),
      (try_end),
      (eq, ":lord_has_fortress", 0),
    ],
    "While I do not contest your claim, my wife, I should like for one of us to hold a fortress which could serve as our court before we declare ourselves publically.", "lord_pretalk",[]],
  
  
  #Proclaim yourself queen
  [anyone,"lord_spouse_leave_faction_proclaim_queen", [
      (assign, ":player_has_enough_right", 0),
      (try_begin),
        (le, "$player_right_to_rule", 5),
        (str_store_string, s11, "str_really_well_this_is_the_first_i_have_heard_of_it_unless_you_build_up_support_for_that_claim_you_may_find_it_difficult_to_find_allies_however_whenever_you_see_fit_to_declare_yourself_publically_as_queen_i_should_be_honored_to_be_your_consort"),
        (assign, "$player_right_to_rule", 5),
      (else_try),
        (lt, "$player_right_to_rule", 20),
        (str_store_string, s11, "str_yes_i_have_heard_such_talk_while_it_is_good_that_you_are_building_up_your_support_i_do_not_think_that_you_are_quite_ready_to_proclaim_yourself_yet_however_i_will_let_you_be_the_judge_of_that_and_when_you_decide_i_should_be_honored_to_be_your_consort"),
      (else_try),
        (str_store_string, s11, "str_yes_and_many_others_in_calradia_think_so_as_well_perhaps_it_is_time_that_you_declared_yourself_and_we_shall_ride_forth_together_to_claim_your_throne_i_should_be_honored_to_be_your_consort"),
        (assign, ":player_has_enough_right", 1),
      (try_end),
      (eq, ":player_has_enough_right", 1),
    ],
    "{!}{s11}", "lord_spouse_leave_faction_proclaim_queen_confirm",[]],
  
  [anyone,"lord_spouse_leave_faction_proclaim_queen", [
    ],
    "{!}{s11}", "lord_pretalk",[]],
  
  [anyone|plyr,"lord_spouse_leave_faction_proclaim_queen_confirm", [
    ],
    "I am ready now, my husband. Let us go forth to seek our throne.", "close_window",[
      (call_script, "script_activate_player_faction", "trp_player"),
      (call_script, "script_change_troop_faction", "$g_talk_troop", "fac_player_supporters_faction"),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone|plyr,"lord_spouse_leave_faction_proclaim_queen_confirm", [
    ],
    "Perhaps I am not yet ready.", "lord_pretalk",[]],
  
  
  
  
  #Declare husband as pretender
  [anyone,"lord_spouse_leave_faction_husband_king", [
      (eq, "$players_kingdom", "fac_player_supporters_faction"),
      (gt, "$supported_pretender", 0),
      (str_store_troop_name, s4, "$supported_pretender"),
    ],
    "Perhaps, but I would need your full support to press that claim. You would want to resolve {s4}'s rebellion before pushing this any further.", "lord_pretalk",[]],
  
  [anyone,"lord_spouse_leave_faction_husband_king", [
      (faction_get_slot, ":talk_troop_liege", "$g_talk_troop_faction", slot_faction_leader),
      (str_store_troop_name, s4, ":talk_troop_liege"),
    ],
    "Most of the great families of this land have a claim to the throne... Given the recent issues with the succession, I should be as legitimate a king as {s4}. ", "lord_spouse_leave_faction_husband_king_2",[]],
  
  [anyone,"lord_spouse_leave_faction_husband_king_2", [
    ],
    "While king, I will defer to your judgment in the appointment of ministers, the conduct of diplomacy, and other such matters.", "lord_spouse_leave_faction_husband_king_3",[]],
  
  [anyone|plyr,"lord_spouse_leave_faction_husband_king_3", [
    ],
    "Very well, my husband. Let us ride forth to press your claim! ", "close_window",[
      (call_script, "script_change_troop_faction", "$g_talk_troop", "fac_player_supporters_faction"),
      (call_script, "script_activate_player_faction", "$g_talk_troop"),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone|plyr,"lord_spouse_leave_faction_husband_king_3", [
    ],
    "Actually, let us bide out time for a bit.", "lord_pretalk",[
  ]],
  
  
  [anyone,"lord_recruit_2_philosophy", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_political_philosophy_default"),
    ],
    "{s43} Did you wish to speak of anything else?", "lord_recruit_2",[]],
  
  [anyone|plyr,"lord_recruit_2", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_recruitment_random, 0),
      (faction_get_slot, ":leader", "$g_talk_troop_faction", slot_faction_leader),
      (neq, "$g_talk_troop", ":leader"),
      (neq, "trp_player", ":leader"),
      (neq, "$g_talk_troop_faction", "fac_adventurers"),
      (str_store_troop_name, s15, ":leader"),
    ],
    "How do you feel about {s15}?", "lord_recruit_2_discontent",[
  ]],
  
  [anyone|plyr,"lord_recruit_2", [
      #(troop_slot_ge, "$g_talk_troop", slot_troop_recruitment_candidate, 1),
      (troop_slot_ge, "$g_talk_troop", slot_lord_recruitment_argument, 1),
      (neq, "$g_talk_troop_faction", "$players_kingdom"),
      (neq, "$g_talk_troop_faction", "fac_adventurers"),
    ],
    "Do you remember what I had told you earlier?", "lord_recruit_3_a",[
  ]],
  
  [anyone|plyr|repeat_for_troops,"lord_recruit_2", [
      (store_repeat_object, ":troop_no"),
      (is_between, ":troop_no", active_npcs_begin, active_npcs_end),
      (store_faction_of_troop, ":faction", ":troop_no"),
      (eq, ":faction", "$g_talk_troop_faction"),
      (neq, "$g_talk_troop_faction", "fac_adventurers"),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, ":troop_no"), #yields wrong string
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":troop_no"),
      (lt, reg0, -9),
      (str_store_troop_name, s16, ":troop_no"),
    ],
    "I have heard that you have quarreled with {s16}", "lord_recruit_quarrel_describe",[
      (store_repeat_object, "$temp"),
  ]],
  
  [anyone,"lord_recruit_quarrel_describe",
    [
      (assign, ":specific_quarrel_found", 0),
      (store_add, ":log_entries_plus_one", "$num_log_entries", 1),
      (try_for_range, ":log_entry_no", 1, ":log_entries_plus_one"),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_ruler_intervenes_in_quarrel),
        (troop_slot_eq, "trp_log_array_troop_object", ":log_entry_no", "$temp"),
        (troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$g_talk_troop"),
        (troop_slot_eq, "trp_log_array_faction_object", ":log_entry_no", "$g_talk_troop_faction"),
        
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s14, reg0),
        (assign, ":specific_quarrel_found", 1),
      (else_try),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lord_protests_marshal_appointment),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
        (troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$temp"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s14, reg0),
        (assign, ":specific_quarrel_found", 1),
      (else_try),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lord_blames_defeat),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
        (troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$temp"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s14, reg0),
        (assign, ":specific_quarrel_found", 1),
      (else_try),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_troop_feels_cheated_by_troop_over_land),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
        (troop_slot_eq, "trp_log_array_troop_object", ":log_entry_no",  "$temp"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s14, reg0),
        (assign, ":specific_quarrel_found", 1),
      (else_try),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lords_quarrel_over_woman),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
        (troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$temp"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s14, reg0),
        (assign, ":specific_quarrel_found", 1),
      (else_try),
        (troop_slot_eq, "trp_log_array_entry_type",  ":log_entry_no", logent_lords_quarrel_over_woman),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$temp"),
        (troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$g_talk_troop"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s14, reg0),
        (assign, ":specific_quarrel_found", 1),
      (try_end),
      
      (try_begin),
        (eq, ":specific_quarrel_found", 0),
        (call_script, "script_troop_describes_quarrel_with_troop_to_s14", "$g_talk_troop", "$temp"),
      (try_end),
      
      (call_script, "script_add_rumor_string_to_troop_notes", "$g_talk_troop", "$temp", 14),
    ],
    "It is no secret. {s14}", "lord_recruit_2",[
  ]],
  
  [anyone|plyr,"lord_recruit_2", [
    ],
    "Never mind", "lord_pretalk",[]],
  
  [anyone,"lord_recruit_2_discontent", [
      (neq, "$g_talk_troop_faction", "fac_adventurers"),
      (faction_get_slot, ":leader", "$g_talk_troop_faction", slot_faction_leader),
      
      (call_script, "script_calculate_troop_political_factors_for_liege", "$g_talk_troop", ":leader"),
      (assign, ":result_for_political", reg3),
      
      (try_begin),
        (eq, "$cheat_mode", 1),
        (display_message, "@{!}DEBUG : result_for_political is {reg3}"),
      (try_end),
      
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":leader"),
      (assign, ":liege_relation", reg0),
      
      (str_store_troop_name, s15, ":leader"),
      (troop_get_type, reg15, ":leader"),
      (val_mod, reg15, 2),
      
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
        (assign, ":intrigue_willingness", -5),
        (str_store_string, s12, "str_i_am_disturbed_about_my_lord_s15s_choice_of_companions"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
        (assign, ":intrigue_willingness", -1),
        (str_store_string, s12, "str_well_ill_be_honest_i_feel_that_sometimes_s15_overlooks_my_rights_and_extends_his_protection_to_the_unworthy"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
        (assign, ":intrigue_willingness", 5),
        (str_store_string, s12, "str_heh_one_thing_that_ill_say_about_s15_is_that_he_has_a_ripe_batch_of_bastards_in_his_court"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
        (assign, ":intrigue_willingness", -4),
        (str_store_string, s12, "str_well_sometimes_i_have_to_say_that_i_question_s15s_judgment_regarding_those_who_he_keeps_in_his_court"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
        (assign, ":intrigue_willingness", 1),
        (str_store_string, s12, "str_s15_is_a_weak_man_who_too_easily_lends_his_ear_to_evil_council_and_gives_his_protection_to_some_who_have_done_me_wrong"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
        (assign, ":intrigue_willingness", 3),
        (str_store_string, s12, "str_i_will_confess_that_sometimes_i_worry_about_s15s_judgment_particularly_in_the_matter_of_the_counsel_that_he_keeps"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
        (assign, ":intrigue_willingness", 5),
        (str_store_string, s12, "str_what_do_i_think_i_think_that_s15_is_a_vile_pretender_a_friend_to_the_flatterer_and_the_hypocrite"),
      (else_try),
        (troop_slot_ge, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
        (assign, ":intrigue_willingness", 5),
        (str_store_string, s12, "str_well_s15_is_not_like_you_ill_say_that_much"),
      (try_end),
      
      #is there a specific quarrel?
      (store_add, ":log_entries_plus_one", "$num_log_entries", 1),
      (try_for_range, ":log_entry_no", 1, ":log_entries_plus_one"),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_ruler_intervenes_in_quarrel),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", ":leader"),
        (troop_slot_eq, "trp_log_array_center_object", ":log_entry_no", "$g_talk_troop"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s12, reg0),
      (else_try),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lord_protests_marshal_appointment),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
        (troop_slot_eq, "trp_log_array_troop_object", ":log_entry_no",  ":leader"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s12, reg0),
      (else_try),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_lord_blames_defeat),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
        (troop_slot_eq, "trp_log_array_troop_object", ":log_entry_no", ":leader"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s12, reg0),
      (else_try),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_troop_feels_cheated_by_troop_over_land),
        (troop_slot_eq, "trp_log_array_actor", ":log_entry_no", "$g_talk_troop"),
        (troop_slot_eq, "trp_log_array_faction_object", ":log_entry_no", "$g_talk_troop_faction"),
        (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"),
        (str_store_string, s12, reg0),
      (try_end),
      
      (val_mul, ":intrigue_willingness", 2), #-10 to 10
      
      (assign, "$lord_might_open_up", 0),
      (try_begin),
        (gt, ":result_for_political", 12),
        (gt, ":liege_relation", 0),
        (str_store_string, s12, "str_s15_long_may_he_live"),
      (else_try),
        (ge, ":result_for_political", ":intrigue_willingness"),
        (str_store_string, s12, "str_he_is_my_liege_that_is_all_that_i_will_say_on_this_matter"),
        (assign, "$lord_might_open_up", 1),
      (try_end),
      
      (lt, ":result_for_political", ":intrigue_willingness"),
      
      (call_script, "script_add_rumor_string_to_troop_notes", "$g_talk_troop", ":leader", 12),
    ],
    "{!}{s12}", "lord_recruit_2_discontent_b",[
  ]],
  
  [anyone, "lord_recruit_2_discontent", [
    ],
    "{!}{s12}", "lord_recruit_hesitant", []],
  
  [anyone, "lord_recruit_2_discontent_b", [  ],
    "Sometimes, I do worry about the state of the realm.", "lord_recruit_3", []],
  
  [anyone|plyr,"lord_recruit_hesitant",
    [
      (eq, "$lord_might_open_up", 1),
    ],
    "Can't I persuade you to say a little more?", "lord_recruit_hesitant_persuade",[
  ]],
  
  [anyone|plyr,"lord_recruit_hesitant", [],
    "Ah. Very good.", "lord_pretalk", []],
  
  [anyone, "lord_recruit_hesitant_persuade",
    [ (neq, "$g_talk_troop_faction", "fac_adventurers"),
      (faction_get_slot, ":leader", "$g_talk_troop_faction", slot_faction_leader),
      (call_script, "script_calculate_troop_political_factors_for_liege", "$g_talk_troop", ":leader"),
      (assign, ":result_for_political", reg3),
      (store_sub, ":open_up_desire", 12, ":result_for_political"),
      (assign, reg3, ":open_up_desire"),
      (val_div, ":open_up_desire", 3),
      
      #(store_random_in_range, ":random", -2, ":max_random_value"),
      (store_sub, ":max_random_value", 14, ":open_up_desire"),
      (troop_get_slot, ":temp_ai_seed", "$g_talk_troop", slot_troop_temp_decision_seed),
      (store_mod, ":random", ":temp_ai_seed", ":max_random_value"),
      (val_sub, ":random", 2), #random changes between -2 to (14 - (":result_for_political" div 3))
      
      #(val_sub, ":random", 20), #open this line when you want to 100% pass this step and remove again after making tests.
      (store_skill_level, ":persuasion_skill", "skl_persuasion", "trp_player"),
      (lt, ":random", ":persuasion_skill"),
    ],
    "If you put it that way, I admit that I do sometimes worry about the state of the realm.", "lord_recruit_3", []],
  
  [anyone, "lord_recruit_hesitant_persuade", [
      (troop_set_slot, "$g_talk_troop", slot_troop_intrigue_impatience, 100),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -1),
    ],
    "You try my patience. I said that I have nothing to say.", "lord_pretalk", []],
  
  [anyone|plyr,"lord_recruit_3", [
    ],
    "Well, I have something to tell you.", "lord_recruit_3_a",[
  ]],
  
  [anyone|plyr,"lord_recruit_3", [
    ],
    "Well, that's interesting to know. But enough about politics.", "lord_pretalk",[
  ]],
  
  
  [anyone, "lord_recruit_3_a", [
      (troop_slot_ge, "$g_talk_troop", slot_lord_recruitment_argument, 1),
      
      (troop_get_slot, ":candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
      (str_store_troop_name, s14, ":candidate"),
      
      (try_begin),
        (eq, ":candidate", "trp_player"),
        (str_store_string, s14, "@you"),
      (try_end),
      
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_claim),
        (eq, ":candidate", "trp_player"),
        (str_store_string, s12, "str_that_you_are_the_rightful_heir_to_the_throne_of_calradia"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_claim),
        (str_store_troop_name, s14, ":candidate"),
        (str_store_string, s12, "str_that_s14_is_the_rightful_ruler_of_calradia"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_ruler),
        (str_store_string, s12, "str_that_s14_will_rule_this_land_justly"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_lords),
        (str_store_string, s12, "str_that_s14_will_protect_our_rights_as_nobles"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_victory),
        (str_store_string, s12, "str_that_s14_will_unify_this_land_and_end_this_war"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_benefit),
        (str_store_string, s12, "str_that_s14_will_reward_me_with_a_fief"),
      (try_end),
    ],
    "{!}{s12}", "lord_recruit_3_reset_claim", []],
  
  
  [anyone|plyr, "lord_recruit_3_reset_claim", [  ],
    "Yes, that's it.", "lord_recruit_3_claim", [
      
  ]],
  
  [anyone|plyr, "lord_recruit_3_reset_claim", [  ],
    "Let me phrase that a little differently.", "lord_recruit_3_a_reset", []],
  
  
  [anyone, "lord_recruit_3_a",
    [
      #(display_message, "str_prior_arguments"),
      #(assign, reg3, "$claim_arguments_made"),
      #(display_message, "str_legal_reg3"),
      
      #(assign, reg3, "$ruler_arguments_made"),
      #(display_message, "str_just_king_reg3"),
      
      #(assign, reg3, "$victory_arguments_made"),
      #(display_message, "str_bring_peace_reg3"),
      
      #(assign, reg3, "$lords_arguments_made"),
      #(display_message, "str_only_best_counsel_reg3"),
      
      #(assign, reg3, "$benefit_arguments_made"),
      #(display_message, "str_reward_lords_reg3"),
    ],
    "Yes?", "lord_recruit_3_b", []],
  
  [anyone, "lord_recruit_3_a_reset", [],
    "Yes?", "lord_recruit_3_b", []],
  
  
  [anyone|plyr, "lord_recruit_3_b", [
      (faction_get_slot, ":players_liege", "$players_kingdom", slot_faction_leader),
      (eq, ":players_liege", "trp_player"),
    ],
    "I ask for your support for the throne of the Northlands", "lord_recruit_3_why",
    [
      (troop_set_slot, "$g_talk_troop", slot_lord_recruitment_candidate, "trp_player"),
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_troop_recruitment_random, 0),
        
        #(store_random_in_range, ":random", 1, 101), #replaced with below 3 lines to provide a constant history (not changable by save-loads).
        (troop_get_slot, ":temp_ai_seed", "$g_talk_troop", slot_troop_temp_decision_seed),
        (store_div, ":random", ":temp_ai_seed", 100),  #I used div instead of mod to have a different random value, value generated from (mod 100) will be used in next steps. These two values should be non-related.
        (val_add, ":random", 1),
        
        (troop_set_slot, "$g_talk_troop", slot_troop_recruitment_random, ":random"),
      (try_end),
  ]],
  
  
  [anyone|plyr, "lord_recruit_3_b", [
      (faction_get_slot, ":players_liege", "$players_kingdom", slot_faction_leader),
      (neq, ":players_liege", "trp_player"),
      (neq, "$players_kingdom", "$g_talk_troop_faction"),
      (str_store_troop_name, s45, ":players_liege"),
      
    ],
    "I ask you to pledge allegiance to my liege, {s45}, as monarch of all the Northlands", "lord_recruit_3_why",
    [
      (faction_get_slot, ":players_liege", "$players_kingdom", slot_faction_leader),
      (troop_set_slot, "$g_talk_troop", slot_lord_recruitment_candidate, ":players_liege"),
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_troop_recruitment_random, 0),
        
        #(store_random_in_range, ":random", 1, 101), #replaced with below 3 lines to provide a constant history (not changable by save-loads).
        (troop_get_slot, ":temp_ai_seed", "$g_talk_troop", slot_troop_temp_decision_seed),
        (store_div, ":random", ":temp_ai_seed", 100),  #I used div instead of mod to have a different random value, value generated from (mod 100) will be used in next steps. These two values should be non-related.
        (val_add, ":random", 1),
        
        (troop_set_slot, "$g_talk_troop", slot_troop_recruitment_random, ":random"),
      (try_end),
  ]],
  
  [anyone|plyr, "lord_recruit_3_b", [
    ],
    "Never mind", "lord_pretalk",
    [
  ]],
  
  [anyone, "lord_recruit_3_dilemma_1", [ #explain the political dilemma
      (troop_get_slot, ":players_liege", "$g_talk_troop", slot_lord_recruitment_candidate),
      (str_store_troop_name, s45, ":players_liege"),
      (troop_get_type, reg3, ":players_liege"),
      (val_mod, reg3, 2),
      
      (faction_get_slot, ":current_liege", "$g_talk_troop_faction", slot_faction_leader),
      (str_store_troop_name, s46, ":current_liege"),
      
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_rebellion_dilemma_default"),
    ], "{!}{s43}", "lord_recruit_3_dilemma_2",
    []],
  
  [anyone, "lord_recruit_3_dilemma_2", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_rebellion_dilemma_2_default"),
    ], "{!}{s43}", "lord_recruit_3_why",
    []],
  
  
  
  [anyone, "lord_recruit_3_why",
    [
      (troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_candidate, "trp_player"),
      
      (assign, ":one_fortress_found", 0),
      (try_for_range, ":walled_center", walled_centers_begin, walled_centers_end),
        (this_or_next|party_slot_eq, ":walled_center", slot_town_lord, "$g_talk_troop"),
        (party_slot_eq, ":walled_center", slot_town_lord, "trp_player"),
        (assign, ":one_fortress_found", 1),
      (try_end),
      (eq, ":one_fortress_found", 0),
      
    ],
    "Neither of us has so much as a single fortress to our name. Would you rule your kingdom from an outlaw's den in the woods?", "lord_pretalk",
    [
  ]],
  
  
  
  
  [anyone, "lord_recruit_3_why",
    [
      (troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
      (try_begin),
        (eq, ":recruitment_candidate", "trp_player"),
        (str_store_string, s44, "@you"),
      (else_try),
        (str_store_troop_name, s44, ":recruitment_candidate"),
      (try_end),
    ],
    "Why should I support {s44}?", "lord_recruit_3_d",
    [
      (troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
      (try_begin),
        (troop_get_type, ":is_female", ":recruitment_candidate"),
        (val_mod, ":is_female", 2),
        (str_store_string, s45, "str_he"),
        (str_store_string, s47, "str_king"),
        
        (try_begin),
          (eq, ":is_female", 1),
          (str_store_string, s45, "str_she"),
          (str_store_string, s47, "str_queen"),
        (try_end),
        
        (try_begin),
          (eq, ":recruitment_candidate", "$supported_pretender"),
          (eq, "$supported_pretender_old_faction", "fac_kingdom_3"),
          (str_store_string, s47, "str_khan"),
        (try_end),
        
        (try_begin),
          (eq, ":recruitment_candidate", "trp_player"),
          (str_store_string, s45, "str_i"),
        (try_end),
      (try_end),
  ]],
  
  [anyone|plyr,"lord_recruit_3_d",
    [
      (troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
      
      (str_store_string, s43, "str_according_to_the_ancient_law_and_custom_of_the_calradians_s45_should_be_s47"),
      (try_begin),
        (gt, "$supported_pretender", 0),
        (eq, ":recruitment_candidate", "$supported_pretender"),
        (str_store_faction_name, s46, "$supported_pretender_old_faction"),
        (str_store_string, s43, "str_because_s44_is_the_rightful_s47_of_the_s46"),
      (try_end),
    ],
    "{!}{s43}", "lord_recruit_3_claim",
    [
      (troop_set_slot, "$g_talk_troop", slot_lord_recruitment_argument, argument_claim),
      (val_add, "$claim_arguments_made", 1),
      (assign, "$opposed_arguments_made", "$victory_arguments_made"),
  ]],
  
  [anyone|plyr,"lord_recruit_3_d",
    [],
    "If {s45} were {s47}, {s45} would deal with all men fairly and uphold the rights of the commons.", "lord_recruit_3_claim",
    [
      (troop_set_slot, "$g_talk_troop", slot_lord_recruitment_argument, argument_ruler),
      (val_add, "$ruler_arguments_made", 1),
      (assign, "$opposed_arguments_made", "$lords_arguments_made"),
  ]],
  
  [anyone|plyr,"lord_recruit_3_d",
    [],
    "If {s45} were {s47}, {s45} would uphold your ancient rights as a noble of this land.", "lord_recruit_3_claim",
    [
      (troop_set_slot, "$g_talk_troop", slot_lord_recruitment_argument, argument_lords),
      (val_add, "$lords_arguments_made", 1),
      (assign, "$opposed_arguments_made", "$ruler_arguments_made"),
  ]],
  
  [anyone|plyr,"lord_recruit_3_d",
    [],
    "Because {s45} can unify the Northlands and end this discord.", "lord_recruit_3_claim",
    [
      (troop_set_slot, "$g_talk_troop", slot_lord_recruitment_argument, argument_victory),
      (val_add, "$victory_arguments_made", 1),
      (assign, "$opposed_arguments_made", "$claim_arguments_made"),
  ]],
  
  [anyone|plyr,"lord_recruit_3_d",
    [],
    "Because {s45} will reward you with lands.", "lord_recruit_3_claim",[
      (troop_set_slot, "$g_talk_troop", slot_lord_recruitment_argument, argument_benefit),
      (val_add, "$benefit_arguments_made", 1),
  ]],
  
  [anyone|plyr,"lord_recruit_3_d",
    [],
    "Never mind", "lord_pretalk",[
      (troop_set_slot, "$g_talk_troop", slot_troop_recruitment_random, 0),
  ]],
  
  [anyone,"lord_recruit_3_claim", [
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_benefit),
      
      (gt, "$opposed_arguments_made", 0),
      (troop_get_slot, ":recruitment_random", "$g_talk_troop", slot_troop_recruitment_random),
      (store_mul, ":opposed_number", "$opposed_arguments_made", 10),
      (val_add, ":opposed_number", ":recruitment_random"),
      (gt, ":opposed_number", 100),
      
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_claim),
        (str_store_string, s12, "str_you_speak_of_claims_and_legalities_yet_to_others_you_talk_of_bringing_peace_by_force"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_victory),
        (str_store_string, s12, "str_you_speak_of_bringing_peace_by_force_yet_to_others_you_make_legal_claims"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_commons),
        (str_store_string, s12, "str_you_speak_to_some_of_upholding_the_rights_of_the_commons_yet_you_speak_to_others_of_uphold_the_rights_of_nobles_what_if_those_rights_are_in_conflict"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_lords),
        (str_store_string, s12, "str_you_speak_to_me_of_upholding_my_rights_as_a_lord_but_to_others_you_talk_of_upholding_the_rights_of_all_commons_what_if_those_rights_come_into_conflict"),
      (try_end),
    ],
    "Do you perhaps tell each person what you think they most want to hear? {s12}", "lord_recruit_3_claim",
    [
      (assign, "$opposed_arguments_made", -1),
  ]],
  
  #Is the candidate  worthy of being king?
  [anyone,"lord_recruit_3_claim", [
      
      (assign, "$g_persuasion_trump_used", 0),
      
      (troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
      
      (assign, ":continue", 0),
      
      (str_store_string, s12, "str_a_claim_should_be_strong_indeed_before_one_starts_talking_about_it"),
      
      (try_begin), #non-player candidates are automatically considered worthy
        (neq, ":recruitment_candidate", "trp_player"),
        
        (str_store_string, s12, "str_indeed_please_continue"),
        (assign, ":continue", 1),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
        
        (str_store_string, s12, "str_a_claim_should_be_strong_indeed_before_one_starts_talking_about_it"),
        
        #(assign, reg0, "$player_right_to_rule"),
        #(assign, reg1, ":recruitment_candidate"),
        #(troop_get_slot, reg2, ":recruitment_candidate", slot_troop_renown),
        #(display_message, "@{!}DEBUG : player_right_to_rule = {reg0}"),
        #(display_message, "@{!}DEBUG : recruitment_candidate = {reg1}"),
        #(display_message, "@{!}DEBUG : renown = {reg2}"),
        
        (ge, "$player_right_to_rule", 10),
        
        (str_store_string, s12, "str_a_king_should_prove_his_valor_beyond_any_doubt_before_he_starts_talking_about_a_claim_to_the_throne"),
        (troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 400),
        
        (assign, ":continue", 1),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
        
        (str_store_string, s12, "str_you_must_prove_yourself_a_great_warrior_before_men_will_follow_you_as_king"),
        (troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 200),
        
        (assign, ":continue", 1),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
        
        (str_store_string, s12, "str_a_claim_to_the_throne_should_be_strong_indeed_before_one_presses_it"),
        (ge, "$player_right_to_rule", 20),
        
        (str_store_string, s12, "str_indeed_but_a_man_must_also_prove_himself_a_great_warrior_before_men_will_follow_you_as_king"),
        (troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 200),
        
        (assign, ":continue", 1),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
        
        (str_store_string, s12, "str_my_pigherd_can_declare_himself_king_if_he_takes_he_fancy_i_think_you_need_to_break_a_few_more_heads_on_tbe_battlefield_before_men_will_follow_you"),
        (troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 200),
        
        (assign, ":continue", 1),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
        
        (str_store_string, s12, "str_if_you_do_not_wish_to_die_on_a_scaffold_like_so_many_failed_pretenders_before_you_i_would_suggest_that_you_to_build_your_claim_on_stronger_foundations_so_that_men_will_follow_you"),
        (ge, "$player_right_to_rule", 10),
        
        (str_store_string, s12, "str_if_you_do_not_wish_to_die_on_a_scaffold_like_so_many_failed_pretenders_before_you_i_would_advise_you_prove_yourself_on_the_field_of_battle_so_that_men_will_follow_you"),
        (troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 200),
        
        (assign, ":continue", 1),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
        
        (str_store_string, s12, "str_talk_is_for_heralds_and_lawyers_real_kings_prove_themselves_with_their_swords"),
        (troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 200),
        
        (assign, ":continue", 1),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
        
        (str_store_string, s12, "str_i_were_you_i_would_try_to_prove_myself_a_bit_more_before_i_went_about_pressing_my_claim"),
        (troop_slot_ge, ":recruitment_candidate", slot_troop_renown, 400),
        
        (assign, ":continue", 1),
      (try_end),
      
      #Trump to overlook player unworthiness
      (str_clear, s14),
      (try_begin),
        (eq, ":continue", 1),
        (str_store_string, s12, "str_indeed_please_continue"),
        
      (else_try),
        (eq, ":continue", 0),
        (eq, "$g_persuasion_trump_used", 0),
        (assign, "$g_persuasion_trump_used", 1),
        #persuasion check
        (store_skill_level, ":persuasion_skill", "skl_persuasion", "trp_player"),
        
        (troop_get_slot, ":persuasion_random", "$g_talk_troop", slot_troop_recruitment_random),
        
        (try_begin),
          (eq, "$cheat_mode", 1),
          #(assign, reg3, ":persuasion_skill"),
          #(assign, reg4, ":persuasion_random"),
          #(display_message, "str_trump_check_random_reg4_skill_reg3"),
        (try_end),
        
        (val_mul, ":persuasion_skill", 7),
        (ge, ":persuasion_skill", ":persuasion_random"),
        
        (assign, ":continue", 1),
        
        (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_changed_my_mind_default"),
        (str_store_string, s14, "str_s12_s43"),
        (str_store_string, s12, s14),
      (try_end),
      
      (eq, ":continue", 1),
      
    ],
    "{!}{s12}", "lord_recruit_4",[
  ]],
  
  
  #the lord refuses. s12 is set by the previous
  [anyone,"lord_recruit_3_claim",  [
    ],
    "{!}{s12}", "lord_pretalk",[
  ]],
  
  
  [anyone|plyr,"lord_recruit_4", [
      (troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
      (str_store_troop_name, s16,  ":recruitment_candidate"),
      
      (try_begin),
        (eq,  ":recruitment_candidate", "trp_player"),
        (str_store_string, s16, "str_me"),
      (try_end),
    ],
    "I ask you to pledge your allegiance to {s16}.", "lord_recruit_4_objective_conditions",[]],
  
  [anyone|plyr,"lord_recruit_4", [
      (troop_set_slot, "$g_talk_troop", slot_troop_recruitment_random, 0),
    ],
    "Never mind.", "lord_pretalk",[]],
  
  [anyone,"lord_recruit_4_objective_conditions", [
      (troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
      
      (call_script, "script_calculate_troop_political_factors_for_liege", "$g_talk_troop", ":recruitment_candidate"),
      (str_store_string, s33, s14),
      
      (assign, ":result_for_security", reg2),
      (assign, ":result_for_political", reg4),
      
      #this will store
      (try_begin),
        (eq, "$cheat_mode", 1),
        (display_message, "str_preliminary_result_for_political_=_reg4"),
      (try_end),
      
      #			(assign, ":result_for_ideological", reg6),
      #			(assign, ":result_for_material", reg8),
      (assign, ":change_penalty", reg10),
      (assign, ":result_for_new_liege", reg0),
      
      (faction_get_slot, ":cur_liege", "$g_talk_troop_faction", slot_faction_leader),
      (call_script, "script_calculate_troop_political_factors_for_liege", "$g_talk_troop", ":cur_liege"),
      
      (store_sub, ":result_for_security_comparative", ":result_for_security", reg2),
      (store_sub, ":result_for_political_comparative", ":result_for_political", reg4),
      #			(store_sub, ":result_for_ideological_comparative", ":result_for_ideological", reg6), #to be used if NPC lords ever have different ideologies
      #			(store_sub, ":result_for_material_comparative", ":result_for_material", reg8), #result for material (meaning, promised new fiefs or bribes) currently disabled
      (assign, ":result_for_old_liege", reg0),
      
      (try_begin),
        (eq, "$cheat_mode", 1),
        (assign, reg31, ":result_for_new_liege"),
        (assign, reg32, ":result_for_old_liege"),
        
        (display_message, "@{!}DEBUG : result_for_new_liege : {reg31}"),
        (display_message, "@{!}DEBUG : result_for_old_liege : {reg32}"),
      (try_end),
      
      (store_sub, "$pledge_chance", ":result_for_new_liege", ":result_for_old_liege"),
      (val_add, "$pledge_chance", 50),
      (val_div, "$pledge_chance", 2),
      
      (try_begin),
        (lt, ":result_for_political", 0),
        
        (try_begin),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
          (str_store_string, s31, "str_i_worry_about_those_with_whom_you_have_chosen_to_surround_yourself" ),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
          (str_store_string, s31, "str_there_are_some_outstanding_matters_between_me_and_some_of_your_vassals_"),
          (try_begin),
            (assign, reg41, ":result_for_political"),
            (ge, "$cheat_mode", 1), #no debug msg in normal
            (display_message, "str_result_for_political_=_reg41"),
          (try_end),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
          (str_store_string, s31, "str_my_liege_has_his_faults_but_i_dont_care_for_your_toadies"),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
          (str_store_string, s31, "str_i_think_youre_a_good_man_but_im_worried_that_you_might_be_pushed_in_the_wrong_direction_by_some_of_those_around_you"),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
          (str_store_string, s31, "str_i_am_loathe_to_fight_alongside_you_so_long_as_you_take_under_your_wing_varlots_and_base_men"),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
          (str_store_string, s31, "str_ill_be_honest__with_some_of_those_who_follow_you_i_think_id_be_more_comfortable_fighting_against_you_than_with_you"),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
          (str_store_string, s31, "str_i_say_that_you_can_judge_a_man_by_the_company_he_keeps_and_you_have_surrounded_yourself_with_vipers_and_vultures"),
        (else_try),
          (troop_slot_ge, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
          (str_store_string, s31, "str_you_know_that_i_have_always_had_a_problem_with_some_of_our_companions"),
        (try_end),
      (else_try),
        (lt, ":result_for_political_comparative", 0),
        (str_store_string, s31, "str_politically_i_would_be_a_better_position_in_the_court_of_my_current_liege_than_in_yours"),
      (else_try),
        (str_store_string, s31, "str_i_am_more_comfortable_with_you_and_your_companions_than_with_my_current_liege"),
      (try_end),
      #end political string
      
      #end
      (try_begin),
        (lt, ":result_for_security", 10),
        
        (try_begin),
          (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
          (troop_slot_ge, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
          (str_store_string, s32, "str_militarily_youre_in_no_position_to_protect_me_should_i_be_attacked_id_be_reluctant_to_join_you_until_you_could"),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
          (str_store_string, s32, "str_militarily_when_i_consider_the_lay_of_the_land_i_realize_that_to_pledge_myself_to_you_now_would_endanger_my_faithful_retainers_and_my_family"),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
          (str_store_string, s32, "str_militarily_youre_in_no_position_to_come_to_my_help_if_someone_attacked_me_i_dont_mind_a_good_fight_but_i_like_to_have_a_chance_of_winning"),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
          (str_store_string, s32, "str_militarily_youre_in_no_position_to_come_to_my_help_if_someone_attacked_me_i_dont_mind_a_good_fight_but_i_like_to_have_a_chance_of_winning"),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
          (str_store_string, s32, "str_militarily_you_would_have_me_join_you_only_to_find_myself_isolated_amid_a_sea_of_enemies"),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
          (str_store_string, s32, "str_militarily_you_would_have_me_join_you_only_to_find_myself_isolated_amid_a_sea_of_enemies"),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
          (str_store_string, s32, "str_militarily_youre_in_no_position_to_come_to_my_help_if_someone_attacked_me_youd_let_me_be_cut_down_like_a_dog_id_bet"),
        (try_end),
      (else_try),
        (lt, ":result_for_security_comparative", 0),
        (str_store_string, s32, "str_militarily_i_wouldnt_be_any_safer_if_i_joined_you"),
      (else_try),
        (str_store_string, s32, "str_militarily_i_might_be_safer_if_i_joined_you"),
      (try_end),
      
      (try_begin),
        (gt, ":change_penalty", 40),
        (str_store_string, s34, "str_finally_there_is_a_cost_to_ones_reputation_to_change_sides_in_this_case_the_cost_would_be_very_high"),
      (else_try),
        (gt, ":change_penalty", 20),
        (str_store_string, s34, "str_finally_there_is_a_cost_to_ones_reputation_to_change_sides_in_this_case_the_cost_would_be_significant"),
      (else_try),
        (str_store_string, s34, "str_finally_there_is_a_cost_to_ones_reputation_to_change_sides_in_this_case_however_many_men_would_understand"),
      (try_end),
    ],
    "Let me think...", "lord_recruit_5_security",[
  ]],
  
  [anyone,"lord_recruit_5_security",  [
    ],
    "{!}{s32}", "lord_recruit_5_political",
    []],
  
  
  [anyone,"lord_recruit_5_political",  [
    ],
    "{!}{s31}", "lord_recruit_5_ideological",
    []],
  
  #    [anyone,"lord_recruit_5_material",  [
  
  #	],
  #	"{!}[Anticipated material gains currently not counted]", "lord_recruit_5_ideological",
  #	[]],
  
  [anyone,"lord_recruit_5_ideological",  [
    ],
    "{!}{s33}", "lord_recruit_5_change_sides",
    [
      
  ]],
  
  [anyone,"lord_recruit_5_change_sides",  [
    ],
    "{!}{s34}", "lord_recruit_6",
    [
      (try_begin),
        (eq, "$cheat_mode", 1),
        (assign, reg1, "$pledge_chance"),
        (display_message, "str_chance_of_success_=_reg1"),
      (try_end),
  ]],
  
  [anyone|plyr,"lord_recruit_6",[
    ],
    "It is time for you to make a decision.", "lord_recruit_6_reaction",
    [
  ]],
  
  [anyone|plyr,"lord_recruit_6",[
    ],
    "No need to decide anything -- we can speak of this at a later time.", "lord_pretalk",
    [
  ]],
  
  
  [anyone,"lord_recruit_6_reaction",
    [
    ],
    "Very well...", "lord_recruit_7_decision",
    [
      (troop_set_slot, "$g_talk_troop", slot_troop_recruitment_random, 0),
  ]],
  
  
  [anyone,"lord_recruit_7_decision",
    [
      #(store_random_in_range, ":random", 0, 100),
      (troop_get_slot, ":temp_ai_seed", "$g_talk_troop", slot_troop_temp_decision_seed),
      (store_mod, ":random", ":temp_ai_seed", 100),
      
      (try_begin),
        (eq, "$cheat_mode", 1),
        (assign, reg3, ":random"),
        (display_message, "str_random_=_reg3"),
      (try_end),
      
      (faction_get_slot, ":leader", "$g_talk_troop_faction", slot_faction_leader),
      (str_store_troop_name, s14, ":leader"),
      
      (assign, ":continue_to_pledge", 0),
      (try_begin),
        (eq, "$special1", 3),
        (val_add, "$pledge_chance", 3),
      (try_end),
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
        (gt, ":random", "$pledge_chance"),
        (str_store_string, s12, "str_i_will_not_have_it_be_said_about_me_that_i_am_a_traitor_that_is_my_final_decision_i_have_nothing_more_to_say_on_this_matter"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
        (gt, ":random", "$pledge_chance"),
        
        (str_store_string, s12, "str_i_am_pledged_to_defend_s14_i_am_sorry_though_we_may_meet_on_the_battlefield_i_hope_that_we_will_still_be_friends"),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
        (troop_slot_ge, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
        (gt, ":random", "$pledge_chance"),
        
        (str_store_string, s12, "str_i_really_cannot_bring_myself_to_renounce_s14_i_am_sorry_please_lets_not_talk_about_this_any_more"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
        (gt, ":random", "$pledge_chance"),
        
        (str_store_string, s12, "str_however_i_have_decided_that_i_must_remain_loyal_to_s14_i_am_sorry"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
        (gt, ":random", "$pledge_chance"),
        
        (str_store_string, s12, "str_however_i_will_not_let_you_lead_me_into_treason_do_not_talk_to_me_of_this_again"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
        (gt, ":random", "$pledge_chance"),
        
        (str_store_string, s12, "str_its_not_good_to_get_a_reputation_as_one_who_abandons_his_liege_that_is_my_decision_let_us_speak_no_more_of_this_matter"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
        (gt, ":random", "$pledge_chance"),
        
        (str_store_string, s12, "str_ive_decided_to_stick_with_s14_i_dont_want_to_talk_about_this_matter_any_more"),
      (else_try),
        (assign, ":continue_to_pledge", 1),
      (try_end),
      
      (eq, ":continue_to_pledge", 0),
    ],
    "{!}{s12}", "lord_pretalk",
    [
      (troop_set_slot, "$g_talk_troop", slot_troop_intrigue_impatience, 500),
  ]],
  
  [anyone,"lord_recruit_7_decision",
    [
      (troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
      (str_store_troop_name, s4, ":recruitment_candidate"),
      
      (try_begin),
        (eq, "$cheat_mode", 1),
        (display_message, "str_lord_pledges_to_s4"),
      (try_end),
    ],
    "Very well -- I am ready to pledge myself to {s4} as my {reg4?queen:king}.", "lord_recruit_pledge",
    [
      (troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
      
      (try_begin),
        (eq, ":recruitment_candidate", "trp_player"),
        (faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_inactive),
        (call_script, "script_activate_player_faction", "trp_player"),
      (try_end),
      
      (assign, "$lord_expects_fief", 0),
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_lord_recruitment_argument, argument_benefit),
        (assign, "$lord_expects_fief", 1),
      (try_end),
      
      (call_script, "script_change_troop_faction", "$g_talk_troop", "$players_kingdom"),
      
      (try_begin), #Actually, perhaps do provocation rather than war
        (ge, "$g_talk_troop_faction_kingdom_relation", 0),
        
        (try_begin),
          (eq, "$cheat_mode", 1),
          (display_message, "str_lord_recruitment_provokes_home_faction"),
        (try_end),
        
        (call_script, "script_add_log_entry", logent_border_incident_troop_suborns_lord, "trp_player", -1, "$g_talk_troop","$g_talk_troop_faction"),
        (store_add, ":slot_provocation_days", "$players_kingdom", slot_faction_provocation_days_with_factions_begin),
        (val_sub, ":slot_provocation_days", kingdoms_begin),
        (faction_set_slot, "$g_talk_troop_faction", ":slot_provocation_days", 30),
        
        (faction_get_slot, ":other_liege", "$g_talk_troop_faction", slot_faction_leader),
        (call_script, "script_troop_change_relation_with_troop", "trp_player", ":other_liege", -3),
      (try_end),
      
      (troop_get_type, reg4, ":recruitment_candidate"),
      (val_mod, reg4, 2),
      (try_begin),
        (eq, ":recruitment_candidate", "trp_player"),
        (str_store_string, s4, "@you"),
        (call_script, "script_change_player_right_to_rule", 5),
      (else_try),
        (str_store_troop_name, s4, ":recruitment_candidate"),
      (try_end),
  ]],
  
  
  [anyone,"lord_recruit_pledge",
    [
      (eq, "$lord_expects_fief", 1),
    ],
    "Remember. You have promised me a fief. I will hold you to that promise.", "lord_recruit_pledge",
    [
      (assign, "$lord_expects_fief", 0),
      (troop_set_slot, "$g_talk_troop", slot_lord_recruitment_argument, 0),
      (call_script, "script_add_log_entry", logent_liege_promises_fief_to_vassal, "trp_player", 0, "$g_talk_troop", "$players_kingdom"),
      (troop_set_slot, "$g_talk_troop", slot_troop_promised_fief, 1),
  ]],
  
  [anyone,"lord_recruit_pledge",
    [
      (troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
      (eq, ":recruitment_candidate", "trp_player"),
    ],
    "So be it -- I pledge allegiance to you as your faithful vassal. I shall stand at your side to fight your enemies should you need my sword, and uphold your claims and those of your legitimate heirs. I expect in turn that you will protect me and recognize my rights as your vassal.", "lord_recruit_pledge_conclude",
    [
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"lord_recruit_pledge",  [
      (troop_get_slot, ":recruitment_candidate", "$g_talk_troop", slot_lord_recruitment_candidate),
      (str_store_troop_name, s4, ":recruitment_candidate"),
    ],
    "So be it -- you may inform {s4} that I am now {reg4?her:him} faithful vassal, that I will follow {reg4?her:him} as long as my breath remains, and I will be at {reg4?her:his} side to fight your enemies should you need my sword, and that I uphold your lawful claims and those of your legitimate heirs. In turn, I expect his protection and his recognition of my rights as his vassal.", "lord_recruit_pledge_conclude",
    []],
  
  [anyone,"lord_recruit_pledge_conclude",  [
    ],
    "Now... It is a momentous step I have taken. I will take my leave, as I may need some time prepare myself for what comes next.", "close_window",
    []],
  #lord recruitment changes end
  
  
  
  
  [anyone|plyr,"lord_talk",[
      (check_quest_active, "qst_denounce_lord"),
      (quest_slot_eq, "qst_denounce_lord", slot_quest_giver_troop, "$g_talk_troop"),
      (this_or_next|check_quest_succeeded, "qst_denounce_lord"),
      (check_quest_failed, "qst_denounce_lord"),
      (quest_get_slot, ":target_troop", "qst_denounce_lord", slot_quest_target_troop),
      (str_store_troop_name, s4, ":target_troop"),
    ],
    "I did as you suggested, and denounced {s4}", "denounce_lord_results"  ,
    [
  ]],
  
  
  [anyone,"denounce_lord_results",[
      (check_quest_succeeded, "qst_denounce_lord"),
      (faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
      (str_store_troop_name, s4, ":faction_leader"),
      
    ],
    "Yes, and hopefully now {s4} will think twice before entrusting him with any additional fiefs, honors, or offices. We are grateful to you.", "lord_pretalk",
    [
      (call_script, "script_succeed_quest", "qst_denounce_lord"),
      (call_script, "script_end_quest", "qst_denounce_lord"),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 8),
      (add_xp_as_reward, 2000),
  ]],
  
  
  [anyone,
    "denounce_lord_results",[
      #	(check_quest_failed, "qst_denounce_lord"),
    ],
    "So you did -- and we have heard that he forced you to retract your words, and thus emerged from this affair looking stronger than before. You will forgive me, {reg59?my lady:sir}, if my gratitude to you is somewhat muted.", "close_window",
    [
      (call_script, "script_end_quest", "qst_denounce_lord"),
      
  ]],
  
  
  
  [anyone|plyr,"lord_talk",[
      (check_quest_active, "qst_intrigue_against_lord"),
      (quest_slot_eq, "qst_intrigue_against_lord", slot_quest_giver_troop, "$g_talk_troop"),
      
      (this_or_next|check_quest_succeeded, "qst_intrigue_against_lord"),
      (check_quest_failed, "qst_intrigue_against_lord"),
      
      (quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
      (str_store_troop_name, s4, ":target_troop"),
      (faction_get_slot, ":liege", "$players_kingdom", slot_faction_leader),
      (str_store_troop_name, s5, ":liege"),
      
      
    ],
    "I did as you asked, and spoke to {s5} about the danger posed by {s4}.", "lord_quest_intrigue_result"  ,
    [
  ]],
  
  [anyone,"lord_quest_intrigue_result",[
      (check_quest_succeeded, "qst_intrigue_against_lord"),
    ],
    "So we hear. I hope that now {s5} will think twice before entrusting him with any additional fiefs, honors, or offices. We are grateful to you.", "lord_pretalk"  ,
    [
      (call_script, "script_end_quest", "qst_intrigue_against_lord"),
      (quest_set_slot, "qst_intrigue_against_lord", slot_quest_dont_give_again_remaining_days, 30),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 8),
      (add_xp_as_reward, 1000),
  ]],
  
  [anyone,"lord_quest_intrigue_result",[
      (check_quest_failed, "qst_intrigue_against_lord"),
    ],
    "So we hear -- but alas, {s5} seems not to have listened. Still, we are grateful to you for trying.", "close_window"  ,
    [
      (call_script, "script_end_quest", "qst_intrigue_against_lord"),
      (quest_set_slot, "qst_intrigue_against_lord", slot_quest_dont_give_again_remaining_days, 30),
      #	(call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 2),
  ]],
  
  
  
  [anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active,"qst_lend_companion"),
      (quest_slot_eq, "qst_lend_companion", slot_quest_giver_troop, "$g_talk_troop"),
      (store_current_day, ":cur_day"),
      (quest_get_slot, ":quest_target_amount", "qst_lend_companion", slot_quest_target_amount),
      (ge, ":cur_day", ":quest_target_amount"),
      (quest_get_slot, ":quest_target_troop", "qst_lend_companion", slot_quest_target_troop),
      (str_store_troop_name,s14,":quest_target_troop"),
      (troop_get_type, reg3, ":quest_target_troop"),
      (val_mod, reg3, 2),
    ],
    "I should like {s14} returned to me, {s65}, if you no longer require {reg3?her:his} services.", "lord_lend_companion_end",
    []],
  
  [anyone,"lord_lend_companion_end",[(neg|hero_can_join, "p_main_party")],
    "You've too many men in your shield wall already, {playername}. You could not lead any more at the moment.", "lord_pretalk",
    []],
  
  [anyone,"lord_lend_companion_end",[],
    "Certainly, {playername}. {reg3?She:He} is a bright {reg3?girl:fellow}, you're a lucky {reg59?woman:man} to have such worthy companions.", "lord_pretalk",
    [(quest_get_slot, ":quest_target_troop", "qst_lend_companion", slot_quest_target_troop),
      (party_add_members, "p_main_party", ":quest_target_troop", 1),
      (call_script, "script_finish_quest", "qst_lend_companion", 100),
      (str_store_troop_name,s14,":quest_target_troop"),
      (troop_get_type, reg3, ":quest_target_troop"),
      (val_mod, reg3, 2),
  ]],
  
  [anyone|plyr,"lord_talk",[(check_quest_active,"qst_collect_debt"),
      (quest_slot_eq,  "qst_collect_debt", slot_quest_current_state, 0),
      (quest_get_slot, ":quest_target_troop", "qst_collect_debt", slot_quest_target_troop),
      (eq,"$g_talk_troop",":quest_target_troop"),
      (quest_get_slot, ":quest_giver_troop", "qst_collect_debt", slot_quest_giver_troop),
      (str_store_troop_name,1,":quest_giver_troop")],
    "I've come to collect the debt you owe to {s1}.", "lord_ask_to_collect_debt",
    [(assign, "$g_convince_quest", "qst_collect_debt")]],
  
  [anyone,"lord_ask_to_collect_debt", [],  "Oh. Well, {s1} did lend me some silver a ways back, " +
    "but I've done him many favours in the past and I consider that money as my due payment.", "lord_ask_to_collect_debt_2",[]],
  [anyone|plyr,"lord_ask_to_collect_debt_2", [],  "{s1} considers it a debt. He asked me to speak to you on his behalf.", "convince_begin",[]],
  [anyone|plyr,"lord_ask_to_collect_debt_2", [],  "Then I will not press the matter any further.", "lord_pretalk",[]],
  
  
  [anyone,"convince_accept",[(check_quest_active, "qst_collect_debt"),
      (quest_slot_eq, "qst_collect_debt", slot_quest_target_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_giver_troop", "qst_collect_debt", slot_quest_giver_troop),
      (str_store_troop_name,s8,":quest_giver_troop"),
      (quest_get_slot, reg10, "qst_collect_debt", slot_quest_target_amount)],
    "My debt to {s8} has long been overdue and was a source of great discomfort to me. " +
    "Thank you for accepting to take the money to him. " +
    "Please give him these {reg10} peningas and thank him on my behalf.", "close_window",
    [(call_script, "script_troop_add_gold", "trp_player", reg10),
      (quest_set_slot,  "qst_collect_debt", slot_quest_current_state, 1),
      (call_script, "script_succeed_quest", "qst_collect_debt"),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  [anyone|plyr,"lord_talk",[(check_quest_active,"qst_persuade_lords_to_make_peace"),
      (quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
      (quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
      (this_or_next|eq, ":quest_target_troop", "$g_talk_troop"),
      (eq, ":quest_object_troop", "$g_talk_troop"),
      (quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
      (quest_get_slot, ":quest_object_faction", "qst_persuade_lords_to_make_peace", slot_quest_object_faction),
      (str_store_faction_name, s12, ":quest_target_faction"),
      (str_store_faction_name, s13, ":quest_object_faction"),
    ],
    "Please, {s64}, it's time to end this war between the {s12} and the {s13}.", "lord_ask_to_make_peace",
    [(assign, "$g_convince_quest", "qst_persuade_lords_to_make_peace")]],
  
  [anyone,"lord_ask_to_make_peace", [], "Eh? I'm not sure I heard you right, {playername}. " +
    "War is not easily forgotten by either side of the conflict, and I have a very long memory. " +
    "Why should I take any interest in brokering peace with those dogs?", "lord_ask_to_make_peace_2",[]],
  
  [anyone|plyr,"lord_ask_to_make_peace_2", [],  "Perhaps I can talk you into it...", "convince_begin",[]],
  [anyone|plyr,"lord_ask_to_make_peace_2", [],  "Never mind, peace can wait for now.", "lord_pretalk",[]],
  
  [anyone,"convince_accept",[(check_quest_active, "qst_persuade_lords_to_make_peace"),
      (this_or_next|quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, "$g_talk_troop"),
      (quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_object_faction", "qst_persuade_lords_to_make_peace", slot_quest_object_faction),
      (quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
      (str_store_faction_name, s12, ":quest_object_faction"),
      (str_store_faction_name, s13, ":quest_target_faction"),
      (try_begin), # store name of other faction
        (eq,":quest_object_faction","$g_talk_troop_faction"),
        (str_store_faction_name, s14, ":quest_target_faction"),
      (else_try),
        (str_store_faction_name, s14, ":quest_object_faction"),
      (try_end),
    ],
    "You... have convinced me, {playername}. Very well then, you've my blessing to bring a peace offer to the {s14}. I cannot guarantee they will accept it, but on the off chance they do, I will stand by it.", "close_window",
    [(store_mul, ":new_value", "$g_talk_troop", -1),
      (try_begin),
        (quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, "$g_talk_troop"),
        (quest_set_slot, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, ":new_value"),
      (else_try),
        (quest_set_slot, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, ":new_value"),
      (try_end),
      (quest_set_slot, "qst_persuade_lords_to_make_peace", slot_quest_convince_value, 1500),#reseting convince value for the second persuasion
      (assign, "$g_leave_encounter", 1),
      (neg|quest_slot_ge, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, 0),
      (neg|quest_slot_ge, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, 0),
      (call_script, "script_succeed_quest", "qst_persuade_lords_to_make_peace"),
  ]],
  
  
  ##
  ##
  ##  [anyone|plyr,"lord_talk",[(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                            (check_quest_active,"qst_bring_reinforcements_to_siege"),
  ##                             (quest_get_slot, ":quest_target_troop", "qst_bring_reinforcements_to_siege", slot_quest_target_troop),
  ##                             (eq,"$g_talk_troop",":quest_target_troop"),
  ##                             (quest_get_slot, ":quest_giver_troop", "qst_bring_reinforcements_to_siege", slot_quest_giver_troop),
  ##                             (quest_get_slot, ":quest_target_amount", "qst_bring_reinforcements_to_siege", slot_quest_target_amount),
  ##                             (quest_get_slot, ":quest_object_troop", "qst_bring_reinforcements_to_siege", slot_quest_object_troop),
  ##                             (party_count_companions_of_type, ":num_companions", "p_main_party", ":quest_object_troop"),
  ##                             (ge, ":num_companions", ":quest_target_amount"),
  ##                             (str_store_troop_name,1,":quest_giver_troop"),
  ##                             (assign, reg1, ":quest_target_amount"),
  ##                             (str_store_troop_name,2,":quest_object_troop")],
  ##   "Sir, {s1} ordered me to bring {reg1} {s2} to reinforce your siege.", "lord_reinforcement_brought",
  ##   [(quest_get_slot, ":quest_target_amount", "qst_bring_reinforcements_to_siege", slot_quest_target_amount),
  ##    (quest_get_slot, ":quest_target_party", "qst_bring_reinforcements_to_siege", slot_quest_target_party),
  ##    (quest_get_slot, ":quest_object_troop", "qst_bring_reinforcements_to_siege", slot_quest_object_troop),
  ##    (party_remove_members, "p_main_party", ":quest_object_troop", ":quest_target_amount"),
  ##    (party_add_members, ":quest_target_party", ":quest_object_troop", ":quest_target_amount"),
  ##    (call_script, "script_finish_quest", "qst_bring_reinforcements_to_siege", 100),
  ##    ]],
  ##
  ##  [anyone|plyr,"lord_talk",[(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                            (check_quest_active,"qst_bring_reinforcements_to_siege"),
  ##                             (quest_get_slot, ":quest_target_troop", "qst_bring_reinforcements_to_siege", slot_quest_target_troop),
  ##                             (eq,"$g_talk_troop",":quest_target_troop"),
  ##                             (quest_get_slot, ":quest_giver_troop", "qst_bring_reinforcements_to_siege", slot_quest_giver_troop),
  ##                             (quest_get_slot, ":quest_target_amount", "qst_bring_reinforcements_to_siege", slot_quest_target_amount),
  ##                             (quest_get_slot, ":quest_object_troop", "qst_bring_reinforcements_to_siege", slot_quest_object_troop),
  ##                             (party_count_companions_of_type, ":num_companions", "p_main_party", ":quest_object_troop"),
  ##                             (lt, ":num_companions", ":quest_target_amount"),
  ##                             (gt, ":num_companions", 0),
  ##                             (str_store_troop_name,1,":quest_giver_troop"),
  ##                             (assign, reg1, ":quest_target_amount"),
  ##                             (str_store_troop_name,2,":quest_object_troop")],
  ##   "Sir, {s1} ordered me to bring {reg1} {s2} as a reinforcement to your siege, but unfortunately I lost some of them during my expedition.", "lord_reinforcement_brought_some",
  ##   [(quest_get_slot, ":quest_target_amount", "qst_bring_reinforcements_to_siege", slot_quest_target_amount),
  ##    (quest_get_slot, ":quest_target_party", "qst_bring_reinforcements_to_siege", slot_quest_target_party),
  ##    (quest_get_slot, ":quest_object_troop", "qst_bring_reinforcements_to_siege", slot_quest_object_troop),
  ##    (party_count_companions_of_type, ":num_companions", "p_main_party", ":quest_object_troop"),
  ##    (party_remove_members, "p_main_party", ":quest_object_troop", ":num_companions"),
  ##    (party_add_members, ":quest_target_party", ":quest_object_troop", ":num_companions"),
  ##    (assign, ":percentage_completed", 100),
  ##    (val_mul, ":percentage_completed", ":num_companions"),
  ##    (val_div, ":percentage_completed", ":quest_target_amount"),
  ##    (call_script, "script_finish_quest", "qst_bring_reinforcements_to_siege", ":percentage_completed"),
  ##     ]],
  ##
  ##  [anyone,"lord_reinforcement_brought", [], "Well done {playername}. These men will no doubt be very useful. I will speak to {s1} of your help.", "lord_pretalk",[]],
  ##  [anyone,"lord_reinforcement_brought_some", [], "That's not quite good enough {playername}. But I suppose it is better than no reinforcements at all. Whatever, I'll tell {s1} you tried your best.", "lord_pretalk",[]],
  ##
  
  [anyone|plyr,"lord_talk",
    [
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active,"qst_duel_for_lady"),
      (neg|check_quest_concluded,"qst_duel_for_lady"),
      (quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_giver_troop", "qst_duel_for_lady", slot_quest_giver_troop),
      (str_store_troop_name, s1, ":quest_giver_troop")
    ],
    "I want you to take back your accusations against {s1}.", "lord_challenge_duel_for_lady", []],
  
  [anyone,"lord_challenge_duel_for_lady", [], "What accusations? " +
    "Everyone knows that she beds her stable boys and anyone else she can lay hands on while her husband is away. " +
    "I merely repeat the words of many.", "lord_challenge_duel_for_lady_2",[]],
  [anyone|plyr,"lord_challenge_duel_for_lady_2", [], "You will recant these lies, sirrah, or prove them against my sword!", "lord_challenge_duel",[]],
  [anyone|plyr,"lord_challenge_duel_for_lady_2", [], "If you say so...", "lord_pretalk",[]],
  
  [anyone,"lord_challenge_duel",
    [
      (str_store_string, s15, "str_error__wrong_quest_type"),
      (try_begin),
        (check_quest_active,"qst_duel_for_lady"),
        (neg|check_quest_concluded,"qst_duel_for_lady"),
        (quest_slot_eq, "qst_duel_for_lady", slot_quest_target_troop, "$g_talk_troop"),
        (str_store_string, s15, "@You are challenging me to a duel? How droll! " +
        "As you wish, {playername}, it will be good sport to bash your head in."),
      (else_try),
        (check_quest_active,"qst_duel_courtship_rival"),
        (neg|check_quest_concluded,"qst_duel_courtship_rival"),
        (quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_talk_troop"),
        (str_store_string, s15, "str_call_me_coward_very_well_you_leave_me_no_choice"),
      (try_end),
    ], "{!}{s15}", "close_window",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -15),
      (call_script, "script_set_up_duel_with_troop", "$g_talk_troop"),
  ]],
  
  [anyone|plyr,"lord_talk",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active,"qst_duel_courtship_rival"),
      (neg|check_quest_concluded,"qst_duel_courtship_rival"),
      (quest_slot_eq, "qst_duel_courtship_rival", slot_quest_target_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_giver_troop", "qst_duel_courtship_rival", slot_quest_giver_troop),
      (str_store_troop_name, s5, ":quest_giver_troop")],
    "Relinquish your suit of {s5}!", "lord_challenge_courtship_rival", []],
  
  [anyone,"lord_challenge_courtship_rival",[], "Or what? Do you intend to duel over a lady? I'll let you know -- our liege frowns on this sort of hotheaded challenge, when every man must stand together against the foreign foe.", "lord_challenge_courtship_rival_2",[]],
  
  [anyone|plyr,"lord_challenge_courtship_rival_2", [], "Do you fear to fight me?", "lord_challenge_duel",[]],
  [anyone|plyr,"lord_challenge_courtship_rival_2", [], "My pardon. I have spoken rashly...", "lord_pretalk",[
      (call_script, "script_end_quest", "qst_duel_courtship_rival"),
  ]],
  
  [anyone|plyr,"lord_talk", [(check_quest_active, "qst_blank_quest_18"),
      (quest_slot_eq, "qst_blank_quest_18", slot_quest_target_troop, "$g_talk_troop"),
      (quest_get_slot, ":troop_no", "qst_blank_quest_18", slot_quest_giver_troop),
      (str_store_troop_name, s3, ":troop_no")],
    "I have brought you a message from {s3}", "message_from_lover_success",[]],
  
  [anyone,"message_from_lover_success", [], "Thank you so much, {playername}! It is good to hear from my lady. Of course, you understand this must be kept confidential, for the sake of the lady's honor.", "lord_pretalk",[
      (quest_get_slot, ":quest_giver", "qst_blank_quest_18", slot_quest_giver_troop),
      (call_script, "script_end_quest", "qst_blank_quest_18"),
      (try_begin),
        (neq, "$campaign_type", camp_storyline),
        (call_script, "script_change_player_relation_with_troop", ":quest_giver", 3),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
      (else_try),
        (store_random_in_range, ":rand", 2,7),
        (store_random_in_range, ":rand1", 3,8),
        (call_script, "script_change_player_relation_with_troop", ":quest_giver", ":rand1"),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", ":rand"),
      (try_end),
  ]],
  
  [anyone|plyr,"lord_talk",[(check_quest_active,"qst_deliver_message"),
      (quest_get_slot, ":quest_target_troop", "qst_deliver_message", slot_quest_target_troop),
      (eq,"$g_talk_troop",":quest_target_troop"),
      (quest_get_slot, ":quest_giver_troop", "qst_deliver_message", slot_quest_giver_troop),
      (str_store_troop_name,s9,":quest_giver_troop")],
    "I bring a message from {s9}.", "lord_message_delivered",
    []],
  
  [anyone,"lord_message_delivered", [], "Oh? Let me see that... " +
    "Well, well, well! It was good of you to bring me this, {playername}. Take my seal as proof that I've received it, " +
    "and give my regards to {s9} when you see him again.", "lord_pretalk",[
      (call_script, "script_end_quest", "qst_deliver_message"),
      (quest_get_slot, ":quest_giver", "qst_deliver_message", slot_quest_giver_troop),
      (str_store_troop_name,s9,":quest_giver"),
      (try_begin),
        (neq, "$campaign_type", camp_storyline),
        (call_script, "script_change_player_relation_with_troop", ":quest_giver", 3),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
      (else_try),
        (store_random_in_range, ":rand", 2,7),
        (store_random_in_range, ":rand1", 3,8),
        (call_script, "script_change_player_relation_with_troop", ":quest_giver", ":rand1"),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", ":rand"),
      (try_end),
  ]],
  
  [anyone|plyr,"lord_talk",[(check_quest_active,"qst_deliver_message_to_enemy_lord"),
      (quest_get_slot, ":quest_target_troop", "qst_deliver_message_to_enemy_lord", slot_quest_target_troop),
      (eq,"$g_talk_troop",":quest_target_troop"),
      (quest_get_slot, ":quest_giver_troop", "qst_deliver_message_to_enemy_lord", slot_quest_giver_troop),
      (str_store_troop_name,s9,":quest_giver_troop")],
    "I bring a message from {s9}.", "lord_message_delivered_enemy",
    []],
  
  
  [anyone,"lord_message_delivered_enemy", [], "Oh? Let me see that... " +
    "Hmmm. It was good of you to bring me this, {playername}. Take my seal as proof that I've received it, " +
    "with my thanks.", "close_window",[
      (call_script, "script_end_quest", "qst_deliver_message_to_enemy_lord"),
      (quest_get_slot, ":quest_giver", "qst_deliver_message_to_enemy_lord", slot_quest_giver_troop),
      (try_begin),
        (neq, "$campaign_type", camp_storyline),
        (call_script, "script_change_player_relation_with_troop", ":quest_giver", 1),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
      (else_try),
        (store_random_in_range, ":rand", 3,7),
        (store_random_in_range, ":rand1", 2,8),
        (call_script, "script_change_player_relation_with_troop", ":quest_giver", ":rand1"),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", ":rand"),
      (try_end),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  
  [anyone|plyr,"lord_talk", [(check_quest_active,"qst_deliver_message_to_prisoner_lord"),
      (quest_slot_eq, "qst_deliver_message_to_prisoner_lord", slot_quest_target_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_giver_troop", "qst_deliver_message_to_prisoner_lord", slot_quest_giver_troop),
      (str_store_troop_name, s11, ":quest_giver_troop")],
    "I bring a message from {s11}.", "lord_deliver_message_prisoner",
    [
      (call_script, "script_finish_quest", "qst_deliver_message_to_prisoner_lord", 100),
  ]],
  
  [anyone,"lord_deliver_message_prisoner", [], "Can it be true? " +
    "Oh, thank you kindly, {playername}! You have brought hope and some small ray of light to these bleak walls. " +
    "Perhaps one day I will be able to repay you.", "lord_deliver_message_prisoner_2",[]],
  [anyone|plyr,"lord_deliver_message_prisoner_2", [], " 'Twas the least I could do, {s65}.", "lord_deliver_message_prisoner_2a",[]],
  [anyone,"lord_deliver_message_prisoner_2a", [], "You've no idea how grateful I am, {playername}. A thousand thanks and more.", "close_window",[]],
  [anyone|plyr,"lord_deliver_message_prisoner_2", [], "Worry not, {s65}. You'll have ample opportunity once you are free again.", "lord_deliver_message_prisoner_2b",[]],
  [anyone,"lord_deliver_message_prisoner_2b", [], "Hah, of course, {playername}. My eternal thanks go with you.", "close_window",[]],
  
  [anyone|plyr,"lord_talk", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 1),
      (troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active,"qst_rescue_lord_by_replace"),
      (quest_slot_eq, "qst_rescue_lord_by_replace", slot_quest_target_troop, "$g_talk_troop"),
      (neg|check_quest_succeeded, "qst_rescue_lord_by_replace")],
    "Fear not, I am here to rescue you.", "lord_rescue_by_replace_offer",[]],
  
  [anyone,"lord_rescue_by_replace_offer", [],
    "Great God, are you serious? What is your plan?", "lord_rescue_by_replace_offer_2",[]],
  [anyone|plyr,"lord_rescue_by_replace_offer_2", [],
    "A simple ruse, {s65}. If we exchange garments, I shall take your place here in prison, " +
    "while you make your escape disguised as myself. " +
    "I paid the guards a handsome bribe, with which I am sure they have already purchased half the wine stocks of the nearest tavern. " +
    "With some luck they'll soon get so drunk, they'd have trouble " +
    "recognising their own mothers, let alone telling one of us from the other. " +
    "At least not until you are safely away.", "lord_rescue_by_replace_offer_3",[]],
  [anyone,"lord_rescue_by_replace_offer_3", [],
    "Hmm, it might just work... But what of you, my {reg59?lady:friend}? The guards won't take kindly to this trickery. " +
    "You may end up spending some time in this cell yourself.", "lord_rescue_by_replace_offer_4",[]],
  [anyone|plyr,"lord_rescue_by_replace_offer_4", [],
    "Not to worry, {s65}. The place is already starting to grow on me.", "lord_rescue_by_replace_offer_5a",[]],
  [anyone|plyr,"lord_rescue_by_replace_offer_4", [],
    "I shall be fine as long there is an ample reward waiting at the end.", "lord_rescue_by_replace_offer_5b",[]],
  [anyone,"lord_rescue_by_replace_offer_5a",[],
    "You are a brave soul indeed. I won't forget this.", "lord_rescue_by_replace_offer_6",[]],
  [anyone,"lord_rescue_by_replace_offer_5b",[],
    "Of course, my {reg59?lady:friend}, of course! Come to me when you have regained your freedom, " +
    "and perhaps I shall be able to repay the debt I owe you.", "lord_rescue_by_replace_offer_6",[]],
  [anyone|plyr,"lord_rescue_by_replace_offer_6",[],
    "Quickly, {s65}, let us change garments. It is past time you were away from here.", "close_window",
    [(call_script, "script_succeed_quest", "qst_rescue_lord_by_replace"),
      (quest_get_slot, ":quest_target_troop", "qst_rescue_lord_by_replace", slot_quest_target_troop),
      (quest_get_slot, ":quest_target_center", "qst_rescue_lord_by_replace", slot_quest_target_center),
      (party_remove_prisoners, ":quest_target_center", ":quest_target_troop", 1),
      #(troop_set_slot, ":quest_target_troop", slot_troop_is_prisoner, 0),
      (troop_set_slot, ":quest_target_troop", slot_troop_prisoner_of_party, -1),
      (assign, "$auto_menu", -1),
      (assign, "$capturer_party", "$g_encountered_party"),
      (jump_to_menu, "mnu_captivity_rescue_lord_taken_prisoner"),
      (finish_mission),
  ]],
  
  [anyone|plyr,"lord_talk", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (eq, "$players_oath_renounced_against_kingdom", "$g_talk_troop_faction"),
      (str_store_faction_name, s4, "$g_talk_troop_faction"),],
    "{s66}, I wish to restore my old oath to the {s4}.", "lord_ask_pardon_after_oath_renounced",[]],
  
  [anyone,"lord_ask_pardon_after_oath_renounced",
    [
      (faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
      (neq, ":faction_leader", "$g_talk_troop"),
      (str_store_troop_name, s4, ":faction_leader"),
      ], "That is too great a matter for me to decide, {playername}. You should seek out {s4}. Such clemency is his alone to grant or deny.", "lord_pretalk",[]],
  
  [anyone,"lord_ask_pardon_after_oath_renounced",
    [
      (assign, ":num_centers_captured_by_player"),
      (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
        (store_faction_of_party, ":cur_center_faction", ":cur_center"),
        (eq, ":cur_center_faction", "fac_player_supporters_faction"),
        (party_slot_eq, ":cur_center", slot_center_faction_when_oath_renounced, "$g_talk_troop_faction"),
        (val_add, ":num_centers_captured_by_player", 1),
      (try_end),
      (store_mul, ":peace_score", ":num_centers_captured_by_player", 500),
      (store_current_hours, ":cur_hours"),
      (val_sub, ":cur_hours", "$players_oath_renounced_begin_time"),
      (val_add, ":peace_score", ":cur_hours"),
      (try_begin),
        (gt, ":peace_score", 800),
        #Do not agree to give any centers but agree to make peace
        (assign, ":given_center", -1),
        (try_begin),
          (gt, ":peace_score", 1500),
          (try_begin),
            #Agree to give one center
            (eq, "$players_oath_renounced_given_center", 0),
            (store_random_in_range, ":given_center", 0, ":num_centers_captured_by_player"),
          (try_end),
        (else_try),
          (assign, "$players_oath_renounced_given_center", 0),
        (try_end),
        (assign, ":num_centers_written", 0),
        (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
          (store_faction_of_party, ":cur_center_faction", ":cur_center"),
          (eq, ":cur_center_faction", "fac_player_supporters_faction"),
          (party_slot_eq, ":cur_center", slot_center_faction_when_oath_renounced, "$g_talk_troop_faction"),
          (try_begin),
            (eq, ":given_center", 0),
            (assign, "$players_oath_renounced_given_center", ":cur_center"),
          (else_try),
            (neq, "$players_oath_renounced_given_center", ":cur_center"),
            (try_begin),
              (eq, ":num_centers_written", 0),
              (str_store_party_name, s17, ":cur_center"),
            (else_try),
              (eq, ":num_centers_written", 1),
              (str_store_party_name, s16, ":cur_center"),
              (str_store_string, s17, "@{s16} and {s17}"),
            (else_try),
              (str_store_party_name, s16, ":cur_center"),
              (str_store_string, s17, "@{!}{s16}, {s17}"),
            (try_end),
            (val_add, ":num_centers_written", 1),
          (try_end),
          (val_sub, ":given_center", 1),
        (try_end),
        (try_begin),
          (eq, ":num_centers_written", 0),#white peace
          (str_store_string, s11, "@Very well, I will accept you back into my ranks, if you're ready to swear your solemn oath once more."),
          (assign, "$players_oath_renounced_terms_state", 1),
        (else_try),
          (str_store_string, s11, "@A pardon will only be possible if you are willing to cede {s17} to me. Do you agree my terms?"),
          (assign, "$players_oath_renounced_terms_state", 2),
        (try_end),
      (else_try),
        #Do not agree to make peace
        (str_store_string, s11, "@No. There is no chance of peace between us. I am not interested."),
        (assign, "$players_oath_renounced_terms_state", 0),
      (try_end),
      ], "{!}{s11}.", "lord_ask_pardon_terms",[]],
  
  
  [anyone|plyr,"lord_ask_pardon_terms",
    [(eq, "$players_oath_renounced_terms_state", 0),
    ],
    "As you like, {s65}. I will accept your judgment.", "lord_pretalk",[]],
  [anyone|plyr,"lord_ask_pardon_terms",
    [(eq, "$players_oath_renounced_terms_state", 0),
    ],
    "A shame, {s65}. A shame.", "lord_pretalk",[]],
  [anyone|plyr,"lord_ask_pardon_terms",
    [(eq, "$players_oath_renounced_terms_state", 0),
    ],
    "Very well, go and die without me.", "lord_pretalk",[]],
  
  [anyone|plyr,"lord_ask_pardon_terms",
    [(eq, "$players_oath_renounced_terms_state", 1),
    ],
    "Aye, I am ready.", "lord_ask_pardon_after_renounce_peace",[]],
  
  [anyone|plyr,"lord_ask_pardon_terms",
    [(eq, "$players_oath_renounced_terms_state", 1),
    ],
    "On second thought, no. I don't wish to be in your service again.", "lord_ask_pardon_terms_rejected",[]],
  
  [anyone|plyr,"lord_ask_pardon_terms",
    [(eq, "$players_oath_renounced_terms_state", 2),
    ],
    "Aye, I agree to those terms.", "lord_ask_pardon_after_renounce_peace",[]],
  
  [anyone|plyr,"lord_ask_pardon_terms",
    [(eq, "$players_oath_renounced_terms_state", 2),
    ],
    "That is too high a price, {s65}. I must decline.", "lord_ask_pardon_terms_rejected",[]],
  
  
  [anyone,"lord_ask_pardon_after_renounce_peace",
    [], "Excellent. Though you strayed from us, {playername}, it gladdens all our hearts that you have found your way back to the right path. I hereby restore your homage to me. Rise once more as an honoured {reg59?warrior:man} in my service.", "lord_pretalk",
    [
      (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
        (store_faction_of_party, ":cur_center_faction", ":cur_center"),
        (eq, ":cur_center_faction", "fac_player_supporters_faction"),
        (party_slot_eq, ":cur_center", slot_center_faction_when_oath_renounced, "$g_talk_troop_faction"),
        (neq, ":cur_center", "$players_oath_renounced_given_center"),
        (party_get_slot, ":town_lord", ":cur_center", slot_town_lord),
        (try_begin),
          (ge, ":town_lord", 1),
          (call_script, "script_change_player_relation_with_troop", ":town_lord", -20), #nobody likes give his fief
        (try_end),
        (call_script, "script_give_center_to_faction", ":cur_center", "$g_talk_troop_faction"),
      (try_end),
      
      (call_script, "script_player_join_faction", "$g_talk_troop_faction"),
      (assign, "$player_has_homage", 1),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 6),
  ]],
  
  
  [anyone,"lord_ask_pardon_terms_rejected",
    [], "Then get out of my sight, traitor! Begone with you, and do not come back!", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
      #TODO: Add relation drop. $players_oath_renounced_begin_time can also be reset to current time for worse conditions in the next conversation.
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -15),
  ]],
  
  
  [anyone|plyr,"lord_talk", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (lt, "$g_talk_troop_faction_relation", 0),
      (this_or_next|ge, "$g_talk_troop_faction_kingdom_relation", 0),
      (this_or_next|eq, "$players_kingdom", 0),
      (eq, "$players_kingdom", "fac_player_supporters_faction"),
      (neq, "$players_oath_renounced_against_kingdom", "$g_talk_troop_faction"),
      (assign, ":continue", 1),
      (try_begin),
        (gt, "$supported_pretender", 0),
        (eq, "$supported_pretender_old_faction", "$g_talk_troop_faction"),
        (assign, ":continue", 0),
      (try_end),
      (eq, ":continue", 1),
      (is_between, "$g_talk_troop_faction", kingdoms_begin, kingdoms_end),
      (str_store_faction_name, s4, "$g_talk_troop_faction"),],
    "I wish to make peace with the {s4}.", "lord_ask_pardon",[]],
  
  [anyone,"lord_ask_pardon", [(lt, "$g_talk_troop_faction_relation", -10)], "Do you indeed, {playername}? Then go and trip on your sword. Give us all peace.", "lord_pretalk",[]],
  
  [anyone,"lord_ask_pardon",
    [
      (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
      (assign, ":has_center", 0),
      (try_for_range, ":cur_center", centers_begin, centers_end),
        (store_faction_of_party, ":cur_center_faction", ":cur_center"),
        (eq, ":cur_center_faction", "fac_player_supporters_faction"),
        (assign, ":has_center", 1),
      (try_end),
      (eq, ":has_center", 1),
      (lt, "$player_right_to_rule", 10),
      
    ], "{playername}, you are a {reg59?lady:lord} without a master, holding lands in your name, with only the barest scrap of a claim to legitimacy. " +
    "No king in the Northlands would accept a lasting peace with you.", "lord_pretalk",[]],
  
  [anyone,"lord_ask_pardon",
    [
      (assign, ":has_center", 0),
      (try_for_range, ":cur_center", centers_begin, centers_end),
        (store_faction_of_party, ":cur_center_faction", ":cur_center"),
        (eq, ":cur_center_faction", "fac_player_supporters_faction"),
        (assign, ":has_center", 1),
      (try_end),
      (eq, ":has_center", 1),
      (encountered_party_is_attacker),
      
      ], "Make peace when I have you at an advantage? I think not.", "lord_pretalk",[]],
  
  #If the player faction is active
  [anyone,"lord_ask_pardon",
    [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      
      (assign, ":has_center", 0),
      (try_for_range, ":cur_center", centers_begin, centers_end),
        (store_faction_of_party, ":cur_center_faction", ":cur_center"),
        (eq, ":cur_center_faction", "fac_player_supporters_faction"),
        (assign, ":has_center", 1),
      (try_end),
      (eq, ":has_center", 1),
      
      (call_script, "script_npc_decision_checklist_peace_or_war", "$g_talk_troop_faction", "fac_player_supporters_faction", "trp_player"), #moto fix here
      (lt, reg0, 0),
      ], "I do not see it as being in my current interest to make peace.", "lord_pretalk",[]],
  
  [anyone,"lord_ask_pardon",
    [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (assign, ":has_center", 0),
      (try_for_range, ":cur_center", centers_begin, centers_end),
        (store_faction_of_party, ":cur_center_faction", ":cur_center"),
        (eq, ":cur_center_faction", "fac_player_supporters_faction"),
        (assign, ":has_center", 1),
      (try_end),
      (eq, ":has_center", 1),
      ], "Yes... I am weary of fighting you. I could offer you a truce. If you keep your word and do not molest my lands and subjects, we may talk again...", "lord_truce_offer",[]],
  
  [anyone|plyr,"lord_truce_offer",
    [], "I accept. Let us stop making war upon each other, for the time being anyway", "close_window",[ (call_script, "script_diplomacy_start_peace_between_kingdoms", "$g_talk_troop_faction", "$players_kingdom", 1),
      (assign, "$g_leave_encounter", 1),
      (assign,"$g_leave_town_outside",1),]],
  
  [anyone|plyr,"lord_truce_offer",
    [], "On second thought, such an accord would not be in my interests.", "lord_pretalk",[]],
  
  [anyone,"lord_ask_pardon", [
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
      (assign, ":has_center", 0),
      (try_for_range, ":cur_center", centers_begin, centers_end),
        (store_faction_of_party, ":cur_center_faction", ":cur_center"),
        (eq, ":cur_center_faction", "fac_player_supporters_faction"),
        (assign, ":has_center", 1),
      (try_end),
      (eq, ":has_center", 0),
      (store_sub, ":hostility", 9, "$g_talk_troop_faction_relation"), #  4 - Seems too small a price MOTO 10 to 19
      (val_mul, ":hostility", ":hostility"), #square it MOTO 100 to 361
      (store_mul, reg16, ":hostility", 10),
      (str_store_faction_name, s4, "$g_talk_troop_faction"),
    ], "Hmm. I could use my considerable influence to arrange a pardon for you, {playername}, " +
    "but there are some who see you as an enemy and will not be satisfied unless you pay tribute. " +
    "All in all, you'd need to bring no less than {reg16} peningas to make any friends in the {s4}.", "lord_ask_pardon_2",[]],
  
  [anyone,"lord_ask_pardon",
    [
      (faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
      (neq, "$g_talk_troop", ":faction_leader"),
      (str_store_troop_name, s7, ":faction_leader"),
      ], "I am in no position to offer you anything. You must speak to {s7}.", "lord_pretalk",[]],
  
  [anyone,"lord_ask_pardon",
    [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (neg|faction_slot_ge, "fac_player_supporters_faction", slot_faction_leader, 1),
      (store_sub, ":hostility", 7, "$g_talk_troop_faction_relation"), # a discount MOTO 8 to 17
      (val_mul, ":hostility", ":hostility"), #square it MOTO 64 to 289
      (store_mul, reg16, ":hostility", 10),
      
      (str_store_faction_name, s4, "$g_talk_troop_faction"),
      ], "Yes... I have bigger worries than you or your followers. However, you have wronged my subjects, and wrongs demand compensation. For the sum of {reg16} peningas, I suppose that I could agree to grant you a pardon. What do you say?", "lord_ask_pardon_2",[
  ]],
  
  [anyone,"lord_ask_pardon",
    [
      ], "I am sorry. I am in no position to offer you a pardon", "lord_pretalk",[
  ]],
  
  
  
  
  
  [anyone|plyr,"lord_ask_pardon_2", [(store_troop_gold, ":gold","trp_player"),(ge, ":gold", reg16)], "I have the money here. {reg16} peningas.", "lord_ask_pardon_tribue_accept",[]],
  [anyone|plyr,"lord_ask_pardon_2", [], "I fear I cannot pay that much.", "lord_ask_pardon_tribue_deny",[]],
  
  [anyone,"lord_ask_pardon_tribue_accept", [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
    ], "Excellent, {playername}. " +
    "I will use this to make amends to those you have wronged, and I will let it be known that you are no longer an enemy of the {s4}.", "close_window",
    [
      (troop_remove_gold, "trp_player", reg16),
      
      (try_begin),
        (this_or_next|eq, "$players_kingdom", 0),
        (ge, "$g_talk_troop_faction_kingdom_relation", 0),
        (call_script, "script_set_player_relation_with_faction", "$g_talk_troop_faction", 0),
      (try_end),
      (assign,"$g_leave_town_outside",1),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"lord_ask_pardon_tribue_accept", [], "Excellent, {playername}. " +
    "I'll use the coin to smooth the feathers of those that can oppose your pardon, and I'm sure that word will soon spread that you are no longer an enemy of {s4}.", "close_window",
    [
      (troop_remove_gold, "trp_player", reg16),
      
      (try_begin),
        (this_or_next|eq, "$players_kingdom", 0),
        (ge, "$g_talk_troop_faction_kingdom_relation", 0),
        (call_script, "script_set_player_relation_with_faction", "$g_talk_troop_faction", 0),
      (else_try),
        (call_script, "script_diplomacy_start_peace_between_kingdoms", "$g_talk_troop_faction", "$players_kingdom", 1),
      (try_end),
      (assign,"$g_leave_town_outside",1),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"lord_ask_pardon_tribue_deny", [], "Then there's nothing I can do for you, {playername}. No silver, no pardon.", "lord_pretalk",[]],
  
  
  [anyone|plyr,"lord_talk", [(store_partner_quest,":lords_quest"),
      (neg|is_between, ":lords_quest", "qst_kennemer_jarl", "qst_vc_menu"), #No abort for mainquest chief evitamos perder quest bug
      (neg|check_quest_succeeded, "qst_denounce_lord"),
      (ge,":lords_quest",0),
    ],
    "About the task you gave me...", "lord_active_mission_1",[]],
  
  # This is done automatically now.
  ##  [anyone|plyr,"lord_talk", [(faction_slot_eq,"$g_talk_troop_faction",slot_faction_leader, "$g_talk_troop"),
  ##                             (eq, "$players_kingdom", "$g_talk_troop_faction"),
  ##                             (eq, "$player_has_homage", 0),
  ##                             (gt, "$mercenary_service_accumulated_pay", 0),
  ##                             ],
  ##   "{s67}, I humbly request the weekly payment for my service.", "lord_pay_mercenary",[]],
  ##
  ##  [anyone,"lord_pay_mercenary", [(assign, reg8, "$mercenary_service_accumulated_pay")],
  ##   "Hmm, let me see... According to my ledgers, we owe you {reg8} peningas for your work. Here you are.", "lord_pay_mercenary_2",
  ##   [(troop_add_gold, "trp_player", "$mercenary_service_accumulated_pay"),
  ##    (assign, "$mercenary_service_accumulated_pay", 0)]],
  ##
  ##  [anyone|plyr,"lord_pay_mercenary_2", [], "Thank you, sir.", "lord_pretalk", []],
  
  [anyone|plyr,"lord_talk", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
    ],
    "Let us discuss matters related to our household.", "lord_switch_to_spouse",[]],
  
  [anyone,"lord_switch_to_spouse", [
      (assign, ":feast_venue", -1),
      
      (try_begin),
        (is_between, "$current_town", walled_centers_begin, walled_centers_end),
        (this_or_next|party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
        (party_slot_eq, "$current_town", slot_town_lord, "$g_talk_troop"),
        (assign, ":feast_venue", "$current_town"),
      (else_try),
        (try_for_range, ":center", walled_centers_begin, walled_centers_end),
          (eq, ":feast_venue", -1),
          (this_or_next|party_slot_eq, ":center", slot_town_lord, "trp_player"),
          (party_slot_eq, ":center", slot_town_lord, "$g_talk_troop"),
          (assign, ":feast_venue", ":center"),
        (try_end),
        (is_between, ":feast_venue", walled_centers_begin, walled_centers_end), #unless there's a try/fail, will not do last check
        
      (else_try),
        (is_between, "$current_town", walled_centers_begin, walled_centers_end),
        (assign, ":feast_venue", "$current_town"),
      (try_end),
      
      (neg|is_between, ":feast_venue", walled_centers_begin, walled_centers_end),
    ],
    "Let us wait until we are in a hall, my wife, as it is difficult to deal with household inventories and such matters in the field.", "lord_pretalk",[]],
  
  [anyone,"lord_switch_to_spouse", [],
    "Certainly, my wife.", "spouse_talk",[]],
  
  [anyone|plyr, "lord_talk", [(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (ge, "$g_talk_troop_faction_kingdom_relation", 0),
      (neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_temp, 0),
      (eq, "$special1", 3),
      (assign, ":wine", 0),
      (troop_get_inventory_capacity, ":capacity", "trp_player"),
      (try_for_range, ":inventory_slot", 0, ":capacity"),
        (troop_get_inventory_slot, ":item", "trp_player", ":inventory_slot"),
        (eq, ":item", "itm_wine"),
        (val_add, ":wine", 1),
      (try_end),
      (ge, ":wine", 1),],"I would like to offer this rare wine for you to enjoy as a token of goodwill.", "lord_get_it",[]],
  [anyone, "lord_get_it",[],"Oh my, thank you very much, {playername}. You are a renowned wine expert. Everyone in Northlands knows that!", "lord_pretalk", [
      (troop_remove_item, "trp_player", "itm_wine"),
      (store_random_in_range, ":rand", 1,3),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", ":rand"),
      (troop_set_slot, "$g_talk_troop", slot_troop_temp, 1),]],
  
  # Pay lord to improve relations with his holdings (maybe)
  [anyone|plyr,"lord_talk", [(party_slot_eq, "$current_town", slot_party_bribed, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (ge, "$g_talk_troop_faction_kingdom_relation", 0),
      (call_script, "script_troop_get_player_relation",  "$g_talk_troop"),
      (assign, "$g_talk_troop_relation", reg0),
      #							 (troop_get_slot, "$g_talk_troop_relation", "$g_talk_troop", slot_troop_player_relation),
      (gt, "$g_talk_troop_relation", 10),
      (troop_get_slot, "$g_talk_troop_party", "$g_talk_troop", slot_troop_leaded_party),
      (gt, "$g_talk_troop_party", "p_bridge_18"),   #troop has party?
      (party_get_attached_to, ":attached_to_party", "$g_talk_troop_party"),
      (assign, ":party_is_in_town", 0),
      (try_begin),
        (is_between, ":attached_to_party", walled_centers_begin, walled_centers_end),
        (assign, ":party_is_in_town", ":attached_to_party"),
      (try_end),
      (gt,":party_is_in_town",0),
      (neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (party_slot_eq, ":party_is_in_town", slot_town_lord, "$g_talk_troop"),
      (party_get_slot, ":center_relation", ":party_is_in_town", slot_center_player_relation),
      (lt, ":center_relation", 0),
      (str_store_party_name, s33, ":party_is_in_town")],
    "Can you help me improve relations with {s33}?", "lord_request_help",[]],
  
  [anyone, "lord_request_help",[], "What do you have in mind?", "lord_request_help1", []],
  
  [anyone|plyr,"lord_request_help1", [
      (store_troop_gold, ":gold", "trp_player"),
      (lt, ":gold", 500)],
    "Nothing, I'm afraid my finances will not allow me to do anything at the moment.", "lord_pretalk",[]],
  
  [anyone|plyr,"lord_request_help1", [(store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 500)],
    "I'll give you 500 peningas to smooth things out with some important people here.", "lord_request_help2",[(assign, "$temp", 500)]],
  
  [anyone|plyr,"lord_request_help1", [(store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 1000)],
    "I'll give you 1000 peningas to smooth things out with some important people here.", "lord_request_help2",[(assign, "$temp", 1000)]],
  
  [anyone|plyr,"lord_request_help1", [],"Never mind.", "lord_pretalk",[]],
  
  [anyone, "lord_request_help2",[(assign, reg7, "$temp"),
      (str_clear, s33),
      (try_begin),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding), #
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured), #
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_benefactor), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_custodian), #
        (str_store_string, s33, "@I may be able to help you with such a delicate situation. Do you have {reg7} peningas on you?"),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome), #
        (str_store_string, s33, "@I have heard of your mistreatment of my subjects, {playername}. I'm pretty sure people still remember " +
        "what you did to them...^^But that's all in the past now, so just hand me the money. Did I hear {reg7} peningas?"),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous), #
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial), #
        (str_store_string, s33, "@{playername}, your treatment of my subjects was atrocious in the past, but such is war. I'm willing to help you in " +
        "this matter. Hand me that purse with {reg7} peningas, and I'll take care of the business."),
      (else_try),
        #(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning), #
        (str_store_string, s33, "@{playername}, we all make mistakes in our lives, and while your treatment of my subjects was bad, I don't hold grudges. " +
        "I will help you to restore people's believe in you as a just ruler. Allow me to take that purse with {reg7} peningas, and I'll take care of the business."),
      (try_end),
      ], "{!}{s33}", "lord_request_help3", [(assign, "$temp", reg7)]],
  
  [anyone|plyr,"lord_request_help3", [(assign, reg7, "$temp"),],
    "Thank you, I appreciate your help.", "lord_pretalk",[
      (str_clear, s34),
      (troop_remove_gold, "trp_player", "$temp"),
      (store_div, ":max_boost", "$temp", 250),
      (val_add,":max_boost", 1),
      (try_begin),
        (party_slot_eq, "$current_town", slot_party_type, spt_castle),
        (val_add, ":max_boost", 4),
      (else_try),
        (val_add, ":max_boost", 2),
      (try_end),
      (try_begin),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding), #
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured), #
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_benefactor), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_custodian), #
        (store_random_in_range, ":rel_boost", 0,":max_boost"),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome), #
        (store_random_in_range, ":rand", 1,6),
        (store_mul, ":stolen", ":rand", "$temp"),
        (val_div, ":stolen", 5),
        (troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
        (val_add, ":wealth", ":stolen"),
        (troop_set_slot, "$g_talk_troop", slot_troop_wealth, ":wealth"),
        (try_begin),
          (eq, "$temp", 500),
          (val_div, ":rand", 2),
        (try_end),
        (val_sub, ":max_boost", ":rand"),
        (val_max, ":max_boost", 0),
        (try_begin),
          (eq, ":max_boost", 1),
          (val_add, ":max_boost", 1),
        (try_end),
        (try_begin),
          (eq, ":max_boost", 0),
          (str_store_troop_name, s35, "$g_talk_troop"),
          (str_store_string, s34, "@Rumor has it that {s35} just took the money and didn't even bother talking to people."),
        (try_end),
        (store_random_in_range, ":rel_boost", 0,":max_boost"),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous), #
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish), #
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial), #
        (store_random_in_range, ":rand", 0,2),
        (val_sub, ":max_boost", ":rand"),
        (val_max, ":max_boost", 0),
        (try_begin),
          (eq, ":max_boost", 1),
          (val_add, ":max_boost", 1),
        (try_end),
        (store_random_in_range, ":rel_boost", 0,":max_boost"),
      (else_try),
        #(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning), #
        (store_random_in_range, ":rand", 1,6),
        (store_mul, ":stolen", ":rand", "$temp"),
        (val_div, ":stolen", 5),
        (troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
        (val_add, ":wealth", ":stolen"),
        (troop_set_slot, "$g_talk_troop", slot_troop_wealth, ":wealth"),
        (val_div, ":rand", 2),
        (val_sub, ":max_boost", ":rand"),
        (val_max, ":max_boost", 0),
        (try_begin),
          (eq, ":max_boost", 1),
          (val_add, ":max_boost", 1),
        (try_end),
        (try_begin),
          (eq, ":max_boost", 0),
          (str_store_troop_name, s35, "$g_talk_troop"),
          (str_store_string, s34, "@Rumor has it that {s35} kept the money for himself."),
        (try_end),
        (store_random_in_range, ":rel_boost", 0,":max_boost"),
      (try_end),
      (try_begin),
        (gt, ":rel_boost", 0),
        (call_script, "script_change_player_relation_with_center", "$current_town", ":rel_boost"),
      (else_try),
        (eq, ":max_boost", 0),
        (display_message,"@{s34}", color_bad_news),
      (else_try),
        (display_message, "@Your efforts to bribe local population were unsuccessful.", color_bad_news),
      (try_end),
      (party_set_slot, "$current_town", slot_party_bribed, 1),
  ]],
  
  [anyone|plyr,"lord_request_help3", [],"Actually, I really don't care what they think about me.", "lord_pretalk",[]],
  
  
  [anyone|plyr,"lord_talk", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (ge, "$g_talk_troop_faction_kingdom_relation", 0),
      (ge, "$g_talk_troop_faction_relation", -5),
      (store_partner_quest,":lords_quest"),
      (lt,":lords_quest",0),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
      (neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (neq,"$g_talk_troop_faction", "fac_adventurers"),
      (store_and, reg0, "$option_switches", lord_option_task),
      (eq, reg0, 0),
    ],
    "Do you have any tasks for me?", "lord_request_mission_ask",[]],
  
  [anyone|plyr,"lord_talk",
    [
      (eq, "$g_talk_troop_faction", "$players_kingdom"),
      (eq, "$player_has_homage", 1),
      (neq,"$g_talk_troop_faction", "fac_adventurers"),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      
    ],
    "Do you think we can work together to advance our standings in this realm?", "combined_political_quests",[
      (call_script, "script_get_political_quest", "$g_talk_troop"),
      (assign, "$political_quest_found", reg0),
      (assign, "$political_quest_target_troop", reg1),
      (assign, "$political_quest_object_troop", reg2),
  ]],
  
  [anyone,"combined_political_quests", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (lt, "$g_talk_troop_effective_relation", -5),
    ],
    "I do not imagine that you and I have many mutual interests.", "lord_pretalk",[
  ]],
  
  
  [anyone,"combined_political_quests", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (gt, "$political_quest_found", 0),
      (assign, ":continue", 1),
      (try_begin),
        (call_script, "script_cf_troop_can_intrigue", "$g_talk_troop", 1),
        (assign, ":continue", 0),
      (try_end),
      (eq, ":continue", 1),
    ],
    "Hmm.. Perhaps we can discuss this matter in a more private setting, at a later date.", "lord_pretalk",[
  ]],
  
  [anyone,"combined_political_quests", [
      (this_or_next|eq, "$political_quest_found", "qst_intrigue_against_lord"),
      (eq, "$political_quest_found", "qst_denounce_lord"),
      
      (troop_slot_ge, "trp_player", slot_troop_controversy, 30),
      
    ],
    "Hmm.. I do have an idea, but it would require you that you be free of controversy. If you were to wait some time without getting into any arguments with the other lords of our realm, perhaps we could proceed further.", "lord_pretalk",[
  ]],
  
  
  [anyone|plyr,"lord_talk", [(le,"$talk_context", tc_party_encounter),
      (faction_slot_eq, "$players_kingdom", slot_faction_leader, "$g_talk_troop"),
      (faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
    ],
    "I wish to resign as marshal.", "lord_ask_resign_marshalship",[]],
  
  [anyone,"lord_ask_resign_marshalship", [],
    "So be it. I shall have to find someone else.", "lord_pretalk",[
      (assign, ":faction_no", "$players_kingdom"),
      (faction_set_slot, ":faction_no", slot_faction_political_issue, 1), #Appointment of marshal
      (store_current_hours, ":hours"),
      (val_max, ":hours", 0),
      (faction_set_slot, ":faction_no", slot_faction_political_issue_time, ":hours"), #Appointment of marshal
      
      (faction_get_slot, ":old_marshal", ":faction_no", slot_faction_marshal),
      (try_begin),
        (ge, ":old_marshal", 0),
        (troop_get_slot, ":old_marshal_party", ":old_marshal", slot_troop_leaded_party),
        (party_is_active, ":old_marshal_party"),
        (party_set_marshal, ":old_marshal_party", 0),
      (try_end),
      
      (faction_set_slot, ":faction_no", slot_faction_marshal, -1),
      
      (try_for_range, ":active_npc", active_npcs_begin, active_npcs_end),
        (store_faction_of_troop, ":active_npc_faction", ":active_npc"),
        (eq, ":active_npc_faction", ":faction_no"),
        (troop_set_slot, ":active_npc", slot_troop_stance_on_faction_issue, -1),
      (try_end),
      (try_begin),
        (eq, "$players_kingdom", ":faction_no"),
        (troop_set_slot, "trp_player", slot_troop_stance_on_faction_issue, -1),
      (try_end),
      (call_script, "script_add_notification_menu", "mnu_notification_relieved_as_marshal", 0, 0),
  ]],
  
  
  
  [anyone|plyr,"lord_talk", [(le,"$talk_context", tc_party_encounter),
      (ge, "$g_talk_troop_faction_kingdom_relation", 0),
      (neq, "$campaign_type", camp_storyline), # JuJu70 to prevent people becoming vassals before the story is over
      #(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (neq, "$players_kingdom", "$g_talk_troop_faction"),
      (store_partner_quest, ":lords_quest"),
      (neq, ":lords_quest", "qst_join_faction"),
      #                           (store_and, reg0, "$option_switches", lord_option_vassalage),
      ##							(troop_get_slot, ":last_talk_time", "$g_talk_troop", slot_troop_last_talk_time),
      ##							(store_current_hours, ":hours_since_last_talk"),
      ##							(val_sub, ":hours_since_last_talk", ":last_talk_time"),
      ## #                            (eq, reg0, 0),
      ##							(gt,  ":hours_since_last_talk",24),
    ],
    "{s66}, I have come to offer you my sword in vassalage!", "lord_ask_enter_service",[]],
  
  
  [anyone|plyr,"lord_talk", [(le,"$talk_context", tc_party_encounter),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (eq, "$players_kingdom", "$g_talk_troop_faction"),
      (eq, "$player_has_homage", 0),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_spouse, "trp_player"),  #no husband v-2461
      (store_partner_quest, ":lords_quest"),
      (neq, ":lords_quest", "qst_join_faction"),
      #                            (store_and, reg0, "$option_switches", lord_option_vassalage),
      #                             (eq, reg0, 0),
      ##							(troop_get_slot, ":last_talk_time", "$g_talk_troop", slot_troop_last_talk_time),
      ##							(store_current_hours, ":hours_since_last_talk"),
      ##							(val_sub, ":hours_since_last_talk", ":last_talk_time"),
      ##							(gt,  ":hours_since_last_talk",120),
    ],
    "{s66}, I wish to become your sworn {reg59?woman:man} and fight for your honour.", "lord_ask_enter_service",[]],
  
  [anyone|plyr,"lord_talk", [(le,"$talk_context", tc_party_encounter),
      (ge, "$g_talk_troop_faction_kingdom_relation", 0),
      #(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (eq, "$players_kingdom", "$g_talk_troop_faction"),
      (eq, "$player_has_homage", 1),
    ],
    "{s66}, I wish to be released from my oath to you.", "lord_ask_leave_service",[]],
  
  ##  [anyone|plyr,"lord_talk", [(le,"$talk_context", tc_party_encounter),
  ##                             (ge, "$g_talk_troop_faction_relation", 0),
  ##                             (troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                             (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
  ##                             (eq, "$players_kingdom", 0),
  ##                             (eq,1,0)],
  ##   "TODO2:I want to fight alongside you against your enemies.", "close_window",[]],
  
  # [anyone|plyr,"lord_talk", [(eq, 1, 0),(le,"$talk_context", tc_party_encounter),(ge, "$g_talk_troop_faction_kingdom_relation", 0)],
    # "I have an offer for you.", "lord_talk_preoffer",[]],
  
  
  [anyone|plyr,"lord_talk", [(eq, "$g_talk_troop_faction", "fac_player_supporters_faction"),
      #(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
    ],
    "I want to give some troops to you.", "lord_give_troops",[]],
  
  [anyone,"lord_give_troops", [],
    "Well, I could use some good soldiers. Thank you.", "lord_pretalk",
    [
      (change_screen_give_members, "$g_talk_troop_party"),
  ]],
  
  
  [anyone|plyr,"lord_talk",
    [
      (eq, "$g_talk_troop_faction", "$players_kingdom"),
      (faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      #(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
    ],
    "I have a new task for you.", "lord_give_order_ask",[]],
  
  
  [anyone|plyr,"lord_talk",
    [
      (eq, "$g_talk_troop_faction", "$players_kingdom"),
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      #(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
    ],
    "May I suggest a course of action?", "lord_give_suggestion_ask",[]],
  
  
  [anyone,"lord_give_order_ask", [],
    "Yes?", "lord_give_order",[]],
  
  [anyone,"lord_give_suggestion_ask", [
      (faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
    ],
    "I will gladly follow your direction, {reg59?your Highness:sire}. If you intend to direct an extensive campaign, however, you may also wish to declare yourself marshal, so there is no cause for confusion.", "lord_give_order",[]],
  
  
  [anyone,"lord_give_suggestion_ask", [
      (lt, "$g_talk_troop_effective_relation", 5), #was five
    ],
    "My apologies. I don't know you well enough to take your advice.", "lord_pretalk",[]],
  
  [anyone,"lord_give_suggestion_ask", [
    ],
    "What is it?", "lord_give_order",[
  ]],
  
  [anyone|plyr,"lord_give_order", [
      (faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
    ],
    "Follow me.", "lord_give_order_answer",
    [
      (assign, "$temp", spai_accompanying_army),
      (assign, "$temp_2", "p_main_party"),
      
      (store_current_hours, ":hours"),
      (party_set_slot, "$g_talk_troop_party", slot_party_following_orders_of_troop, "trp_kingdom_heroes_including_player_begin"),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_type, "$temp"),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_object, "$temp_2"),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_time, ":hours"),
  ]],
  
  [anyone|plyr,"lord_give_order", [
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
    ],
    "Will you follow me? I have a plan...", "lord_give_order_answer",
    [
      (assign, "$temp", spai_accompanying_army),
      (assign, "$temp_2", "p_main_party"),
      
      (store_current_hours, ":hours"),
      (party_set_slot, "$g_talk_troop_party", slot_party_following_orders_of_troop, "trp_kingdom_heroes_including_player_begin"),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_type, "$temp"),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_object, "$temp_2"),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_time, ":hours"),
  ]],
  
  [anyone|plyr,"lord_give_order", [
      (faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      
    ],
    "Go to...", "lord_give_order_details_ask",
    [
      (assign, "$temp", spai_holding_center),
  ]],
  
  
  [anyone|plyr,"lord_give_order", [
      (faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      
    ],
    "Raid around the village of...", "lord_give_order_details_ask",
    [
      (assign, "$temp", spai_raiding_around_center),
  ]],
  
  [anyone|plyr,"lord_give_order", [
      (faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      
    ],
    "Patrol around...", "lord_give_order_details_ask",
    [
      (assign, "$temp", spai_patrolling_around_center),
  ]],
  
  #only as suggestion
  [anyone|plyr,"lord_give_order", [
      (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_besieging_center),
      (party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (party_slot_eq, ":ai_object", slot_center_is_besieged_by, "$g_talk_troop_party"),
      (party_slot_eq, ":ai_object", slot_village_state, svs_under_siege),
      (str_store_party_name, s11, ":ai_object"),
    ],
    "Together, you and I can take {s11}. You should assault immediately...", "lord_give_order_assault",
    [
      #for this one and another one, if the $g_talk_troop is a _t
      #     (assign, "$temp", spai_patrolling_around_center),
  ]],
  
  #only as suggestion
  [anyone|plyr,"lord_give_order", [
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"), #not an order,  only a suggestion
      
    ],
    "We are under attack, but the enemy can be repulsed. You should ride towards...", "lord_give_order_details_ask",
    [
      (assign, "$temp", spai_patrolling_around_center),
  ]],
  
  #only as suggestion
  [anyone|plyr,"lord_give_order", [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshal, "$g_talk_troop"),
      
    ],
    "We are under attack, but the enemy can be repulsed. You should assemble the army and march to...", "lord_give_order_details_ask",
    [
      (assign, "$temp", spai_patrolling_around_center),
  ]],
  
  
  [anyone,"lord_give_order_assault", [
      (party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (party_get_slot, ":besieging_party", ":ai_object", slot_center_is_besieged_by),
      (neq, ":besieging_party", "$g_talk_troop_party"),
      (party_stack_get_troop_id, ":siege_commander", ":besieging_party", 0),
      (str_store_troop_name, s4, ":siege_commander"),
      (troop_get_type, reg4, ":siege_commander"),
      (val_mod, reg4, 2),
    ],
    "{s4} is directing this siege. I suggest you speak to {reg4?her:him}", "lord_pretalk",
    []],
  
  
  [anyone,"lord_give_order_assault", [
      (party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (party_get_slot, ":siege_begun", ":ai_object", slot_center_siege_begin_hours),
      (store_current_hours, ":cur_hour"),
      (store_sub, ":hours_of_siege", ":cur_hour", ":siege_begun"),
      
      (try_begin),
        (assign, ":hours_required", 9),
      (try_end),
      (val_sub, ":hours_required", ":hours_of_siege"),
      (gt, ":hours_required", 0),
      (try_begin),
        (gt, ":hours_required", 1),
        (assign, reg3, ":hours_required"),
        (str_store_string, s11, "str_reg3_hours"),
      (else_try),
        (str_store_string, s11, "str_hour"),
      (try_end),
    ],
    "Our preparations are not yet ready. We need another {s11}", "lord_pretalk",
    [
  ]],
  
  
  [anyone,"lord_give_order_assault", [
    ],
    "Very well -- to the walls!", "close_window",
    [
      (party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (call_script, "script_begin_assault_on_center", ":ai_object"),
      
      (party_set_slot, "$g_talk_troop_party", slot_party_under_player_suggestion, spai_besieging_center),
      (assign, "$g_leave_encounter", 1),
      
  ]],
  
  
  
  
  #only as suggestion
  [anyone|plyr,"lord_give_order", [
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"), #not an order,  only a suggestion
    ],
    "There is a fortress which can easily be taken. Go to..", "lord_give_order_details_ask",
    [
      (assign, "$temp", spai_besieging_center),
  ]],
  
  [anyone|plyr,"lord_give_order", [
      #    (neg|faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
    ],
    "The enemy is coming in force. Flee in the direction of...", "lord_give_order_details_ask",
    [
      (assign, "$temp", spai_retreating_to_center),
  ]],
  
  
  
  
  
  [anyone|plyr,"lord_give_order",
    [
      (faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      #    (neg|troop_slot_eq, "$g_talk_troop", slot_troop_player_order_state, spai_undefined),
    ],
    "I won't need you for some time. You are free to do as you like.", "lord_give_order_stop",
    []],
  
  [anyone|plyr,"lord_give_order",
    [
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_accompanying_army),
      (party_slot_eq, "$g_talk_troop_party", slot_party_ai_object, "p_main_party"),
    ],
    "You no longer need to accompany me.", "lord_give_order_stop",
    []],
  
  
  
  [anyone|plyr,"lord_give_order", [],
    "Never mind.", "lord_pretalk",
    []],
  
  
  [anyone,"lord_give_order_details_ask", [
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
      (eq, "$temp", spai_retreating_to_center),
      
    ],
    "It is not my way to turn tail and run, without even laying eyes on the enemy.", "lord_pretalk",[]],
  
  [anyone,"lord_give_order_details_ask", [
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
      (eq, "$temp", spai_besieging_center),
      
    ],
    "You want me to shed my blood outside a fortress while others stand by and watch? I think not.", "lord_pretalk",[]],
  
  [anyone,"lord_give_order_details_ask", [],
    "Where?", "lord_give_order_details",[]],
  
  [anyone|plyr|repeat_for_parties, "lord_give_order_details",
    [
      (store_repeat_object, ":party_no"),
      (store_faction_of_party, ":party_faction", ":party_no"),
      (store_relation, ":relation", ":party_faction", "$players_kingdom"),
      (assign, ":continue", 0),
      (try_begin),
        (this_or_next|eq, "$temp", spai_retreating_to_center),
        (eq, "$temp", spai_holding_center),
        (try_begin),
          (this_or_next|party_slot_eq, ":party_no", slot_party_type, spt_castle),
          (party_slot_eq, ":party_no", slot_party_type, spt_town),
          (eq, ":party_faction", "$players_kingdom"),
          (assign, ":continue", 1),
        (try_end),
      (else_try),
        (eq, "$temp", spai_raiding_around_center),
        (try_begin),
          (party_slot_eq, ":party_no", slot_party_type, spt_village),
          (lt, ":relation", 0),
          (assign, ":continue", 1),
        (try_end),
      (else_try),
        (eq, "$temp", spai_besieging_center),
        (try_begin),
          (this_or_next|party_slot_eq, ":party_no", slot_party_type, spt_castle),
          (party_slot_eq, ":party_no", slot_party_type, spt_town),
          (party_slot_eq, ":party_no", slot_center_is_besieged_by, -1),
          (lt, ":relation", 0),
          (assign, ":continue", 1),
        (try_end),
      (else_try),
        (eq, "$temp", spai_patrolling_around_center),
        (try_begin),
          (eq, ":party_faction", "$players_kingdom"),
          (is_between, ":party_no", centers_begin, centers_end),
          (assign, ":continue", 1),
        (else_try),
          (is_between, ":party_no", centers_begin, centers_end),
          (store_distance_to_party_from_party, ":distance", ":party_no", "p_main_party"),
          (le, ":distance", 25),
          (assign, ":continue", 1),
        (try_end),
      (try_end),
      (eq, ":continue", 1),
      (neq, ":party_no", "$g_encountered_party"),
      (str_store_party_name, s1, ":party_no")],
    "{!}{s1}", "lord_give_order_answer",
    [
      (store_repeat_object, "$temp_2"),
      (store_current_hours, ":hours"),
      (party_set_slot, "$g_talk_troop_party", slot_party_following_orders_of_troop, "trp_kingdom_heroes_including_player_begin"),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_type, "$temp"),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_object, "$temp_2"),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_time, ":hours"),
  ]],
  
  [anyone|plyr, "lord_give_order_details",
    [], "Never mind.", "lord_pretalk",[]],
  
  #Simple stop order
  [anyone,"lord_give_order_stop", [],
    "All right, I will stop here.", "lord_pretalk",
    [
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_type, spai_undefined),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_object, -1),
      #this is not set above, so should be set here
      (store_current_hours, ":hours"),
      (val_sub, ":hours", 36),
      (val_max, ":hours", 0),
      
      (party_set_slot, "$g_talk_troop_party", slot_party_following_orders_of_troop, "trp_kingdom_heroes_including_player_begin"),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_type, spai_undefined),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_object, -1),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_time, ":hours"),
      
      #same variable as above
      (troop_get_slot, ":party_no", "$g_talk_troop", slot_troop_leaded_party),
      (try_begin),
        (gt, ":party_no", 0),
        (call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1),
        (party_set_slot, ":party_no", slot_party_commander_party, -1),
      (try_end),
  ]],
  
  [anyone,"lord_give_order_answer",
    [
      (eq, "$temp", spai_accompanying_army),
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      (call_script, "script_troop_get_player_relation", "$g_talk_troop"),
      (assign, ":player_relation", reg0),
      (troop_get_slot, ":troop_renown", "$g_talk_troop", slot_troop_renown),
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      #(val_mul, ":troop_renown", 3),
      #(val_div, ":troop_renown", 4),
      #(this_or_next|lt, ":player_renown", ":troop_renown"),
      #(lt, ":player_relation", 0),
      
      (store_skill_level, ":player_persuasion_level", "skl_persuasion", "trp_player"),
      (store_div, ":player_relation_div_5", ":player_relation", 5),
      (val_min, ":player_relation_div_5", 10),
      (store_add, ":player_persuasion_power", ":player_relation_div_5", ":player_persuasion_level"),
      
      (store_sub, ":needed_lowest_renown", 20, ":player_persuasion_power"),
      (val_mul, ":needed_lowest_renown", ":troop_renown"),
      (val_div, ":needed_lowest_renown", 10),
      
      (this_or_next|lt, ":player_renown", ":needed_lowest_renown"),
      (lt, ":player_relation", 0),
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_leader, "trp_player"),
    ],
    "That would hardly be proper. It would be more appropriate for you to follow me instead. Did you have any other ideas?", "lord_give_order",
    [
      (party_set_slot, "$g_talk_troop_party", slot_party_following_orders_of_troop, 0),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_type, 0),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_object, 0),
      (party_set_slot, "$g_talk_troop_party", slot_party_orders_time, 0),
  ]],
  
  #More complicated order
  [anyone,"lord_give_order_answer",
    [	(neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshal, "trp_player"),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
      (str_store_string, s12, "str_but_if_this_goes_badly"),
      (call_script, "script_npc_decision_checklist_party_ai", "$g_talk_troop"),
      (eq, reg0, "$temp"),
      (eq, reg1, "$temp_2"),
    ],
    "All right, I will do that.{s12}", "lord_pretalk",
    [
      (call_script, "script_party_set_ai_state", "$g_talk_troop_party", "$temp", "$temp_2"),
      (party_set_slot, "$g_talk_troop_party", slot_party_under_player_suggestion,"$temp"),
      (assign, "$g_leave_encounter", 1),
  ]],
  [anyone,"lord_give_order_answer",
    [	(this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshal, "trp_player"),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
    ],
    "All right, I will do that.", "lord_pretalk",
    [
      (call_script, "script_party_set_ai_state", "$g_talk_troop_party", "$temp", "$temp_2"),
      (assign, "$g_leave_encounter", 1),
  ]],
  #Recalculated orders do not match
  [anyone,"lord_give_order_answer", [],
    "I am sorry. I need to attend my own business at the moment.", "lord_pretalk",
    [
      (call_script, "script_npc_decision_checklist_party_ai", "$g_talk_troop"),
      (call_script, "script_party_set_ai_state", "$g_talk_troop_party", reg0, reg1),
  ]],
  
  
  [anyone|plyr,"lord_talk",
    [
      (eq, "$g_talk_troop_faction", "$players_kingdom"),
      (faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      #(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (this_or_next|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_default),
      (faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_feast),
    ],
    "I want to start a new campaign. Let us assemble the army here.", "lord_give_order_call_to_arms_verify",
    []],
  
  [anyone,"lord_give_order_call_to_arms_verify", [],
    "You wish to summon all lords for a new campaign?", "lord_give_order_call_to_arms_verify_2",[]],
  
  [anyone|plyr,"lord_give_order_call_to_arms_verify_2", [], "Yes. We must gather all our forces before we march on the enemy.", "lord_give_order_call_to_arms",[]],
  [anyone|plyr,"lord_give_order_call_to_arms_verify_2", [], "On second thought, it won't be necessary to summon everyone.", "lord_pretalk",[]],
  
  [anyone,"lord_give_order_call_to_arms",
    [],
    "All right, then I will send messengers and tell everyone to come here.", "lord_pretalk",
    [
      (assign, "$player_marshal_ai_state", sfai_gathering_army),
      (assign, "$player_marshal_ai_object", "p_main_party"),
      (call_script, "script_decide_faction_ai", "$players_kingdom"),
      (assign, "$g_recalculate_ais", 1),
  ]],
  
  [anyone|plyr,"lord_talk",
    [
      (eq, "$g_talk_troop_faction", "$players_kingdom"),
      (faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      #(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_default),
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_feast),
    ],
    "I want to end the campaign and let everyone return home.", "lord_give_order_disband_army_verify", []],
  
  [anyone,"lord_give_order_disband_army_verify", [],
    "You want to end the current campaign and release all lords from duty?", "lord_give_order_disband_army_2",[]],
  
  [anyone|plyr,"lord_give_order_disband_army_2", [], "Yes. We no longer need all our forces here.", "lord_give_order_disband_army",[]],
  [anyone|plyr,"lord_give_order_disband_army_2", [], "On second thought, it will be better to stay together for now.", "lord_pretalk",[]],
  
  [anyone,"lord_give_order_disband_army",
    [],
    "All right, I will let everyone know that they are released from duty.", "lord_pretalk",
    [
      (assign, "$player_marshal_ai_state", sfai_default),
      (assign, "$player_marshal_ai_object", -1),
      (call_script, "script_decide_faction_ai", "$players_kingdom"),
      (assign, "$g_recalculate_ais", 1),
  ]],
  
  [anyone|plyr,"lord_talk", [
      (ge,"$g_encountered_party_relation",0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
    ],
    "I wish to ask you something.", "lord_talk_ask_something",[]],
  
  [anyone,"lord_talk_ask_something", [],
    "Aye? What is it?", "lord_talk_ask_something_2",[]],
  
  [anyone|plyr,"lord_talk_ask_something_2",
    [(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (ge, "$g_talk_troop_effective_relation", 0),
      (this_or_next|is_between, "$g_talk_troop", companions_begin, companions_end),
      (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
    ],
    "Let me see your skills.", "lord_talk_ask_skill",[]],
  
  [anyone,"lord_talk_ask_skill", [], "Let me show you...", "lord_pretalk",[(change_screen_view_character)]],
  
  [anyone,"lord_talk_ask_something_again", [],
    "Is there anything else?", "lord_talk_ask_something_2",[]],
  
  
  [anyone|plyr,"lord_talk_ask_something_2", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
    ],
    "I want to know the location of someone.", "lord_talk_ask_location",[]],
  
  [anyone|plyr,"lord_talk_ask_something_2", [
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_leaded_party, -1)
    ],
    "What are you and your men doing?", "lord_tell_objective",[
      (party_get_slot, ":ai_behavior", "$g_talk_troop_party", slot_party_ai_state),
      (party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      
      (try_begin),
        (eq, "$cheat_mode", 1),
        (party_get_ai_initiative, reg4, "$g_talk_troop_party"),
        (party_get_helpfulness, reg5, "$g_talk_troop_party"),
        (display_message, "@{!}DEBUG : Initiative {reg4}, helpfulness {reg5}"),
      (try_end),
      
      (str_clear, s14),
      (str_clear, s15),
      (str_clear, s16),
      
      (try_begin),
        (call_script, "script_npc_decision_checklist_party_ai", "$g_talk_troop"),
        (eq, reg0, ":ai_behavior"),
        (eq, reg1, ":ai_object"),
      (else_try),
        (eq, reg0, spai_screening_army),	#what script_npc_decision_checklist_party_ai specifies
        (eq, ":ai_behavior", spai_accompanying_army),	#what script_party_set_ai_state sets
        (party_slot_eq, "$g_talk_troop_party", slot_party_ai_substate, 1),
        (eq, reg1, ":ai_object"),
      (else_try),
        # (call_script, "script_party_set_ai_state", "$g_talk_troop_party", reg0, reg1),	this makes the dialog make no sense; wait for trigger
        (str_store_string, s14, "str_however_circumstances_have_changed_since_we_made_that_decision_and_i_may_reconsider_shortly_s16"),
        (try_begin),
          (ge, "$cheat_mode", 1),
          (display_message, "@{!}DEBUG -- ai behavior: {reg0}, ai object: {reg1}"),
        (try_end),
      (try_end),
  ]],
  
  [anyone|plyr,"lord_talk_ask_something_2", [
      #(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (neq,"$g_talk_troop_faction", "fac_adventurers"),
      (neq,"$g_talk_troop_faction", "fac_commoners"),
    ],
    "What is the realm doing?", "lord_talk_ask_about_strategy",[]],
  
  [anyone,"lord_talk_ask_about_strategy", [
      (eq, "$players_kingdom", "$g_talk_troop_faction"),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshal, "trp_player"),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
    ],
    "You should decide that, as you are the marshal.", "lord_pretalk",[]],
  
  
  
  [anyone|plyr,"lord_talk_ask_something_2", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (neq,"$g_talk_troop_faction", "fac_adventurers"),
      (neq,"$g_talk_troop_faction", "fac_commoners"),
    ],
    "How goes the war?", "lord_talk_ask_about_war",[]],
  
  [anyone|plyr,"lord_talk_ask_something_2", [	 (troop_slot_eq, "$g_talk_troop",slot_troop_sell_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (ge,"$g_encountered_party_relation",0),
      (neq, "$g_talk_troop_faction", "$players_kingdom"),
      (party_get_num_prisoners, ":prisoners", "p_main_party"),
      (ge, ":prisoners", 1),
    ],
    "I have some prisoners for ransom.", "lord_talk_ask_about_prisoners",[]],
  
  [anyone,"lord_talk_ask_about_prisoners", [
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
    ],
    "I may consider that if I see someone that I know or that appears to be a real warrior.", "lord_talk_ask_about_prisoners1",[]],
  
  [anyone,"lord_talk_ask_about_prisoners", [],"I am not interested.", "lord_pretalk",[]],
  
  [anyone|plyr,"lord_talk_ask_about_prisoners1", [
      (assign, ":prisoner_to_buy", 0),
      (party_get_num_prisoner_stacks,":num_prisoner_stacks","p_main_party"),
      (try_for_range,":i_pris_stack",0,":num_prisoner_stacks"),
        (party_prisoner_stack_get_troop_id, ":troop_id", "p_main_party", ":i_pris_stack"),
        (neg|troop_slot_eq, ":troop_id", slot_troop_occupation, slto_kingdom_hero),
        (neg|troop_slot_eq, ":troop_id", slot_troop_occupation, slto_kingdom_lady),
        (store_character_level, ":level", ":troop_id"),
        (gt,  ":level", 26),
        (party_stack_get_size, ":stack_size","p_main_party",":i_pris_stack"),
        (val_add, ":prisoner_to_buy", ":stack_size"),
      (try_end),
      (gt, ":prisoner_to_buy", 0),
    ],
    "Alright, here they are. Does anyone catch your eye?", "lord_talk_ask_about_prisoners2",[]],
  
  [anyone|plyr,"lord_talk_ask_about_prisoners1", [],"Real warriors? I don't think I have any of those.", "lord_pretalk",[]],
  
  [anyone,"lord_talk_ask_about_prisoners2", [
      (party_get_num_prisoner_stacks,":num_prisoner_stacks","p_main_party"),
      (assign, ":size", 0),
      (assign, ":troop", 0),
      (try_for_range,":i_pris_stack",0,":num_prisoner_stacks"),
        (party_prisoner_stack_get_troop_id, ":troop_id", "p_main_party", ":i_pris_stack"),
        (neg|troop_slot_eq, ":troop_id", slot_troop_occupation, slto_kingdom_hero),
        (neg|troop_slot_eq, ":troop_id", slot_troop_occupation, slto_kingdom_lady),
        (store_character_level, ":level", ":troop_id"),
        (gt,  ":level", 26),
        (neg|is_between, ":troop_id", bandits_begin, bandits_end),
        (party_stack_get_size, ":stack_size","p_main_party",":i_pris_stack"),
        (gt, ":stack_size", ":size"),
        (assign, ":size", ":stack_size"),
        (assign, ":troop", ":troop_id"),
        (assign, ":num_prisoner_stacks", 0),
      (try_end),
      (gt, ":size", 0),
      (try_begin),
        (eq, ":size", 1),
        (str_store_troop_name, s33, ":troop"),
      (else_try),
        (str_store_troop_name_plural, s33, ":troop"),
      (try_end),
      (assign, reg33, ":size"),
      (store_character_level, ":level", ":troop"),
      (val_mul, ":level", 5),
      #	(val_div, ":level", 2),
      (val_mul, ":level", ":size"),
      (troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (gt, ":wealth", ":level"),
      (assign, reg34, ":level"),
      (assign, "$temp", ":troop"),
      ],"I would like to ransom {reg33} {s33}. I will pay you {reg34} peningas.", "lord_talk_ask_about_prisoners3",[]],
  
  [anyone,"lord_talk_ask_about_prisoners2", [], "No one that I would buy right now.", "lord_pretalk",[(troop_set_slot, "$g_talk_troop",slot_troop_sell_prisoner, 1),]],
  
  [anyone|plyr,"lord_talk_ask_about_prisoners3", [],"Ok, deal, you can have them.", "lord_pretalk",[
      (troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (val_sub, ":wealth", reg34),
      (troop_set_slot, "$g_talk_troop", slot_troop_wealth, ":wealth"),
      (call_script, "script_troop_add_gold", "trp_player", reg34),
      (remove_troops_from_prisoners,  "$temp", reg33),
      (party_add_members, "$g_talk_troop_party", "$temp", reg33),
      (troop_set_slot, "$g_talk_troop",slot_troop_sell_prisoner, 1),
  ]],
  
  [anyone|plyr,"lord_talk_ask_about_prisoners3", [],"On second thought, I'll hold on to them.", "lord_pretalk",[(troop_set_slot, "$g_talk_troop",slot_troop_sell_prisoner, 1),]],
  
  
  
  
  #Marriage proposal
  [anyone|plyr,"lord_talk_ask_something_2",[
      (check_quest_active, "qst_formal_marriage_proposal"),
      (neg|check_quest_failed, "qst_formal_marriage_proposal"),
      (neg|check_quest_succeeded, "qst_formal_marriage_proposal"),
      
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
      
      (quest_slot_eq, "qst_formal_marriage_proposal", slot_quest_target_troop, "$g_talk_troop"),
      (quest_get_slot, ":bride", "qst_formal_marriage_proposal", slot_quest_giver_troop),
      
      (str_store_troop_name, s10, ":bride"),
      (call_script, "script_troop_get_family_relation_to_troop", ":bride", "$g_talk_troop"),
      
      (call_script, "script_troop_get_relation_with_troop", "trp_player", ":bride"),
      
      (try_begin),
        (gt, reg0, 20),
        (str_store_string, s19, "str_i_wish_to_marry_your_s11_s10_i_ask_for_your_blessing"),
      (else_try),
        (str_store_string, s19, "str_i_wish_to_marry_your_s11_s10_i_ask_for_your_help"),
      (try_end),
      
    ],
    "{!}{s19}", "lord_marriage_permission",
    [
      
  ]],
  
  #no permission
  [anyone,"lord_marriage_permission", [
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
    ],
    "Great heaven, man -- if I haven't given you permission to see her, do you think I'm going to give you permission to marry her?", "lord_pretalk",[
      (call_script, "script_fail_quest", "qst_formal_marriage_proposal"),
      (call_script, "script_end_quest", "qst_formal_marriage_proposal"),
  ]],
  
  #unwilling bride -- failed due to lord personality
  [anyone,"lord_marriage_permission", [
      (troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
      (quest_get_slot, ":bride", "qst_formal_marriage_proposal", slot_quest_giver_troop),
      (call_script, "script_troop_get_relation_with_troop", "trp_player", ":bride"),
      (lt, reg0, 20),
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
      
      (call_script, "script_troop_get_family_relation_to_troop", ":bride", "$g_talk_troop"),
    ],
    "It is not my way to push my {s11} to marry against her will or her better judgment", "lord_pretalk",[
      (call_script, "script_fail_quest", "qst_formal_marriage_proposal"),
      (call_script, "script_end_quest", "qst_formal_marriage_proposal"),
      
  ]],
  
  
  #unwilling bride -- failed due to competitor
  [anyone,"lord_marriage_permission", [
      (troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
      (quest_get_slot, ":bride", "qst_formal_marriage_proposal", slot_quest_giver_troop),
      (call_script, "script_troop_get_relation_with_troop", "trp_player", ":bride"),
      (lt, reg0, 20),
      (assign, ":highest_competitor_score", "$g_talk_troop_relation"),
      (try_for_range, ":competitor", lords_begin, lords_end),
        (this_or_next|troop_slot_eq, ":competitor", slot_troop_love_interest_1, ":bride"),
        (this_or_next|troop_slot_eq, ":competitor", slot_troop_love_interest_2, ":bride"),
        (troop_slot_eq, ":competitor", slot_troop_love_interest_3, ":bride"),
        (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":competitor"),
        (gt, reg0, ":highest_competitor_score"),
        (assign, ":highest_competitor_score", reg0),
        
        (str_store_troop_name, s12, ":competitor"),
      (try_end),
      (gt, ":highest_competitor_score", "$g_talk_troop_relation"),
      (call_script, "script_troop_get_family_relation_to_troop",  ":bride", "$g_talk_troop"),
      
    ],
    "Sorry, lad -- I'm not going to make my {s11} marry you, when I'd rather see her married to {s12}", "lord_pretalk",[
      (call_script, "script_fail_quest", "qst_formal_marriage_proposal"),
      (call_script, "script_end_quest", "qst_formal_marriage_proposal"),
  ]],
  
  
  #Permission granted
  [anyone,"lord_marriage_permission", [
      (quest_get_slot, ":bride", "qst_formal_marriage_proposal", slot_quest_giver_troop),
      (str_store_troop_name, s11, ":bride"),
    ],
    "Splendid news, my young man -- I shall be proud to have you in our family. Now, let us talk the terms of the marriage. As per our custom, the two of us must make sure that {s11} has sufficient finances to support herself, in the event of any unforeseen circumstances.", "lord_marriage_permission_endowment",[
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (troop_get_slot, ":guardian_renown", "$g_talk_troop", slot_troop_renown),
      
      (store_mul, "$marriage_dowry", ":player_renown", 20),
      (val_min, "$marriage_dowry", 20000),
      
      (store_mul, "$marriage_dower", ":guardian_renown", 20),
      (val_min, "$marriage_dower", 20000),
  ]],
  
  
  [anyone,"lord_marriage_permission_endowment", [
      (assign, reg3, "$marriage_dower"),
      (assign, reg4, "$marriage_dowry"),
    ],
    "I would say that, taking into consideration the prestige of our two houses, that you can provide a dower of {reg3} peningas, while I will supply a dowry of {reg4} peningas. This shall be her ladyship's property, as a security, lest for any reason you are unable to provide for her. What say you to that?", "lord_marriage_permission_endowment_answer",[
  ]],
  
  [anyone|plyr,"lord_marriage_permission_endowment_answer", [
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", "$marriage_dower"),
    ],
    "Very well -- so let it be.", "lord_marriage_permission_engagement_date",[
  ]],
  
  [anyone|plyr,"lord_marriage_permission_endowment_answer", [],
    "I cannot afford that right now.", "lord_marriage_permission_endowment_answer_delay",[
  ]],
  
  # [anyone|plyr,"lord_marriage_permission_endowment_answer", [
      # (eq, 1, 0),
    # ],
    # "That is too much to pay.", "lord_marriage_permission_endowment_answer_no",[
  # ]],
  
  # [anyone,"lord_marriage_permission_endowment_answer_no", [],
    # "Well. I cannot in all decency allow my daughter to marry without some security, can I? Let me know if you change your mind.", "close_window",[
      # (assign, "$g_leave_encounter", 1),
  # ]],
  
  
  [anyone,"lord_marriage_permission_engagement_date", [
      (quest_get_slot, ":bride", "qst_formal_marriage_proposal", slot_quest_giver_troop),
      (call_script, "script_get_kingdom_lady_social_determinants", ":bride"),
      (assign, ":venue", reg1),
      (is_between, ":venue", walled_centers_begin, walled_centers_end),
      (party_slot_eq, ":venue", slot_village_state, svs_normal),
      (str_store_party_name, s24, ":venue"),
    ],
    "Splendid! You two may now consider yourselves officially betrothed. Very well -- I shall plan to hold a great feast in {s24}, as soon as circumstances permit. We will be sure to notify you when the day comes.", "close_window",
    [
      (quest_get_slot, ":bride", "qst_formal_marriage_proposal", slot_quest_giver_troop),
      (troop_set_slot, "trp_player", slot_troop_betrothed, ":bride"),
      (troop_set_slot, ":bride", slot_troop_betrothed, "trp_player"),
      
      (call_script, "script_end_quest", "qst_formal_marriage_proposal"),
      
      
      (troop_remove_gold, "trp_player", "$marriage_dower"),
      (call_script, "script_get_kingdom_lady_social_determinants", ":bride"),
      (assign, ":venue", reg1),
      
      (str_store_troop_name, s3, ":bride"),
      (str_store_troop_name, s4, "$g_talk_troop"),
      (str_store_party_name, s5, ":venue"),
      
      (setup_quest_text, "qst_wed_betrothed"),
      (str_store_string, s2, "str_you_plan_to_marry_s3_at_a_feast_hosted_by_s4_in_s5_you_should_be_notifed_of_the_feast_as_soon_as_it_is_held"),
      
      (call_script, "script_start_quest", "qst_wed_betrothed", "$g_talk_troop"),
      
      (quest_set_slot, "qst_wed_betrothed", slot_quest_expiration_days, 365),
      (quest_set_slot, "qst_wed_betrothed", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_set_slot, "qst_wed_betrothed", slot_quest_target_troop, ":bride"),
      
      (try_begin),
        (eq,"$talk_context",tc_party_encounter),
        (assign, "$g_leave_encounter", 1),
      (try_end),
      
  ]],
  
  
  [anyone,"lord_marriage_permission_engagement_date", [],
    "Unfortunately, there is one final complication -- there is no safe place to hold the wedding. Let us hold off on finalizing this, for the time being.", "close_window",
    []],
  
  [anyone,"lord_marriage_permission_endowment_answer_delay", [],
    "No matter -- take the time you need to raise the money. I want her ladyship to be well looked after.", "lord_pretalk",[
  ]],
  
  [anyone,"lord_marriage_permission_endowment_answer_delay", [],
    "That is a shame, but I would be remiss in my duty if I allowed her ladyship to face an uncertain future.", "lord_pretalk",[
      (call_script, "script_fail_quest", "qst_formal_marriage_proposal"),
      (call_script, "script_end_quest", "qst_formal_marriage_proposal"),
  ]],
  
  
  
  #courtship
  [anyone|plyr,"lord_talk_ask_something_2",[
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_refused, 0),
      (assign, "$marriage_candidate", 0),
      (try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
        (eq, "$marriage_candidate", 0),
        (troop_slot_ge, ":lady", slot_troop_courtship_state, 2),
        (neg|troop_slot_eq, ":lady", slot_troop_courtship_state, 4),
        (neg|troop_slot_ge, ":lady", slot_troop_spouse, 0),
        (call_script, "script_get_kingdom_lady_social_determinants", ":lady"),
        (eq, reg0, "$g_talk_troop"),
        
        (assign, "$marriage_candidate", ":lady"),
        
        (str_clear, s14),
        (call_script, "script_troop_get_family_relation_to_troop", ":lady", "$g_talk_troop"),
        (gt, reg0, 0),
        (str_store_string, s14, "str_your_s11_"),
      (try_end),
      (gt, "$marriage_candidate", 0),
      (str_store_troop_name, s12, "$marriage_candidate"),
      
      (str_clear, s10),
      #	(try_begin),
      #		(troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, -1),
      #		(str_store_string, s10, "str_i_ask_again_may"),
      #	(else_try),
      (str_store_string, s10, "str_may"),
      #	(try_end),
    ],
    "{s10} I have the honor of visiting with {s14}{s12}?", "lord_courtship_permission",
    []],
  
  
  [anyone,"lord_courtship_permission", [
      (troop_slot_ge, "$marriage_candidate", slot_troop_met, 2),
      (neg|troop_slot_eq, "$marriage_candidate", slot_troop_met, 4),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
      
      (call_script, "script_troop_get_relation_with_troop", "$marriage_candidate", "trp_player"),
      (gt, reg0, 0),
    ],
    "From what I hear, you have already spoken to her -- without my permission. Let me tell you this: I am her lord and guardian, and I have plans for her. I will not be mocked behind my back as a man who cannot control the women of his household. I would ask you not to discuss this matter with me again.", "lord_pretalk",
    [
      (troop_set_slot, "$g_talk_troop", slot_lord_granted_courtship_permission, -1),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -1),
      (troop_set_slot, "$g_talk_troop", slot_troop_refused, 1),
  ]],
  
  
  [anyone,"lord_courtship_permission", [
      (call_script, "script_npc_decision_checklist_male_guardian_assess_suitor", "$g_talk_troop", "trp_player"),
      (lt, reg0, 1),
      (str_store_string, s14, reg1),
    ],
    "{!}{s14}", "lord_pretalk",
    [
      (troop_set_slot, "$g_talk_troop", slot_lord_granted_courtship_permission, -1),
      (troop_set_slot, "$g_talk_troop", slot_troop_refused, 1),
  ]],
  
  
  [anyone,"lord_courtship_permission", [
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
        (str_store_string, s12, "str_very_well_as_far_as_im_concerned_i_suppose_she_can_see_most_anyone_she_likes__within_reason_of_course"),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
        (str_store_string, s12, "str_very_well_an_alliance_with_you_could_be_valuable_go_chat_with_her_and_see_if_you_can_get_her_to_take_a_fancy_to_you_if_she_doesnt_and_if_we_still_want_to_conclude_this_business_then_i_can_make_her_see_reason"),
      (else_try),
        (str_store_string, s12, "str_you_have_my_blessing_to_pay_suit_to_her__so_long_as_your_intentions_are_honorable_of_course_depending_on_how_things_proceed_between_you_two_we_may_have_more_to_discuss_at_a_later_date"),
      (try_end),
    ],
    "{!}{s12}", "lord_pretalk",
    [
      (troop_set_slot, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
  ]],
  
  #Ask for marriage, following courtship, both with or against lady's wishes
  
  [anyone|plyr,"lord_talk_ask_something_2", [
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
      (troop_get_type, ":is_female", "$g_talk_troop"),
      (val_mod, ":is_female", 2),
      (neq, ":is_female", 1),
      (assign, ":cont", 0),
      (try_begin),
        (check_quest_active, "qst_wed_betrothed_female"),
        (quest_slot_eq, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
        (assign, ":cont", 1),
      (try_end),
      (eq, ":cont", 0),
    ],
    "What would it take to cement a lasting alliance with your house?", "lord_talk_ask_marriage_1",[]],
  
  
  [anyone|plyr,"lord_talk_ask_something_2", [],
    "Never mind.", "lord_pretalk",[]],
  
  [anyone,"lord_talk_ask_location", [],
    "Very well, I may or may not have an answer for you. About whom do you wish to hear?", "lord_talk_ask_location_2",[]],
  
  [anyone|plyr|repeat_for_troops,"lord_talk_ask_location_2", [(store_repeat_object, ":troop_no"),
      (neq, "$g_talk_troop", ":troop_no"),
      (is_between, ":troop_no", active_npcs_begin, kingdom_ladies_end),
      (neq, ":troop_no", "trp_player"),
      (this_or_next|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_lady),
      (store_troop_faction, ":faction_no", ":troop_no"),
      (eq, "$g_talk_troop_faction", ":faction_no"),
      (str_store_troop_name, s1, ":troop_no"),
      (try_begin),
        (faction_slot_eq, "$players_kingdom", slot_faction_marshal, ":troop_no"),
        (str_store_string, s1, "@Our marshal, {s1}"),
      (try_end),
      
    ],
    "{!}{s1}", "lord_talk_ask_location_3",[(store_repeat_object, "$hero_requested_to_learn_location")]],
  
  [anyone|plyr,"lord_talk_ask_location_2", [
      (is_between, "$g_talk_troop", kingdom_ladies_begin, kingdom_ladies_end),
      ], "Never mind.", "lady_pretalk",[]],
  
  [anyone|plyr,"lord_talk_ask_location_2", [
      (neg|is_between, "$g_talk_troop", kingdom_ladies_begin, kingdom_ladies_end),
      ], "Never mind.", "lord_pretalk",[]],
  
  [anyone,"lord_talk_ask_location_3",
    [
      (is_between, "$g_talk_troop", kingdom_ladies_begin, kingdom_ladies_end),
      (call_script, "script_update_troop_location_notes", "$hero_requested_to_learn_location", 1),
      (call_script, "script_get_information_about_troops_position", "$hero_requested_to_learn_location", 0),
    ],
    "{!}{s1}", "lady_pretalk",[]],
  
  
  
  [anyone,"lord_talk_ask_location_3",
    [
      (call_script, "script_update_troop_location_notes", "$hero_requested_to_learn_location", 1),
      (call_script, "script_get_information_about_troops_position", "$hero_requested_to_learn_location", 0),
    ],
    "{!}{s1}", "lord_pretalk",[]],
  
  [anyone,"lord_talk_ask_about_war", [],
    "{!}{s12}", "lord_talk_ask_about_war_2",[
      (assign, ":num_enemies", 0),
      (try_for_range_backwards, ":cur_faction", kingdoms_begin, kingdoms_end),
        (faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active),
        (store_relation, ":cur_relation", ":cur_faction", "$g_talk_troop_faction"),
        (lt, ":cur_relation", 0),
        (try_begin),
          (eq, ":num_enemies", 0),
          (str_store_faction_name_link, s12, ":cur_faction"),
          (str_store_string, s12, "@the {s12}"),
        (else_try),
          (eq, ":num_enemies", 1),
          (str_store_faction_name_link, s11, ":cur_faction"),
          (str_store_string, s12, "@the {s11} and {s12}"),
        (else_try),
          (str_store_faction_name_link, s11, ":cur_faction"),
          (str_store_string, s12, "@the {s11}, {s12}"),
        (try_end),
        (val_add, ":num_enemies", 1),
      (try_end),
      (try_begin),
        (eq, ":num_enemies", 0),
        (str_store_string, s12, "@We are not at war with anyone."),
      (else_try),
        (str_store_string, s12, "@We are at war with {s12}."),
      (try_end),
  ]],
  
  [anyone|plyr|repeat_for_factions, "lord_talk_ask_about_war_2", [(store_repeat_object, ":faction_no"),
      (is_between, ":faction_no", kingdoms_begin, kingdoms_end),
      (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
      (store_relation, ":cur_relation", ":faction_no", "$g_talk_troop_faction"),
      (lt, ":cur_relation", 0),
      (str_store_faction_name, s1, ":faction_no")],
    "Tell me more about the war with the {s1}.", "lord_talk_ask_about_war_details",[(store_repeat_object, "$faction_requested_to_learn_more_details_about_the_war_against")]],
  
  [anyone|plyr,"lord_talk_ask_about_war_2", [], "That's all I wanted to know. Thank you.", "lord_pretalk",[]],
  
  [anyone,"lord_talk_ask_about_war_details", [
      (assign, ":faction", "$faction_requested_to_learn_more_details_about_the_war_against"),
      (store_add, ":war_damage_slot", ":faction", slot_faction_war_damage_inflicted_on_factions_begin),
      (val_sub, ":war_damage_slot", kingdoms_begin),
      (faction_get_slot, ":war_damage_inflicted", "$g_talk_troop_faction", ":war_damage_slot"),
      
      (store_add, ":war_damage_slot", "$g_talk_troop_faction", slot_faction_war_damage_inflicted_on_factions_begin),
      (val_sub, ":war_damage_slot", kingdoms_begin),
      (faction_get_slot, ":war_damage_suffered", ":faction", ":war_damage_slot"),
      
      (val_max, ":war_damage_suffered", 1),
      
      (store_mul, ":war_damage_ratio", ":war_damage_inflicted", 100),
      (val_div, ":war_damage_ratio", ":war_damage_suffered"),
      
      (try_begin),
        (eq, "$cheat_mode", 1),
        (assign, reg3, ":war_damage_inflicted"),
        (assign, reg4, ":war_damage_suffered"),
        (assign, reg5, ":war_damage_ratio"),
        (display_message, "str_war_damage_inflicted_reg3_suffered_reg4_ratio_reg5"),
      (try_end),
      
      (str_store_string, s9, "str_error__did_not_calculate_war_progress_string_properly"),
      (try_begin),
        (lt, ":war_damage_inflicted", 5),
        (str_store_string, s9, "str_the_war_has_barely_begun_so_and_it_is_too_early_to_say_who_is_winning_and_who_is_losing"),
      (else_try),
        (gt, ":war_damage_inflicted", 100),
        (gt, ":war_damage_ratio", 200),
        (str_store_string, s9, "str_we_have_been_hitting_them_very_hard_and_giving_them_little_chance_to_recover"),
      (else_try),
        (gt, ":war_damage_inflicted", 80),
        (gt, ":war_damage_ratio", 150),
        (str_store_string, s9, "str_the_fighting_has_been_hard_but_we_have_definitely_been_getting_the_better_of_them"),
      (else_try),
        (gt, ":war_damage_suffered", 100),
        (lt, ":war_damage_ratio", 50),
        (str_store_string, s9, "str_they_have_been_hitting_us_very_hard_and_causing_great_suffering"),
      (else_try),
        (gt, ":war_damage_suffered", 80),
        (lt, ":war_damage_ratio", 68),
        (str_store_string, s9, "str_the_fighting_has_been_hard_and_i_am_afraid_that_we_have_been_having_the_worst_of_it"),
      (else_try),
        (gt, ":war_damage_suffered", 50),
        (gt, ":war_damage_inflicted", 50),
        (gt, ":war_damage_ratio", 65),
        (str_store_string, s9, "str_both_sides_have_suffered_in_the_fighting"),
      (else_try),
        (gt, ":war_damage_ratio", 125),
        (str_store_string, s9, "str_no_clear_winner_has_yet_emerged_in_the_fighting_but_i_think_we_are_getting_the_better_of_them"),
      (else_try),
        (gt, ":war_damage_ratio", 80),
        (str_store_string, s9, "str_no_clear_winner_has_yet_emerged_in_the_fighting_but_i_fear_they_may_be_getting_the_better_of_us"),
      (else_try),
        (str_store_string, s9, "str_no_clear_winner_has_yet_emerged_in_the_fighting"),
      (try_end),
      
      (try_begin),
        (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
        (call_script, "script_npc_decision_checklist_peace_or_war", "$g_talk_troop_faction", ":faction", -1),
        (str_store_string, s9, "str_s9_s14"),
      (try_end),
      
      
    ],
    #   "We have {reg5?{reg5}:no} {reg3?armies:army} and they have {reg6?{reg6}:none}. Overall, {s9}.",
    "{!}{s9}.",
    "lord_talk_ask_about_war_2",
    [#(call_script, "script_faction_get_number_of_armies", "$g_encountered_party_faction"),
      #(assign, reg5, reg0),
      #(assign, reg3, 1),
      #(try_begin),
      #  (eq, reg5, 1),
      #  (assign, reg3, 0),
      #(try_end),
      #(call_script, "script_faction_get_number_of_armies", "$faction_requested_to_learn_more_details_about_the_war_against"),
      #(assign, reg6, reg0),
      #(assign, reg4, 1),
      #(try_begin),
      #  (eq, reg6, 1),
      #  (assign, reg4, 0),
      #(try_end),
      #(store_div, ":our_str", reg5, 2),
      #(store_div, ":enemy_str", reg6, 2),
      #(store_sub, ":advantage", ":our_str", ":enemy_str"),
      #(val_clamp, ":advantage", -4, 5),
      #(val_add, ":advantage", 4),
      #(store_add, ":adv_str", "str_war_report_minus_4", ":advantage"),
      #(str_store_string, s9, ":adv_str"),
      
      
  ]],
  
  
  
  [anyone,"lord_talk_ask_about_strategy", [
      (faction_get_slot, ":ai_state", "$g_encountered_party_faction", slot_faction_ai_state),
      (faction_get_slot, ":ai_object", "$g_encountered_party_faction", slot_faction_ai_object),
      
      
      
      (faction_get_slot, ":ai_decider", "$g_encountered_party_faction", slot_faction_marshal),
      (try_begin),
        (eq, ":ai_decider", -1),
        (faction_get_slot, ":ai_decider", "$g_encountered_party_faction", slot_faction_leader),
      (try_end),
      
      (call_script, "script_npc_decision_checklist_faction_ai_alt", ":ai_decider"),
      (assign, ":planned_state", reg0),
      (assign, ":planned_object", reg1),
      
      
      (try_begin),
        (gt, ":ai_object", -1),
        (str_store_party_name, s8, ":ai_object"),
      (try_end),
      
      (try_begin),
        (eq, ":ai_state", sfai_default),
        (str_store_string, s7, "str_there_is_no_campaign_currently_in_progress"),
      (else_try),
        (eq, ":ai_state", sfai_gathering_army),
        (str_store_string, s7, "str_we_are_assembling_the_army"),
      (else_try),
        (eq, ":ai_state", sfai_attacking_center),
        (str_store_string, s7, "str_we_aim_to_take_the_fortress_of_s8"),
      (else_try),
        (eq, ":ai_state", sfai_raiding_village),
        (str_store_string, s7, "str_we_are_on_a_raid_and_are_now_targeting_s8"),
      (else_try),
        (eq, ":ai_state", sfai_attacking_enemy_army),
        (str_store_string, s7, "str_we_are_trying_to_seek_out_and_defeat_s8"),
      (else_try),
        (eq, ":ai_state", sfai_attacking_enemies_around_center),
        (str_store_string, s7, "str_we_are_riding_to_the_defense_of_s8"),
      (else_try),
        (eq, ":ai_state", sfai_feast),
        (str_store_string, s7, "str_we_are_gathering_for_a_feast_at_s8"),
      (try_end),
      
      #Additional information for gathering the army
      (str_clear, s9),
      (try_begin),
        (eq, ":ai_state", sfai_gathering_army),
        (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
        (gt, ":faction_marshal", -1),
        (troop_get_slot, ":marshal_party", ":faction_marshal", slot_troop_leaded_party),
        (party_is_active, ":marshal_party"),
        
        (this_or_next|eq, "$g_talk_troop", ":faction_marshal"),
        (party_slot_eq, "$g_talk_troop_party", slot_party_ai_object, ":marshal_party"),
        
        (party_get_slot, ":marshal_object", ":marshal_party", slot_party_ai_object),
        
        (try_begin),
          (eq, ":marshal_object", -1),
          (str_store_string, s9, "str_we_are_waiting_here_for_vassals"),
        (else_try),
          (str_store_party_name, s11, ":marshal_object"),
          (str_store_string, s9, "str_we_are_travelling_to_s11_for_vassals"),
        (try_end),
      (try_end),
      
      
      (try_begin),
        (this_or_next|neq, ":ai_state", ":planned_state"),
        (neq, ":ai_object", ":planned_object"),
        
        (str_store_string, s14, "str__however_that_may_change_shortly_s14"),
      (try_end),
      
    ],
    "{s7} {s9} {s14}", "lord_strategy_follow_evaluation",
    []],
  
  [anyone, "lord_strategy_follow_evaluation", [
      (this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshal, "$g_talk_troop"),
      (this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_default),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
    ],
    "Did you have any other questions?",
    "lord_talk_ask_something_2",[
  ]],
  
  
  [anyone, "lord_strategy_follow_evaluation", [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_gathering_army),
      (call_script, "script_npc_decision_checklist_faction_ai_alt", "$g_talk_troop"),
      (assign, ":talk_troop_preferred_strategy", reg0),
      (neq, ":talk_troop_preferred_strategy", sfai_gathering_army),
      
      (store_current_hours, ":hours_at_current_state"),
      (faction_get_slot, ":current_state_started", "$g_talk_troop_faction", slot_faction_ai_current_state_started),
      (val_sub, ":hours_at_current_state", ":current_state_started"),
      (ge, ":hours_at_current_state", 40),
      
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
      (neq, ":faction_marshal", "$g_talk_troop"),
      (str_store_troop_name, s4, ":faction_marshal"),
    ],
    "Our leader {s4} is far too cautious. {reg4?He:She} should either use the army to attack the enemy, or let it go home.",
    "lord_strategy_follow_up",[
      (assign, "$g_talk_troop_disagrees_with_marshal", 1),
      
  ]],
  
  
  [anyone, "lord_strategy_follow_evaluation", [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_gathering_army),
      
      (store_current_hours, ":hours_at_current_state"),
      (faction_get_slot, ":current_state_started", "$g_talk_troop_faction", slot_faction_ai_current_state_started),
      (val_sub, ":hours_at_current_state", ":current_state_started"),
      (ge, ":hours_at_current_state", 40),
      
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
      (neq, ":faction_marshal", "$g_talk_troop"),
      
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":faction_marshal"),
      (lt, reg0, 5),
      
      (str_store_troop_name, s4, ":faction_marshal"),
      
    ],
    "Our army sits, doing nothing. Apparently, too few vassals have answered the call to arms. Perhaps {s4} does not enjoy the confidence of the great lords of this realm.",
    "lord_strategy_follow_up",[
      (assign, "$g_talk_troop_disagrees_with_marshal", 1),
      
  ]],
  
  #To Steve - Why we need this dialog? It already included in below lord_strategy_follow_evaluation dialogs
  #[anyone, "lord_strategy_follow_evaluation",
  #[
  #  (this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_attacking_center),
  #  (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_raiding_village),
  #
  #  (faction_get_slot, ":cur_object", "$g_talk_troop_faction", slot_faction_ai_object),
  #  (call_script, "script_npc_decision_checklist_evaluate_enemy_center_for_attack", "$g_talk_troop", ":cur_object", 1, 0),
  #  (lt, reg0, 0),
  #
  #  (str_store_string, s9, reg1),
  #  (str_store_party_name, s8, ":cur_object"),
  #],
  # "I disagree with the marshal's decision. I believe that {s8} {s9}",
  # "lord_strategy_why_not",[
  # ]],
  
  #This dialog appears when lord disagrees with marshal about the selected faction ai (attack/defend/gather/other).
  #To Steve - I took that dialog upper from below one. Lord should compare his faction ai choice with marshal's one before comparing preffered ai objects.
  [anyone, "lord_strategy_follow_evaluation",
    [
      (call_script, "script_npc_decision_checklist_faction_ai_alt", "$g_talk_troop"),
      (assign, ":talk_troop_preferred_strategy", reg0),
      
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, ":talk_troop_preferred_strategy"),
      
      (assign, ":continue", 1),
      (try_begin),
        (eq, ":talk_troop_preferred_strategy", sfai_raiding_village),
        (str_store_string, s4, "@go on the offensive now."),
      (else_try),
        (eq, ":talk_troop_preferred_strategy", sfai_attacking_center),
        (str_store_string, s4, "@go on the offensive now."),
      (else_try),
        (eq, ":talk_troop_preferred_strategy", sfai_attacking_enemies_around_center),
        (str_store_string, s4, "@act to defend our lands."),
      (else_try),
        (eq, ":talk_troop_preferred_strategy", sfai_gathering_army),
        (str_store_string, s4, "@take more time to gather the army."),
      (else_try),
        (assign, ":continue", 0),
      (try_end),
      
      (eq, ":continue", 1),
      
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
      (neq, ":faction_marshal", "$g_talk_troop"),
      
      (str_store_troop_name, s10, ":faction_marshal"),
      (assign, "$g_talk_troop_disagrees_with_marshal", 1),
      
    ],
    "I disagree with this strategy. I would prefer to {s4}.",
    "lord_strategy_follow_up", [
      (assign, "$g_talk_troop_disagrees_with_marshal", 1),
      
  ]],
  
  #This dialog appears when lord disagrees with marshal about the city will be attacked.
  [anyone, "lord_strategy_follow_evaluation",
    [
      (this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_attacking_center),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_raiding_village),
      
      (call_script, "script_find_center_to_attack_alt", "$g_talk_troop", 1, 0),
      (assign, ":preferred_center", reg0),
      (is_between, ":preferred_center", centers_begin, centers_end),
      
      (faction_get_slot, ":cur_object", "$g_talk_troop_faction", slot_faction_ai_object),
      (neq, ":cur_object", ":preferred_center"),
      
      #To Steve - if lord's preffered center is different from marshal's current one then this should be enough for lord to say I disagree with marshal isn't this better?
      #Because it is not easy for any lord to return minus score for a center, so if we do not do this, we will not be able to see lords which disagree with marshal.
      #Conclusion : I removed condition of (lt, reg0, 0),
      
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
      (neq, ":faction_marshal", "$g_talk_troop"),
      
      (call_script, "script_npc_decision_checklist_evaluate_enemy_center_for_attack", ":faction_marshal", ":preferred_center", 1, 0),
      #(lt, reg0, 0),
      
      (str_store_string, s9, reg1),
      (str_store_party_name, s8, ":preferred_center"),
      
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
      (neq, ":faction_marshal", "$g_talk_troop"),
      
      (str_store_troop_name, s10, ":faction_marshal"),
      
    ],
    "I personally would prefer to attack {s8}, but our marshal {s10} believes that it {s9}",
    "lord_strategy_follow_up",[
      (assign, "$g_talk_troop_disagrees_with_marshal", 1),
      
  ]],
  
  #This dialog appears when lord disagrees with marshal about the city will be defended.
  [anyone, "lord_strategy_follow_evaluation",
    [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_attacking_enemies_around_center),
      
      (call_script, "script_find_center_to_defend", "$g_talk_troop"),
      (assign, ":preferred_center", reg0),
      (is_between, ":preferred_center", centers_begin, centers_end),
      (faction_get_slot, ":cur_object", "$g_talk_troop_faction", slot_faction_ai_object),
      (neq, ":cur_object", ":preferred_center"),
      
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
      (neq, ":faction_marshal", "$g_talk_troop"),
      
      (str_store_party_name, s8, ":preferred_center"),
      (str_store_party_name, s9, ":cur_object"),
      
    ],
    "I personally would prefer to defend {s8}, instead of {s9}.",
    "lord_strategy_follow_up",[
      (assign, "$g_talk_troop_disagrees_with_marshal", 1),
  ]],
  
  
  
  
  
  [anyone, "lord_strategy_follow_evaluation",
    [
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (this_or_next|neg|is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
      (eq, ":faction_marshal", "$g_talk_troop"),
    ],
    "Is there anything else?",
    "lord_talk",[
  ]],
  
  
  [anyone, "lord_strategy_follow_evaluation",
    [],
    "This strategy seems reasonable to me.",
    "lord_strategy_follow_up",[
      (assign, "$g_talk_troop_disagrees_with_marshal", 0),
  ]],
  
  [anyone|plyr, "lord_strategy_follow_up", [
      (this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_attacking_center),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_raiding_village),
    ],
    "If you're attacking, why aren't you...",
    "lord_strategy_why_not",[
  ]],
  
  [anyone|plyr, "lord_strategy_follow_up", [
    ],
    "I see...",
    "lord_talk_ask_something_again",[
  ]],
  
  [anyone|plyr, "lord_strategy_follow_up", [
      (eq, "$g_talk_troop_disagrees_with_marshal", 1),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (is_between, ":faction_marshal", active_npcs_begin, active_npcs_end),
      (str_store_troop_name, s4, ":faction_marshal"),
    ],
    "Would you say, then, that {s4} should no longer be marshal?",
    "lord_talk_replace_marshal",[
  ]],
  
  [anyone, "lord_talk_replace_marshal", [
      (faction_get_slot, ":faction_issue", "$g_talk_troop_faction", slot_faction_political_issue),
      (is_between, ":faction_issue", centers_begin, centers_end),
      (str_store_party_name, s4, ":faction_issue"),
    ],
    "I believe that our realm should resolve the issue of {s4} before we begin to debate replacing the marshal.",
    "lord_talk_ask_something_again",[
  ]],
  
  
  [anyone, "lord_talk_replace_marshal", [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_political_issue, 1),
      (troop_get_slot, ":stance_on_faction_issue", "$g_talk_troop", slot_troop_stance_on_faction_issue),
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (neq, ":stance_on_faction_issue", ":faction_marshal"),
      (str_store_troop_name, s4,  ":stance_on_faction_issue"),
      (str_store_troop_name, s5,  ":faction_marshal"),
      
    ],
    "Yes. I have already made my position on this matter clear. I believe that {s4} should be marshal instead of {s5}.",
    "lord_talk_ask_something_again",[
  ]],
  
  [anyone, "lord_talk_replace_marshal", [
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":faction_marshal"),
      (assign, ":relation_with_marshal", reg0),
      (gt, ":relation_with_marshal", "$g_talk_troop_effective_relation"),
    ],
    "I will make up my mind on this matter without your persuasion, {reg59?my lady:my lord}.",
    "lord_talk_ask_something_again",[
  ]],
  
  [anyone, "lord_talk_replace_marshal", [
    ],
    "Hmm...",
    "lord_talk_replace_marshal_decision",[
      (faction_set_slot, "$g_talk_troop_faction", slot_faction_political_issue, 1),
  ]],
  
  
  [anyone, "lord_talk_replace_marshal_decision", [
      (call_script, "script_npc_decision_checklist_take_stand_on_issue", "$g_talk_troop"),
      (assign, ":replacement_candidate", reg0),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshal, ":replacement_candidate"),
      (call_script, "script_troop_describes_troop_to_s15", "$g_talk_troop", ":replacement_candidate"),
    ],
    "Yes, I would say that. At this point, I would be tempted to say that I support {s15} instead. I am glad that you and I had this discussion, so that I know that we are of the same mind on this matter.",
    "lord_talk_ask_something_again",[
      (call_script, "script_npc_decision_checklist_take_stand_on_issue", "$g_talk_troop"),
      (assign, ":replacement_candidate", reg0),
      (troop_set_slot, "$g_talk_troop", slot_troop_stance_on_faction_issue, ":replacement_candidate"),
      
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (troop_get_slot, ":marshal_controversy",  ":faction_marshal", slot_troop_controversy),
      (val_add, ":marshal_controversy", 5),
      (troop_set_slot, ":faction_marshal", slot_troop_controversy, ":marshal_controversy"),
      
      
      (call_script, "script_troop_describes_troop_to_s15", "$g_talk_troop", ":replacement_candidate"),
      
  ]],
  
  
  [anyone, "lord_talk_replace_marshal_decision", [
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (str_store_troop_name, s4, ":faction_marshal"),
    ],
    "Not necessarily. It is possible for {s4} and I have to have an honest disagreement over strategy, without my seeking to replace him.",
    "lord_talk_ask_something_again",[
  ]],
  
  
  
  
  [anyone, "lord_strategy_why_not", [
    ],
    "Yes?",
    "lord_strategy_why_not_select",[
  ]],
  
  [anyone|plyr, "lord_strategy_why_not_select", [
    ],
    "Never mind",
    "lord_talk_ask_something_again",[]],
  
  [anyone|plyr, "lord_strategy_why_not_select",
    [
      (this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_raiding_village),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_attacking_center),
      
      (faction_get_slot, ":cur_object", "$g_talk_troop_faction", slot_faction_ai_object),
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (gt, ":faction_marshal", -1),
      (call_script, "script_find_center_to_attack_alt", ":faction_marshal", 1, 0),
      (neq, reg0, ":cur_object"),
      (str_store_party_name,s4, ":cur_object"),
    ],
    "..planning to continue with the attack on {s4}?",
    "lord_strategy_why_not_reason",[
  ]],
  
  [anyone|plyr|repeat_for_parties, "lord_strategy_why_not_select",
    [
      (store_repeat_object, ":selected_center"),
      (is_between, ":selected_center", centers_begin, centers_end),
      
      (store_faction_of_party, ":selected_center_faction", ":selected_center"),
      (eq, ":selected_center_faction", "$g_talk_troop_faction"),
      
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, ":selected_center"),
      (neq, "$g_target_after_gathering", ":selected_center"),
      
      (party_slot_ge, ":selected_center", slot_center_sortie_enemy_strength, 1),
      (str_store_party_name,s4, ":selected_center"),
    ],
    "..defending {s4}?",
    "lord_strategy_why_not_reason",[
      (store_repeat_object, "$temp"),
  ]],
  
  [anyone|plyr|repeat_for_parties, "lord_strategy_why_not_select",
    [
      (store_repeat_object, ":selected_center"),
      (is_between, ":selected_center", centers_begin, centers_end),
      
      (store_faction_of_party, ":selected_center_faction", ":selected_center"),
      (store_relation, ":relation", ":selected_center_faction", "$g_talk_troop_faction"),
      (lt, ":relation", 0),
      
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, ":selected_center"),
      (str_store_party_name,s4, ":selected_center"),
    ],
    "..attacking {s4}?",
    "lord_strategy_why_not_reason",
    [
      (store_repeat_object, "$temp"),
      
      (try_begin),
        (eq, "$cheat_mode", 1),
        (store_sub, ":faction_recce_slot", "$g_talk_troop_faction", kingdoms_begin),
        (val_add, ":faction_recce_slot", slot_center_last_reconnoitered_by_faction_time),
        (store_current_hours, ":hours_since_last_recon"),
        (party_get_slot, ":last_recon_time", "$temp", ":faction_recce_slot"),
        (val_sub, ":hours_since_last_recon", ":last_recon_time"),
      (try_end),
  ]],
  
  [anyone, "lord_strategy_why_not_reason",
    [
      (assign, ":selected_center", "$temp"),
      (store_faction_of_party, ":selected_center_faction", ":selected_center"),
      (eq, ":selected_center_faction", "$g_talk_troop_faction"),
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (call_script, "script_find_center_to_defend", ":faction_marshal"),
      (assign, ":most_threatened_center", reg0),
      (assign, ":threat_danger_level", reg1),
      (assign, ":enemy_strength_near_threatened_center", reg2),
      
      (try_begin),
        (call_script, "script_find_center_to_attack_alt", ":faction_marshal", 1, 0),
        (assign, ":target_value_level", reg1),
        (call_script, "script_find_center_to_attack_alt", ":faction_marshal", 1, 1),
        (assign, ":target_value_level_all_vassals", reg1),
        
        (try_begin),
          (ge, ":target_value_level_all_vassals", ":target_value_level"),
          (assign, ":target_value_level_max", ":target_value_level_all_vassals"),
        (else_try),
          (assign, ":target_value_level_max", ":target_value_level"),
        (try_end),
        
        (gt, ":target_value_level_max", ":threat_danger_level"),
        (assign, reg4, ":target_value_level"),
        (assign, reg5, ":threat_danger_level"),
        (str_store_string, s9, "str_reason_1"),
      (else_try),
        (assign, ":continue", 0),
        (try_begin),
          (is_between, ":selected_center", villages_begin, villages_end),
          (is_between, ":most_threatened_center", walled_centers_begin, walled_centers_end),
          (assign, ":continue", 1),
        (try_end),
        
        (try_begin),
          (is_between, ":selected_center", castles_begin, castles_end),
          (is_between, ":most_threatened_center", towns_begin, towns_end),
          (assign, ":continue", 1),
        (try_end),
        
        (eq, ":continue", 1),
        
        (str_store_party_name, s8, ":most_threatened_center"),
        #values of centers : town > castle > village
        #Situation : We are going to defend more valueable center.
        #To Steve - Please find a better explaining string for below line.
        (str_store_string, s9, "str_reason_2"),
      (else_try),
        (neq, ":most_threatened_center", ":selected_center"),
        (str_store_party_name, s8, ":most_threatened_center"),
        (str_store_string, s9, "str_reason_3"),
      (else_try),
        (troop_get_slot, ":marshal_party", ":faction_marshal", slot_troop_leaded_party),
        (party_is_active, ":marshal_party"),
        (party_get_slot, ":cached_strength", ":marshal_party", slot_party_cached_strength),
        (party_get_slot, ":follower_strength", ":marshal_party", slot_party_follower_strength),
        (store_add, ":total_strength", ":cached_strength", ":follower_strength"),
        (ge, ":enemy_strength_near_threatened_center", ":total_strength"),
        (assign, reg4, ":enemy_strength_near_threatened_center"),
        (assign, reg5, ":total_strength"),
        (str_store_string, s9, "str_reason_4"),
      (else_try),
        (str_store_string, s9, "str_reason_5"),
      (try_end),
    ],
    "{!}{s9}",
    "lord_talk_why_not_repeat",[]],
  
  [anyone, "lord_strategy_why_not_reason",
    [
      (assign, ":selected_center", "$temp"),
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      
      (faction_get_slot, ":faction_ai_object", "$g_talk_troop_faction", slot_faction_ai_object),
      
      (call_script, "script_npc_decision_checklist_evaluate_enemy_center_for_attack", ":faction_marshal", ":faction_ai_object", 1, 0),
      (assign, "$g_faction_object_score", reg0),
      
      (assign, "$g_do_not_skip_other_than_current_ai_object", 1),
      (call_script, "script_npc_decision_checklist_evaluate_enemy_center_for_attack", ":faction_marshal", ":selected_center", 1, 0),
      (assign, "$g_do_not_skip_other_than_current_ai_object", 0),
      
      (lt, reg0, 0),
      (assign, ":explainer_string", reg1),
      (try_begin),
        (eq, "$g_use_current_ai_object_as_s8", 0),
        (str_store_party_name, s8, ":selected_center"),
      (else_try),
        (str_store_party_name, s8, ":faction_ai_object"),
      (try_end),
      (str_store_string, s9, ":explainer_string"),
      (str_clear, s10),
      (str_store_troop_name, s11, ":faction_marshal"),
      #s10 will say that
    ],
    "Our marshal {s11} believes that {s8} {s9}{s10}",
    "lord_talk_why_not_repeat",[]],
  
  [anyone, "lord_strategy_why_not_reason",
    [
      (faction_get_slot, ":faction_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (faction_get_slot, ":cur_object", "$g_talk_troop_faction", slot_faction_ai_object),
      
      (call_script, "script_npc_decision_checklist_evaluate_enemy_center_for_attack", ":faction_marshal", ":cur_object", 1, 0),
      (assign, ":power_ratio_for_cur_object", reg2),
      (call_script, "script_npc_decision_checklist_evaluate_enemy_center_for_attack", ":faction_marshal", "$temp", 1, 0),
      (assign, ":power_ratio_for_selected_center", reg2),
      
      (try_begin),
        (eq, ":power_ratio_for_selected_center", 0),
        (str_store_string, s7, "str_reason_6"),
      (else_try),
        (lt, ":power_ratio_for_selected_center", 200),
        (str_store_string, s7, "str_reason_7"),
      (else_try),
        (is_between, ":power_ratio_for_selected_center", 200, 300),
        (str_store_string, s7, "str_reason_8"),
      (else_try),
        (ge, ":power_ratio_for_selected_center", 300),
        (str_store_string, s7, "str_reason_9"),
      (else_try),
        (str_store_string, s7, "str_error_string"),
      (try_end),
      
      (try_begin),
        (eq, ":power_ratio_for_cur_object", 0),
        (str_store_string, s8, "str_reason_6"),
      (else_try),
        (lt, ":power_ratio_for_cur_object", 200),
        (str_store_string, s8, "str_reason_7"),
      (else_try),
        (is_between, ":power_ratio_for_cur_object", 200, 300),
        (str_store_string, s8, "str_reason_8"),
      (else_try),
        (ge, ":power_ratio_for_cur_object", 300),
        (str_store_string, s8, "str_reason_9"),
      (else_try),
        (str_store_string, s8, "str_error_string"),
      (try_end),
      
      (try_begin),
        (ge, ":cur_object", 0),
        (str_store_party_name, s4, ":cur_object"),
      (else_try),
        (ge, "$g_target_after_gathering", 0),
        (str_store_party_name, s4, "$g_target_after_gathering"),
      (else_try),
        (str_store_party_name, s4, "str_error_string"),
      (try_end),
      
      (str_store_troop_name, s5, ":faction_marshal"),
      
      (try_begin),
        (eq, "$cheat_mode", 1),
        (store_sub, ":faction_recce_slot", "$g_talk_troop_faction", kingdoms_begin),
        (val_add, ":faction_recce_slot", slot_center_last_reconnoitered_by_faction_time),
        (store_current_hours, ":hours_since_last_recon"),
        (party_get_slot, ":last_recon_time", "$temp", ":faction_recce_slot"),
        (val_sub, ":hours_since_last_recon", ":last_recon_time"),
        
        (store_sub, ":faction_recce_slot", "$g_talk_troop_faction", kingdoms_begin),
        (val_add, ":faction_recce_slot", slot_center_last_reconnoitered_by_faction_time),
        (store_current_hours, ":hours_since_last_recon"),
        (party_get_slot, ":last_recon_time", ":cur_object", ":faction_recce_slot"),
        (val_sub, ":hours_since_last_recon", ":last_recon_time"),
      (try_end),
      
      (try_begin),
        (assign, ":continue", 0),
        (try_begin),
          (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, sfai_gathering_army),
          (lt, "$g_target_after_gathering", 0), #then this means faction is gathering army to attack a center.
          (assign, ":continue", 1),
        (try_end),
        
        (this_or_next|eq, ":continue", 1),
        (this_or_next|faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_attacking_center),
        (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_raiding_village),
        
        (str_store_string, s3, "str_has_decided_that_an_attack_on_"),
        (str_store_string, s6, "str_this_would_be_better_worth_the_effort"),
      (else_try),
        (str_store_string, s3, "str_has_decided_to_defend_"),
        (str_store_party_name, s9, "$temp"),
        (str_store_string, s6, "str_before_going_offensive_we_should_protect_our_lands_if_there_is_any_threat_so_this_can_be_reason_marshal_choosed_defending_s4"),
        (str_clear, s8),
      (try_end),
    ],
    "We could go there. {s7} However, {s5} {s3} {s4}. {s6} {s8}.",
    "lord_talk_why_not_repeat",[
  ]],
  
  [anyone,"lord_talk_why_not_repeat", [
    ],
    "Did you have any similar questions? Why we are not...",
    "lord_strategy_why_not_select",[
  ]],
  
  [anyone,"lord_talk_ask_marriage_1", [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
    ],
    "You will not take offense if I tell you that, as a king, I have other plans for my children.",
    "lord_pretalk",[
  ]],
  
  
  [anyone,"lord_talk_ask_marriage_1", [
      (assign, "$marriage_candidate", -1),
      (try_begin),
        (troop_get_type, ":is_female", "trp_player"),
        (val_mod, ":is_female", 2),
        (eq, ":is_female", 1),
        (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
        (assign, "$marriage_candidate", "$g_talk_troop"),
      (else_try),
        (troop_get_type, ":is_female", "trp_player"),
        (val_mod, ":is_female", 2),
        (eq, ":is_female", 0),
        (assign, "$marriage_candidate", -1),
        (try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
          (troop_slot_eq, ":lady", slot_troop_spouse, -1),
          (troop_slot_eq, ":lady", slot_troop_betrothed, -1),
          (call_script, "script_get_kingdom_lady_social_determinants", ":lady"),
          
          (eq, reg0, "$g_talk_troop"),
          
          (call_script, "script_troop_get_family_relation_to_troop", ":lady", "$g_talk_troop"),
          (assign, "$marriage_candidate", ":lady"),
          (str_store_troop_name, s14, "$marriage_candidate"),
          
          (str_store_string, s15, "str_it_is_our_custom_to_seal_any_such_alliances_with_marriage_and_in_fact_we_have_been_looking_for_a_suitable_groom_for_my_s11_s14"),
          
        (try_end),
      (try_end),
      (eq, "$marriage_candidate", -1),
    ],
    "It is our custom to seal any such alliances with marriage. Unfortunately, no one in my household is eligible to wed.",
    "lord_pretalk",[
  ]],
  
  [anyone,"lord_talk_ask_marriage_1", [
      (troop_get_type, ":type", "trp_player"),
      (val_mod, ":type", 2),
      (eq, ":type", 0),
    ],
    "{!}{s15}",
    "lord_courtship_pre_permission",[
  ]],
  
  [anyone,"lord_talk_ask_marriage_1", [
      (eq, "$marriage_candidate", "$g_talk_troop"),
    ],
    "Are you proposing that you and I marry?",
    "lord_marriage_proposal_female_pc_confirm",[
  ]],
  
  
  
  
  [anyone|plyr,"lord_courtship_pre_permission", [
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, 1),
      (neg|troop_slot_ge, "trp_player", slot_troop_betrothed, 1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_refused, 0),
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (eq, ":is_female", 0),
      
      (str_clear, s15),
      # (try_begin),
      #	(troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, -1),
      #	(str_store_string, s15, "str_once_again_"),
      # (try_end),
    ],
    "May I {s15}suggest that I be considered as a groom?",
    "lord_courtship_permission",[
  ]],
  
  
  [anyone|plyr,"lord_courtship_pre_permission", [
      (eq, "$cheat_mode", 2),
    ],
    "CHEAT -- Start engagement",
    "lord_marriage_permission_engagement_date",[
      
      (setup_quest_text, "qst_formal_marriage_proposal"),
      (str_store_string, s2, "str_cheat__marriage_proposal"),
      
      (call_script, "script_start_quest", "qst_formal_marriage_proposal", "$marriage_candidate"),
      (quest_set_slot, "qst_formal_marriage_proposal", slot_quest_giver_troop, "$marriage_candidate"),
  ]],
  
  
  
  [anyone|plyr,"lord_courtship_pre_permission", [
    ],
    "Never mind.",
    "lord_pretalk",[
  ]],
  
  
  
  
  
  [anyone|plyr,"lord_marriage_proposal_female_pc_confirm", [
    ],
    "Yes. That is my proposal.",
    "lord_marriage_proposal_female_pc_reax",[
  ]],
  
  [anyone|plyr,"lord_marriage_proposal_female_pc_confirm", [
    ],
    "No, I think you have misunderstood me.",
    "lord_pretalk",[
  ]],
  
  [anyone,"lord_marriage_proposal_female_pc_reax", [
      (call_script, "script_npc_decision_checklist_marry_female_pc", "$g_talk_troop"),
      (le, reg0, 0),
    ],
    "{!}{s14}",
    "lord_pretalk",[
  ]],
  
  [anyone,"lord_marriage_proposal_female_pc_reax", [
      (call_script, "script_npc_decision_checklist_marry_female_pc", "$g_talk_troop"),
      (eq, reg0, 2),
    ],
    "{!}{s14}",
    "lord_pretalk",[
      (troop_set_slot, "$g_talk_troop", slot_troop_met, 2),
  ]],
  
  [anyone,"lord_marriage_proposal_female_pc_reax", [
    ],
    "{!}{s14}",
    "lord_marriage_proposal_female_pc_next_step",[
  ]],
  
  #  [anyone,"lord_marriage_proposal_female_pc_next_step", [
  #  ],
  #   "I must say, though. You live your life like a man, riding where you will, with the company you choose. This will not make it easy for the other lords to accept our marriage. I don't suppose that you would give up adventuring, for the sake of our marriage?",
  #   "lord_marriage_proposal_female_pc_next_step_2",[
  #   ]],
  
  #   [anyone|plyr,"lord_marriage_proposal_female_pc_next_step_2", [
  #  ],
  #   "I think not!",
  #   "lord_marriage_proposal_female_pc_next_step_3",[
  #   ]],
  
  [anyone,"lord_marriage_proposal_female_pc_next_step", [
    ],
    "I suppose the next step would be for me to send a message to your family, asking for their permission to marry you, but I suppose that you make your own decisions.",
    "lord_marriage_proposal_female_pc_next_step_4",[
  ]],
  
  [anyone|plyr,"lord_marriage_proposal_female_pc_next_step_4", [
    ],
    "You assume correctly.",
    "lord_marriage_proposal_female_pc_next_step_5",[
  ]],
  
  [anyone,"lord_marriage_proposal_female_pc_next_step_5", [
    ],
    "Very well, then. As there are no obstacles to our marriage, should we then consider ourselves engaged to be wed? I will organize a great feast, and we can exchange our vows before all the lords of the realm. If you are willing, that is...",
    "lord_marriage_proposal_female_pc_confirm_engagement",[
  ]],
  
  [anyone|plyr,"lord_marriage_proposal_female_pc_confirm_engagement", [
    ],
    "I am willing.",
    "lord_marriage_proposal_female_pc_confirm_engagement_yes",[
      (troop_set_slot, "$g_talk_troop", slot_troop_betrothed, "trp_player"),
      (troop_set_slot, "trp_player", slot_troop_betrothed, "$g_talk_troop"),
      
      (assign, "$g_other_quest", 0),
      (try_begin),
        (store_partner_quest, ":other_quest", "$g_talk_troop"),
        (gt, ":other_quest", 0),
        (assign, "$g_other_quest", ":other_quest"),
      (try_end),
      
      (str_store_troop_name, s4, "$g_talk_troop"),
      
      (setup_quest_text, "qst_wed_betrothed_female"),
      (str_store_string, s2, "str_you_plan_to_marry_s4_as_you_have_no_family_in_calradia_he_will_organize_the_wedding_feast"),
      
      (call_script, "script_start_quest", "qst_wed_betrothed_female", "$g_talk_troop"),
      
      (quest_set_slot, "qst_wed_betrothed_female", slot_quest_expiration_days, 120),
      (quest_set_slot, "qst_wed_betrothed_female", slot_quest_giver_troop, "$g_talk_troop"),
      
  ]],
  
  [anyone|plyr,"lord_marriage_proposal_female_pc_confirm_engagement", [
    ],
    "Actually, I would like to reconsider.",
    "lord_marriage_proposal_female_pc_confirm_engagement_no",[
      
  ]],
  
  [anyone,"lord_marriage_proposal_female_pc_confirm_engagement_yes", [
      
      (str_clear, s12),
      (try_begin),
        (gt, "$g_other_quest", 0),
        (call_script, "script_succeed_quest", "$g_other_quest"),
        (call_script, "script_end_quest", "$g_other_quest"),
        (str_store_string, s12, "str_cancel_fiancee_quest"),
      (try_end),
    ],
    "Very well. I hope that, a little over a month from now, we shall be wed.{s12}",
    "close_window",[
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"lord_marriage_proposal_female_pc_confirm_engagement_no", [
    ],
    "Take whatever time you need, my lady.",
    "close_window",[
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  
  #continue marriage talks here
  
  [anyone|plyr,"lord_talk", [(eq,"$talk_context",tc_party_encounter),
      (lt, "$g_encountered_party_relation", 0),
      (str_store_troop_name,s4,"$g_talk_troop")],
    "I say this only once, {s4}! Surrender or die!", "party_encounter_lord_hostile_ultimatum_surrender", []],
  
  [anyone|plyr,"lord_talk", [  (call_script, "script_troop_get_player_relation", "$g_talk_troop"),
      (assign,":troop_relation", reg0),
      (lt,":troop_relation", -20),
      (eq,"$g_encountered_party_faction","$players_kingdom"),
      (neg|faction_slot_eq, "$g_encountered_party_faction", slot_faction_leader, "$g_talk_troop"),
      (neq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (troop_get_slot, "$g_talk_troop_party", "$g_talk_troop", slot_troop_leaded_party),
      (party_get_attached_to, ":cur_attached_party", "$g_talk_troop_party"),
      (neg|is_between, ":cur_attached_party", centers_begin, centers_end),
      (str_store_troop_name,s4,"$g_talk_troop")],
    "{s4}, I'm tired of your insolence! I will teach you a lesson, once and for all!", "party_encounter_lord_hostile_ultimatum_surrender", [
      (troop_get_slot, ":controversy",  "trp_player", slot_troop_controversy),
      (val_add, ":controversy", 5),
      (troop_set_slot, "trp_player", slot_troop_controversy, ":controversy"),
  ]],
  
  
  
  [anyone,"party_encounter_lord_hostile_ultimatum_surrender", [],
    "{!}{s43}", "close_window", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_challenged_default"),
      (try_begin),
        (neq, "$g_encountered_party_faction","$players_kingdom"),
        (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      (else_try),
        (call_script, "script_change_player_relation_with_faction", "$g_encountered_party_faction", -10),
        (faction_get_slot, ":leader_no", "$g_encountered_party_faction", slot_faction_leader),
        (neq, "$g_talk_troop", ":leader_no"),
        (call_script, "script_change_player_relation_with_troop", ":leader_no", -5),
        (call_script, "script_troop_change_relation_with_troop", ":leader_no", "$g_talk_troop", -2),
      (try_end),
      
      (try_begin),
        (gt, "$g_talk_troop_relation", -10),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (try_end),
      (troop_get_slot, ":controversy", "$g_talk_troop", slot_troop_controversy),
      (val_add, ":controversy", 2),
      (troop_set_slot, "$g_talk_troop", slot_troop_controversy, ":controversy"),
      (assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),
      (assign,"$cant_leave_encounter", 1),]],
  
  
  [anyone|plyr,"lord_talk", [(eq,"$talk_context", tc_party_encounter),
      (neq,"$g_encountered_party_faction","$players_kingdom"),
      (ge, "$g_encountered_party_relation", 0),
      ], "I'm here to deliver my demands!", "lord_predemand",[]],
  [anyone,"lord_predemand", [], "Eh? What do you want?", "lord_demand",[]],
  
  [anyone|plyr,"lord_demand", [(neq,"$g_encountered_party_faction","$players_kingdom"),
      (ge, "$g_encountered_party_relation", 0),], "I offer you one chance to surrender or die.", "lord_ultimatum_surrender",[]],
  
  #Neutral attack on lord
  [anyone,"lord_ultimatum_surrender", [(ge, "$g_encountered_party_relation", 0)], "{!}{s43}", "lord_attack_verify",[#originally, speak you rascal
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_unprovoked_attack_default"),
      (try_begin),
        (faction_slot_ge, "$g_encountered_party_faction", slot_faction_truce_days_with_factions_begin, 1),
        (str_store_faction_name, s34, "$g_encountered_party_faction"),
        (str_store_string, s43, "str_s43_just_so_you_know_if_you_attack_me_you_will_be_in_violation_of_the_truce_you_signed_with_the_s34"),
      (try_end),
      (try_begin),
        (eq, "$players_kingdom", "fac_player_supporters_faction"),
        (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
        (str_store_string, s43, "str_s43_also_you_should_know_that_an_unprovoked_assault_is_declaration_of_war"),
      (try_end),
      
  ]],
  
  [anyone|plyr,"lord_attack_verify", [], "Forgive me sir. I don't know what I was thinking.", "lord_attack_verify_cancel",[]],
  [anyone,"lord_attack_verify_cancel", [], "Be gone, then.", "close_window",[(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),(assign, "$g_leave_encounter",1)]],
  [anyone|plyr,"lord_attack_verify", [], "That is none of your business. Prepare to fight!", "lord_attack_verify_commit",[
  ]],
  
  #The kingdoms are already at war
  [anyone,"lord_ultimatum_surrender", [], "{!}{s43}", "lord_attack_verify_b", #originally, you will not survive this
    [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_unnecessary_attack_default"),
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      
      (assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),
  ]],
  
  [anyone|plyr,"lord_attack_verify_b", [], "Forgive me sir. I don't know what I was thinking.", "lord_attack_verify_cancel",[]],
  [anyone|plyr,"lord_attack_verify_b", [], "I stand my ground. Prepare to fight!", "lord_attack_verify_commit",[]],
  
  [anyone,"lord_attack_verify_commit", [], "{!}{s43}", "close_window",
    [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_challenged_default"),
      (try_begin),
        (ge, "$g_encountered_party_relation", 0),
        (call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
      (try_end),
      (try_begin), #this try is added so that a player vassal ccannot spark a war by attacking a neutral. The player does however cause a provocation, which may allow the other side to go to war
        #If a player can create a hostile faction simply by attacking, this will allow a number of exploits. Therefore, it is quite important to keep this condition in here for active player kingdoms
        (neq, "$players_kingdom", "fac_player_supporters_faction"),
        (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      (else_try),
        (call_script, "script_diplomacy_start_war_between_kingdoms",  "fac_player_supporters_faction", "$g_encountered_party_faction", logent_player_faction_declares_war), #MOTO chief pass log entries
      (try_end),
      
      #   (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      (assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
  ]],
  #Post 0907 changes end
  
  [anyone|plyr,"lord_demand", [], "Forgive me. It's nothing.", "lord_pretalk",[]],
  
  
  ##  [anyone|plyr,"lord_talk", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                             (ge, "$g_talk_troop_faction_relation", 0),
  ##                             ],
  ##   "I wish to ask for a favor.", "lord_ask_for_favor_ask",[]],
  
  
  
  [anyone|plyr,"lord_talk", [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_discussed_rebellion, 0),
      (assign, ":pretender", 0),
      (try_for_range, ":possible_pretender", pretenders_begin, pretenders_end),
        (troop_slot_eq, ":possible_pretender", slot_troop_original_faction, "$g_talk_troop_faction"),
        (assign, ":pretender", ":possible_pretender"),
      (try_end),
      (troop_slot_ge, ":pretender", slot_troop_met, 1),
      (str_store_troop_name, s45, ":pretender"),
      (troop_get_type, reg3, ":pretender"),
      (val_mod, reg3, 2),
    ],
    "I have met in my travels one who calls {reg3?herself:himself} {s45}...", "liege_defends_claim_1",[
  ]],
  
  [anyone,"liege_defends_claim_1", [],
    "Oh really? It is not everyone who dares mention that name in my presence. I am not sure whether to reward your bravery, or punish you for your impudence.", "liege_defends_claim_2", [
      (troop_set_slot, "$g_talk_troop", slot_troop_discussed_rebellion, 1),
  ]],
  
  [anyone,"liege_defends_claim_2", [],
    "Very well. I will indulge your curiosity. But listen closely, because I do not wish to speak of this matter again.", "liege_defends_claim_3", [
  ]],
  
  [anyone,"liege_defends_claim_3", [],
    "{!}{s48}", "liege_defends_claim_4", [
      (try_for_range, ":possible_pretender", pretenders_begin, pretenders_end),
        (troop_slot_eq, ":possible_pretender", slot_troop_original_faction, "$g_talk_troop_faction"),
        (assign, ":pretender", ":possible_pretender"),
      (try_end),
      (troop_get_slot, ":rebellion_string", ":pretender", slot_troop_original_faction2),
      (val_sub, ":rebellion_string", "fac_kingdom_1"),
      (val_add, ":rebellion_string", "str_swadian_rebellion_monarch_response_1"),
      (str_store_string, 48, ":rebellion_string"),
      (assign, "$temp", ":pretender"),
  ]],
  
  [anyone,"liege_defends_claim_4", [],
    "{!}{s48}", "lord_talk", [
      (assign, ":pretender", "$temp"),
      (troop_get_slot, ":rebellion_string", ":pretender", slot_troop_original_faction2),
      (val_sub, ":rebellion_string", "fac_kingdom_1"),
      (val_add, ":rebellion_string", "str_swadian_rebellion_monarch_response_2"),
      (str_store_string, 48, ":rebellion_string"),
  ]],
  
  
  #Rebellion changes begin
  #  [anyone|plyr,"lord_talk", [
  #                             (gt, "$supported_pretender", 0),
  #                             (eq, "$supported_pretender_old_faction", "$g_talk_troop_faction"),
  #                             (troop_slot_eq, "$g_talk_troop", slot_troop_discussed_rebellion, 0),
  #                             (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
  #                             (troop_slot_ge, "$g_talk_troop", slot_troop_leaded_party, 1),
  #                             (str_store_troop_name, s12, "$supported_pretender"),
  #                             (str_store_faction_name, s14, "$supported_pretender_old_faction"),
  #                             (faction_get_slot, ":old_faction_lord", "$supported_pretender_old_faction", slot_faction_leader),
  #                             (str_store_troop_name, s15, ":old_faction_lord"),
  #                             ],
  #   "{s12} is the rightful ruler of the {s14}. Join our cause against the usurper, {s15}!", "lord_join_rebellion_suggest",[]],
  
  [anyone|plyr,"lord_talk",
    [
      (eq, "$cheat_mode", 2),
      (gt, "$supported_pretender", 0),
      (eq, "$supported_pretender_old_faction", "$g_talk_troop_faction"),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (troop_slot_ge, "$g_talk_troop", slot_troop_leaded_party, 1),
    ],
    "{!}CHEAT - Join our cause by force.", "lord_join_rebellion_suggest_cheat",[]],
  
  [anyone|plyr,"party_encounter_lord_hostile_attacker_2",
    [
      (eq, "$cheat_mode", 2),
      (gt, "$supported_pretender", 0),
      (eq, "$supported_pretender_old_faction", "$g_talk_troop_faction"),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (troop_slot_ge, "$g_talk_troop", slot_troop_leaded_party, 1),
    ],
    "{!}CHEAT - Join our cause by force.", "lord_join_rebellion_suggest_cheat",[]],
  
  [anyone,"lord_join_rebellion_suggest_cheat",
    [], "Cheat: All right.",
    "close_window", # unused
    [
      (troop_set_slot, "$g_talk_troop", slot_troop_discussed_rebellion, 1),
      (call_script, "script_change_troop_faction", "$g_talk_troop", "$players_kingdom"),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  #  [anyone|plyr,"party_encounter_lord_hostile_attacker_2", [
  #                             (gt, "$supported_pretender", 0),
  #                             (eq, "$supported_pretender_old_faction", "$g_talk_troop_faction"),
  #                             (neg|troop_slot_ge, "$g_talk_troop", slot_troop_intrigue_impatience, 100),
  #                             (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
  #                             (troop_slot_ge, "$g_talk_troop", slot_troop_leaded_party, 1),
  #                             (str_store_troop_name, s12, "$supported_pretender"),
  #                             (str_store_faction_name, s14, "$supported_pretender_old_faction"),
  #                             (faction_get_slot, ":old_faction_lord", "$supported_pretender_old_faction", slot_faction_leader),
  #                             (str_store_troop_name, s15, ":old_faction_lord"),
  #                             ],
  #   "{s12} is your rightful ruler. Join our cause against the usurper, {s15}!", "lord_join_rebellion_suggest",[]],
  
  
  
  #  [anyone,"lord_join_rebellion_suggest", [
  #                    (eq,"$talk_context",tc_party_encounter),
  #                    (encountered_party_is_attacker),
  #                    (lt, "$g_talk_troop_relation", -5),
  #      ], "I have no time to bandy words with the likes of you. Now defend yourself!",
  #   "party_encounter_lord_hostile_attacker_2",
  #   [
  #    (try_begin),
  #		(neg|troop_slot_ge, "$g_talk_troop", slot_troop_intrigue_impatience, 100),
  #		(troop_set_slot, "$g_talk_troop", slot_troop_intrigue_impatience, 100),
  #	(try_end),
  
  #    ]],
  
  
  #removed a number of rebellion scripts...
  
  #Rebellion changes end
  
  
  [anyone|plyr,"lord_talk",
    [
      (troop_get_slot, ":prison_location", "$g_talk_troop", slot_troop_prisoner_of_party),
      (is_between, ":prison_location", centers_begin, centers_end),
      (neg|party_slot_eq, ":prison_location", slot_town_lord, "trp_player"),
      (neq, "$talk_context", tc_prison_break),
    ],
    "I've come to break you out of here.", "lord_prison_break_chains",[]],
  
  [anyone,"lord_prison_break_chains", [],
    "Thank the heavens you came! However, I'm not going anywhere with these chains on my legs. You'll need to get the key away from the guard somehow.", "close_window",[]],
  
  [anyone|plyr,"lord_talk",
    [
      (ge, "$cheat_mode", 1),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
    ],
    "{!}CHEAT - Take the following action.", "lord_suggest_action_ask",[]],
  
  
  [anyone,"lord_tell_objective",
    [
      (troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
    ],
    "What am I doing? What does it look like I'm doing? I'm a prisoner here!", "lord_pretalk",[]],
  
  [anyone,"lord_tell_objective",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_leaded_party, -1)
    ],
    "I am not commanding any men at the moment.", "lord_pretalk",[]],
  
  ## CHEAT
  [anyone,"lord_tell_objective", [(ge, "$cheat_mode", 1),  ],
    "{!}slot_party_ai_object: {reg1}/{s1} ^ slot_party_ai_state: {reg2} ^ slot_party_on_water: {reg3} ^ slot_party_ai_state_backup: {reg4} ^ slot_party_ai_object_backup: {reg5}/{s5} ^ slot_party_ai_behavior_backup: {reg6} ^ slot_party_ai_embarking_port: {reg7}",
    "lord_pretalk",
    [
      (party_get_slot, reg1, "$g_talk_troop_party", slot_party_ai_object),
      (str_store_party_name, s1, reg1),
      (party_get_slot, reg2, "$g_talk_troop_party", slot_party_ai_state),
      (party_get_slot, reg3, "$g_talk_troop_party", slot_party_on_water),
      (party_get_slot, reg4, "$g_talk_troop_party", slot_party_ai_state_backup),
      (party_get_slot, reg5, "$g_talk_troop_party", slot_party_ai_object_backup),
      (str_store_party_name, s5, reg5),
      (party_get_slot, reg6, "$g_talk_troop_party", slot_party_ai_behavior_backup),
      (party_get_slot, reg7, "$g_talk_troop_party", slot_party_ai_embarking_port),
  ]],
  ##
  
  [anyone,"lord_tell_objective", [
      (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_holding_center),
      (party_get_attached_to, ":cur_center_no", "$g_talk_troop_party"),
      (try_begin),
        (lt, ":cur_center_no", 0),
        (party_get_cur_town, ":cur_center_no", "$g_talk_troop_party"),
      (try_end),
      (is_between, ":cur_center_no", centers_begin, centers_end),
    ],
    "We are resting at {s1}. {s14}{s15}",
    "lord_pretalk",
    [(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (str_store_party_name, s1, ":ai_object")]],
  
  
  
  
  
  
  
  [anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_holding_center)],
    "We are travelling to {s1}. {s14}{s15}", "lord_pretalk",
    [(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (str_store_party_name, s1, ":ai_object"),
  ]],
  
  [anyone|auto_proceed,"lord_tell_objective", [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshal, "$g_talk_troop"),
      (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_visiting_village)],
    "{!}Warning: This line should never display.", "lord_tell_objective_2",
    []],
  
  #fix for translation variable changes
  [anyone,"lord_tell_objective_2", [],
    "I am heading to the vicinity of {s1}. {s14}{s15}", "lord_pretalk",
    [(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (str_store_party_name, s1, ":ai_object")]],
  
  [anyone,"lord_tell_objective", [
      (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_visiting_village)],
    "We are recruiting new soldiers from {s1}. {s14}{s15}", "lord_pretalk",
    [(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (str_store_party_name, s1, ":ai_object")]],
  
  
  
  
  [anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_patrolling_around_center)],
    "We are scouting for the enemy around {s1}. {s14}{s15}", "lord_pretalk",
    [(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (str_store_party_name, s1, ":ai_object"),
  ]],
  
  #  [anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_raiding_around_center)],
  #   "We ride out to lay waste to village of {s1} to punish the foe for his misdeeds.", "lord_pretalk",[(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
  #                                                               (str_store_party_name, s1, ":ai_object")]],
  
  [anyone,"lord_tell_objective", [
      (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_raiding_around_center),
      (party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (str_store_party_name, s1, ":ai_object")
    ],
    "We are laying waste to the village of {s1}. {s14}{s15}", "lord_pretalk",[]],
  
  [anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_retreating_to_center)],
    "We are retreating to {s1}. {s14}{s15}", "lord_pretalk",[(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (str_store_party_name, s1, ":ai_object")]],
  
  [anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_besieging_center)],
    "We are besieging {s1}. {s14}{s15}", "lord_pretalk",[(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (str_store_party_name, s1, ":ai_object")]],
  
  [anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_engaging_army),
      (party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (party_is_active, ":ai_object"),
    ],
    "We are fighting against {s1}. {s14}{s15}", "lord_pretalk",
    [
      (party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (str_store_party_name, s1, ":ai_object")
  ]],
  
  [anyone,"lord_tell_objective", [
      
      #MOTO use substate to represent screening properly
      # (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_screening_army)],
      (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_accompanying_army),
      (party_slot_eq, "$g_talk_troop_party", slot_party_ai_substate, 1)],
    #MOTO end use substate to represent screening properly
    "I am screening {s1}'s advance. {s14}{s15}", "lord_pretalk",[
      (party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (party_stack_get_troop_id, ":ai_object_commander", ":ai_object", 0),
      (str_store_troop_name, s1, ":ai_object_commander")
  ]],
  
  
  [anyone,"lord_tell_objective", [(party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_accompanying_army)],
    "We are accompanying {s1}. {s14}{s15}", "lord_pretalk",[(party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (str_store_party_name, s1, ":ai_object")]],
  
  
  [anyone,"lord_tell_objective",
    [
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshal, "$g_talk_troop"),
      (neg|faction_slot_eq,  "$g_talk_troop_faction", slot_faction_ai_state, sfai_default),
      (neg|faction_slot_eq,  "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
    ],
    "I am leading the army of the realm.", "lord_talk_ask_about_strategy",[]],
  
  
  [anyone,"lord_tell_objective",
    [
      (assign, ":pass", 0),
      (try_begin),
        (this_or_next|party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, 0),
        (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_undefined),
        (assign, ":pass", 1),
      (else_try),
        (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_engaging_army),
        (party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
        (neg|party_is_active, ":ai_object"),
        (assign, ":pass", 1),
      (try_end),
      (eq, ":pass", 1),
    ],
    "We are reconsidering our next objective.", "lord_pretalk",[]],
  
  [anyone,"lord_tell_objective", [],
    "I don't know: {reg1} {s1} (ERROR)", "lord_pretalk",[(party_get_slot, reg1, "$g_talk_troop_party", slot_party_ai_state),
      (party_get_slot, ":ai_object", "$g_talk_troop_party", slot_party_ai_object),
      (str_store_party_name, s1, ":ai_object")]],
  
  # [anyone|plyr,"lord_talk",
    # [
      # (eq, "$talk_context", tc_party_encounter),
      # (eq, 1, 0),
      # (eq, "$g_talk_troop_faction", "$players_kingdom"),
      # (party_slot_eq, "$g_encountered_party", slot_party_following_player, 0),
      # (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_marshal, "trp_player"),
    # ],
    # "Will you follow me? I have a plan.", "lord_ask_follow",[]],
  
  # [anyone,"lord_ask_follow", [(party_get_slot, ":dont_follow_until_time", "$g_encountered_party", slot_party_dont_follow_player_until_time),
      # (store_current_hours, ":cur_time"),
      # (lt, ":cur_time", ":dont_follow_until_time")],
    # "I enjoy your company, {playername}, but there are other things I must attend to. Perhaps in a few days I can ride with you again.", "close_window",
    # [(assign, "$g_leave_encounter",1)]],
  
  # [anyone,"lord_ask_follow", [(troop_get_slot, ":troop_renown", "$g_talk_troop", slot_troop_renown),
      # (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      # (val_mul, ":troop_renown", 3),
      # (val_div, ":troop_renown", 4),
      # (lt, ":player_renown", ":troop_renown"),
    # ],
    # "That would hardly be proper, {playername}. Why don't you follow me instead?", "close_window",
    # [(assign, "$g_leave_encounter",1)]],
  
  # [anyone,"lord_ask_follow", [(lt, "$g_talk_troop_effective_relation", 25)],
    # "{s43}", "close_window",
    # [
      # (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_follow_refusal_default"),
      # (assign, "$g_leave_encounter",1)]],
  # #Post 0907 changes end
  
  # [anyone,"lord_ask_follow", [],
    # "Lead the way, {playername}! Let us bring death and defeat to all our enemies.", "close_window",
    # [(party_set_slot, "$g_talk_troop_party", slot_party_commander_party, "p_main_party"),
      # #(call_script, "script_party_decide_next_ai_state_under_command", "$g_talk_troop_party"),
      # (call_script, "script_npc_decision_checklist_party_ai", "$g_talk_troop"), #This handles AI for both marshal and other parties
      # (call_script, "script_party_set_ai_state", "$g_talk_troop_party", reg0, reg1),
      
      # (store_current_hours, ":follow_until_time"),
      # (store_add, ":follow_period", 30, "$g_talk_troop_relation"),
      # (val_div, ":follow_period", 2),
      # (val_add, ":follow_until_time", ":follow_period"),
      # (party_set_slot, "$g_encountered_party", slot_party_follow_player_until_time, ":follow_until_time"),
      # (party_set_slot, "$g_encountered_party", slot_party_following_player, 1),
      # (assign, "$g_leave_encounter",1)]],
  
  # [anyone,"lord_talk_preoffer", [], "Yes?", "lord_talk_offer",[]],
  
  
  ##  [anyone|plyr,"lord_talk_offer", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                             (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"), #he is not a faction leader!
  ##                             (call_script, "script_get_number_of_hero_centers", "$g_talk_troop"),
  ##                             (eq, reg0, 0), #he has no castles or towns
  ##                             (hero_can_join),
  ##                             ],
  ##   "I need capable men like you. Will you join me?", "knight_offer_join",[
  ##       ]],
  
  # [anyone|plyr,"lord_talk_offer", [(eq,1,0)],
    # "I wish to ransom one of your prisoners.", "knight_offer_join",[
  # ]],
  
  # [anyone|plyr,"lord_talk_offer", [], "Never mind.", "lord_pretalk",[]],
  
  # [anyone ,"knight_offer_join", [(call_script, "script_cf_is_quest_troop", "$g_talk_troop")],
    # "I fear I cannot join you at the moment, {playername}. I've important business to attend to, and it cannot wait.", "hero_pretalk",[]],
  
  # [anyone ,"knight_offer_join", [(lt, "$g_talk_troop_relation", 5),
      # (store_character_level,":player_level","trp_player"),
      # (store_character_level,":talk_troop_level","$g_talk_troop"),
      # (val_mul,":player_level",2),
      # (lt, ":player_level", ":talk_troop_level")],
    # "You forget your place, {reg59?madam:sir}. I do not take orders from the likes of you.", "hero_pretalk",[]],
  
  # [anyone ,"knight_offer_join", [
      # (assign, ":num_player_companions",0),
      # (try_for_range, ":hero_id", heroes_begin, heroes_end),
        # (troop_slot_eq, ":hero_id",slot_troop_occupation, slto_player_companion),
        # (val_add, ":num_player_companions",1),
      # (try_end),
      # (assign, reg5, ":num_player_companions"),
      # (store_add, reg6, reg5, 1),
      # (val_mul, reg6,reg6),
      # (val_mul, reg6, 1000),
      # (gt, reg6,0)], #note that we abuse the value of reg6 in the next line.
    # "I would be glad to fight at your side, my friend, but there is a problem... " +
    # "The thing is, I've found myself in a bit of debt that I must repay very soon. " +
    # "I am honour-bound to return every coin. Unless you have {reg6} peningas to spare, " +
    # "I have to stay until I get this weight off my neck.", "knight_offer_join_2",[]],
  # [anyone ,"knight_offer_join", [(gt,reg6, 100000)], "Join you? I think not.", "close_window",[]],
  # [anyone ,"knight_offer_join", [], "Aye, my friend, I'll be happy to join you.", "knight_offer_join_2",[]],
  
  # [anyone|plyr,"knight_offer_join_2", [(gt, reg6,0),(store_troop_gold, ":gold", "trp_player"),(gt,":gold",reg6)],
    # "Here, take it, all {reg6} peningas you need. 'Tis only money.", "knight_offer_join_accept",[(troop_remove_gold, "trp_player",reg6)]],
  # [anyone|plyr,"knight_offer_join_2", [(le, reg6,0)], "Then let us ride together, my friend.", "knight_offer_join_accept",[]],
  
  # [anyone|plyr,"knight_offer_join_2", [(eq, "$talk_context", tc_hero_freed)], "That's good to know. I will think on it.", "close_window",[]],
  # [anyone|plyr,"knight_offer_join_2", [(neq, "$talk_context", tc_hero_freed)], "That's good to know. I will think on it.", "hero_pretalk",[]],
  
  
  # [anyone ,"knight_offer_join_accept", [(troop_slot_ge, "$g_talk_troop", slot_troop_leaded_party, 1)],
    # "I've some trusted men in my band who could be of use to you. What do you wish to do with them?", "knight_offer_join_accept_party",[
  # ]],
  # [anyone ,"knight_offer_join_accept", [], "Ah, certainly, it might be fun!", "close_window",[
      # (call_script, "script_recruit_troop_as_companion", "$g_talk_troop"),
      # (assign, "$g_leave_encounter",1)
  # ]],
  
  # [anyone|plyr,"knight_offer_join_accept_party", [], "You may disband your men. I've no need for other troops.", "knight_join_party_disband",[]],
  # [anyone|plyr,"knight_offer_join_accept_party", [(troop_get_slot, ":companions_party","$g_talk_troop", slot_troop_leaded_party),
      # (party_can_join_party,":companions_party","p_main_party"),
      # ], "Your men may join as well. We need every soldier we can muster.", "knight_join_party_join",[]],
  # [anyone|plyr,"knight_offer_join_accept_party", [(is_between,"$g_encountered_party",centers_begin, centers_end)], "Lead your men out of the town. I shall catch up with you on the road.", "knight_join_party_lead_out",[]],
  # [anyone|plyr,"knight_offer_join_accept_party", [(neg|is_between,"$g_encountered_party",centers_begin, centers_end)],
    # "Keep doing what you were doing. I'll catch up with you later.", "knight_join_party_lead_out",[]],
  
  
  # [anyone ,"knight_join_party_disband", [], "Ah... Very well, {playername}. Much as I dislike losing good men, " +
    # "the decision is yours. I'll disband my troops and join you.", "close_window",[
      # (call_script, "script_recruit_troop_as_companion", "$g_talk_troop"),
      
      # (troop_get_slot, ":companions_party","$g_talk_troop", slot_troop_leaded_party),
      # (party_detach, ":companions_party"),
      # (remove_party, ":companions_party"),
      # (assign, "$g_leave_encounter",1)
  # ]],
  
  # [anyone ,"knight_join_party_join", [], "Excellent. " +
    # "My lads and I will ride with you.", "close_window",[
      # (call_script, "script_recruit_troop_as_companion", "$g_talk_troop"),
      # (party_remove_members, "p_main_party", "$g_talk_troop", 1),
      
      # (troop_get_slot, ":companions_party","$g_talk_troop", slot_troop_leaded_party),
      # (assign, "$g_move_heroes", 1),
      # (call_script, "script_party_add_party", "p_main_party", ":companions_party"),
      # (party_detach, ":companions_party"),
      # (remove_party, ":companions_party"),
      # (assign, "$g_leave_encounter",1)
  # ]],
  
  # [anyone ,"knight_join_party_lead_out", [], "Very well then. " +
    # "I shall maintain a patrol of this area. Return if you have further orders for me.", "close_window",[
      # (call_script, "script_recruit_troop_as_companion", "$g_talk_troop"),
      # (party_remove_members, "p_main_party", "$g_talk_troop", 1),
      
      # (troop_get_slot, ":companions_party","$g_talk_troop", slot_troop_leaded_party),
      # (party_set_faction, ":companions_party", "fac_player_supporters_faction"),
      # (party_detach, ":companions_party"),
      # (party_set_ai_behavior, ":companions_party", ai_bhvr_patrol_location),
      # (party_set_flags, ":companions_party", pf_default_behavior, 0),
  # ]],
  ###storyline
  ##  [anyone,"lord_enter_service_reject", [(eq, "$campaign_type", camp_storyline),
  ##                                        (is_between, "$g_talk_troop", "trp_kingdom_5_lord", "trp_kingdom_9_lord"),
  ##                                        (check_quest_active,"qst_the_alliance")
  ##  ], "Very well -- you shall have time to reconsider, but if you are toying with me, it will do your reputation no credit.", "lord_pretalk",
  ##   [
  ##    ]],
  ###
  [anyone,"lord_enter_service_reject", [
      (eq, "$players_kingdom", "fac_player_supporters_faction"),
    ], "Indeed... Did you offer vassalage, then, just to by time? Very well -- you shall have time to reconsider, but if you are toying with me, it will do your reputation no credit.", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"lord_give_oath_give_up", [
      (eq, "$players_kingdom", "fac_player_supporters_faction"),
    ], "Indeed... Did you offer vassalage, then, just to buy time? Very well -- you shall have time to reconsider, but if you are toying with me, it will do your reputation no credit.", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  
  [anyone,"lord_enter_service_reject", [], "What pigswill! " +
    "And to think I would offer you a place among my nobles. Begone, beggar, before I lose my temper!", "close_window",
    [
      (try_begin),
        (store_partner_quest, ":lords_quest"),
        (eq, ":lords_quest", "qst_join_faction"),
        (call_script, "script_abort_quest", "qst_join_faction", 1),
      (try_end),
      (assign, "$g_invite_faction", 0),
      (assign, "$g_invite_faction_lord", 0),
      (assign, "$g_invite_offered_center", 0),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone,"lord_ask_enter_service", [(gt, "$players_kingdom", 0),
      (neq, "$players_kingdom", "$g_talk_troop_faction"),
      (faction_get_slot, ":players_lord", "$players_kingdom", slot_faction_leader),
      (neq, ":players_lord", "trp_player"),
      (str_store_troop_name, s5, ":players_lord"),
      ], "You are already oath-bound to serve {s5}, are you not?", "lord_give_oath_under_oath_already",[(troop_set_slot, "$g_talk_troop", slot_troop_last_talk_time, "$g_current_hours"),]],
  [anyone|plyr ,"lord_give_oath_under_oath_already", [], "Indeed I am, {s65}. Forgive my rambling.", "lord_pretalk",[]],
  
  [anyone,"lord_ask_enter_service", [(lt, "$g_talk_troop_effective_relation", -5)], "I accept oaths only from those I can trust to keep them, {playername}.", "lord_pretalk",[(troop_set_slot, "$g_talk_troop", slot_troop_last_talk_time, "$g_current_hours"),]],
  [anyone,"lord_ask_enter_service", [(lt, "$g_talk_troop_faction_relation", 0)], "You've caused trouble in my realm, {playername}. I do not wish for myself the opposition that would come from making you my vassal.", "lord_pretalk",[(troop_set_slot, "$g_talk_troop", slot_troop_last_talk_time, "$g_current_hours"),]],
  
  [anyone,"lord_ask_enter_service", [
      (troop_get_type, ":type", "trp_player"),
      (val_mod, ":type", 2),
      (eq, ":type", 1),
      
      
      (try_for_range, ":center", centers_begin, centers_end),
        (party_slot_eq, ":center", slot_town_lord, "trp_player"),
        (assign, "$bypass_female_vassal_explanation", 1),
      (try_end),
      (eq, "$bypass_female_vassal_explanation", 0),
      
      #  (troop_get_slot, ":husband", "trp_player", slot_troop_spouse),
      ], "My lady, you seem to have the makings of a good war leader. For a woman to show such skill is an uncommon thing in the Northlands, but not completely without precedent. Noblewomen have often taken command of armies after their husbands or fathers were slain or captured, for example.", "lord_ask_enter_service_female_2",[
      (assign, "$bypass_female_vassal_explanation", 1),
      
  ]],
  
  [anyone,"lord_ask_enter_service_female_2", [
      ], "However, I have never heard of a king who granted a fief to a woman, no matter how valorous, simply because he needed an extra vassal. Were I to do such a thing, I would raise eyebrows across the Northlands. Men would say that I was besotted or bewitched, or that I aimed to overturn the natural order of things. As much as I regret it, I cannot afford to grant you a fief.", "lord_ask_enter_service_female_response",[]],
  
  [anyone|plyr, "lord_ask_enter_service_female_response", [],
    "What if I were to take one of your enemy's castles by force?", "lord_ask_enter_service_female_solution_capture", []],
  
  [anyone|plyr, "lord_ask_enter_service_female_response", [
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
    ],
    "What if I were to marry one of your lords?", "lord_ask_enter_service_female_solution_marriage", []],
  
  [anyone|plyr, "lord_ask_enter_service_female_response", [],
    "Perhaps one of your competitors will prove to be more open-minded.", "lord_ask_enter_service_female_solution_competitor", []],
  
  [anyone|plyr, "lord_ask_enter_service_female_response", [],
    "I would be willing to fight for you, even without the fief.", "lord_ask_enter_service", []],
  
  [anyone|plyr, "lord_ask_enter_service_female_response", [],
    "Never mind.", "lord_pretalk", []],
  
  [anyone,"lord_ask_enter_service_female_solution_marriage", [
      ], "Well, I still would not be willing to grant you any fiefs. However, you would no doubt have the use of your husband's properties, which would allow you to act as one of my vassals in all but name. Did you have other questions?", "lord_ask_enter_service_female_response",[]],
  
  [anyone,"lord_ask_enter_service_female_solution_competitor", [
      ], "Oh, perhaps you might find someone who was truly desperate -- but then, I would think, they would not have many fiefs to bestow. Did you have other questions?", "lord_ask_enter_service_female_response",[]],
  
  [anyone,"lord_ask_enter_service_female_solution_capture", [
      ], "Well, in that case, depending on the circumstances, I might be inclined to let you keep it. Did you have other questions?", "lord_ask_enter_service_female_response",[]],
  
  
  [anyone,"lord_ask_enter_service",
    [
      (assign, "$g_invite_offered_center", -1),
      (troop_get_slot, ":renown", "trp_player", slot_troop_renown),
      (store_mul, ":vassal_potential", "$g_talk_troop_effective_relation", 5),
      (val_add, ":vassal_potential", ":renown"),
      (call_script, "script_get_number_of_hero_centers", "trp_player"),
      (assign, ":num_centers_owned", reg0),
      (store_mul, ":center_affect", ":num_centers_owned", 50),
      (val_add, ":vassal_potential", ":center_affect"),
      (ge, ":vassal_potential", 150),
      (try_begin),
        (troop_get_type, ":is_female", "trp_player"),
        (val_mod, ":is_female", 2),
        (eq, ":is_female", 0),
        (eq, ":num_centers_owned", 0),
        (call_script, "script_get_poorest_village_of_faction", "$g_talk_troop_faction"),
        (gt, reg0, 0),
        (assign, "$g_invite_offered_center", reg0),
      (try_end),
    ],
    "You are known as a brave {reg59?warrior:man-at-arms} and a fine leader of men, {playername}. " +
    "I shall be pleased to accept your sword into my service and bestow vassalage upon you, " +
    "if you are ready to swear homage to me.", "lord_give_oath_1",[]],
  
  [anyone,"lord_ask_enter_service", [], "You've yet to show yourself as a competent commander, {playername}. " +
    "Take your sword to my enemies and prove to me that you are worthy of becoming my vassal. " +
    "Then we may speak more of this.", "lord_pretalk",[(troop_set_slot, "$g_talk_troop", slot_troop_last_talk_time, "$g_current_hours"),]],
  
  [anyone|plyr,"lord_give_oath_1", [],  "I am ready, {s65}.", "lord_give_oath_2", []],
  [anyone|plyr,"lord_give_oath_1", [],  "Forgive me, {s65}. I must give the matter more thought first...", "lord_give_oath_give_up", []],
  
  [anyone,"lord_give_oath_give_up", [
      (troop_get_type, ":type", "trp_player"),
      (val_mod, ":type", 2),
      (eq, ":type", 1),
      ],  "Take whatever time you need, my lady.", "lord_pretalk", []],
  
  [anyone,"lord_give_oath_give_up", [],  "What are you playing at, {playername}? Go and make up your mind, and stop wasting my time.", "close_window", [(assign, "$g_leave_encounter",1)]],
  [anyone,"lord_give_oath_2", [],  "Good. Then repeat the words of the oath with me: I swear homage to you as lawful ruler of the {s41}.", "lord_give_oath_3", [
      (str_store_faction_name, 41, "$g_talk_troop_faction"),
      (try_begin),
        (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
        (neg|troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
        
        (troop_get_slot, ":rebel_faction", "$g_talk_troop", slot_troop_original_faction),
        (str_store_faction_name, 41, ":rebel_faction"),
      (try_end),
  ]],
  
  [anyone|plyr,"lord_give_oath_3", [],  "I pledge homage to you as lawful ruler of the {s41}.", "lord_give_oath_4", []],
  [anyone|plyr,"lord_give_oath_3", [(neq, "$campaign_type", camp_storyline),],  "Excuse me, my {reg65?Lady:Lord}. I feel I need to think about this.", "lord_give_oath_give_up", []],
  
  [anyone,"lord_give_oath_4", [],  "I will remain as your loyal and devoted {reg59?follower:man} as long as my breath remains...", "lord_give_oath_5", []],
  
  [anyone|plyr,"lord_give_oath_5", [],  "I will remain as your loyal and devoted {reg59?follower:man} as long as my breath remains...", "lord_give_oath_6", []],
  [anyone|plyr,"lord_give_oath_5", [(neq, "$campaign_type", camp_storyline),],  "My {reg65?Lady:Lord}, may I ask for some time to think about this?", "lord_give_oath_give_up", []],
  
  [anyone,"lord_give_oath_6", [],  "...and I will be at your side to fight your enemies should you need my sword.", "lord_give_oath_7", []],
  
  [anyone|plyr,"lord_give_oath_7", [],  "...and I will be at your side to fight your enemies should you need my sword.", "lord_give_oath_8", []],
  [anyone|plyr,"lord_give_oath_7", [(neq, "$campaign_type", camp_storyline),],  "My {reg65?Lady:Lord}, please give me more time to think about this.", "lord_give_oath_give_up", []],
  
  [anyone,"lord_give_oath_8", [],  "Finally, I will uphold your lawful claims and those of your legitimate heirs.", "lord_give_oath_9", []],
  
  [anyone|plyr,"lord_give_oath_9", [],  "Finally, I will uphold your lawful claims and those of your legitimate heirs.", "lord_give_oath_10", []],
  [anyone|plyr,"lord_give_oath_9", [(neq, "$campaign_type", camp_storyline),],  "My {reg65?Lady:Lord}, I must have more time to consider this.", "lord_give_oath_give_up", []],
  
  [anyone,"lord_give_oath_10", [],  "Very well. You have given me your solemn oath, {playername}. May you uphold it always, with proper courage and devotion.", "lord_give_oath_go_on_2", []],
  
  [anyone,"lord_give_oath_go_on_2",
    [
      (assign, reg1, 1),
      (try_begin),
        (le, "$g_invite_offered_center", 0),
        (assign, reg1, 0),
      (else_try),
        (str_store_party_name, s1, "$g_invite_offered_center"),
      (try_end),
    ],
    "Let it be known that from this day forward, you are my sworn {reg59?follower:man} and vassal. " +
    "I give you my protection and grant you the right to bear arms in my name, and I pledge that I shall not deprive you of your life, liberty or properties except by the lawful judgment of your peers or by the law and custom of the land.{reg1? Furthermore I give you the fief of {s1} with all its rents and revenues.:}", "lord_give_oath_go_on_3", []],
  
  [anyone,"lord_give_oath_go_on_3",
    [
    ],
    
    "You have done a wise thing, {playername}. Serve me well, and I promise you will rise high.", "lord_give_conclude", []],
  
  
  
  ##  [anyone,"lord_give_oath_go_on_2", [],  "Then let it be know that from now on, you are my sworn {reg59?follower:man}.\
  ## I give you my protection and grant you the right to bear arms in my name.\
  ## You have done wisely {playername}. Serve me well and I promise, you will rise high.", "lord_give_oath_5", []],
  
  #  [anyone,"lord_ask_enter_service", [(lt, "$g_talk_troop_relation", 10),
  #                                     (store_character_level, ":player_level", "trp_player"),
  #                                     (lt, ":player_level", 10),
  #                                     ], "I know not much about you. Keep serving me {playername}. Prove your loyality, then I will know I can trust you and accept your oath.", "lord_pretalk",[]],
  
  ##  [anyone,"lord_ask_enter_service", [], "What kind of oath are you willing to make?", "lord_oath_what_kind",[]],
  ##
  ##  [anyone|plyr ,"lord_oath_what_kind", [], "I will give you my oath to serve you for two months.", "lord_oath_what_kind_2",[(assign, "$temp", 60)]],
  ##  [anyone|plyr ,"lord_oath_what_kind", [], "I will give you my oath to serve you for three months.", "lord_oath_what_kind_2",[(assign, "$temp", 90)]],
  ##  [anyone|plyr ,"lord_oath_what_kind", [], "I will give you my oath to serve you for six months.", "lord_oath_what_kind_2",[(assign, "$temp", 180)]],
  ##  [anyone|plyr ,"lord_oath_what_kind", [], "I will give you my oath to serve you indefinitely.", "lord_oath_what_kind_2",[(assign, "$temp", 720)]],
  ##  [anyone|plyr ,"lord_oath_what_kind", [], "Maybe I should give more thought to this, my lord.", "lord_oath_what_kind_cancel",[]],
  ##  [anyone ,"lord_oath_what_kind_cancel", [], "What nonsense is this? Now go make up your mind and stop wasting my time.", "close_window",[]],
  ##
  ##  [anyone, "lord_oath_what_kind_2", [], "Hmmm. Do you ask for anything in return?", "lord_oath_what_do_you_want",[]],
  ##
  ##  [anyone|plyr, "lord_oath_what_do_you_want", [], "I ask for nothing but your blessing, my lord.", "lord_oath_consider",[(assign,"$temp2",0)]],
  ##  [anyone|plyr, "lord_oath_what_do_you_want", [], "I only ask for the right to have my own banner, my lord.", "lord_oath_consider",[(assign,"$temp2",1)]],
  ##  [anyone|plyr, "lord_oath_what_do_you_want", [], "I just ask for the right to hold one castle, my lord.", "lord_oath_consider",[(assign,"$temp2",2)]],
  ##  [anyone|plyr, "lord_oath_what_do_you_want", [], "I ask for the right to hold two castles, my lord.", "lord_oath_consider",[(assign,"$temp2",4)]],
  ##  [anyone|plyr, "lord_oath_what_do_you_want", [], "I ask for the right to hold three castles, my lord.", "lord_oath_consider",[(assign,"$temp2",6)]],
  ##  [anyone|plyr ,"lord_oath_what_do_you_want", [], "Maybe I should give more thought to this, my lord.", "lord_oath_what_kind_cancel",[]],
  ##
  ##  [anyone ,"lord_oath_consider", [
  ##      (store_character_level, ":player_level", "trp_player"),
  ##      (store_mul, ":benefit", ":player_level", 5),
  ##      (val_add, ":benefit", "$temp"),
  ##      (val_add, ":benefit", "$g_talk_troop_relation"),
  ##
  ##      (store_mul, ":cost", "$temp2", 100),
  ##      (lt, ":cost", ":benefit"),
  ##      ], "That is agreeable {playername}. Give me your oath now and I will accept you as my follower and offer you my protection.", "lord_give_oath_go_on",[]],
  ##
  ##  [anyone ,"lord_oath_consider", [], "Hmmm. What you ask for is not acceptible {playername}.", "close_window",[]],
  ##
  ##  [anyone|plyr,"lord_give_oath_go_on", [(eq, "$temp", 60)],  "I give you my oath lord, that I will remain in your service for two months.\
  ## During this time, I will be faithful to you,\
  ## I will not act in a way to cause you harm, and I will be at your side to fight your enemies should you need my sword.", "lord_give_oath_go_on_2", []],
  ##  [anyone|plyr,"lord_give_oath_go_on", [(eq, "$temp", 90)],  "I give you my oath lord, that I will remain in your service for three months.\
  ## During this time, I will be faithful to you,\
  ## I will not act in a way to cause you harm, and I will be at your side to fight your enemies should you need my sword.", "lord_give_oath_go_on_2", []],
  ##  [anyone|plyr,"lord_give_oath_go_on", [(eq, "$temp", 180)],  "I give you my oath lord, that I will remain in your service for six months.\
  ## During this time, I will be faithful to you,\
  ## I will not act in a way to cause you harm, and I will be at your side to fight your enemies should you need my sword.", "lord_give_oath_go_on_2", []],
  ##  [anyone|plyr,"lord_give_oath_go_on", [(gt, "$temp", 700)],  "I give you my oath lord, that I will remain as your loyal and devoted {reg59?follower:man} as long as my breath remains.\
  ## I will never act in a way to cause you harm, and I will be at your side to fight your enemies should you need my sword.", "lord_give_oath_go_on_2", []],
  ##
  ##  [anyone,"lord_give_oath_go_on_2", [(eq,"$temp2",0)],  "Then let it be know that from now on, you are my sworn {reg59?follower:man}.\
  ## I give you my protection and grant you the right to bear arms in my name.\
  ## You have done wisely {playername}. Serve me well and I promise, you will rise high.", "lord_give_oath_5", []],
  ##
  ##  [anyone,"lord_give_oath_go_on_2", [(eq,"$temp2",1)],  "Then let it be know that from now on, you are my sworn {reg59?follower:man}.\
  ## I give you my protection and grant you the right to hold your own banner.\
  ## You have done wisely {playername}. Serve me well and I promise, you will rise high.", "lord_give_oath_5", []],
  ##
  ##  [anyone,"lord_give_oath_go_on_2", [(eq,"$temp2",2)],  "Then let it be know that from now on, you are my sworn {reg59?follower:man} and vassal.\
  ## I give you my protection and grant you the right to hold a castle.\
  ## You have done wisely {playername}. Serve me well and I promise, you will rise high.", "lord_give_oath_5", []],
  ##
  ##  [anyone,"lord_give_oath_go_on_2", [(eq,"$temp2",4)],  "Then let it be know that from now on, you are my sworn {reg59?follower:man} and vassal.\
  ## I give you my protection and grant you the right to hold two castles.\
  ## You have done wisely {playername}. Serve me well and I promise, you will rise high.", "lord_give_oath_5", []],
  ##
  ##  [anyone,"lord_give_oath_go_on_2", [],  "Then let it be know that from now on, you are my sworn {reg59?follower:man} and vassal.\
  ## I give you my protection and grant you the right to hold three castles.\
  ## You have done wisely {playername}. Serve me well and I promise, you will rise high.", "lord_give_oath_5", []],
  
  [anyone|plyr,"lord_give_conclude",
    [
      (troop_get_type, reg39, "$g_talk_troop"),
      (val_mod, reg39, 2),
      (try_begin), #activate husband as pretender
        (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, "trp_player"),
        (str_store_string, s41, "str_very_well__you_are_now_my_liege_as_well_as_my_husband"),
      (else_try),	#all other situations
        (str_store_string, s41, "str_i_thank_you_reg39my_ladylord"),
      (try_end),
    ],  "{!}{s41}", "lord_give_conclude_2",
    [
      #Pretender changes
      (assign, ":is_pretender", 0),
      (try_begin),
        (this_or_next|is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
        (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, "trp_player"),
        (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
        (assign, ":is_pretender", 1),
        
        (assign, "$supported_pretender", "$g_talk_troop"),
        (troop_get_slot, "$supported_pretender_old_faction", "$g_talk_troop", slot_troop_original_faction),
        (troop_set_faction, "$g_talk_troop", "fac_player_supporters_faction"),
        (faction_set_slot, "fac_player_supporters_faction", slot_faction_leader, "$g_talk_troop"),
        (assign, "$g_talk_troop_faction", "fac_player_supporters_faction"),
        
        (quest_set_slot, "qst_rebel_against_kingdom", slot_quest_giver_troop, "$g_talk_troop"),
        (quest_set_slot, "qst_rebel_against_kingdom", slot_quest_target_faction, "$supported_pretender_old_faction"),
        
        (str_store_faction_name_link, s14, "$supported_pretender_old_faction"),
        (str_store_troop_name_link, s13, "$g_talk_troop"),
        (setup_quest_text,"qst_rebel_against_kingdom"),
        (str_store_string, s2, "@You promised to help {s13} claim the throne of the {s14}."),
        (call_script, "script_start_quest", "qst_rebel_against_kingdom", "$g_talk_troop"),
      (try_end),
      
      (try_begin),
        (eq, "$players_kingdom", "fac_player_supporters_faction"),
        # (call_script, "script_deactivate_player_faction"), done in script_player_join_faction
        (try_for_range, ":npc", active_npcs_begin, active_npcs_end),
          (store_faction_of_troop, ":npc_faction", ":npc"),
          (eq, ":npc_faction", "fac_player_supporters_faction"),
          (troop_slot_eq, ":npc", slot_troop_occupation, slto_kingdom_hero),
          (call_script, "script_change_troop_faction", ":npc", "$g_talk_troop_faction"),
        (try_end),
      (try_end),
      
      (try_begin),
        (is_between, "$players_oath_renounced_against_kingdom", kingdoms_begin, kingdoms_end),
        (neq, "$players_oath_renounced_against_kingdom", "$g_talk_troop_faction"),
        (call_script, "script_make_kingdom_hostile_to_player", "$players_oath_renounced_against_kingdom", -40),
        (call_script, "script_update_all_notes"),
        (assign, "$g_recalculate_ais", 1),
      (try_end),
      
      (try_begin),
        (is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
        (neq, "$players_kingdom", "fac_player_supporters_faction"),
        (neq, "$players_kingdom", "$g_talk_troop_faction"), #ie, don't leave faction if the player is already part of the same kingdom
        
        (faction_get_slot, ":old_leader", "$players_kingdom", slot_faction_leader),
        (call_script, "script_add_log_entry", logent_renounced_allegiance,   "trp_player",  -1, ":old_leader", "$players_kingdom"),
        (try_begin),
          (eq, ":is_pretender", 1),
          (call_script, "script_activate_player_faction", "$g_talk_troop"),
        (try_end),
        (call_script, "script_player_leave_faction", 0),
      (try_end),
      
      (call_script, "script_player_join_faction", "$g_talk_troop_faction"),
      
      (try_begin),
        (gt, "$g_invite_offered_center", 0),
        (call_script, "script_give_center_to_lord", "$g_invite_offered_center", "trp_player", 0),
        (try_begin),
          (faction_slot_eq, "$g_talk_troop_faction", slot_faction_political_issue, "$g_invite_offered_center"),
          (faction_set_slot, "$g_talk_troop_faction", slot_faction_political_issue, -1),
        (try_end),
      (try_end),
      (call_script, "script_add_log_entry", logent_pledged_allegiance,   "trp_player",  -1, "$g_talk_troop", "$g_talk_troop_faction"),
      
      (try_begin),
        (check_quest_active, "qst_join_faction"),
        (eq, "$g_invite_faction_lord", "$g_talk_troop"),
        (call_script, "script_end_quest", "qst_join_faction"),
      (else_try),
        (check_quest_active, "qst_join_faction"),
        (call_script, "script_abort_quest", "qst_join_faction", 0),
      (try_end),
      (assign, "$player_has_homage" ,1),
      (assign, "$g_player_banner_granted", 1),
      (assign, "$g_invite_faction", 0),
      (assign, "$g_invite_faction_lord", 0),
      (assign, "$g_invite_offered_center", 0),
      (assign, "$g_player_court", -1),
      (assign, "$g_trainerlair_training_center2", -1),
      (assign, "$g_trainerlair_training_type2", 0),
      (assign, "$g_leave_encounter",1)]],
  
  [anyone,"lord_give_conclude_2", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, "trp_player"),
      ],  "So be it, my wife. May all my vassals be as valiant and loyal as you.", "close_window", [(assign, "$g_leave_encounter",1)]],
  
  [anyone,"lord_give_conclude_2", [],  "I have great hopes for you {playername}. " +
    "I know you shall prove yourself worthy of the trust I have placed in you.", "close_window", [(assign, "$g_leave_encounter",1)]],
  
  
  
  [anyone,"lord_ask_enter_service", [(str_store_faction_name,5,"$g_talk_troop_faction")], "Heh, a wise move, " +
    "{playername}. With loyal service, a {reg59?woman:man} in my service could become wealthy and powerful, " +
    "and our enemies... Well, our enemies are as wheat before a scythe. " +
    "However, to enter my service you must first renounce all worldly oaths and bonds, " +
    "and swear to serve only the {s5}.", "lord_enter_service_swear",[]],
  [anyone|plyr ,"lord_enter_service_swear", [], "I do so swear, {s65}.", "lord_enter_service_swear_accepted",[]],
  [anyone|plyr ,"lord_enter_service_swear", [], "I need some time to think about this.", "lord_enter_service_swear_denied",[]],
  [anyone ,"lord_enter_service_swear_denied", [], "Are you having me on? I've no time for games, {playername}. " +
    "Make up your mind and stop wasting my time.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  [anyone ,"lord_enter_service_swear_accepted", [(str_store_faction_name,5,"$g_talk_troop_faction")],
    "Then it is my pleasure to welcome you to the service of my house. From this day on, {playername}, " +
    "you are a soldier of the {s5} with all the duties and privileges that come with it.", "lord_enter_service_swear_accepted_2",
    [
  ]],
  
  [anyone ,"lord_enter_service_swear_accepted_2", [(str_store_faction_name,5,"$g_talk_troop_faction")],
    "I charge you with rooting out and destroying the forces of our enemies wherever you may find them. " +
    "Moreover, I will have special tasks for you from time to time, as may some of my other vassal lords. " +
    "Serve, fight, and honour your oaths. These things will take you far, if you've a mind for promotion. " +
    "May God grant us long lives and many victories to toast in my hall!", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  [anyone,"lord_ask_leave_service", [
      (ge, "$g_talk_troop_relation", 1),
      (ge, "$g_talk_troop_faction_relation", 0),
    ], "Hrm. " +
    "Has your oath become burdensome, {playername}? It is unusual to request release from homage, " +
    "but in respect of your fine service, I will not hold you if you truly wish to end it. " +
    "Though you would be sorely missed.", "lord_ask_leave_service_verify",[]],
  [anyone,"lord_ask_leave_service", [], "Release from homage? Hmm, perhaps it would be for the best... " +
    "However, {playername}, you must be sure that release is what you desire. This is not a thing done lightly.", "lord_ask_leave_service_verify",[]],
  
  [anyone|plyr ,"lord_ask_leave_service_verify", [], "It is something I must do, {s65}.", "lord_ask_leave_service_2",[]],
  [anyone|plyr ,"lord_ask_leave_service_verify", [], "You are right, {s65}. My place is here.", "lord_ask_leave_service_giveup",[]],
  
  [anyone,"lord_ask_leave_service_giveup", [], "I am pleased to hear it, {playername}. " +
    "I hope you'll banish such unworthy thoughts from your mind from now on.", "lord_pretalk",[]],
  
  [anyone,"lord_ask_leave_service_2", [], "Then you are sure? Also, be aware that if you leave my services, you will be surrendering to me all the fiefs which you hold in my name.", "lord_ask_leave_service_verify_again",[]],
  [anyone|plyr ,"lord_ask_leave_service_verify_again", [], "Yes, {s65}.", "lord_ask_leave_service_3",[]],
  [anyone|plyr ,"lord_ask_leave_service_verify_again", [], "Of course not, {s65}. I am ever your loyal vassal.", "lord_ask_leave_service_giveup",[]],
  
  [anyone,"lord_ask_leave_service_3", [], "As you wish. I hereby declare your oaths to be null and void. " +
    "You will no longer hold land or titles in my name, and you are released from your duties to my house. " +
    "You are free, {playername}.", "lord_ask_leave_service_end",
    [
      (call_script, "script_add_log_entry", logent_renounced_allegiance,   "trp_player",  -1, "$g_talk_troop", "$g_talk_troop_faction"),
      (call_script, "script_player_leave_faction", 1), #1 means give back fiefs
  ]],
  
  [anyone|plyr ,"lord_ask_leave_service_end", [], "Thank you, sir. It was an honour to serve you.", "lord_ask_leave_service_end_2",[]],
  [anyone|plyr ,"lord_ask_leave_service_end", [], "My thanks. It feels good to be {reg59?free:a free man} once again.", "lord_ask_leave_service_end_2",[]],
  
  [anyone ,"lord_ask_leave_service_end_2", [], "Farewell then, {playername}, and good luck go with you.", "close_window",
    [(assign, "$g_leave_encounter", 1)]],
  
  #Active quests
  ##### TODO: QUESTS COMMENT OUT BEGIN
  
  [anyone,"lord_active_mission_1", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_lend_companion"),
      #(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active,"qst_lend_companion"),
      (quest_slot_eq, "qst_lend_companion", slot_quest_giver_troop, "$g_talk_troop"),
      (store_current_day, ":cur_day"),
      (quest_get_slot, ":quest_target_amount", "qst_lend_companion", slot_quest_target_amount),
      (ge, ":cur_day", ":quest_target_amount"),
      ##                                    (quest_get_slot, ":quest_target_troop", "qst_lend_companion", slot_quest_target_troop),
      ##                                    (str_store_troop_name,s14,":quest_target_troop"),
      ##                                    (troop_get_type, reg3, ":quest_target_troop"),
      ##                                    (val_mod, reg3, 2),
    ],
    "Oh, you want your companion back? I see...", "lord_lend_companion_end",[]],
  
  
  
  
  [anyone,"lord_active_mission_1", [(store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_lend_companion")],
    "{playername}, I must beg your patience. I still have need of your companion. Please return later when things have settled.", "lord_pretalk",[]],
  #default
  [anyone,"lord_active_mission_1", [], "Yes, have you made any progress on it?", "lord_active_mission_2",[]],
  
  [anyone|plyr,"lord_active_mission_2",[#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active,"qst_capture_prisoners"),
      (quest_slot_eq, "qst_capture_prisoners", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_target_amount", "qst_capture_prisoners", slot_quest_target_amount),
      (quest_get_slot, ":quest_target_troop", "qst_capture_prisoners", slot_quest_target_troop),
      (party_count_prisoners_of_type, ":count_prisoners", "p_main_party", ":quest_target_troop"),
      (ge, ":count_prisoners", ":quest_target_amount"),
      (assign, reg1, ":quest_target_amount"),
      (str_store_troop_name_plural, s1, ":quest_target_troop")],
    "Indeed. I brought you {reg1} {s1} as prisoners.", "lord_generic_mission_thank",
    [(quest_get_slot, ":quest_target_amount", "qst_capture_prisoners", slot_quest_target_amount),
      (quest_get_slot, ":quest_target_troop", "qst_capture_prisoners", slot_quest_target_troop),
      (party_remove_prisoners, "p_main_party", ":quest_target_troop", ":quest_target_amount"),
      (party_add_prisoners, "$g_encountered_party", ":quest_target_troop", ":quest_target_amount"),
      (call_script, "script_finish_quest", "qst_capture_prisoners", 100)]],
  
  
  [anyone|plyr,"lord_active_mission_2",
    [
      #(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (store_partner_quest, ":lords_quest"),
      (eq, ":lords_quest", "qst_capture_enemy_hero"),
      (assign, ":has_prisoner", 0),
      (quest_get_slot, ":quest_target_faction", "qst_capture_enemy_hero", slot_quest_target_faction),
      (party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_prisoner_stack_get_troop_id, ":stack_troop", "p_main_party", ":i_stack"),
        (troop_is_hero, ":stack_troop"),
        (store_troop_faction, ":stack_faction", ":stack_troop"),
        (eq, ":quest_target_faction", ":stack_faction"),
        (troop_slot_eq, ":stack_troop", slot_troop_occupation, slto_kingdom_hero),
        (assign, ":has_prisoner", 1),
        (quest_set_slot, "qst_capture_enemy_hero", slot_quest_target_troop, ":stack_troop"),
      (try_end),
      (eq, ":has_prisoner", 1),
      (str_store_faction_name, s13, ":quest_target_faction")
    ],
    "Oh, indeed. I've captured a lord from the {s13} for you.", "capture_enemy_hero_thank",
    []],
  
  [anyone,"capture_enemy_hero_thank", [],
    "Many thanks, my friend. He will serve very well for a bargain. You've done a fine work here. Please accept these {reg5} peningas for your help.", "capture_enemy_hero_thank_2",
    [(quest_get_slot, ":quest_target_troop", "qst_capture_enemy_hero", slot_quest_target_troop),
      (quest_get_slot, ":quest_target_faction", "qst_capture_enemy_hero", slot_quest_target_faction),
      (party_remove_prisoners, "p_main_party", ":quest_target_troop", 1),
      (store_relation, ":reln", "$g_encountered_party_faction", ":quest_target_faction"),
      (try_begin),
        (lt, ":reln", 0),
        (party_add_prisoners, "$g_encountered_party", ":quest_target_troop", 1), #Adding him to the dungeon
      (else_try),
        #Do not add a non-enemy lord to the dungeon (due to recent diplomatic changes or due to a neutral town/castle)
        #(troop_set_slot, ":quest_target_troop", slot_troop_is_prisoner, 0),
        (troop_set_slot, ":quest_target_troop", slot_troop_prisoner_of_party, -1),
      (try_end),
      (quest_get_slot, reg5, "qst_capture_enemy_hero", slot_quest_gold_reward),
      (call_script, "script_finish_quest", "qst_capture_enemy_hero", 100),
  ]],
  
  [anyone|plyr,"capture_enemy_hero_thank_2", [],
    "Certainly, {s65}.", "lord_pretalk",[]],
  [anyone|plyr,"capture_enemy_hero_thank_2", [],
    "It was nothing.", "lord_pretalk",[]],
  [anyone|plyr,"capture_enemy_hero_thank_2", [],
    "Give me more of a challenge next time.", "lord_pretalk",[]],
  
  ##
  ##  [anyone|plyr,"lord_active_mission_2", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                                         (store_partner_quest,":lords_quest"),
  ##                                         (eq,":lords_quest","qst_capture_messenger"),
  ##                                         (quest_get_slot, ":quest_target_troop", ":lords_quest", slot_quest_target_troop),
  ##                                         (quest_get_slot, ":quest_target_amount", ":lords_quest", slot_quest_target_amount),
  ##                                         (store_num_parties_destroyed_by_player, ":num_destroyed", "pt_messenger_party"),
  ##                                         (gt, ":num_destroyed", ":quest_target_amount"),
  ##                                         (party_count_prisoners_of_type, ":num_prisoners", "p_main_party", ":quest_target_troop"),
  ##                                         (ge, ":num_prisoners", 1),
  ##                                         (str_store_troop_name, 3, ":quest_target_troop")],
  ##   "Indeed sir. I have captured a {s3} my lord.", "lord_generic_mission_thank",[(quest_get_slot, ":quest_target_troop", "qst_capture_messenger", slot_quest_target_troop),
  ##                                                                     (party_remove_prisoners, "p_main_party", ":quest_target_troop", 1),
  ##                                                                     (party_add_prisoners, "$g_encountered_party", ":quest_target_troop", 1),#Adding him to the dungeon
  ##                                                                     (call_script, "script_finish_quest", "qst_capture_messenger", 100)]],
  ##
  ##
  [anyone|plyr,"lord_active_mission_2", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (store_partner_quest,":lords_quest"),
      (eq,":lords_quest","qst_raise_troops"),
      (quest_get_slot, ":quest_target_troop", ":lords_quest", slot_quest_target_troop),
      (quest_get_slot, ":quest_target_amount", ":lords_quest", slot_quest_target_amount),
      (party_count_companions_of_type, ":num_companions", "p_main_party", ":quest_target_troop"),
      (ge, ":num_companions", ":quest_target_amount"),
      (assign, reg1, ":quest_target_amount"),
      (str_store_troop_name_plural, s13, ":quest_target_troop")],
    "Indeed. I have raised {reg1} {s13}. You can take them.", "lord_raise_troops_thank",[(quest_get_slot, ":quest_target_troop", "qst_raise_troops", slot_quest_target_troop),
      (quest_get_slot, ":quest_target_amount", "qst_raise_troops", slot_quest_target_amount),
      (call_script,"script_change_player_relation_with_troop","$g_talk_troop", 30),
      (party_remove_members, "p_main_party", ":quest_target_troop", ":quest_target_amount"),
      (call_script, "script_end_quest", "qst_raise_troops"),
      (troop_get_slot, ":cur_lords_party", "$g_talk_troop", slot_troop_leaded_party),
      (gt, ":cur_lords_party", 0),
      (party_add_members, ":cur_lords_party", ":quest_target_troop", ":quest_target_amount"),
  ]],
  
  [anyone,"lord_raise_troops_thank", [],
    "These men may well turn the tide in my plans, {playername}. I am confident you've trained them well. My thanks and my compliments to you.", "lord_raise_troops_thank_2",[]],
  
  [anyone|plyr,"lord_raise_troops_thank_2", [],
    "Well, the lads are at your command now, sir. I am sure you will take good care of them.", "lord_pretalk",[]],
  
  
  [anyone|plyr,"lord_active_mission_2", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      
      #                                         (store_partner_quest,":lords_quest"),
      #                                         (eq, ":lords_quest", "qst_collect_taxes"),
      (check_quest_active, "qst_collect_taxes"),
      (quest_slot_eq, "qst_collect_taxes", slot_quest_giver_troop, "$g_talk_troop"),
      
      (check_quest_succeeded, "qst_collect_taxes"),
      (eq, "$qst_collect_taxes_halve_taxes", 0),
      (quest_get_slot, ":quest_gold_reward", "qst_collect_taxes", slot_quest_gold_reward),
      (store_mul, ":required_gold", ":quest_gold_reward", 8),
      (val_div, ":required_gold", 10),
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", ":required_gold"),
      (assign, reg19, ":quest_gold_reward"),
      (quest_get_slot, ":quest_target_center", "qst_collect_taxes", slot_quest_target_center),
      (str_store_party_name, s3, ":quest_target_center"),
    ],
    "Here are all the taxes from {s3}. It comes up to {reg19} peningas.", "lord_collect_taxes_success",
    []],
  
  [anyone|plyr,"lord_active_mission_2", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active, "qst_collect_taxes"),
      (quest_slot_eq, "qst_collect_taxes", slot_quest_giver_troop, "$g_talk_troop"),
      
      #                                         (store_partner_quest,":lords_quest"),
      #                                         (eq, ":lords_quest", "qst_collect_taxes"),
      (check_quest_succeeded, "qst_collect_taxes"),
      (eq, "$qst_collect_taxes_halve_taxes", 1),
      (quest_get_slot, ":quest_gold_reward", "qst_collect_taxes", slot_quest_gold_reward),
      (store_mul, ":required_gold", ":quest_gold_reward", 95),
      (val_div, ":required_gold", 100),
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", ":required_gold"),
      (assign, reg19, ":quest_gold_reward"),
      (quest_get_slot, ":quest_target_center", "qst_collect_taxes", slot_quest_target_center),
      (str_store_party_name, s3, ":quest_target_center"),
    ],
    "Here are the taxes from {s3}. It comes up to {reg19} peningas.", "lord_collect_taxes_half_success",
    []],
  
  [anyone|plyr,"lord_active_mission_2", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active, "qst_collect_taxes"),
      (quest_slot_eq, "qst_collect_taxes", slot_quest_giver_troop, "$g_talk_troop"),
      
      #                                         (store_partner_quest,":lords_quest"),
      #                                         (eq, ":lords_quest", "qst_collect_taxes"),
      (check_quest_failed, "qst_collect_taxes"),
      (quest_get_slot, ":quest_gold_reward", "qst_collect_taxes", slot_quest_gold_reward),
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", ":quest_gold_reward"),
      (assign, reg19, ":quest_gold_reward"),
      (quest_get_slot, ":quest_target_center", "qst_collect_taxes", slot_quest_target_center),
      (str_store_party_name, s3, ":quest_target_center"),
    ],
    "Unfortunately, a revolt broke up while I was collecting the taxes. " +
    "I could only collect {reg19} peningas.", "lord_collect_taxes_fail",
    []],
  
  [anyone,"lord_collect_taxes_success", [(quest_get_slot, ":total_revenue", "qst_collect_taxes", slot_quest_gold_reward),
      (store_mul, ":owner_share", ":total_revenue", 8),
      (val_div, ":owner_share", 10),
      (assign, reg20, ":owner_share"),
      (store_sub, reg21, ":total_revenue", ":owner_share")],
    "Well done, {playername}, very well done indeed! You were truly the right {reg59?person:man} for the job. " +
    "I promised you a fifth of the taxes, so that amounts to {reg21} peningas. " +
    "If you give me {reg20} peningas, you may keep the difference. " +
    "A good result for everyone, eh?", "lord_pretalk",
    [
      (troop_remove_gold, "trp_player", reg20),
      (troop_add_gold, "$g_talk_troop", reg20),
      (quest_set_slot, "qst_collect_taxes", slot_quest_gold_reward, 0),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (call_script, "script_end_quest", "qst_collect_taxes"),
  ]],
  
  
  [anyone,"lord_collect_taxes_half_success", [(quest_get_slot, ":gold_reward", "qst_collect_taxes", slot_quest_gold_reward),
      (val_mul, ":gold_reward", 95),
      (val_div, ":gold_reward", 100),
      (assign, reg20, ":gold_reward")],
    "What? Is this some scheme of yours, {playername}? That's less than half the taxes I'm owed! " +
    "You have let them get away with murder as well as my money. What a farce! " +
    "You can forget the money I promised you, I'm taking {reg20} peningas from what you collected, " +
    "and you're lucky I'm leaving you a few coins for honour's sake.", "lord_pretalk",
    [(troop_remove_gold, "trp_player", reg20),
      (troop_add_gold, "$g_talk_troop", reg20),
      (quest_set_slot, "qst_collect_taxes", slot_quest_gold_reward, 0),
      (call_script, "script_end_quest", "qst_collect_taxes"),
  ]],
  
  
  [anyone,"lord_collect_taxes_fail", [],
    "God, what a bloody mess you've gotten us into, {playername}. " +
    "This could turn very ugly if I do not take immediate action. " +
    "I certainly hope you're not here expecting to be paid for failure. " +
    "Hand over my {reg19} peningas, if you please, and end our business together.", "lord_pretalk",
    [(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (quest_get_slot, ":gold_reward", "qst_collect_taxes", slot_quest_gold_reward),
      (troop_remove_gold, "trp_player", ":gold_reward"),
      (troop_add_gold, "$g_talk_troop", ":gold_reward"),
      (quest_set_slot, "qst_collect_taxes", slot_quest_gold_reward, 0),
      (call_script, "script_end_quest", "qst_collect_taxes"),
  ]],
  
  [anyone|plyr,"lord_active_mission_2", [ (check_quest_active, "qst_hunt_down_fugitive"),
      (quest_slot_eq, "qst_hunt_down_fugitive", slot_quest_giver_troop, "$g_talk_troop"),
      
      (check_quest_succeeded, "qst_hunt_down_fugitive"),
      (quest_get_slot, ":quest_target_center", "qst_hunt_down_fugitive", slot_quest_target_center),
      (str_store_party_name, s3, ":quest_target_center"),
      (quest_get_slot, ":quest_target_dna", "qst_hunt_down_fugitive", slot_quest_target_dna),
      (call_script, "script_get_name_from_dna_to_s50", ":quest_target_dna"),
      (str_store_string, s4, s50),],
    "I found {s4} hiding in {s3} and gave him his punishment.", "lord_hunt_down_fugitive_success",
    []],
  
  [anyone|plyr,"lord_active_mission_2", [
      (check_quest_active, "qst_hunt_down_fugitive"),
      (quest_slot_eq, "qst_hunt_down_fugitive", slot_quest_giver_troop, "$g_talk_troop"),
      
      (check_quest_failed, "qst_hunt_down_fugitive"),
    ],
    "I'm afraid he got away.", "lord_hunt_down_fugitive_fail",
    []],
  
  [anyone,"lord_hunt_down_fugitive_success", [
      (try_begin),
        (neq, "$campaign_type", camp_storyline),
        (assign, reg25, 300),
      (else_try),
        (assign, reg25, 600),
      (try_end),
    ],
    "And we'll all be a lot better off without him! Thank you, {playername}, " +
    "for removing this long-festering thorn from my side. 'Tis good to know you can be trusted to handle things " +
    "with an appropriate level of tactfulness. " +
    "A bounty I promised, and a bounty you shall have. {reg25} peningas and not a copper less!", "lord_hunt_down_fugitive_success_2",
    [
      (add_xp_as_reward, 300),
  ]],
  
  [anyone|plyr,"lord_hunt_down_fugitive_success_2", [],
    "Let me take the money, {s65}. Thank you.", "lord_hunt_down_fugitive_reward_accept",[]],
  [anyone|plyr,"lord_hunt_down_fugitive_success_2", [],
    "This is blood money. I can't accept it.", "lord_hunt_down_fugitive_reward_reject",[]],
  
  #Post 0907 changes begin
  [anyone,"lord_hunt_down_fugitive_reward_accept", [],
    "Of course, {playername}. Here you are. Once again, you've my thanks for ridding me of that {s43}.", "lord_pretalk",[
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_insult_default"),
      (try_begin),
        (neq, "$campaign_type", camp_storyline),
        (call_script, "script_troop_add_gold", "trp_player", 300),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (else_try),
        (call_script, "script_troop_add_gold", "trp_player", 600),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (try_end),
      (call_script, "script_end_quest", "qst_hunt_down_fugitive"),
  ]],
  
  [anyone,"lord_hunt_down_fugitive_reward_reject", [],
    "You are a {reg59?woman:man} for whom justice is its own reward, eh? As you wish it, {playername}, as you wish it. " +
    "An honourable sentiment, to be true. Regardless, you've my thanks for ridding me of that {s43}.", "lord_pretalk",[
      
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_insult_default"),
      (try_begin),
        (neq, "$campaign_type", camp_storyline),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (else_try),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (try_end),
      (call_script, "script_change_player_honor", 3),
      (call_script, "script_end_quest", "qst_hunt_down_fugitive"),
  ]],
  
  [anyone,"lord_hunt_down_fugitive_fail", [],
    "It is a sad day when that {s43} manages to avoid the hand of justice yet again. " +
    "I thought you would be able to do this, {playername}. Clearly, I was wrong.", "lord_pretalk",
    [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_insult_default"),
      
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (call_script, "script_end_quest", "qst_hunt_down_fugitive"),
  ]],
  #Post 0907 changes end
  
  
  
  ##
  ##
  ##  [anyone|plyr,"lord_active_mission_2", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                                         (store_partner_quest,":lords_quest"),
  ##                                         (eq,":lords_quest","qst_bring_back_deserters"),
  ##                                         (quest_get_slot, ":quest_target_troop", ":lords_quest", slot_quest_target_troop),
  ##                                         (quest_get_slot, ":quest_target_amount", ":lords_quest", slot_quest_target_amount),
  ##                                         (party_count_prisoners_of_type, ":num_prisoners", "p_main_party", ":quest_target_troop"),
  ##                                         (ge, ":num_prisoners", ":quest_target_amount"),
  ##                                         (assign, reg1, ":quest_target_amount")],
  ##   "Yes sir. I have brought {reg1} deserters as you asked me to.", "lord_generic_mission_thank",[(quest_get_slot, ":quest_target_troop", "qst_bring_back_deserters", slot_quest_target_troop),
  ##                                                                                     (quest_get_slot, ":quest_target_amount", "qst_bring_back_deserters", slot_quest_target_amount),
  ##                                                                                     (party_remove_prisoners, "p_main_party", ":quest_target_troop", ":quest_target_amount"),
  ##                                                                                     (faction_get_slot, ":faction_tier_2_troop", "$g_talk_troop_faction", slot_faction_tier_2_troop),
  ##                                                                                     (try_begin),
  ##                                                                                       (gt, ":faction_tier_2_troop", 0),
  ##                                                                                       (troop_get_slot, ":cur_lords_party", "$g_talk_troop", slot_troop_leaded_party),
  ##                                                                                       (gt, ":cur_lords_party", 0),
  ##                                                                                       (party_add_members, ":cur_lords_party", ":faction_tier_2_troop", ":quest_target_amount"),
  ##                                                                                     (try_end),
  ##                                                                                     (call_script, "script_finish_quest", "qst_bring_back_deserters", 100)]],
  ##
  ##
  ##### TODO: QUESTS COMMENT OUT END
  [anyone|plyr,"lord_active_mission_2", [], "I am still working on it.", "lord_active_mission_3",[]],
  [anyone|plyr,"lord_active_mission_2", [
      ], "I am afraid I won't be able to do this quest.", "lord_mission_failed",[]],
  
  [anyone,"lord_active_mission_3", [], "Good. Remember, I am counting on you.", "lord_pretalk",[]],
  
  
  
  
  #Post 0907 changes begin
  [anyone,"lord_mission_failed", [], "{!}{s43}", "lord_pretalk",
    [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_mission_failed_default"),
      (store_partner_quest,":lords_quest"),
      (call_script, "script_abort_quest", ":lords_quest", 1)]],
  #Post 0907 changes end
  
  
  #Claim center
  ##  [anyone,"lord_claim_center_begin", [],
  ##   "What do you want to do with {s4}?", "lord_claim_center_ask",[]],
  ##
  ##  [anyone|plyr,"lord_claim_center_ask", [],
  ##   "I want to claim it for myself.", "lord_claim_center_2",[]],
  ##  [anyone|plyr,"lord_claim_center_ask", [],
  ##   "I will leave it to you my lord. I have no interest in holding {s4}.", "lord_claim_center_leave_to_lord",[]],
  
  
  ##  [anyone,"lord_claim_center_2", [(eq, "$g_player_permitted_castles", 0),],
  ##   "You are an able warrior {playername} and there is no question of your bravery.\
  ## Alas, you are not noble born, and there are those who will be upset if I allow you to hold a castle.\
  ## So, it saddens me but I must decline your request.", "lord_claim_center_deny", []],
  ##
  ##  [anyone|plyr,"lord_claim_center_deny", [],
  ##   "This is not fair my lord. I shed my blood to take {s4}. Now another {man/master} will rule over it.", "lord_claim_center_deny_2", []],
  ##  [anyone|plyr,"lord_claim_center_deny", [],
  ##   "I understand sir. Do as you will.", "lord_claim_center_leave_to_lord", []],
  ##  [anyone,"lord_claim_center_deny_2", [],
  ##   "Remember that you gave me your oath {playername}. And you agreed to do as told.", "lord_claim_center_deny_3", []],
  ##  [anyone,"lord_claim_center_deny_3", [],
  ##   "Yes sir.", "lord_claim_center_leave_to_lord", []],
  ##
  ##  [anyone,"lord_claim_center_leave_to_lord", [],
  ##   "Very well.  Then I will find a suitable master for {s4}.\
  ## In recognition of your bravery and service, I give you these 5000 peningas.", "lord_pretalk",
  ##   [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
  ##    (val_sub, ":wealth", 6000),
  ##    (troop_set_slot, "$g_talk_troop", slot_troop_wealth, ":wealth"),
  ##    (call_script, "script_troop_add_gold", "trp_player", 5000),
  ##
  ##    (assign, ":new_master", "$g_talk_troop"),
  ##    (assign, ":max_wealth", 0),
  ##
  ##    (try_for_range, ":hero_no", kingdom_heroes_begin, kingdom_heroes_end),
  ##      (troop_slot_eq, ":hero_no", slot_troop_is_prisoner, 0),
  ##      (troop_slot_eq, ":hero_no", slot_troop_occupation, slto_kingdom_hero),
  ##      (store_troop_faction, ":hero_faction", ":hero_no"),
  ##      (eq, ":hero_faction", "$players_kingdom"),
  ##      (call_script, "script_get_number_of_hero_centers", "$g_talk_troop"),
  ##      (assign, ":no_of_owned_centers", reg0),
  ##      (neg|faction_slot_eq, "$players_kingdom", slot_faction_leader, ":hero_no"),
  ##      (lt, ":no_of_owned_centers", 2),
  ##      (troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
  ##      (ge, ":wealth", ":max_wealth"),
  ##      (assign, ":new_master", ":hero_no"),
  ##      (assign, ":max_wealth", ":wealth"),
  ##    (try_end),
  ##
  ##    (call_script, "script_give_center_to_lord", "$center_to_be_claimed", ":new_master"),
  ##    (set_spawn_radius, 1),
  ##    (spawn_around_party, "$center_to_be_claimed", "pt_old_garrison"),
  ##    (assign, ":new_party", reg0),
  ##    (party_set_ai_behavior, ":new_party", ai_bhvr_attack_party),
  ##    (party_set_ai_object, ":new_party", "p_main_party"),
  ##    (party_set_flags, ":new_party", pf_default_behavior, 0),
  ##    (call_script, "script_party_copy", ":new_party", "$center_to_be_claimed"),
  ##    (party_clear, "$center_to_be_claimed"),
  ##
  ##    (faction_get_slot, ":reinforcement_template_a", "$g_talk_troop_faction", slot_faction_reinforcements_a),
  ##    (faction_get_slot, ":reinforcement_template_b", "$g_talk_troop_faction", slot_faction_reinforcements_b),
  ##    (party_add_template, "$center_to_be_claimed", ":reinforcement_template_a"),
  ##    (party_add_template, "$center_to_be_claimed", ":reinforcement_template_b"),
  ##    ]],
  ##
  ##
  ##  [anyone,"lord_claim_center_2", [(assign, ":number_of_claimed_centers", 0),
  ##                                  (try_for_range, ":center_no", centers_begin, centers_end),
  ##                                    (party_slot_eq, ":center_no", slot_party_type, spt_castle),
  ##                                    (store_faction_of_party, ":faction_no", ":center_no"),
  ##                                    (eq, ":faction_no", "fac_player_supporters_faction"),
  ##                                    (party_slot_eq, ":center_no", slot_town_claimed_by_player, 1),
  ##                                    (val_add, ":number_of_claimed_centers", 1),
  ##                                  (try_end),
  ##                                  (lt, ":number_of_claimed_centers", "$g_player_permitted_castles"),
  ##                                  (assign, reg7, ":number_of_claimed_centers"),
  ##                                  ],
  ##   "I had promised you to defend your right to hold {reg7?a:another} castle {playername}. Now I honor that promise.\
  ## I can think of {no man finer than you/no one better than you} to be the {reg59?lady:lord} of {s4}.\
  ## Renew your oath to me now. Then I will be your liege,\
  ## and I'll support you and protect you against all those who oppose your claim.",
  ##  "lord_claim_center_give_oath",[]],
  ##
  ##
  ##  [anyone|plyr,"lord_claim_center_give_oath", [],  "I give you my oath lord, I will forever be faithful to you,\
  ## I will never act in a way to cause you harm, and I will be at your side to fight your enemies should you need my sword.", "lord_claim_center_direct_3", []],
  ##  [anyone,"lord_claim_center_direct_3", [],  "You have given your oath of fealty {playername}. I accept your oath and give you the fief of {s4}.\
  ## Rule it wisely and protect it against our enemies.", "lord_claim_center_direct_4", [
  ##     (party_set_slot, "$center_to_be_claimed", slot_town_claimed_by_player, 1),
  ##     (call_script, "script_give_center_to_lord", "$center_to_be_claimed", "trp_player")]],
  ##  [anyone|plyr,"lord_claim_center_direct_4", [],  "I thank you lord.", "close_window", [(assign, "$g_leave_encounter",1)]],
  
  #Ask for favor
  ##  [anyone,"lord_ask_for_favor_ask", [],
  ##   "What is it? I don't have time for personal requests.", "lord_ask_for_favor",[]],
  ##  [anyone,"lord_ask_for_favor_ask", [],
  ##   "Say it then. If it's something possible...", "lord_ask_for_favor",[]],
  ##
  ##  [anyone|plyr,"lord_ask_for_favor", [],
  ##   "Nothing my lord. It's not important.", "lord_pretalk",[]],
  #Suggest action
  [anyone,"lord_suggest_action_ask", [],
    "{!}What do you suggest?", "lord_suggest_action",[]],
  
  ##  [anyone|plyr,"lord_suggest_action",
  ##   [(troop_get_type, ":is_female", "trp_player"),
  ##   [(val_mod, ":is_female", 2),
  ##    (eq, ":is_female", 1),
  ##    (lt, "$talk_context", tc_siege_commander),
  ##    ],
  ##   "{!}CHEAT: I want to marry you! (1)", "lord_groom_vows",[]],
  
  [anyone|plyr,"lord_suggest_action", [],
    "{!}CHEAT: I want to join your faction.", "lord_suggest_join_faction",[]],
  [anyone,"lord_suggest_join_faction", [],
    "{!}Alright then.", "lord_give_oath_5",[]],
  
  [anyone|plyr,"lord_suggest_action", [],
    "{!}CHEAT: I want to know your leaded party ID.", "lord_suggest_learn_party_id",[]],
  [anyone,"lord_suggest_learn_party_id", [
      (assign, reg1, "$g_encountered_party"),
      (troop_get_slot, reg0, "$g_talk_troop", slot_troop_leaded_party)],
    "{!}It is {reg0}. Encountered party is {reg1}", "lord_pretalk",[]],
  
  [anyone|plyr,"lord_suggest_action", [],
    "{!}CHEAT: I want to know your AI initiative.", "lord_suggest_learn_ai_initiative",[]],
  [anyone,"lord_suggest_learn_ai_initiative", [(party_get_ai_initiative, reg0, "$g_encountered_party")],
    "{!}It is {reg0}.", "lord_pretalk",[]],
  
  
  [anyone|plyr,"lord_suggest_action", [(eq, "$players_kingdom", "$g_talk_troop_faction"),],
    "{!}CHEAT: I want to be your kingdom's marshal.", "lord_suggest_become_marshal",[]],
  [anyone,"lord_suggest_become_marshal", [],
    "{!}Alright then.", "lord_pretalk",
    [
      (faction_get_slot, ":old_marshal", "$g_talk_troop_faction", slot_faction_marshal),
      (try_begin),
        (ge, ":old_marshal", 0),
        (troop_get_slot, ":old_marshal_party", ":old_marshal", slot_troop_leaded_party),
        (party_is_active, ":old_marshal_party"),
        (party_set_marshal, ":old_marshal_party", 0),
      (try_end),
      
      (faction_set_slot, "$g_talk_troop_faction", slot_faction_marshal, "trp_player"),
      (faction_set_slot, "$g_talk_troop_faction", slot_faction_ai_state, sfai_default),
      (assign, "$g_recalculate_ais", 1),
  ]],
  
  [anyone|plyr,"lord_suggest_action", [(neq, "$talk_context", tc_siege_commander)],
    "{!}CHEAT: Let us attack an enemy town or castle.", "lord_suggest_attack_enemy_castle",[]],
  [anyone|plyr,"lord_suggest_action", [(neq, "$talk_context", tc_siege_commander)],
    "{!}CHEAT: Let us return back to a friendly town.", "lord_suggest_go_to_friendly_town",[]],
  [anyone|plyr,"lord_suggest_action", [(neq, "$talk_context", tc_siege_commander)],
    "{!}CHEAT: Let us attack an enemy war party.", "lord_suggest_attack_enemy_party",[]],
  [anyone|plyr,"lord_suggest_action", [(eq, "$talk_context", tc_siege_commander)],
    "{!}CHEAT: Let us lift this siege.", "lord_suggest_lift_siege",[]],
  [anyone|plyr,"lord_suggest_action", [(neq, "$talk_context", tc_siege_commander)],
    "{!}CHEAT: Follow me.", "lord_suggest_follow_me",[]],
  [anyone|plyr,"lord_suggest_action", [(neq, "$talk_context", tc_siege_commander)],
    "{!}CHEAT: Follow someone.", "lord_suggest_follow_other",[]],
  [anyone|plyr,"lord_suggest_action", [(neq, "$talk_context", tc_siege_commander)],
    "{!}CHEAT: Raid a village.", "lord_suggest_raid_village",[]],
  [anyone|plyr,"lord_suggest_action", [],
    "{!}CHEAT: Like me.", "lord_pretalk",[(call_script,"script_change_player_relation_with_troop","$g_talk_troop",20)]],
  
  [anyone,"lord_suggest_lift_siege", [],
    "{!}As you wish, {playername}.", "close_window",[(call_script, "script_party_set_ai_state", "$g_talk_troop_party", spai_undefined),
      (party_leave_cur_battle, "$g_talk_troop_party"),
      (assign, "$g_leave_encounter", 1)]],
  
  [anyone,"lord_suggest_go_to_friendly_town", [],
    "{!}Hmm. Which town or castle do you suggest we go to?", "lord_suggest_go_to_friendly_town2",[]],
  [anyone|plyr|repeat_for_parties,"lord_suggest_go_to_friendly_town2", [
      (store_repeat_object, ":center_no"),
      (this_or_next|party_slot_eq,":center_no",slot_party_type, spt_castle),
      (party_slot_eq,":center_no",slot_party_type, spt_town),
      (neq, ":center_no", "$g_encountered_party"),
      (store_faction_of_party, ":town_faction", ":center_no"),
      (eq, ":town_faction", "$g_talk_troop_faction"),
      (str_store_party_name, s1, ":center_no")],
    "{!}CHEAT: {s1}", "lord_suggest_go_to_friendly_town3",[(store_repeat_object, "$town_suggested_to_go_to")]],
  [anyone|plyr,"lord_suggest_go_to_friendly_town2", [],
    "{!}CHEAT: Never mind.", "lord_pretalk",[]],
  
  [anyone,"lord_suggest_go_to_friendly_town3", [(str_store_party_name, 1, "$town_suggested_to_go_to")],
    "{!}Very well, we go to {s1}.", "lord_pretalk",
    [
      (call_script, "script_party_set_ai_state", "$g_talk_troop_party", spai_holding_center, "$town_suggested_to_go_to"),
  ]],
  
  
  
  [anyone,"lord_suggest_attack_enemy_party", [],
    "{!}Hmm. Which party do you suggest we attack?", "lord_suggest_attack_enemy_party2",[]],
  [anyone|plyr|repeat_for_parties,"lord_suggest_attack_enemy_party2", [
      (store_repeat_object, ":party_no"),
      (party_slot_eq,":party_no",slot_party_type, spt_kingdom_hero_party),
      (party_is_active, ":party_no"),
      (store_faction_of_party, ":party_faction", ":party_no"),
      (store_relation, ":party_relation", ":party_faction", "$g_talk_troop_faction"),
      (le, ":party_relation", -10),
      (call_script, "script_get_closest_walled_center", ":party_no"),
      (assign, ":center_no", reg0),
      (str_store_party_name, s3, ":center_no"),
      (str_store_faction_name, s2, ":party_faction"),
      (str_store_party_name, s1, ":party_no")],
    "{!}CHEAT: {s1} of the {s2} around {s3}", "lord_suggest_attack_enemy_party3",[(store_repeat_object, "$suggested_to_attack_party")]],
  [anyone|plyr,"lord_suggest_attack_enemy_party2", [],
    "{!}CHEAT: Never mind.", "lord_pretalk",[]],
  
  [anyone,"lord_suggest_attack_enemy_party3", [(str_store_party_name, 1, "$suggested_to_attack_party")],
    "{!}As you wish, we will attack {s1}.", "lord_pretalk",
    [
      (call_script, "script_party_set_ai_state", "$g_talk_troop_party", spai_engaging_army, "$suggested_to_attack_party"),
  ]],
  
  
  ##  [anyone,"lord_suggest_attack_enemy_castle", [(troop_get_slot, ":player_favor", "$g_talk_troop", slot_troop_player_favor),
  ##                                               (lt, ":player_favor", 20)],
  ##   "Hmm. No, I don't think that's a good idea.", "lord_pretalk",[]],
  
  [anyone,"lord_suggest_attack_enemy_castle", [],
    "{!}Hmm. Which one do you suggest we attack?", "lord_suggets_attack_enemy_castle2",[]],
  [anyone|plyr|repeat_for_parties,"lord_suggets_attack_enemy_castle2", [
      (store_repeat_object, ":center_no"),
      (this_or_next|party_slot_eq,":center_no",slot_party_type, spt_castle),
      (party_slot_eq,":center_no",slot_party_type, spt_town),
      (store_faction_of_party, ":town_faction", ":center_no"),
      (store_relation, ":town_relation", ":town_faction", "$g_talk_troop_faction"),
      (le, ":town_relation", -10),
      (str_store_faction_name, s2, ":town_faction"),
      (str_store_party_name, s1, ":center_no")],
    "{!}CHEAT: {s1} of the {s2}", "lord_suggets_attack_enemy_castle3",[(store_repeat_object, "$suggested_to_attack_center")]],
  
  [anyone|plyr,"lord_suggets_attack_enemy_castle2", [],
    "{!}CHEAT: Never mind my lord.", "lord_pretalk",[]],
  
  [anyone,"lord_suggets_attack_enemy_castle3", [(str_store_party_name, 1, "$suggested_to_attack_center")],
    "That should be possible. Very well, we'll attack {s1}.", "lord_pretalk",
    [
      (call_script, "script_party_set_ai_state", "$g_talk_troop_party", spai_besieging_center, "$suggested_to_attack_center"),
      
  ]],
  
  [anyone,"lord_suggest_raid_village", [],
    "{!}Hmm. Which village do you suggest we attack?", "lord_suggest_raid_village_2",[]],
  [anyone|plyr|repeat_for_parties,"lord_suggest_raid_village_2", [
      (store_repeat_object, ":center_no"),
      (party_slot_eq,":center_no",slot_party_type, spt_village),
      (store_faction_of_party, ":town_faction", ":center_no"),
      (store_relation, ":town_relation", ":town_faction", "$g_talk_troop_faction"),
      (le, ":town_relation", -10),
      (str_store_faction_name, s2, ":town_faction"),
      (str_store_party_name, s1, ":center_no")],
    "{!}CHEAT: {s1} of the {s2}", "lord_suggest_raid_village_3",[(store_repeat_object, "$suggested_to_attack_center")]],
  [anyone|plyr,"lord_suggest_raid_village_2", [],
    "{!}CHEAT: Never mind.", "lord_pretalk",[]],
  
  [anyone,"lord_suggest_raid_village_3", [(str_store_party_name, s1, "$suggested_to_attack_center")],
    "{!}That should be possible. Very well, we'll attack {s1}.", "lord_pretalk",
    [
      (call_script, "script_party_set_ai_state", "$g_talk_troop_party", spai_raiding_around_center, "$suggested_to_attack_center"),
  ]],
  
  
  [anyone,"lord_suggest_follow_me", [],
    "{!}Aye, I'll follow you.", "lord_pretalk",
    [
      (party_set_slot, "$g_talk_troop_party", slot_party_commander_party, "p_main_party"),
      #(call_script, "script_party_decide_next_ai_state_under_command", "$g_talk_troop_party")
      (call_script, "script_npc_decision_checklist_party_ai", "$g_talk_troop"),
      (call_script, "script_party_set_ai_state", "$g_talk_troop_party", reg0, reg1),
  ]],
  
  
  [anyone,"lord_suggest_follow_other", [],
    "{!}Who do you want me to follow?", "lord_suggest_follow_other_2",[]],
  [anyone|plyr|repeat_for_parties,"lord_suggest_follow_other_2", [
      (store_repeat_object, ":party_no"),
      (party_slot_eq,":party_no",slot_party_type, spt_kingdom_hero_party),
      (neq, ":party_no", "$g_talk_troop"),
      (store_faction_of_party, ":party_faction", ":party_no"),
      (eq, ":party_faction", "$g_talk_troop_faction"),
      (str_store_party_name, s1, ":party_no")],
    "{!}CHEAT: {s1}", "lord_suggest_follow_other_3",[(store_repeat_object, "$town_suggested_to_go_to")]],
  [anyone|plyr,"lord_suggest_follow_other_2", [],
    "{!}CHEAT: Never mind.", "lord_pretalk",[]],
  
  [anyone,"lord_suggest_follow_other_3", [(str_store_party_name, 1, "$town_suggested_to_go_to")],
    "{!}As you wish, I shall be accompanying {s1}.", "lord_pretalk",
    [
      (party_set_slot, "$g_talk_troop_party", slot_party_commander_party, "$town_suggested_to_go_to"),
      #(call_script, "script_party_decide_next_ai_state_under_command", "$g_talk_troop_party"),
      (call_script, "script_npc_decision_checklist_party_ai", "$g_talk_troop"),
      (call_script, "script_party_set_ai_state", "$g_talk_troop_party", reg0, reg1),
  ]],
  
  [anyone|plyr,"lord_suggest_action", [],
    "{!}CHEAT: Nothing, {s65}. It's not important.", "lord_pretalk",[]],
  
  
  ##### TODO: QUESTS COMMENT OUT BEGIN
  #Request Mission
  
  [anyone|auto_proceed,"lord_request_mission_ask",
    [(eq, "$players_kingdom", 0),
      (ge, "$g_talk_troop_faction_kingdom_relation", 0),
      (ge, "$g_talk_troop_faction_relation", -5),
      (ge, "$g_talk_troop_relation", 0),
      (neq, "$campaign_type", camp_storyline),
      (troop_slot_ge, "trp_player", slot_troop_renown, 30),
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      (faction_get_slot, ":last_offer_time", "$g_talk_troop_faction", slot_faction_last_mercenary_offer_time),
      
      (assign, ":num_enemies", 0),
      (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
        (faction_slot_eq, "$g_talk_troop_faction", slot_faction_state, sfs_active),
        (store_relation, ":reln", "$g_talk_troop_faction", ":faction_no"),
        (lt, ":reln", 0),
        (val_add, ":num_enemies", 1),
      (try_end),
      (ge, ":num_enemies", 1),
      (store_current_hours, ":cur_hours"),
      (store_add,  ":week_past_last_offer_time", ":last_offer_time", 7 * 24),
      (val_add,  ":last_offer_time", 24),
      (ge, ":cur_hours", ":last_offer_time"),
      (store_random_in_range, ":rand", 0, 100),
      (this_or_next|lt, ":rand", 20),
      (ge, ":cur_hours", ":week_past_last_offer_time"),
      
      
      (troop_get_type, ":type", "trp_player"),
      (val_mod, ":type", 2),
      (this_or_next|eq, ":type", 0),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
    ],
    "{!}Warning: This line should never display.", "lord_propose_mercenary",[(store_current_hours, ":cur_hours"),
      (faction_set_slot, "$g_talk_troop_faction", slot_faction_last_mercenary_offer_time,  ":cur_hours")]],
  
  
  
  
  
  [anyone,"lord_propose_mercenary", [
      (call_script, "script_party_calculate_strength", "p_main_party", 0),
      (assign, ":offer_value", reg0),
      (val_add, ":offer_value", 100),
      (call_script, "script_round_value", ":offer_value"),
      (assign, ":offer_value", reg0),
      (assign, "$temp", ":offer_value"),
      (faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
      (neq, ":faction_leader", "$g_talk_troop"),
      (str_store_faction_name, s9, "$g_talk_troop_faction"),
      (str_store_troop_name, s10, ":faction_leader"),
      
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (try_begin),
        (eq, ":is_female", 3), #disabled
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
        (str_store_string, s11, "str_now_some_might_say_that_women_have_no_business_leading_mercenary_companies_but_i_suspect_that_you_would_prove_them_wrong_what_do_you_say"),
      (else_try),
        (str_store_string, s11, "@What do you say to entering the service of the {s9} as a mercenary captain? " +
        "I have no doubt that you would be up to the task."),
      (try_end)
    ],
    
    "As it happens, {playername}, I promised {s10} that I would hire a company of mercenaries for an upcoming campaign. " +
    "","lord_mercenary_service", []],
  [anyone|plyr,"lord_mercenary_service", [], "I'm not interested, thank you.", "lord_mercenary_service_reject", []],
  [anyone|plyr,"lord_mercenary_service", [], "Aye, I'll join the {s9}.", "lord_mercenary_service_accept", []],
  [anyone|plyr,"lord_mercenary_service", [], "I'm interested. Please tell me more.", "lord_mercenary_elaborate_pay", []],
  
  [anyone,"lord_mercenary_service_accept", [(str_store_faction_name, s9, "$g_talk_troop_faction")],
    "Perfect. Of course, you shall have to make a formal declaration of allegiance, " +
    "and give your oath that you and your company will remain in service to the {s9} " +
    "for a period of no less than one month.", "lord_mercenary_service_verify", []],
  [anyone|plyr,"lord_mercenary_service_verify", [], "As you wish. Your enemies are my enemies.", "lord_mercenary_service_verify_2", []],
  [anyone|plyr,"lord_mercenary_service_verify", [], "On second thought, forget it.", "lord_mercenary_service_reject", []],
  
  [anyone,"lord_mercenary_service_verify_2", [], "That will do. You've made a wise choice, my friend. " +
    "The {s9} does well by its loyal fighters. You will receive many rewards for your service.", "lord_mercenary_service_accept_3", [
      (call_script, "script_troop_add_gold", "trp_player", "$temp"),
      (store_current_day, ":cur_day"),
      (store_add, "$mercenary_service_next_renew_day", ":cur_day", 30),
      (call_script, "script_player_join_faction", "$g_talk_troop_faction"),
      (str_store_faction_name, s9, "$g_talk_troop_faction"),]],
  
  [anyone,"lord_mercenary_service_accept_3", [], "Now, I suggest you prepare for a serious campaign. " +
    "Train and equip your soldiers as best you can in the meantime, and respond quickly when you are summoned for duty.", "lord_pretalk", []],
  
  [anyone,"lord_mercenary_service_reject", [(str_store_faction_name, s9, "$g_talk_troop_faction")],
    "I'm very sorry to hear that. You'll find no better place than the {s9}, be sure of that.", "lord_pretalk", []],
  
  [anyone,"lord_mercenary_elaborate_pay", [(assign, reg12, "$temp")],
    "I can offer you a contract for one month. At the end of this period, it can be extended on a monthly basis. " +
    "An initial sum of {reg12} peningas will be paid to you to seal the contract. " +
    "After that, you'll receive wages from {s10} each week, according to the number and quality of the soldiers in your company. " +
    "You still have your rights to battlefield loot and salvage, as well as any prisoners you capture. " +
    "War can be very profitable at times...", "lord_mercenary_elaborate_1",
    [(faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
      (str_store_troop_name, s10, ":faction_leader")]],
  
  
  [anyone,"lord_mercenary_service_elaborate_duty", [],
    "Duties... There are only a few, none of them difficult. The very first thing is to declare your allegiance. " +
    "An oath of loyalty to our cause. Once that's done, you shall be required to fulfill certain responsibilities. " +
    "You'll participate in military campaigns, fulfill any duties given to you by your commanders, " +
    "and most of all you shall attack the enemies of our kingdom wherever you might find them.", "lord_mercenary_elaborate_1",
    [(faction_get_slot, ":faction_leader", "$g_talk_troop_faction", slot_faction_leader),
      (str_store_troop_name, s10, ":faction_leader")]],
  
  [anyone|plyr,"lord_mercenary_elaborate_1", [], "And what about my duties as a mercenary?", "lord_mercenary_service_elaborate_duty", []],
  [anyone|plyr,"lord_mercenary_elaborate_1", [], "Can I hold on to any castles I take?", "lord_mercenary_elaborate_castle", []],
  [anyone|plyr,"lord_mercenary_elaborate_1",
    [
      (neg|troop_slot_ge, "trp_player", slot_troop_banner_scene_prop, 1),
      #custom_banner begin
      ##    (eq, "trp_player", slot_troop_custom_banner_flag_type, -1),
      #custom_banner end
      ], "Can I fly my own banner?", "lord_mercenary_elaborate_banner", []],
  [anyone|plyr,"lord_mercenary_elaborate_1", [], "How much will you pay me for my service?", "lord_mercenary_elaborate_pay", []],
  [anyone|plyr,"lord_mercenary_elaborate_1", [], "Sounds good. I wish to enter your service as a mercenary.", "lord_mercenary_service_accept", []],
  [anyone|plyr,"lord_mercenary_elaborate_1", [], "Apologies, my sword is not for hire.", "lord_mercenary_service_reject", []],
  
  
  [anyone,"lord_mercenary_elaborate_castle", [(troop_get_type, ":type", "trp_player"),(val_mod, ":type", 2),(eq, ":type", 1),
      (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop")
    ],
    "Only my loyal vassals can own lands and castles in my realm -- and all my vassals are men.\I am not inclined to depart from this tradition without a very good reason. If you prove yourself in battle, you can swear an oath of homage to me and become my vassal.\We may then discuss how you may obtain a castle.",
    "lord_mercenary_elaborate_1", []],
  
  [anyone,"lord_mercenary_elaborate_castle", [(troop_get_type, ":type", "trp_player"),(val_mod, ":type", 2),(eq, ":type", 1),
    ],
    "Hmm... Only loyal vassals of {s10} can own lands and castles. While kings will sometimes accept vassalage from men who prove themselves in battle, and grant them land, I have never heard of a king who gave fiefs to women. You had best discuss that issue with {s10} himself.",
    "lord_mercenary_elaborate_1", []],
  
  
  [anyone,"lord_mercenary_elaborate_castle", [(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop")],
    "Only my loyal vassals can own lands and castles in my realm. " +
    "A mercenary cannot be trusted with such a responsibility. " +
    "However, after serving for some time, you can swear homage to me and become my vassal. " +
    "Then you will be rewarded with a fief.", "lord_mercenary_elaborate_1", []],
  
  [anyone,"lord_mercenary_elaborate_castle", [], "Only loyal vassals of {s10} can own lands and castles. " +
    "You understand, a simple mercenary cannot be trusted with such responsibility. " +
    "However, after serving for some time, you may earn the right to swear homage to {s10} and become his vassal. " +
    "Then you would be rewarded with a fief.", "lord_mercenary_elaborate_1", []],
  
  [anyone,"lord_mercenary_elaborate_banner", [(faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop")],
    "Only my noble vassals have the honour of carrying their own banners. " +
    "However, after some time in mercenary service, you may earn the opportunity to swear homage to me and become my vassal, " +
    "gaining the right to choose a banner of your own and fight under it in battle.", "lord_mercenary_elaborate_1", []],
  [anyone,"lord_mercenary_elaborate_banner", [], "Only noble vassals of {s10} have the honour of carrying their own banners. " +
    "However, after some time of mercenary service, perhaps you can earn the opportunity to swear homage to {s10} and become his vassal, " +
    "gaining the right to choose a banner of your own and fight under it in battle.", "lord_mercenary_elaborate_1", []],
  
  [anyone,"lord_request_mission_ask", [(store_partner_quest,":lords_quest"),(ge,":lords_quest",0)],
    "You still haven't finished the last job I gave you, {playername}. You should be working on that, not asking me for other things to do.", "lord_pretalk",[(val_or, "$option_switches", lord_option_task)]],
  
  
  [anyone,"lord_request_mission_ask", [(troop_slot_eq, "$g_talk_troop", slot_troop_does_not_give_quest, 1)],
    "I don't have any other jobs for you right now.", "lord_pretalk",[(val_or, "$option_switches", lord_option_task)]],
  
  [anyone,"lord_request_mission_ask", [
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
      (troop_slot_eq, "trp_player", slot_troop_betrothed, "$g_talk_troop"),
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (eq, ":is_female", 1),
    ],
    "My lady, by the traditions of courtship, I should be offering my services to you. Unfortunately, I have little time right now, so I beg you to take this declaration of my esteem in its place.", "lord_pretalk",[(val_or, "$option_switches", lord_option_task)]],
  
  [anyone|auto_proceed,"lord_request_mission_ask", [], "A task?", "lord_tell_mission",
    [
      (call_script, "script_get_quest", "$g_talk_troop"),
      (assign, "$random_quest_no", reg0),
  ]],
  
  [anyone,"lord_tell_mission", [
      (eq, "$player_has_homage" ,1),
      (neq, "$random_quest_no", "qst_rescue_prisoner"),
      (neq, "$random_quest_no", "qst_deliver_message"),
      (neq, "$random_quest_no", "qst_destroy_bandit_lair"),
      (neq, "$random_quest_no", "qst_raise_troops"),
      (neq, "$random_quest_no", "qst_escort_lady"),
      (neq, "$random_quest_no", "qst_lend_companion"),
      (neq, "$random_quest_no", "qst_capture_enemy_hero"),
      (neq, "$random_quest_no", "qst_cause_provocation"),
      (neq, "$random_quest_no", "qst_deal_with_bandits_at_lords_village"),
      (neq, "$random_quest_no", "qst_bring_back_runaway_serfs"),
      (neq, "$random_quest_no", "qst_blank_quest_2"),
      (neq, "$random_quest_no", "qst_blank_quest_3"),
    ],
    "There are some minor errands which I need completed, but it would be more appropriate to give them to one of my own men, not to a sworn vassal.", "lord_tell_mission_sworn_vassal",[]],
  
  [anyone,"lord_tell_mission_sworn_vassal", [
      (this_or_next|party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_besieging_center),
      (party_slot_eq, "$g_talk_troop_party", slot_party_ai_state, spai_raiding_around_center),
      
      (party_get_slot, ":cur_object", "$g_talk_troop_party", slot_party_ai_object),
      (is_between, ":cur_object", centers_begin, centers_end),
      (str_store_party_name, s4, ":cur_object"),
    ],
    "If you are looking for action against our foes, you may join our attack on {s4}. The enemy may come in force to oppose us, so it is good to have as many men as possible.", "lord_pretalk",[]],
  
  
  
  [anyone,"lord_tell_mission_sworn_vassal", [
      (eq, "$g_talk_troop_faction", "$players_kingdom"),
      
      (party_get_slot, ":cur_object", "$g_talk_troop_party", slot_party_ai_object),
      (is_between, ":cur_object", centers_begin, centers_end),
      (party_get_slot, ":last_spotted_enemy", ":cur_object", slot_center_last_spotted_enemy),
      (party_is_active, ":last_spotted_enemy"),
      (store_faction_of_party, ":last_spotted_enemy_faction", ":last_spotted_enemy"),
      (store_relation, ":relation",":last_spotted_enemy_faction", "$g_talk_troop_faction"),
      (lt, ":relation", 0),
      
      (is_between, ":last_spotted_enemy_faction", kingdoms_begin, kingdoms_end),
      (str_store_party_name, s4, ":cur_object"),
      (str_store_faction_name, s5, ":last_spotted_enemy_faction"),
      
    ],
    "If you are looking for action against our foes, you may try venturing out to {s4}. We have received word that a force of the {s5} is in the area, and I am going there myself. I cannot guarantee you that our enemies will be there when you arrive, of course.", "lord_pretalk",[]],
  
  [anyone,"lord_tell_mission_sworn_vassal", [
      (eq, "$g_talk_troop_faction", "$players_kingdom"),
      (assign, ":alarmed_center_found", -1),
      (assign, ":score_to_beat", 9999),
      
      (try_for_range, ":center_no", centers_begin, centers_end),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (eq, ":center_faction", "$g_talk_troop_faction"),
        (party_get_slot, ":last_spotted_enemy", ":center_no", slot_center_last_spotted_enemy),
        (party_is_active, ":last_spotted_enemy"),
        (store_faction_of_party, ":last_spotted_enemy_faction", ":last_spotted_enemy"),
        (is_between, ":last_spotted_enemy_faction", kingdoms_begin, kingdoms_end),
        
        (store_relation, ":relation", ":last_spotted_enemy_faction", "$g_talk_troop_faction"),
        (lt, ":relation", 0),
        
        (store_distance_to_party_from_party, ":distance", ":center_no", "p_main_party"),
        (lt, ":distance", ":score_to_beat"),
        
        (assign, ":alarmed_center_found", ":center_no"),
        (assign, ":score_to_beat", ":distance"),
        (str_store_faction_name, s5, ":last_spotted_enemy_faction"),
      (try_end),
      (is_between, ":alarmed_center_found", centers_begin, centers_end),
      (str_store_party_name, s4, ":alarmed_center_found"),
    ],
    "If you are looking for action against our foes, you may try venturing out to {s4}. We have received word that a force of the {s5} is in the area. I am not currently headed that way, but others may be.  I cannot guarantee you that our enemies will be there when you arrive, of course.", "lord_pretalk",[]],
  
  
  
  [anyone,"lord_tell_mission_sworn_vassal", [],
    "If a worthy task presents itself, however, I may have a favor to ask of you at a later date.", "lord_pretalk",[
      (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
    ]],
  
  [anyone,"lord_tell_mission", [
      (eq,"$random_quest_no", "qst_blank_quest_4"),
    ],"I have heard that my village {s5} was raided by some masterless men a while ago. I would appreciate it very much if you could track down these scoundrels. The village leader gave a vague description of their leader, and I have put a bounty together. " +
    "If you can hunt them down and destroy them, I would most certainly be very happy about it.", "lord_quest_mmen",
    [
      #	(quest_get_slot, ":b_party",  "qst_blank_quest_4", slot_quest_target_party),
      (quest_get_slot, ":center", "qst_blank_quest_4", slot_quest_object_center),
      (str_store_party_name, s5, ":center"),
  ]],
  
  [anyone|plyr,"lord_quest_mmen", [], "Aye, I'll do it.", "lord_quest_mmen1", [
      (quest_get_slot, ":center", "qst_blank_quest_4", slot_quest_object_center),
      (quest_get_slot, ":target_party", "qst_blank_quest_4", slot_quest_target_party),
      (party_set_flags, ":target_party", pf_quest_party, 1),
      (quest_set_slot, "qst_blank_quest_4", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_set_slot, "qst_blank_quest_4", slot_quest_giver_center, "$g_encountered_party"),
      (party_get_num_companion_stacks, ":num_stacks",":target_party"),
      (assign, ":total", 0),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop",":target_party",":i_stack"),
        (party_stack_get_size, ":stack_size",":target_party",":i_stack"),
        (store_character_level, ":troop_level", ":stack_troop"),
        (store_mul, ":troop_total",":troop_level", ":stack_size"),
        (val_add, ":total", ":troop_total"),
      (try_end),
      (val_div, ":total", 10),
      (val_mul, ":total", 10),
      (quest_set_slot, "qst_blank_quest_4", slot_quest_gold_reward, ":total"),
      (val_mul, ":total", 3),
      (val_div, ":total", 2),
      (quest_set_slot, "qst_blank_quest_4", slot_quest_xp_reward, ":total"),
      (str_store_troop_name_link, s8, "$g_talk_troop"),
      (str_store_party_name_link, s9, ":center"),
      (setup_quest_text, "qst_blank_quest_4"),
      (str_store_string, s2, "@{s8} asked you to track down a group of masterless men who looted his village, {s9}."),
      (call_script, "script_start_quest", "qst_blank_quest_4", "$g_talk_troop"),
  ]],
  
  
  [anyone,"lord_quest_mmen1", [
    ], "Very good. The band may not have lingered long in the area, but chances are that they will be spotted by other travellers on the road.", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone|plyr,"lord_quest_mmen", [], "I'm afraid I can't take the job at the moment.", "lord_mission_rejected",[]],
  
  [anyone,"lord_tell_mission", [
      (eq,"$random_quest_no", "qst_destroy_bandit_lair"),
      (quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
      
      (party_stack_get_troop_id, ":bandit_type", ":bandit_lair", 0),
      (str_store_troop_name_plural, s4, ":bandit_type"),
      
    ], "Yes -- there is something you can do for us. We have heard reports that a group of {s4} have established a hideout in this area, and have been attacking travellers. If you could find their lair and destroy it, we would be very grateful.", "destroy_lair_quest_brief", #s48 is bandits, s42 is the road information
    []],
  
  
  [anyone,"lord_tell_mission",
    [(eq,"$random_quest_no","qst_rescue_prisoner")],
    "My {s11}, {s13}, has been taken prisoner by {s14} of the {s15}. Normally, honorable nobles will grant prisoners of gentle blood the privilege of parole, and treat them as honored guests so long as they give their word that they will not attempt to escape, until such time as a ransom can be paid.  But {s14}, instead of granting {s13} parole, has consigned my {s11} to his dungeons -- no doubt in the hope that he can demand more from us.", "lord_mission_rescue_prisoner",
    [
      (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
      (troop_get_slot, ":quest_target_center", ":quest_target_troop", slot_troop_prisoner_of_party),
      (call_script, "script_troop_get_family_relation_to_troop", ":quest_target_troop", "$g_talk_troop"),
      
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_troop_name_link, s13, ":quest_target_troop"),
      (str_store_party_name_link, s24, ":quest_target_center"),
      (party_get_slot, ":captor", ":quest_target_center", slot_town_lord),
      (str_store_troop_name, s14, ":captor"),
      (store_faction_of_party, ":target_faction", ":quest_target_center"),
      (str_store_faction_name, s15, ":target_faction"),
      
      
      (setup_quest_text,"$random_quest_no"),
      ##     (try_begin),
      ##       (is_between, "$g_encountered_party", centers_begin, centers_end),
      ##       (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
      ##     (else_try),
      ##       (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
      ##     (try_end),
      (str_store_string, s2, "str_s9_asked_you_to_rescue_s13_who_is_prisoner_at_s24"),
  ]],
  
  
  [anyone,"lord_mission_rescue_prisoner", [(quest_get_slot, reg1, "qst_rescue_prisoner", slot_quest_gold_reward)],
    "We need you to get my {s11} out of prison. You may be able to pay a ransom -- in which case we could cover your expenses, up to {reg1} peningas. If you have connections within {s24}, you may be able to use them to sneak him out. Or, you may try a more direct approach -- walk up to the gaoler, take the keys by force, and then fight your way out. Can you do this for us?", "lord_mission_rescue_prisoner_confirm",
    [
  ]],
  
  [anyone|plyr,"lord_mission_rescue_prisoner_confirm", [],
    "I can try.", "lord_mission_rescue_prisoner_accepted",[]],
  
  [anyone|plyr,"lord_mission_rescue_prisoner_confirm", [], "I don't think that I can help you.", "lord_mission_rescue_prisoner_rejected",[]],
  [anyone,"lord_mission_rescue_prisoner_rejected", [], "It would not have been an easy task. Perhaps we will find another way.", "close_window",[
      (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone,"lord_mission_rescue_prisoner_accepted", [], "We are most grateful. Could I ask you how you were planning to proceed?", "lord_mission_rescue_prisoner_method",
    [(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",1),
  ]],
  
  [anyone,"lord_mission_rescue_other_ideas", [], "Did you have any other ideas which you wished to discuss?", "lord_mission_rescue_prisoner_method",
    []],
  
  
  # [anyone|plyr,"lord_mission_rescue_prisoner_method", [
      # (eq, 1, 0),
    # ], # unused
    # "{!}I am thinking of paying the ransom.", "lord_mission_rescue_prisoner_method_ransom",[]],
  
  # [anyone|plyr,"lord_mission_rescue_prisoner_method", [
      # (eq, 1, 0),
    # ], # unused
    # "{!}I am thinking of using my connections in {s24}.", "close_window",[]],
  
  [anyone|plyr,"lord_mission_rescue_prisoner_method", [],
    "I am thinking of breaking into the prison in {s24}, finding {s13}, and fighting my way out.", "lord_mission_rescue_prisoner_method_prisonbreak",[]],
  
  [anyone|plyr,"lord_mission_rescue_prisoner_method", [],
    "I am thinking of taking {s24} by storm.", "lord_mission_rescue_prisoner_method_siege",[]],
  
  [anyone|plyr,"lord_mission_rescue_prisoner_method", [],
    "I have done enough planning. Time to act!", "lord_mission_rescue_prisoner_planning_end",[]],
  
  [anyone,"lord_mission_rescue_prisoner_planning_end", [],
    "May the heavens protect you.", "close_window",[
      (assign, "$g_leave_encounter", 1),
  ]],
  
  # [anyone,"lord_mission_rescue_prisoner_method_ransom", [],
    # "{!}[Ransom option not yet implemented]", "lord_mission_rescue_other_ideas",[]],
  
  [anyone,"lord_mission_rescue_prisoner_method_prisonbreak", [],
    "I had discussed this idea with some of my men. One could enter {s24}, either in disguise or openly, then walk up to the prison guard and try to take the keys by force. However, getting out may be difficult. The garrison may be slow to react, but even so, you are likely to find yourself fighting a half dozen or more of the enemy at once, with limited space in which to maneuver. If you can fight your way past them, though, you can probably get out.", "lord_mission_rescue_prisoner_method_prisonbreak_2",[]],
  
  [anyone,"lord_mission_rescue_prisoner_method_prisonbreak_2", [],
    "You may find it useful to create a distraction, to divert the attention of some of the garrison. If you have any connections in the villages near {s24}, this may be a time to put them to use.", "lord_mission_rescue_other_ideas",[]],
  
  
  [anyone,"lord_mission_rescue_prisoner_method_siege", [],
    "Well, that is certainly the most direct approach.", "lord_mission_rescue_other_ideas",[]],
  
  
  
  
  
  
  [anyone,"lord_tell_mission", [
    (eq,"$random_quest_no","qst_deliver_message"),
    (quest_get_slot, reg1, "qst_deliver_message", slot_quest_expiration_days),
  ],
    "I need to send a letter to {s13} who should be currently at {s4}. " +
    "If you will be heading towards there, would you deliver it to him? " +
    "The letter needs to be in his hands in {reg1} days.", "lord_mission_deliver_message",
    [
      (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (str_store_troop_name_link,s9,"$g_talk_troop"),
      (str_store_troop_name_link,s13,":quest_target_troop"),
      (str_store_party_name_link,s4,":quest_target_center"),
      (setup_quest_text,"$random_quest_no"),
      ##     (try_begin),
      ##       (is_between, "$g_encountered_party", centers_begin, centers_end),
      ##       (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
      ##     (else_try),
      ##       (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
      ##     (try_end),
      (str_store_string, s2, "@{s9} asked you to take a message to {s13}. {s13} was believed to be at {s4} when you were given this quest."),
  ]],
  
  [anyone|plyr,"lord_mission_deliver_message", [], "Certainly, I intend to pass by {s4} and it would be no trouble.", "lord_mission_deliver_message_accepted",[]],
  [anyone|plyr,"lord_mission_deliver_message", [], "I doubt I'll be seeing {s13} anytime soon, {s65}. You'd best send it with someone else.", "lord_mission_deliver_message_rejected",[]],
  [anyone|plyr,"lord_mission_deliver_message", [], "I am no errand boy, sir. Hire a courier for your trivialities.", "lord_mission_deliver_message_rejected_rudely",[]],
  
  [anyone,"lord_mission_deliver_message_accepted", [], "I appreciate it, {playername}. Here's the letter, " +
    "and a small sum to cover your travel expenses. Give my regards to {s13} when you see him.", "close_window",
    [(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (call_script, "script_troop_add_gold", "trp_player", 30),    (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone,"lord_mission_deliver_message_rejected", [], "Ah, all right then. Well, I am sure I will find someone else.", "lord_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
  
  [anyone,"lord_mission_deliver_message_rejected_rudely", [], "Hmm, is this how you respond to a polite request " +
    "for a small favor? A poor show, {playername}. I didn't know you would take offence.", "lord_mission_deliver_message_rejected_rudely_2",[]],
  
  [anyone|plyr,"lord_mission_deliver_message_rejected_rudely_2", [], "Then you shall know better from now on.", "lord_mission_deliver_message_rejected_rudely_3",[]],
  [anyone|plyr,"lord_mission_deliver_message_rejected_rudely_2", [], "Forgive my temper, {s65}. I'll deliver your letter.", "lord_mission_deliver_message_accepted",[]],
  
  [anyone,"lord_mission_deliver_message_rejected_rudely_3", [], "All right, I will remember that.", "close_window",[
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",-4),
      (quest_set_slot, "$random_quest_no", slot_quest_dont_give_again_remaining_days, 150),
      (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
      (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone,"lord_tell_mission", [
    (eq,"$random_quest_no","qst_deliver_message_to_enemy_lord"),
    (quest_get_slot, reg1, "qst_deliver_message_to_enemy_lord", slot_quest_expiration_days),
  ],
    "I need to deliver a letter to {s13} of {s15}, who must be at {s4} currently. " +
    "If you are going towards there, would you deliver my letter to him? The letter needs to reach him in {reg1} days.", "lord_mission_deliver_message",
    [
      (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (str_store_troop_name_link,s9,"$g_talk_troop"),
      ##     (str_store_party_name,2,"$g_encountered_party"),
      (str_store_troop_name_link,s13,":quest_target_troop"),
      (str_store_party_name_link,s4,":quest_target_center"),
      (store_troop_faction, ":target_faction", ":quest_target_troop"),
      (str_store_faction_name_link,s15,":target_faction"),
      (setup_quest_text,"$random_quest_no"),
      ##     (try_begin),
      ##       (is_between, "$g_encountered_party", centers_begin, centers_end),
      ##       (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
      ##     (else_try),
      ##       (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
      ##     (try_end),
      (str_store_string, s2, "@{s9} asked you to take a message to {s13} of the {s15}. {s13} was believed to be at {s4} when you were given this quest."),
  ]],
  
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_blank_quest_2")],
    "Hmm, yes, I may need your help. The local Bishop here at {s22} wants to inspect the monastery at {s14}. Normally, I would put a small detachment to " +
    "accompany him, but I'm really busy here with my estates. Would you consider escorting him to his destination?", "lord_mission_told",[
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_party_name, s14, ":quest_target_center"),
      (troop_get_slot, "$g_talk_troop_party", "$g_talk_troop", slot_troop_leaded_party),
      (party_get_attached_to, ":attached_to","$g_talk_troop_party"),
      (str_store_party_name, s22, ":attached_to"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s11} asked you to escort the Bishop from {s22} to {s14}."),]],
  
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_blank_quest_3")],
    "Hmm, yes. I have heard from the port master in Ribe that the monastery at {s14} has a considerable amount of silver stored. I was going to pay those monks a visit myself, " +
    "but I'm currently occupied with some other things. So here is what I propose: if you go there and bring me {reg33} peningas, you can keep the rest. Do we have a deal?", "lord_mission_told",[
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_party_name, s14, ":quest_target_center"),
      (quest_get_slot, ":quest_target_amount", "$random_quest_no", slot_quest_target_amount),
      (assign, reg33,  ":quest_target_amount"),
      (call_script, "script_get_closest_center", ":quest_target_center"),
      (assign, ":center", reg0),
      (str_store_party_name_link, s34, ":center"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s11} asked you to raid a monastery at {s14}, near {s34}, and bring him {reg33} peningas."),]],
  
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_escort_lady")],
    "There is a small thing... My {s17} {s13} is due for a visit to her relatives at {s14}. " +
    "The visit has been postponed several times already with all the trouble on the roads, " +
    "but this time she is adamant about going. So, I want to make sure that at least she is well guarded. " +
    "I trust you well, {playername}, so I would be very grateful if you could escort her to {s14} " +
    "to make sure she arrives safe and sound.", "lord_mission_told",
    [
      (quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (try_begin),
        (troop_slot_eq, ":quest_object_troop", slot_troop_father, "$g_talk_troop"),
        (str_store_string, s17, "str_daughter"),
      (else_try),
        (str_store_string, s17, "str_wife"),
      (try_end),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_troop_name_link, s13, ":quest_object_troop"),
      (str_store_party_name_link, s14, ":quest_target_center"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s11} asked you to escort his {s17} {s13} to {s14}."),
  ]],
  
  ##
  ##  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_hunt_down_raiders")],
  ## "A messenger came with important news a few hours ago.\
  ## A group of enemy raiders have attacked a village near {s3}.\
  ## They have murdered anyone who tried to resist, stolen everything they could carry and put the rest to fire.\
  ## Now, they must be on their way back to their base at {s4}.\
  ## You must catch them on the way and make them pay for their crimes.", "lord_mission_told",
  ##   [
  ##       (quest_get_slot, ":quest_object_center", "$random_quest_no", slot_quest_object_center),
  ##       (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
  ##       (str_store_party_name_link,3,":quest_object_center"),
  ##       (str_store_party_name_link,4,":quest_target_center"),
  ##    ]],
  ##
  ##  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_bring_back_deserters")],
  ## "I am worried about the growing number of deserters. If we don't do something about it, we may soon have no one left to fight in our wars.\
  ## I want you to go now and bring back {reg1} {s3}. I would ask you to hang the bastards but we are short of men and we need them back in the ranks.", "lord_mission_told",
  ##   [
  ##       (quest_get_slot, ":quest_target_amount", "$random_quest_no", slot_quest_target_amount),
  ##       (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
  ##
  ##       (str_store_troop_name_link,1,"$g_talk_troop"),
  ##       (str_store_party_name_link,2,"$g_encountered_party"),
  ##       (str_store_troop_name_plural,3,":quest_target_troop"),
  ##       (assign, reg1, ":quest_target_amount"),
  ##       (setup_quest_text,"$random_quest_no"),
  ##       (try_begin),
  ##         (is_between, "$g_encountered_party", centers_begin, centers_end),
  ##         (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
  ##       (else_try),
  ##         (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
  ##       (try_end),
  ##    ]],
  ##
  ##  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_deliver_supply_to_center_under_siege")],
  ## "The enemy has besieged {s5}. Our brothers there are doing their best to fend off attacks, but they can't hold for long without supplies.\
  ## We need someone to take the supplies they need and make it into the town as soon as possible.\
  ## It's a very dangerous job, but if there's one person who can do it, it's you {playername}.\
  ## You can take the supplies from seneschal {s3}. When you arrive at {s5}, give them to the seneschal of that town.", "lord_mission_told",
  ##   [
  ##       (quest_get_slot, ":quest_target_amount", "$random_quest_no", slot_quest_target_amount),
  ##       (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
  ##       (quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
  ##       (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
  ##
  ##       (str_store_troop_name_link,1,"$g_talk_troop"),
  ##       (str_store_party_name_link,2,"$g_encountered_party"),
  ##       (str_store_troop_name_link,3,":quest_object_troop"),
  ##       (str_store_troop_name,4,":quest_target_troop"),
  ##       (str_store_party_name_link,5,":quest_target_center"),
  ##       (assign, reg1, ":quest_target_amount"),
  ##       (setup_quest_text,"$random_quest_no"),
  ##       (try_begin),
  ##         (is_between, "$g_encountered_party", centers_begin, centers_end),
  ##         (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
  ##       (else_try),
  ##         (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
  ##       (try_end),
  ##    ]],
  ##
  ##  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_bring_reinforcements_to_siege")],
  ## "{s4} has besieged {s5} and God willing, that town will not hold for long.\
  ## Still I promised him to send {reg1} {s3} as reinforcements and I need someone to lead those men.\
  ## Can you take them to {s4}?", "lord_mission_told",
  ##   [
  ##       (quest_get_slot, ":quest_target_amount", "$random_quest_no", slot_quest_target_amount),
  ##       (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
  ##       (quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
  ##       (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
  ##
  ##       (str_store_troop_name_link,1,"$g_talk_troop"),
  ##       (str_store_party_name_link,2,"$g_encountered_party"),
  ##       (str_store_troop_name_plural,3,":quest_object_troop"),
  ##       (str_store_troop_name_link,4,":quest_target_troop"),
  ##       (str_store_party_name_link,5,":quest_target_center"),
  ##       (assign, reg1, ":quest_target_amount"),
  ##       (setup_quest_text,"$random_quest_no"),
  ##       (try_begin),
  ##         (is_between, "$g_encountered_party", centers_begin, centers_end),
  ##         (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
  ##       (else_try),
  ##         (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
  ##       (try_end),
  ##    ]],
  ##
  ##  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_rescue_lady_under_siege")],
  ## "The enemy has besieged {s4} and my dear {s7} {s3} has been trapped within the town walls.\
  ## As you may guess, I am greatly distressed by this. I need a very reliable commander, to rescue her from the town and bring her back to me.\
  ## Will you do that {playername}?", "lord_mission_told",
  ##   [
  ##       (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
  ##       (quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
  ##
  ##       (try_begin),
  ##         (troop_slot_eq, "$g_talk_troop", slot_troop_daughter, ":quest_object_troop"),
  ##         (str_store_string, s7, "str_daughter"),
  ##       (else_try),
  ##         (str_store_string, s7, "str_wife"),
  ##       (try_end),
  ##
  ##       (str_store_troop_name_link,1,"$g_talk_troop"),
  ##       (str_store_party_name_link,2,"$g_encountered_party"),
  ##       (str_store_troop_name_link,3,":quest_object_troop"),
  ##       (str_store_party_name_link,4,":quest_target_center"),
  ##       (setup_quest_text,"$random_quest_no"),
  ##       (try_begin),
  ##         (is_between, "$g_encountered_party", centers_begin, centers_end),
  ##         (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
  ##       (else_try),
  ##         (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
  ##       (try_end),
  ##    ]],
  ##
  ##
  ##  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_bring_prisoners_to_enemy")],
  ##   "The enemy wants to ransom some of their soldiers that we captured at the last battle.\
  ## They'll pay 100 peningas in return for giving them back {reg1} {s3}.\
  ## God knows I can use that money so I accepted their offer.\
  ## Now, what I need is someone to take the prisoners to {s4} and come back with the money.", "lord_mission_told",
  ##   [
  ##     (quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
  ##     (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
  ##     (quest_get_slot, reg1, "$random_quest_no", slot_quest_target_amount),
  ##     (str_store_troop_name_link,1,"$g_talk_troop"),
  ##     (str_store_party_name_link,2,"$g_encountered_party"),
  ##     (str_store_troop_name_plural,3,":quest_object_troop"),
  ##     (str_store_party_name_link,4,":quest_target_center"),
  ##     (setup_quest_text,"$random_quest_no"),
  ##     (try_begin),
  ##       (is_between, "$g_encountered_party", centers_begin, centers_end),
  ##       (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
  ##     (else_try),
  ##       (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
  ##     (try_end),
  ##   ]],
  ##
  
  
  # Deal with bandits
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_deal_with_bandits_at_lords_village")],
    "A group of bandits has taken refuge in my village of {s15}. " +
    "They are plundering nearby farms, and getting rich and fat stealing my taxes and feasting on my cattle. " +
    "I'd like nothing better than to go out there and teach them a lesson, " +
    "but I have my hands full at the moment, so I can't do anything about it.", "lord_mission_deal_with_bandits_told",
    [
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (str_store_party_name_link,s15,":quest_target_center"),
      (str_store_troop_name_link,s13,"$g_talk_troop"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s13} asked you to deal with the bandits who are occupying the village of {s15} and then report back to him."),
  ]],
  
  [anyone|plyr,"lord_mission_deal_with_bandits_told", [],
    "Worry not, I can go to {s15} and deal with these scum for you.", "lord_mission_deal_with_bandits_accepted",[]],
  [anyone|plyr,"lord_mission_deal_with_bandits_told", [], "You shall have to find help elsewhere. I am too busy.", "lord_mission_deal_with_bandits_rejected",[]],
  
  [anyone,"lord_mission_deal_with_bandits_accepted", [], "Will you do that? " +
    "Know that, I will be grateful to you. Here is some money for the expenses of your campaign. " +
    "Make an example of those {s43}s.", "close_window",
    [
      
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_insult_default"),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (try_begin),
        (neq, "$campaign_type", camp_storyline),
        (call_script, "script_troop_add_gold", "trp_player", 200),
      (else_try),
        (call_script, "script_troop_add_gold", "trp_player", 600),
      (try_end),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",5),
      (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone,"lord_mission_deal_with_bandits_rejected", [], "Ah... Very well then, forget I brought it up.", "lord_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
  
  # Raise troops
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_raise_troops")],
    "No lord should have to admit this, {playername}, but I was inspecting my soldiers the other day " +
    "and there are men here who don't know which end of a sword to hold. " +
    "{!}{s43}." +
    "You are a warrior of renown, {playername}. Will you train some troops for me? " +
    "I would be grateful to you.", "lord_tell_mission_raise_troops",[
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_troop_train_request_default"),
      
  ]],
  
  [anyone|plyr,"lord_tell_mission_raise_troops", [], "How many men do you need?", "lord_tell_mission_raise_troops_2",[]],
  
  [anyone,"lord_tell_mission_raise_troops_2", [], "If you can raise {reg1} {s14} and bring them to me, that will probably be enough.", "lord_mission_raise_troops_told",
    [
      (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
      (quest_get_slot, reg1, "$random_quest_no", slot_quest_target_amount),
      (str_store_troop_name_link,s9,"$g_talk_troop"),
      (str_store_troop_name_plural,s14,":quest_target_troop"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s9} asked you to raise {reg1} {s14} and bring them to him."),
  ]],
  
  [anyone|plyr,"lord_mission_raise_troops_told", [(quest_get_slot, reg1, "$random_quest_no", slot_quest_target_amount)],
    "Of course, {s65}. Give me {reg1} fresh recruits and I'll train them to be {s14}.", "lord_mission_raise_troops_accepted",[]],
  [anyone|plyr,"lord_mission_raise_troops_told", [], "I am too busy these days to train anyone.", "lord_mission_raise_troops_rejected",[]],
  
  [anyone,"lord_mission_raise_troops_accepted", [], "You've taken a weight off my shoulders, {playername}. " +
    "I shall tell my sergeants to send you the recruits and attach them to your command. " +
    "Also, I'll advance you some money to help with expenses. Here, this purse should do it. " +
    "Thank you for your help.", "close_window",
    [(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (try_begin),
        (neq, "$campaign_type", camp_storyline),
        (call_script, "script_troop_add_gold", "trp_player", 1000),
      (else_try),
        (call_script, "script_troop_add_gold", "trp_player", 2000),
      (try_end),
      (quest_get_slot, ":recruit_troop", "$random_quest_no", slot_quest_object_troop),
      (quest_get_slot, ":num_recruits", "$random_quest_no", slot_quest_target_amount),
      (party_add_members, "p_main_party", ":recruit_troop", ":num_recruits"),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",5),
      (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone,"lord_mission_raise_troops_rejected", [], "Oh, of course. I had expected as much. Well, good luck to you then.", "lord_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
  
  
  #Collect Taxes
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_collect_taxes"),
      (assign, reg9, 0),
      (try_begin),
        (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
        (party_slot_eq, ":quest_target_center", slot_party_type, spt_town),
        (assign, reg9, 1),
      (try_end),
    ], "You probably know that I am the lord of the {reg9?town:village} of {s3}. " +
    "However, it has been months since {s3} has delivered the taxes and rents due me as its rightful lord. " +
    "Apparently, the populace there has grown unruly lately and I need someone to go there and remind them of " +
    "their obligations. And to... persuade them if they won't listen. " +
    "If you go there and raise the taxes they owe me, I will grant you one-fifth of everything you collect.", "lord_mission_collect_taxes_told",
    [
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (str_store_troop_name_link,s9,"$g_talk_troop"),
      (str_store_party_name_link,s3,":quest_target_center"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s9} asked you to collect taxes from {s3}. He offered to leave you one-fifth of all the money you collect there."),
  ]],
  
  [anyone|plyr,"lord_mission_collect_taxes_told", [],
    "A fair offer, {s65}. We have an agreement.", "lord_mission_collect_taxes_accepted",[]],
  [anyone|plyr,"lord_mission_collect_taxes_told", [], "Forgive me. I don't have the time.", "lord_mission_collect_taxes_rejected",[]],
  
  [anyone,"lord_mission_collect_taxes_accepted", [], "Welcome news, {playername}. " +
    "I will entrust this matter to you. " +
    "Remember, those {reg9?townsmen:peasants} are foxy beasts, they will make every excuse not to pay me my rightful incomes. " +
    "Do not let them fool you.", "close_window",
    [(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",1),
      (assign, "$g_leave_encounter",1),
      (assign, reg9, 0),
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (try_begin),
        (party_slot_eq, ":quest_target_center", slot_party_type, spt_town),
        (assign, reg9, 1),
      (try_end),
  ]],
  
  [anyone,"lord_mission_collect_taxes_rejected", [], "Oh, yes. Well, good luck to you then.", "lord_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
  
  #Hunt down fugitive
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_hunt_down_fugitive"),
      (try_begin),
        (neq, "$campaign_type", camp_storyline),
        (assign, reg25, 300),
      (else_try),
        (assign, reg25, 600),
      (try_end),
    ],
    "I have something you could help with, an issue with the lawless villain known as {s4}. " +
    "He murdered one of my men and has been on the run from his judgment ever since. " +
    "I can't let him get away with avoiding justice, so I've put a bounty of {reg25} peningas on his head. " +
    "Friends of the murdered man reckon that this assassin may have taken refuge with his kinsmen in {s3}. " +
    "You might be able to hunt him down and give him what he deserves, and claim the bounty for yourself.", "lord_mission_hunt_down_fugitive_told",
    [
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (quest_get_slot, ":quest_target_dna", "$random_quest_no", slot_quest_target_dna),
      (str_store_troop_name_link,s9, "$g_talk_troop"),
      (str_store_party_name_link,s3, ":quest_target_center"),
      (call_script, "script_get_name_from_dna_to_s50", ":quest_target_dna"),
      (str_store_string, s4, s50),
      (setup_quest_text, "$random_quest_no"),
      (str_store_string, s2, "@{s9} asked you to hunt down a fugitive named {s4}. He is currently believed to be in {s3}."),
  ]],
  
  [anyone|plyr,"lord_mission_hunt_down_fugitive_told", [],
    "Then I will hunt him down and execute the law.", "lord_mission_hunt_down_fugitive_accepted",[]],
  [anyone|plyr,"lord_mission_hunt_down_fugitive_told", [], "I am too busy to go after him at the moment.", "lord_mission_hunt_down_fugitive_rejected",[]],
  
  [anyone,"lord_mission_hunt_down_fugitive_accepted", [], "That's excellent, {playername}. " +
    "I will be grateful to you, and so will the family of the man he murdered. " +
    "And of course, the bounty on his head will be yours if you can get him. " +
    "Well, good hunting to you.", "close_window",
    [(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",1),
      (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone,"lord_mission_hunt_down_fugitive_rejected", [], "As you wish, {playername}. " +
    "I suppose there are plenty of bounty hunters around to get the job done...", "lord_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
  
  
  
  ##  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_capture_messenger")],
  ##   "The enemy seems to be preparing for some kind of action and I want to know what their plans are.\
  ## Capture one of their messengers and bring him to me.", "lord_mission_told",
  ##   [
  ##       (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
  ##
  ##       (str_store_troop_name_link,1,"$g_talk_troop"),
  ##       (str_store_party_name_link,2,"$g_encountered_party"),
  ##       (str_store_troop_name,3,":quest_target_troop"),
  ##       (setup_quest_text,"$random_quest_no"),
  ##       (try_begin),
  ##         (is_between, "$g_encountered_party", centers_begin, centers_end),
  ##         (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
  ##       (else_try),
  ##         (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
  ##       (try_end),
  ##   ]],
  ##
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_kill_local_merchant")],
    "The wretched truth is that I owe a considerable sum of money to one of the merchants here in {s3}. " +
    "I've no intention of paying it back, of course, but that loud-mouthed fool is making a terrible fuss about it. " +
    "He even had the audacity to come and threaten me -- me! -- " +
    "with a public letter of complaint to others traders and stockers. Why, he'd ruin my good reputation! " +
    "So I need a {reg59?woman:man} I can trust, someone who will guarantee the man's silence. For good.", "lord_mission_told_kill_local_merchant",
    [
      (str_store_troop_name_link,s9,"$g_talk_troop"),
      (str_store_party_name_link,s3,"$current_town"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s9} asked you to assassinate a local merchant at {s3}."),
  ]],
  
  [anyone|plyr,"lord_mission_told_kill_local_merchant", [], "Worry not. He shan't breathe a word.", "lord_mission_accepted_kill_local_merchant",[]],
  [anyone|plyr,"lord_mission_told_kill_local_merchant", [], "I'm no common murderer, sir. Find someone else for your dirty job.", "lord_mission_rejected",[]],
  
  [anyone,"lord_mission_accepted_kill_local_merchant", [], "Very good. I trust in your skill and discretion, " +
    "{playername}. Do not disappoint me. " +
    "Go now and wait for my word, I'll send you a message telling when and where you can catch the merchant. " +
    "Dispose of him for me and I shall reward you generously.", "close_window",
    [(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (assign, "$g_leave_town",1),
      (assign, "$qst_kill_local_merchant_center", "$current_town"),
      (rest_for_hours, 10, 4, 0),
      (finish_mission),
  ]],
  
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_meet_spy_in_enemy_town"),
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (str_store_party_name, s13, ":quest_target_center"),
      (store_faction_of_party,":quest_target_center_faction",),
      (str_store_faction_name, s14, ":quest_target_center_faction"),
    ],
    "I have a sensitive matter that needs tending to, {playername}, and no trustworthy retainers to take care of it. The fact is that I have a spy in {s13} to keep an eye on things for me, and report anything that might warrant my attention. Every week I send someone to collect the spy's reports and bring them back to me. The job's yours if you wish it.", "lord_mission_told_meet_spy_in_enemy_town",
    [
  ]],
  
  [anyone|plyr,"lord_mission_told_meet_spy_in_enemy_town", [], "I don't mind a bit of skullduggery. Count me in.", "quest_meet_spy_in_enemy_town_accepted",[]],
  [anyone|plyr,"lord_mission_told_meet_spy_in_enemy_town", [], "I must decline. This cloak-and-dagger work isn't fit for me.", "quest_meet_spy_in_enemy_town_rejected",[]],
  
  [anyone,"quest_meet_spy_in_enemy_town_accepted", [], "Excellent! Make your way to {s13} as soon as you can, the spy will be waiting.", "quest_meet_spy_in_enemy_town_accepted_response",
    [
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (quest_get_slot, ":secret_sign", "$random_quest_no", slot_quest_target_amount),
      (store_sub, ":countersign", ":secret_sign", secret_signs_begin),
      (val_add, ":countersign", countersigns_begin),
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_string, s11, ":secret_sign"),
      (str_store_string, s12, ":countersign"),
      (str_store_party_name_link, s13, ":quest_target_center"),
      (setup_quest_text, "$random_quest_no"),
      (str_store_string, s2, "@{s9} has asked you to meet with a spy in {s13}."),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (call_script, "script_cf_center_get_free_walker", ":quest_target_center"),
      (call_script, "script_center_set_walker_to_type", ":quest_target_center", reg0, walkert_spy),
      (str_store_item_name,s14,"$spy_item_worn"),
      #TODO: Change this value
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (assign, "$g_leave_encounter",1),
  ]],
  [anyone|plyr,"quest_meet_spy_in_enemy_town_accepted_response", [(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (str_store_party_name_link, s13, ":quest_target_center")],
    "{s13} is heavily defended. How can I get close without being noticed?", "quest_meet_spy_in_enemy_town_accepted_2",
    []],
  [anyone,"quest_meet_spy_in_enemy_town_accepted_2", [], "You shall have to use stealth. Take care to avoid enemy strongholds, villages and patrols, and don't bring too many men with you. If you fail to sneak in the first time, give it a while for the garrison to lower its guard again, or you may have a difficult time infiltrating the town.", "quest_meet_spy_in_enemy_town_accepted_response",
    []],
  [anyone|plyr,"quest_meet_spy_in_enemy_town_accepted_response", [], "How will I recognise the spy?", "quest_meet_spy_in_enemy_town_accepted_3",
    []],
  [anyone,"quest_meet_spy_in_enemy_town_accepted_3", [(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (str_store_party_name_link, s13, ":quest_target_center"),
      (troop_get_type, reg7, "$spy_quest_troop"),
      (val_mod, reg7, 2),
      (quest_get_slot, ":secret_sign", "$random_quest_no", slot_quest_target_amount),
      (store_sub, ":countersign", ":secret_sign", secret_signs_begin),
      (val_add, ":countersign", countersigns_begin),
      (str_store_string, s11, ":secret_sign"),
      (str_store_string, s12, ":countersign"),],
    "Once you get to {s13} you must talk to the locals, the spy will be one of them. If you think you've found the spy, say the phrase '{s11}' The spy will respond with the phrase '{s12}' Thus you will know the other, and {reg7?she:he} will give you any information {reg7?she:he}'s gathered in my service.", "quest_meet_spy_in_enemy_town_accepted_response",
    []],
  [anyone|plyr,"quest_meet_spy_in_enemy_town_accepted_response", [], "Will I be paid?", "quest_meet_spy_in_enemy_town_accepted_4",
    []],
  [anyone,"quest_meet_spy_in_enemy_town_accepted_4", [], "Of course, I have plenty of silver in my coffers for loyal {reg59?women:men} like you. Do well by me, {playername}, and you'll rise high.", "quest_meet_spy_in_enemy_town_accepted_response",
    []],
  [anyone|plyr,"quest_meet_spy_in_enemy_town_accepted_response", [], "I know what to do. Farewell, my lord.", "quest_meet_spy_in_enemy_town_accepted_end",
    []],
  [anyone,"quest_meet_spy_in_enemy_town_accepted_end", [(quest_get_slot, ":secret_sign", "$random_quest_no", slot_quest_target_amount),
      (store_sub, ":countersign", ":secret_sign", secret_signs_begin),
      (val_add, ":countersign", countersigns_begin),
      (str_store_string, s11, ":secret_sign"),
      (str_store_string, s12, ":countersign")],
    "Good luck, {playername}. Remember, the secret phrase is '{s11}' The counterphrase is '{s12}' Bring any reports back to me, and I'll compensate you for your trouble.", "lord_pretalk",
    []],
  
  [anyone,"quest_meet_spy_in_enemy_town_rejected", [], "As you wish, {playername}, but I strongly advise you to forget anything I told you about any spies. They do not exist, have never existed, and no one will ever find them. Remember that.", "lord_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
  
  
  
  
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_cause_provocation"),
      (quest_get_slot, ":quest_target_faction", "$random_quest_no", slot_quest_target_faction),
      (str_store_faction_name_link, s13, ":quest_target_faction")],
    "This peace with the {s13} ill suits me, {playername}. We've let those swine have their way for far too long. " +
    "Now they get stronger with each passing and their arrogance knows no bounds. " +
    "I say, we must wage war on them before it's too late! " +
    "Unfortunately, some of the bleeding hearts among our realm's lords are blocking a possible declaration of war. " +
    "Witless cowards with no stomach for blood.", "lord_mission_told_raid_caravan_to_start_war",
    [
  ]],
  
  [anyone|plyr,"lord_mission_told_raid_caravan_to_start_war", [], "You are right, {s65}, but what can we do?", "lord_mission_tell_raid_caravan_to_start_war_2",[]],
  [anyone|plyr,"lord_mission_told_raid_caravan_to_start_war", [], "I disagree, sir. It is better that there be peace.", "quest_raid_caravan_to_start_war_rejected_1",[]],
  
  [anyone,"lord_mission_tell_raid_caravan_to_start_war_2", [(quest_get_slot, ":quest_target_faction", "$random_quest_no", slot_quest_target_faction),
      (str_store_faction_name_link, s13, ":quest_target_faction"),
      (str_store_faction_name, s14, "$g_talk_troop_faction")],
    "Ah, 'tis good to hear someone who understands! " +
    "As a matter of fact, there is something we can do, {playername}. A little bit of provocation... " +
    "If one of our war parties managed to enter their territory and pillage one of their caravans, or raided one of their villages, " +
    "and perhaps left behind a little token or two of the {s14}, " +
    "they would have ample cause to declare war on us. " +
    "And then, well, even the cowards among us must rise to defend themselves. " +
    "So what do you say? Are you interested?", "lord_mission_tell_raid_caravan_to_start_war_3",[]],
  
  [anyone|plyr,"lord_mission_tell_raid_caravan_to_start_war_3", [], "An excellent plan. Count me in.", "quest_raid_caravan_to_start_war_accepted",[]],
  [anyone|plyr,"lord_mission_tell_raid_caravan_to_start_war_3", [], "Why don't you do that yourself?", "lord_mission_tell_raid_caravan_to_start_war_4",[]],
  
  [anyone,"lord_mission_tell_raid_caravan_to_start_war_4", [
    ], "Well, {playername}, some of the lords in our kingdom " +
    "won't like the idea of someone inciting a war without their consent. " +
    "They are already looking for an excuse to get at me. If I were to do this, they would make me pay for it dearly. " +
    "You, on the other hand, are young, well liked and daring, so you might just get away with it. " +
    "And of course, I will back you up and defend your actions against any potential opponents. " +
    "All in all, a few lords might be upset by your actions, but I am sure that you won't be bothered with that.", "lord_mission_tell_raid_caravan_to_start_war_5",[]],
  
  [anyone|plyr,"lord_mission_tell_raid_caravan_to_start_war_5", [], "That seems reasonable. I am willing to do this.", "quest_raid_caravan_to_start_war_accepted",[]],
  [anyone|plyr,"lord_mission_tell_raid_caravan_to_start_war_5", [], "I don't like this. Find yourself someone else to take the blame for your schemes.", "quest_raid_caravan_to_start_war_rejected_2",[]],
  
  [anyone,"quest_raid_caravan_to_start_war_accepted", [], "Very good! " +
    "A raid on a caravan, or, if you can't manage that, an attack on one of their villages, should do the trick. " +
    "Now, good luck and good hunting. Go set the borders aflame!", "close_window",
    [
      (quest_get_slot, ":quest_target_faction", "$random_quest_no", slot_quest_target_faction),
      (quest_get_slot, ":quest_target_amount", "$random_quest_no", slot_quest_target_amount),
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_faction_name_link, s13, ":quest_target_faction"),
      (assign, reg13, ":quest_target_amount"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "str_s9_asked_you_to_attack_a_village_or_some_caravans_as_to_provoke_a_war_with_s13"),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",5),
      (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone,"quest_raid_caravan_to_start_war_rejected_1", [], "Ah, you think so? But how long will your precious peace last? Not long, believe me.", "lord_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
  [anyone,"quest_raid_caravan_to_start_war_rejected_2", [], "Hm. As you wish, {playername}. " +
    "I thought you had some fire in you, but it seems I was wrong.", "lord_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
  
  
  
  
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_bring_back_runaway_serfs")],
    "Well, some of the serfs working my fields in {s4} have run away. The ungrateful swine, " +
    "I let them plough my fields and rent my cottages, and this is how they repay me! " +
    "From what I've been hearing, they're running to {s3} as fast as they can, " +
    "and have split up into three groups to try and avoid capture. " +
    "I want you to capture all three groups and fetch them back to {s4} by whatever means necessary. " +
    "I should really have them hanged for attempting to escape, but we need hands for the upcoming harvest, " +
    "so I'll let them go off this time with a good beating.", "lord_mission_told",
    [
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (quest_get_slot, ":quest_object_center", "$random_quest_no", slot_quest_object_center),
      
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_party_name_link, s3, ":quest_target_center"),
      (str_store_party_name_link, s4, ":quest_object_center"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "str_s9_asked_you_to_catch_the_three_groups_of_runaway_serfs_and_bring_them_back_to_s4_alive_and_breathing_he_said_that_all_three_groups_are_heading_towards_s3"),
  ]],
  
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_follow_spy")],
    "I have good information that a man in this very town is actually an enemy spy. " +
    "He should be seized and hanged for his impudence, " +
    "but we also believe that very soon he will leave town to meet with his master, " +
    "the man to whom the spy feeds all his little whispers. " +
    "The spy himself is of little import, but the master is a dangerous man, and could tell us a great deal " +
    "if we could only get our hands on him...", "lord_tell_mission_follow_spy",[]],
  [anyone,"lord_tell_mission_follow_spy", [],
    "I want you to wait here until the spy leaves town. Then you must follow him, stealthily, to the meeting place. " +
    "You must take absolute care not to be seen by the spy on your way; else he may suspect foul play and turn back. " +
    "When the master appears, you must ambush and arrest them and bring the pair back to me. " +
    "Alive, if you please.", "lord_tell_mission_follow_spy_2",
    [
  ]],
  
  [anyone|plyr, "lord_tell_mission_follow_spy_2", [],
    "I'll do it, {s65}.", "lord_tell_mission_follow_spy_accepted", []],
  [anyone|plyr, "lord_tell_mission_follow_spy_2", [],
    "No, this skulking is not for me.", "lord_tell_mission_follow_spy_rejected", []],
  
  
  [anyone,"lord_tell_mission_follow_spy_accepted", [],
    "Good, I'm sure you'll do a fine job of it. One of my men will point the spy out to you when he leaves, " +
    "so you will know the man to follow. Remember, I want them both, and I want them alive.", "close_window",
    [
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_party_name_link, s12, "$g_encountered_party"),
      (setup_quest_text, "$random_quest_no"),
      (str_store_string, s2, "@{s11} asked you to follow the spy that will leave {s12}. Be careful not to let the spy see you on the way, or he may get suspicious and turn back. Once the spy meets with his accomplice, you are to capture them and bring them back to {s11}."),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      #TODO: Change this value
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      
      (spawn_around_party, "p_main_party", "pt_spy_partners"),
      (assign, "$qst_follow_spy_spy_partners_party", reg0),
      (party_set_position, "$qst_follow_spy_spy_partners_party", pos63),
      (party_set_ai_behavior, "$qst_follow_spy_spy_partners_party", ai_bhvr_hold),
      (party_set_flags, "$qst_follow_spy_spy_partners_party", pf_default_behavior, 0),
      (set_spawn_radius, 0),
      (spawn_around_party, "$g_encountered_party", "pt_spy"),
      (assign, "$qst_follow_spy_spy_party", reg0),
      (party_set_ai_behavior, "$qst_follow_spy_spy_party", ai_bhvr_travel_to_party),
      (party_set_ai_object, "$qst_follow_spy_spy_party", "$qst_follow_spy_spy_partners_party"),
      (party_set_flags, "$qst_follow_spy_spy_party", pf_default_behavior, 0),
      (assign, "$g_leave_town", 1),
      (rest_for_hours, 2, 4, 0),
      #no need to set g_leave_encounter to 1 since this quest can only be given at a town
  ]],
  
  [anyone,"lord_tell_mission_follow_spy_rejected", [],
    "A shame. Well, carry on as you were, {playername}...", "lord_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
  
  
  
  
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_capture_enemy_hero")],
    "There is a difficult job I need done, {playername}, and you may be the {reg59?one:man} who can carry it off. " +
    "I need someone to capture one of the noble lords of the {s13} and bring him to me. " +
    "Afterwards, I'll be able to exchange him in return for a relative of mine held by the {s13}. " +
    "It is a simple enough job, but whomever you choose will be guarded by an elite band of personal retainers. " +
    "Are you up for a fight?", "lord_tell_mission_capture_enemy_hero",
    [
      (quest_get_slot, ":quest_target_faction", "$random_quest_no", slot_quest_target_faction),
      (str_store_faction_name, s13, ":quest_target_faction"),
  ]],
  
  [anyone|plyr, "lord_tell_mission_capture_enemy_hero", [],
    "Consider it done, {s65}.", "lord_tell_mission_capture_enemy_hero_accepted", []],
  [anyone|plyr, "lord_tell_mission_capture_enemy_hero", [],
    "I must refuse, {s65}. I am not a kidnapper.", "lord_tell_mission_capture_enemy_hero_rejected", []],
  
  [anyone,"lord_tell_mission_capture_enemy_hero_accepted", [],
    "I like your spirit! Go and bring me one of our enemies, " +
    "and I'll toast your name in my hall when you return! And reward you for your efforts, of course...", "close_window",
    [
      (quest_get_slot, ":quest_target_faction", "$random_quest_no", slot_quest_target_faction),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_faction_name_link, s13, ":quest_target_faction"),
      (setup_quest_text, "$random_quest_no"),
      (str_store_string, s2, "@{s11} asked you to capture a lord from the {s13}, any lord, and then drag your victim back to {s11} for safekeeping."),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      #TODO: Change this value
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone,"lord_tell_mission_capture_enemy_hero_rejected", [],
    "Clearly, you lack the mettle I had thought you possessed. Very well, {playername}, I will find someone else.", "lord_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 10)]],
  
  
  
  
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_lend_companion")],
    "I don't have a job for you right now, but your companion {s3} is a skilled {reg3?lass:fellow}, " +
    "and I need someone with {reg3?her:his} talents. Will you lend {reg3?her:him} to me for a while?", "lord_tell_mission_lend_companion",
    [
      (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
      (quest_get_slot, ":quest_target_amount", "$random_quest_no", slot_quest_target_amount),
      (val_add, ":quest_target_amount", 1),
      (assign, reg1, ":quest_target_amount"),
      (str_store_troop_name_link,s9,"$g_talk_troop"),
      (str_store_troop_name,s3,":quest_target_troop"),
      (setup_quest_text,"$random_quest_no"),
      (troop_get_type, reg3, ":quest_target_troop"),
      (val_mod, reg3, 2),
      (str_store_string, s2, "@{s9} asked you to lend your companion {s3} to him for a week."),
  ]],
  [anyone|plyr,"lord_tell_mission_lend_companion", [],
    "How long will you need {reg3?her:him}?", "lord_tell_mission_lend_companion_2", []],
  [anyone,"lord_tell_mission_lend_companion_2", [],
    "Just a few days, a week at most.", "lord_mission_lend_companion_told", []],
  
  [anyone|plyr,"lord_mission_lend_companion_told",
    [(neq, "$campaign_type", camp_storyline),(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),(str_store_troop_name,s3,":quest_target_troop"),],
    "Then I will leave {s3} with you for one week.", "lord_tell_mission_lend_companion_accepted", []],
  [anyone|plyr,"lord_mission_lend_companion_told", [(quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
      (str_store_troop_name,s3,":quest_target_troop"),],
    "I am sorry, but I cannot do without {s3} for a whole week.", "lord_tell_mission_lend_companion_rejected", []],
  
  [anyone,"lord_tell_mission_lend_companion_accepted", [],
    "I cannot thank you enough, {playername}. Worry not, your companion shall be returned to you with due haste.", "close_window",
    [(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",5),
      (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
      (party_remove_members, "p_main_party", ":quest_target_troop", 1),
      (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone,"lord_tell_mission_lend_companion_rejected", [],
    "Well, that's damned unfortunate, but I suppose I cannot force you or {s3} to agree. " +
    "I shall have to make do without.", "lord_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
  
  
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_collect_debt")],
    "Some time ago, I loaned out a considerable sum of money to {s3}. {reg4} peningas, to be precise. " +
    "He was supposed to pay it back within a month but I haven't received a copper from him since. " +
    "That was months ago. If you could collect the debt from him on my behalf, " +
    "I would be grateful indeed. I would even let you keep one fifth of the money for your trouble. " +
    "What do you say?", "lord_tell_mission_collect_debt",
    [
      (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (quest_get_slot, reg4, "$random_quest_no", slot_quest_target_amount),
      (str_store_troop_name_link,s9,"$g_talk_troop"),
      (str_store_troop_name_link,s3,":quest_target_troop"),
      (str_store_party_name_link,s4,":quest_target_center"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s9} asked you to collect the debt of {reg4} peningas {s3} owes to him. {s3} was at {s4} when you were given this quest."),
  ]],
  [anyone|plyr,"lord_tell_mission_collect_debt", [],
    "Do you know where I can find {s3}, {s65}?", "lord_tell_mission_collect_debt_2", []],
  [anyone,"lord_tell_mission_collect_debt_2", [],
    "If you leave now, you should be able to find him at {s4}. " +
    "I've no doubt that he will be suitably embarrassed by his conduct and give you all the money he owes me.", "lord_tell_mission_collect_debt_3", []],
  [anyone|plyr,"lord_tell_mission_collect_debt_3", [], "Then I will talk to {s3} on your behalf.", "lord_tell_mission_collect_debt_accepted", []],
  [anyone|plyr,"lord_tell_mission_collect_debt_3", [], "Forgive me, {s65}, but I doubt I would be more successful than you would.", "lord_tell_mission_collect_debt_rejected", []],
  
  [anyone,"lord_tell_mission_collect_debt_accepted", [], "You made me very happy by accepting this {playername}. Please, talk to {s3} and don't leave him without my money.", "close_window",
    [(call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop", 5),
      (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone,"lord_tell_mission_collect_debt_rejected", [], "Perhaps not, {playername}. I suppose I'm never getting that money back...", "lord_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1)]],
  
  ##
  ##  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_capture_conspirators")],
  ## "TODO: I want you to capture troops in {reg1} conspirator parties that plan to rebel against me and join {s3}.", "lord_mission_told",
  ##   [
  ##       (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
  ##       (assign, reg1, "$qst_capture_conspirators_num_parties_to_spawn"),
  ##       (str_store_troop_name_link,1,"$g_talk_troop"),
  ##       (str_store_party_name_link,2,"$g_encountered_party"),
  ##       (str_store_troop_name,3,":quest_target_troop"),
  ##       (setup_quest_text,"$random_quest_no"),
  ##       (try_begin),
  ##         (is_between, "$g_encountered_party", centers_begin, centers_end),
  ##         (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
  ##       (else_try),
  ##         (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
  ##       (try_end),
  ##    ]],
  ##
  ##
  ##  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_defend_nobles_against_peasants")],
  ## "TODO: I want you to defend {reg1} noble parties against peasants.", "lord_mission_told",
  ##   [
  ##       (assign, reg1, "$qst_defend_nobles_against_peasants_num_noble_parties_to_spawn"),
  ##       (str_store_troop_name_link,1,"$g_talk_troop"),
  ##       (str_store_party_name_link,2,"$g_encountered_party"),
  ##       (setup_quest_text,"$random_quest_no"),
  ##       (try_begin),
  ##         (is_between, "$g_encountered_party", centers_begin, centers_end),
  ##         (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
  ##       (else_try),
  ##         (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
  ##       (try_end),
  ##    ]],
  ##
  ##
  [anyone,"lord_tell_mission", [(eq, "$random_quest_no", "qst_incriminate_loyal_commander"),
      (quest_get_slot, ":quest_target_troop", "qst_incriminate_loyal_commander", slot_quest_target_troop),
      (quest_get_slot, ":quest_object_troop", "qst_incriminate_loyal_commander", slot_quest_object_troop),
      (quest_get_slot, ":quest_target_center", "qst_incriminate_loyal_commander", slot_quest_target_center),
      (str_store_troop_name_link, s13,":quest_target_troop"),
      (str_store_party_name_link, s14,":quest_target_center"),
      (str_store_troop_name_link, s15,":quest_object_troop"),
    ],
    "I tell you, that blubbering fool {s13} is not fit to rule {s14}. " +
    "God knows he would be divested of his lands in an instant were it not for one of his loyal vassals, {s15}. " +
    "As long as he has his vassal aiding him, it will be a difficult job beating him. " +
    "So I need to get {s15} out of the picture, and I have a plan just to do that... " +
    "With your help, naturally.", "lord_tell_mission_incriminate_commander",[]],
  
  [anyone|plyr,"lord_tell_mission_incriminate_commander", [], "{s66}, I am all ears.", "lord_tell_mission_incriminate_commander_2",[]],
  [anyone|plyr,"lord_tell_mission_incriminate_commander", [], "I don't wish to involve myself in anything dishonourable against {s15}.", "lord_tell_mission_incriminate_commander_rejected",[]],
  
  [anyone,"lord_tell_mission_incriminate_commander_rejected", [], "Dishonourable? Bah! " +
    "I was hoping I could count on you, {playername}, but you've shown me what a fool I was. " +
    "I shall have to find someone whose loyalty I can trust.", "lord_pretalk",
    [(call_script, "script_change_player_relation_with_troop","$g_talk_troop",-5),
      (call_script, "script_change_player_honor", 2)]],
  
  [anyone,"lord_tell_mission_incriminate_commander_2", [], "I have written a fake letter to {s15}, " +
    "bearing my own seal, which implicates him in a conspiracy with us to stage a coup in {s14}, in my favour. " +
    "If we can make {s13} believe the letter is genuine, he will deal with {s15} very swiftly. " +
    "Of course, the challenge there is to convince {s13} that the letter is indeed real...", "lord_tell_mission_incriminate_commander_3",[]],
  
  [anyone|plyr,"lord_tell_mission_incriminate_commander_3", [], "Please continue, {s65}...", "lord_tell_mission_incriminate_commander_4",[]],
  [anyone|plyr,"lord_tell_mission_incriminate_commander_3", [], "No, I will not sully myself with this dishonourable scheme.", "lord_tell_mission_incriminate_commander_rejected",[]],
  
  [anyone,"lord_tell_mission_incriminate_commander_4", [], "This is where you come into play. " +
    "You'll take the letter to {s14}, then give it to one of your soldiers and instruct him to take it to {s15}. " +
    "I will have one of my spies inform the town garrison so that your man will be arrested on his way. " +
    "The guards will then find the letter and take it to {s13}. " +
    "They'll torture your man, of course, to try and get the truth out of him, " +
    "but all he knows is that you ordered the letter to be delivered to {s15} under the utmost secrecy. " +
    "{s13} knows you serve me, and the fool will certainly believe the whole charade.", "lord_tell_mission_incriminate_commander_5",[]],
  
  [anyone|plyr,"lord_tell_mission_incriminate_commander_5", [], "Is that all?", "lord_tell_mission_incriminate_commander_7",[]],
  [anyone,"lord_tell_mission_incriminate_commander_7", [(str_store_troop_name, s8, "$incriminate_quest_sacrificed_troop"),
      (str_store_troop_name_plural, s9, "$incriminate_quest_sacrificed_troop"),
    ], "There is one more thing... " +
    "Your messenger must be someone trustworthy. If you sent the letter with a simple peasant, someone expendable, " +
    "{s13} might suspect a plot. He may have the wits of a snail, but even a snail can see the obvious. " +
    "Give the letter to someone of rank. One of your {s9}, perhaps.", "lord_tell_mission_incriminate_commander_8",[]],
  [anyone|plyr,"lord_tell_mission_incriminate_commander_8", [], "What? I can't send one of my trusted {s9} to his death!", "lord_tell_mission_incriminate_commander_9",[]],
  [anyone|plyr,"lord_tell_mission_incriminate_commander_8", [], "Then a {s8} it will be.", "lord_tell_mission_incriminate_commander_fin",[]],
  [anyone,"lord_tell_mission_incriminate_commander_9", [], "Come now, {playername}. " +
    "There is a place for sentimentality, but this is not it. Believe me, you shall be generously compensated, " +
    "and what is the purpose of soldiers if not to die at our say-so?", "lord_tell_mission_incriminate_commander_10",[]],
  [anyone|plyr,"lord_tell_mission_incriminate_commander_10", [], "A {s8} it is.", "lord_tell_mission_incriminate_commander_fin",[]],
  [anyone|plyr,"lord_tell_mission_incriminate_commander_10", [], "No, I'll not sacrifice one of my chosen men.", "lord_tell_mission_incriminate_commander_rejected",[]],
  
  [anyone,"lord_tell_mission_incriminate_commander_fin", [], "I can't tell you how pleased I am to hear that, " +
    "{playername}. You are removing one of the greatest obstacles in my path. " +
    "Here is the letter, as well as 500 peningas for your expenses. " +
    "Remember, there'll be more once you succeed. Much, much more...", "lord_pretalk",
    [
      (quest_get_slot, ":quest_target_troop", "qst_incriminate_loyal_commander", slot_quest_target_troop),
      (quest_get_slot, ":quest_object_troop", "qst_incriminate_loyal_commander", slot_quest_object_troop),
      (quest_get_slot, ":quest_target_center", "qst_incriminate_loyal_commander", slot_quest_target_center),
      (call_script, "script_troop_add_gold", "trp_player", 500),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",10),
      (str_store_troop_name_link, s11,"$g_talk_troop"),
      (str_store_troop_name_link, s13,":quest_target_troop"),
      (str_store_party_name_link, s14,":quest_target_center"),
      (str_store_troop_name_plural, s15,"$incriminate_quest_sacrificed_troop"),
      (str_store_troop_name_link, s16,":quest_object_troop"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s11} gave you a fake letter to fool {s13} into banishing his vassal {s16}. " +
        "You are to go near {s14}, give the letter to one of your {s15} and send him into the town as a messenger, " +
      "believing his orders to be genuine."),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
  ]],
  
  [anyone,"lord_tell_mission", [(eq,"$random_quest_no","qst_capture_prisoners")],
    "A group of my soldiers was captured in a recent skirmish with the enemy. " +
    "Thankfully, we have a mutual agreement of prisoner exchange, and they will release my men, " +
    "but they want us to give them prisoners of equal rank and number. Prisoners I don't currently have. " +
    "So, I need a good {reg59?warrior:man} to find me {reg1} {s3} as prisoners, that I may exchange them.", "lord_mission_told",
    [
      (quest_get_slot, ":quest_target_troop", "qst_capture_prisoners", slot_quest_target_troop),
      (quest_get_slot, ":quest_target_amount", "qst_capture_prisoners", slot_quest_target_amount),
      (assign,reg1,":quest_target_amount"),
      (str_store_troop_name_link,s9,"$g_talk_troop"),
      (str_store_troop_name_by_count,s3,":quest_target_troop",":quest_target_amount"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s9} has requested you to bring him {reg1} {s3} as prisoners."),
  ]],
  
  
  [anyone,"lord_tell_mission", [], "No, {playername}, I do not need your help at this time.", "lord_pretalk",[
    (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
  ]],
  
  
  [anyone|plyr,"lord_mission_told", [], "You can count on me, {s65}.", "lord_mission_accepted",[]],
  [anyone|plyr,"lord_mission_told", [], "I fear I cannot accept such a mission at the moment.", "lord_mission_rejected",[]],
  
  [anyone,"lord_mission_accepted", [], "Excellent, {playername}, excellent. I have every confidence in you.", "close_window",
    [(assign, "$g_leave_encounter",1),
      (try_begin),
        (eq, "$random_quest_no", "qst_blank_quest_2"),
        (troop_join, "trp_sacerdote_1"),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
      (else_try),
        (eq, "$random_quest_no", "qst_escort_lady"),
        (quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
        (troop_set_slot, ":quest_object_troop", slot_troop_cur_center, 0),
        (troop_join, ":quest_object_troop"),
      (else_try),
        (eq, "$random_quest_no", "qst_deliver_message_to_enemy_lord"),
        (try_begin),
          (neq, "$campaign_type", camp_storyline),
          (call_script, "script_troop_add_gold", "trp_player", 10),
        (else_try),
          (call_script, "script_troop_add_gold", "trp_player", 100),
        (try_end),
      (else_try),
        (eq, "$random_quest_no", "qst_bring_back_runaway_serfs"),
        (quest_get_slot, ":quest_giver_center", "$random_quest_no", slot_quest_giver_center),
        (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
        (quest_get_slot, ":quest_target_party_template", "$random_quest_no", slot_quest_target_party_template),
        
        (set_spawn_radius, 3),
        (spawn_around_party,":quest_giver_center",":quest_target_party_template"),
        (assign, "$qst_bring_back_runaway_serfs_party_1", reg0),
        (party_set_ai_behavior,"$qst_bring_back_runaway_serfs_party_1",ai_bhvr_travel_to_party),
        (party_set_ai_object,"$qst_bring_back_runaway_serfs_party_1",":quest_target_center"),
        (party_set_flags, "$qst_bring_back_runaway_serfs_party_1", pf_default_behavior, 0),
        (spawn_around_party,":quest_giver_center",":quest_target_party_template"),
        (assign, "$qst_bring_back_runaway_serfs_party_2", reg0),
        (party_set_ai_behavior,"$qst_bring_back_runaway_serfs_party_2",ai_bhvr_travel_to_party),
        (party_set_ai_object,"$qst_bring_back_runaway_serfs_party_2",":quest_target_center"),
        (party_set_flags, "$qst_bring_back_runaway_serfs_party_2", pf_default_behavior, 0),
        (spawn_around_party,":quest_giver_center",":quest_target_party_template"),
        (assign, "$qst_bring_back_runaway_serfs_party_3", reg0),
        (party_set_ai_behavior,"$qst_bring_back_runaway_serfs_party_3",ai_bhvr_travel_to_party),
        (party_set_ai_object,"$qst_bring_back_runaway_serfs_party_3",":quest_target_center"),
        (party_set_flags, "$qst_bring_back_runaway_serfs_party_3", pf_default_behavior, 0),
        (rest_for_hours, 1, 4),
      (try_end),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (try_begin),
        (eq, "$random_quest_no", "qst_lend_surgeon"),
        (assign, "$g_leave_town_outside", 1),
        (assign,"$auto_enter_town","$g_encountered_party"),
        (rest_for_hours, 4),
        (assign, "$lord_requested_to_talk_to", "$g_talk_troop"),
      (try_end),
  ]],
  
  [anyone,"lord_mission_rejected", [], "Is that so? Well, I suppose you're just not up to the task. " +
    "I shall have to look for somebody with more mettle.", "close_window",
    [(assign, "$g_leave_encounter",1),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (try_begin),
        (quest_slot_eq, "$random_quest_no", slot_quest_dont_give_again_remaining_days, 0),
        (quest_set_slot, "$random_quest_no", slot_quest_dont_give_again_remaining_days, 1),
      (try_end),
      (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
  ]],
  
  
  ##### TODO: QUESTS COMMENT OUT END
  
  #Leave
  [anyone|plyr,"lord_talk",
    [
      (troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      ], "I must leave now.", "lord_leave_prison",[]],
  
  [anyone|plyr,"lord_talk",
    [
      (troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
    ], "You are free to go.", "prisoner_freeoption",
    [
      (call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
      (troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, -1),
      (troop_set_slot, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (call_script, "script_change_player_honor", 3),
      (call_script, "script_add_log_entry", logent_lord_defeated_but_let_go_by_player, "trp_player",  -1, "$g_talk_troop", "$g_talk_troop_faction"),
  ]],
  [anyone,"prisoner_freeoption", [],
    "{!}{s43}", "close_window", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_prisoner_released_default"),
      (party_remove_prisoners, "$current_town", "$g_talk_troop",1),
      (call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle"),
  ]],
  
  [anyone|plyr,"lord_talk",
    [
      (troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
      (troop_get_slot, ":tor", "$g_talk_troop", slot_troop_tortured),
      (gt, ":tor", 0),
      ], "I have some propositions for you.", "lord_offer_smth",[]],
  
  [anyone, "lord_offer_smth",[], "What propositions, you bloody lowlife?","lord_offer_smth1", []],
  
  [anyone|plyr,"lord_offer_smth1", [], "Never mind. You have nothing that I want.", "lord_pretalk",[]],
  
  [anyone|plyr,"lord_offer_smth1", [
      (troop_get_type, ":troop_type", "$g_talk_troop"),
      (val_mod, ":troop_type", 2),
      (eq, ":troop_type", reg59),
      (troop_get_slot, ":spouse", "$g_talk_troop", slot_troop_spouse),
      (gt, ":spouse", 0),
      (troop_slot_eq, "$g_talk_troop", slot_troop_religion, 2),#pagan
      (str_store_troop_name, s33, ":spouse"),
      (assign, "$temp3", ":spouse"),
      ], "I feel a lot of admiration for your spouse, {s33}. I see a divorce in your future...", "lord_offer_smth2a",[]],
  
  [anyone|plyr,"lord_offer_smth1", [
      (eq,reg59,tf_male),
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
      (assign, ":wedding", -1),
      (try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
        (troop_get_slot, ":guardian", ":lady", slot_troop_guardian),
        (eq, ":guardian", "$g_talk_troop"),
        (troop_get_slot, ":spouse", ":lady", slot_troop_spouse),
        (lt, ":spouse", 0),
        (assign, ":wedding", ":lady"),
      (try_end),
      (gt, ":wedding", 0),
      (str_store_troop_name, s33, ":wedding"),
      (call_script, "script_troop_get_family_relation_to_troop",  ":wedding", "$g_talk_troop"),
      (assign, "$temp_2", ":wedding"),
      ], "Let me court your {s11}, {s33}, or else...", "lord_offer_smth2b",[]],
  
  [anyone|plyr,"lord_offer_smth1", [
      (eq,reg59,tf_male),
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
      (ge, "$g_talk_troop_relation", 30),
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_refused, 0),
      (assign, ":wedding", -1),
      (try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
        (troop_get_slot, ":guardian", ":lady", slot_troop_guardian),
        (eq, ":guardian", "$g_talk_troop"),
        (troop_get_slot, ":spouse", ":lady", slot_troop_spouse),
        (lt, ":spouse", 0),
        (assign, ":wedding", ":lady"),
      (try_end),
      (gt, ":wedding", 0),
      (str_store_troop_name, s33, ":wedding"),
      (call_script, "script_troop_get_family_relation_to_troop",  ":wedding", "$g_talk_troop"),
      (assign, "$temp_2", ":wedding"),
      ], "I will set you free if you allow me to court your {s11}, {s33}.", "lord_offer_smth1bb",[]],
  
  [anyone, "lord_offer_smth1bb", [
    (troop_slot_ge, "trp_player", slot_troop_renown, 450),
    (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
    (gt, ":persuasion", 6),
    (store_random_in_range, ":rand", 0, 100),
    (lt, ":rand", 10),
  ], "I suppose I can live with that.", "close_window",[
    (call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
    (party_remove_prisoners, "$current_town", "$g_talk_troop", 1),
    (troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, -1),
    (troop_set_slot, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
    (call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle"),
  ]],
  
  [anyone, "lord_offer_smth1bb",[], "I think you are plain crazy to offer me something like that!", "lord_talk",[(troop_set_slot, "$g_talk_troop", slot_troop_refused, 1),]],
  
  [anyone|plyr, "lord_offer_smth1",
    [	(assign, ":place", 0),
      (try_for_range, ":fief", centers_begin, centers_end),
        (party_get_slot, ":owner", ":fief", slot_town_lord),
        (eq, ":owner", "$g_talk_troop"),
        (val_add, ":place", 1),
      (try_end),
      (gt, ":place", 0),], "Would you mind if I collect some of the taxes from one of your fiefs for a while?", "lord_offer_smth1a",[]],
  
  [anyone, "lord_offer_smth1a",[],"Well, that would depend. Which one do you have in mind?", "lord_offer_smth1b",[]],
  
  [anyone|plyr|repeat_for_parties,"lord_offer_smth1b",
    [ (store_repeat_object, ":fief"),
      (is_between, ":fief", centers_begin, centers_end),
      (party_get_slot, ":owner", ":fief", slot_town_lord),
      (eq, ":owner", "$g_talk_troop"),
      (str_store_party_name, s4, ":fief"),
      ], "{!}{s4}", "lord_offer_smth2c",[(store_repeat_object, "$temp")]],
  
  [anyone|plyr, "lord_offer_smth1b", [],"Never mind.", "lord_pretalk",[]],
  
  
  [anyone, "lord_offer_smth2c",[
      (troop_get_slot, ":tor", "$g_talk_troop", slot_troop_tortured),
      (gt, ":tor", 16),
      (assign, ":diff", 0),
      (try_begin),
        (is_between, "$temp", villages_begin, villages_end),
        (assign, ":diff", 100),
      (else_try),
        (is_between, "$temp", castles_begin, castles_end),
        (assign, ":diff", 200),
      (else_try),
        (is_between, "$temp", towns_begin, towns_end),
        (assign, ":diff", 400),
      (try_end),
      (store_skill_level, ":player_power_strike", "skl_power_strike", "trp_player"),
      (store_skill_level, ":player_pers", "skl_persuasion", "trp_player"),
      (store_attribute_level, ":charisma", "trp_player", ca_charisma),
      (val_sub, ":charisma", 12),
      (val_div, ":player_pers", 2),
      (store_add, ":mod", ":charisma",":player_pers"),
      (val_add, ":mod", ":player_power_strike"),
      
      (store_div, ":torr",":tor",7),
      (val_add, ":mod", ":torr"),
      (store_random_in_range, ":rand", 1, ":diff"),
      (lt, ":rand", ":mod"),
      (str_store_party_name, s33, "$temp"),],"I suppose, if you set me free, I can allow you to collect half the rents from {s33} for about four weeks.", "lord_offer_smth3c", []],
  
  [anyone,  "lord_offer_smth2c",[],"I think you're out of your mind. I prefer the comforts here, small though they be, to paying such a price.", "lord_talk", [(troop_get_slot, ":tor", "$g_talk_troop", slot_troop_tortured),
      (val_sub, ":tor", 3),
      (val_max, ":tor", 0),
      (troop_set_slot, "$g_talk_troop", slot_troop_tortured, ":tor"),
  ]],
  
  [anyone|plyr, "lord_offer_smth3c", [],"No, I had something else in mind.", "lord_pretalk",[]],
  
  [anyone|plyr, "lord_offer_smth3c", [],"Great! You're free to go.", "close_window",[
      (troop_get_slot, ":tor", "$g_talk_troop", slot_troop_tortured),
      (val_max, ":tor", 0),
      (troop_set_slot, "$g_talk_troop", slot_troop_tortured, ":tor"),
      (call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
      (troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, -1),
      #	(troop_set_slot, "$g_talk_troop", slot_troop_tortured, -1),
      (troop_set_slot, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (party_set_slot, "$temp", slot_center_racket, 4),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -20),
      (party_remove_prisoners, "$current_town", "$g_talk_troop",1),
      (call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle"),
  ]],
  
  [anyone,  "lord_offer_smth2a",[
    (troop_get_slot, ":tor", "$g_talk_troop", slot_troop_tortured),
    (gt, ":tor", 29),
    (store_skill_level, ":player_pers", "skl_persuasion", "trp_player"),
    (store_attribute_level, ":charisma", "trp_player", ca_charisma),
    (val_div, ":player_pers", 2),
    (store_add, ":mod",":player_pers",":charisma"),

    (store_div, ":torr",":tor",7),
    (val_add, ":mod", ":torr"),
    (store_random_in_range, ":rand", 7, 200),
    (lt, ":rand", ":mod"),
  ],"Ok, you win. I will get the divorce, but, remember, I will hunt you down like a dog!", "lord_offer_smth3a", []],
  
  [anyone,  "lord_offer_smth2a",[],"I think you're out of your mind. I love my spouse more than life itself.", "lord_talk", [(troop_get_slot, ":tor", "$g_talk_troop", slot_troop_tortured),
      (val_sub, ":tor", 5),
      (val_max, ":tor", 1),
      (troop_set_slot, "$g_talk_troop", slot_troop_tortured, ":tor"),
  ]],
  
  [anyone|plyr, "lord_offer_smth3a", [],"Actually, I don't need you to do that.", "lord_pretalk",[]],
  
  [anyone|plyr, "lord_offer_smth3a", [],"Great. You're free to go.", "close_window",[
      (troop_get_slot, ":tor", "$g_talk_troop", slot_troop_tortured),
      (val_max, ":tor", 1),
      (troop_set_slot, "$g_talk_troop", slot_troop_tortured, ":tor"),
      (call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
      (party_remove_prisoners, "$current_town", "$g_talk_troop",1),
      (troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, -1),
      #	(troop_set_slot, "$g_talk_troop", slot_troop_tortured, -1),
      (troop_set_slot, "$g_talk_troop", slot_troop_spouse, -1),
      (troop_set_slot, "$temp3", slot_troop_spouse, -1),
      (troop_set_slot, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (call_script, "script_change_player_honor", -5),
      (call_script, "script_change_troop_renown", "trp_player", 5),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -20),
      (call_script, "script_update_troop_notes", "$temp3"),
      (call_script, "script_update_troop_notes", "$g_talk_troop"),
      (call_script, "script_get_kingdom_lady_social_determinants", "$temp3"),
      (assign, ":guardian", reg0),
      (try_begin),
        (gt, ":guardian", -1),
      (else_try),
        (store_faction_of_troop, ":faction", "$temp3"),
        (faction_get_slot, ":king", ":faction", slot_faction_leader),
        (troop_set_slot, "$temp3", slot_troop_guardian, ":king"),
      (try_end),
      (call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle"),
  ]],
  
  [anyone,  "lord_offer_smth2b",[
      (troop_get_slot, ":tor", "$g_talk_troop", slot_troop_tortured),
      (gt, ":tor", 9),
      (store_skill_level, ":player_pers", "skl_persuasion", "trp_player"),
      (store_attribute_level, ":charisma", "trp_player", ca_charisma),
      (val_div, ":player_pers", 3),
      (troop_get_slot, ":renown", "trp_player",slot_troop_renown),
      (troop_get_slot, ":renown1","$g_talk_troop", slot_troop_renown),
      (val_sub, ":renown", ":renown1"),
      (val_div, ":renown", 10),
      (val_min, ":renown", 80),
      (store_add, ":mod",":player_pers",":charisma"),
      (val_add, ":mod", ":renown"),
      
      (store_div, ":torr",":tor",7),
      (val_add, ":mod", ":torr"),
      (gt, ":mod", 0),
      (store_random_in_range, ":rand", 2, 200),
      (lt, ":rand", ":mod"),
      (call_script, "script_troop_get_family_relation_to_troop",  "$temp_2", "$g_talk_troop"),
      (str_store_troop_name, s33, "$temp_2"),
      ],"Ok, you win. I give you permission to visit my {s11}, {s33}.", "lord_offer_smth3b", []],
  
  [anyone,  "lord_offer_smth2b",[],"I think you're out of your mind. I love her more than life itself.", "lord_talk", [(troop_get_slot, ":tor", "$g_talk_troop", slot_troop_tortured),
      (val_sub, ":tor", 4),
      (val_max, ":tor", 1),
      (troop_set_slot, "$g_talk_troop", slot_troop_tortured, ":tor"),
  ]],
  
  [anyone|plyr, "lord_offer_smth3b", [],"Actually, I don't want to do that.", "lord_pretalk",[]],
  
  [anyone|plyr, "lord_offer_smth3b", [],"Great. You're free to go.", "close_window",[
      (troop_get_slot, ":tor", "$g_talk_troop", slot_troop_tortured),
      (val_max, ":tor", 1),
      (troop_set_slot, "$g_talk_troop", slot_troop_tortured, ":tor"),
      (call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
      (troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, -1),
      (troop_set_slot, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
      (troop_set_slot, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (call_script, "script_change_player_honor", -3),
      (call_script, "script_change_troop_renown", "trp_player", 3),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (party_remove_prisoners, "$current_town", "$g_talk_troop",1),
      (call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle"),
  ]],
  
  
  [anyone|plyr,"lord_talk", [
      (lt, "$g_talk_troop_faction_kingdom_relation", 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
    ], "This audience is over. I leave now.", "lord_leave",[]],
  
  [anyone|plyr,"lord_talk", [
      (ge, "$g_talk_troop_faction_kingdom_relation", 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
    ], "I must beg my leave.", "lord_leave",[]],
  
  [anyone,"lord_leave", [
      (lt, "$g_talk_troop_faction_kingdom_relation", 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (store_partner_quest,":enemy_lord_quest"),
      (lt, ":enemy_lord_quest", 0),
      (troop_slot_eq, "$g_talk_troop", slot_troop_does_not_give_quest, 0),
      (call_script, "script_get_quest", "$g_talk_troop"),
      (assign, "$random_quest_no", reg0),
      (ge, "$random_quest_no", 0),
      (this_or_next|eq, "$random_quest_no", "qst_lend_surgeon"), #so far only for quest lend surgeon
      (eq, 2, 1),
    ],
    "Before you go, {playername}, I have something to ask of you... We may be enemies in this war, " +
    "but I pray that you believe, as I do, that we can still be civil towards each other. " +
    "Thus, I hoped that you would be kind enough to assist me in something important to me.", "lord_leave_give_quest",[]],
  
  [anyone|plyr,"lord_leave_give_quest", [],
    "I am listening.", "enemy_lord_tell_mission",[]],
  
  
  [anyone,"enemy_lord_tell_mission", [(eq,"$random_quest_no","qst_lend_surgeon")],
    "I have a friend here, an old warrior, who is very sick. Pestilence has infected an old battle wound. " +
    "Unless a surgeon sees him soon, he will surely die. This man is dear to me, {playername}, " +
    "but he's also stubborn as a hog and refuses to have anyone look at his injury because he doesn't trust the physicians here. " +
    "I have heard that you've a capable surgeon with you. If you would let your surgeon come here and have a look, " +
    "{reg3?she:he} may be able to convince him to give his consent to an operation. " +
    "Please, I will be deeply indebted to you if you grant me this request.", "lord_mission_told",
    [
      (quest_get_slot, ":quest_object_troop", "$random_quest_no", slot_quest_object_troop),
      (str_store_troop_name_link,1,"$g_talk_troop"),
      ##     (str_store_party_name,2,"$g_encountered_party"),
      (str_store_troop_name,3,":quest_object_troop"),
      (troop_get_type, reg3, ":quest_object_troop"),
      (val_mod, reg3, 2),
      (setup_quest_text,"$random_quest_no"),
      ##     (try_begin),
      ##       (is_between, "$g_encountered_party", centers_begin, centers_end),
      ##       (setup_quest_giver, "$random_quest_no", "str_given_by_s1_at_s2"),
      ##     (else_try),
      ##       (setup_quest_giver,"$random_quest_no", "str_given_by_s1_in_wilderness"),
      ##     (try_end),
      (str_store_string, s2, "@Lend your experienced surgeon {s3} to {s1}."),
  ]],
  
  [anyone,"enemy_lord_tell_mission", [(str_store_quest_name, s7, "$random_quest_no")],
    "{!}ERROR: MATCHED WITH QUEST: {s7}.", "close_window",
    []],
  
  [anyone,"lord_leave_prison", [],
    "We'll meet again.", "close_window",[]],
  
  [anyone|auto_proceed,"lord_leave", [
      (troop_get_type, ":type", "trp_player"),
      (val_mod, ":type", 2),
      (eq, ":type", 1),
      (call_script, "script_troop_get_romantic_chemistry_with_troop", "trp_player", "$g_talk_troop"),
      (gt, reg0, 7),
      (ge, "$g_talk_troop_relation", 0),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_betrothed, active_npcs_begin),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_spouse, active_npcs_begin),
      (neg|troop_slot_ge, "trp_player", slot_troop_betrothed, active_npcs_begin),
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
      
      (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"),
      
    ],
    "Farewell, my lady. I shall remain your most ardent admirer.", "close_window",
    [(eq,"$talk_context",tc_party_encounter),
      (assign, "$g_leave_encounter", 1),(assign, "$option_switches", 0)]],
  
  
  [anyone|auto_proceed,"lord_leave", [(faction_slot_eq,"$g_talk_troop_faction",slot_faction_leader,"$g_talk_troop")],
    "Of course, {playername}. Farewell.", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),(assign, "$option_switches", 0),]],
  [anyone|auto_proceed,"lord_leave", [(ge,"$g_talk_troop_relation",10)],
    "Good journeys to you, {playername}.", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),(assign, "$option_switches", 0),]],
  [anyone|auto_proceed,"lord_leave", [(ge,"$g_talk_troop_relation",0),(ge, "$g_talk_troop_faction_relation", 0),(ge, "$g_talk_troop_faction_kingdom_relation", 0)],
    "Yes, yes. Farewell.", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),(assign, "$option_switches", 0),]],
  [anyone|auto_proceed,"lord_leave", [],
    "We will meet again.", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1),(assign, "$option_switches", 0),]],
  
  
  #Royal family members
  
  
  [anyone|plyr,"member_chat", [(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady)],
    "Are you enjoying the journey, {s65}?", "lady_journey_1",[]],
  [anyone,"lady_journey_1", [],
    "I am doing quite fine, {playername}. Thank you for your concern.", "close_window",[]],
  
  
  #Spouse
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      #    (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, "trp_player"),
      (troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
    ],
    "Yes, my husband?", "spouse_talk",[
  ]],
  
  [anyone|plyr,"spouse_talk",
    [
      (eq, "$g_player_minister", "$g_talk_troop"),
    ],
    "As you are my chief minister, I wish to speak to about affairs of state.", "minister_issues",[
  ]],
  
  [anyone|plyr,"spouse_talk", [
      (check_quest_active, "qst_offer_gift"),
      (quest_slot_eq, "qst_offer_gift", slot_quest_giver_troop, "$g_talk_troop"),
      
      (quest_get_slot, ":target_troop", "qst_offer_gift", slot_quest_target_troop),
      (str_store_troop_name, s4, ":target_troop"),
      (player_has_item, "itm_vc_furs"),
      (player_has_item, "itm_jewelry"),
    ],
    "I have acquired everything for {s4}'s gift.", "offer_gift_quest_complete",[
  ]],
  
  [anyone,"offer_gift_quest_complete", [
      (quest_get_slot, ":target_troop", "qst_offer_gift", slot_quest_target_troop),
      (troop_get_type, reg4, ":target_troop"),
      (val_mod, reg4, 2),
    ],
    "Ah, let me take those. I hope that this will mend the quarrel between you two. You may wish to speak to {reg4?her:him}, and see if I had any success.", "close_window",[
      (quest_set_slot, "qst_offer_gift", slot_quest_current_state, 2),
      (quest_set_slot, "qst_offer_gift", slot_quest_expiration_days, 365),
      (troop_remove_item, "trp_player", "itm_vc_furs"),
      (troop_remove_item, "trp_player", "itm_jewelry"),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone|plyr,"spouse_talk",
    [
      (assign, "$political_quest_to_cancel", -1),
      (try_begin),
        (check_quest_active, "qst_offer_gift"),
        (quest_slot_eq, "qst_offer_gift", slot_quest_giver_troop, "$g_talk_troop"),
        (assign, "$political_quest_to_cancel", "qst_offer_gift"),
        (str_store_string, s10, "str_offer_gift_description"),
      (else_try),
        (check_quest_active, "qst_resolve_dispute"),
        (quest_slot_eq, "qst_resolve_dispute", slot_quest_giver_troop, "$g_talk_troop"),
        (assign, "$political_quest_to_cancel", "qst_resolve_dispute"),
        (str_store_string, s10, "str_resolve_dispute_description"),
      (try_end),
      (gt, "$political_quest_to_cancel", 0),
    ],
    "Let's abandon our plan to {s10}.", "spouse_cancel_political_quest",[
  ]],
  
  [anyone,"spouse_cancel_political_quest",
    [],
    "Are you sure you want to drop that idea?", "spouse_cancel_political_quest_confirm",[
  ]],
  [anyone|plyr,"spouse_cancel_political_quest_confirm",
    [],
    "Yes, I am sure. Let's abandon that idea.", "spouse_pretalk",[
      (call_script, "script_abort_quest", "$political_quest_to_cancel", 1),
  ]],
  [anyone|plyr,"spouse_cancel_political_quest_confirm",
    [],
    "Actually, never mind.", "spouse_pretalk",[
  ]],
  
  
  
  [anyone|plyr,"spouse_talk",
    [],
    "Let us think of a way to improve our standing in this realm.", "combined_political_quests",[
      (call_script, "script_get_political_quest", "$g_talk_troop"),
      (assign, "$political_quest_found", reg0),
      (assign, "$political_quest_target_troop", reg1),
      (assign, "$political_quest_object_troop", reg2),
  ]],
  
  [anyone|plyr, "spouse_talk",
    [
      (neg|check_quest_active, "qst_organize_feast"),
      (troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
      (gt, ":spouse", 0),
      (troop_get_type, ":is_female", ":spouse"),
      (val_mod, ":is_female", 2),
      (eq, ":is_female", 1), #only women
    ],
    "I was thinking that perhaps we could host a feast.", "spouse_organize_feast",[
  ]],
  
  [anyone|plyr, "spouse_talk",
    [
    ],
    "Let us take inventory of our household possessions.", "spouse_household_possessions",[
      (change_screen_loot, "trp_household_possessions"),
  ]],
  
  [anyone, "spouse_household_possessions",
    [
    ],
    "Anyway, that is the content of our larder.", "spouse_pretalk",[
  ]],
  
  
  #chief tener hijos children empieza
  #Spouse Talk
  
  [anyone|plyr,"spouse_talk",
    [
      ],   "How are my offspring?","spouse_descendescia_reply",[]], #pregunta sobre descendencia
  
  
  [anyone,"spouse_descendescia_reply",
    [
      (ge,"$g_nino_varon",1),
      (eq,"$g_nina_chica",0),
      (assign, reg5, "$g_nino_varon"),
      (store_sub, reg3, reg5, 1),
      ],   "Your offspring grow healthy and strong. We have {reg3?{reg5} boys:one boy}.","spouse_descendescia_reply2",[]],
  [anyone,"spouse_descendescia_reply",
    [
      (eq,"$g_nino_varon",0),
      (ge,"$g_nina_chica",1),
      (assign, reg3, "$g_nina_chica"),
      (store_sub, reg5, reg3, 1),
      ],   "Your offspring grow healthy and strong. We have {reg5?{reg3} girls:one girl}.","spouse_descendescia_reply2",[]],
  [anyone,"spouse_descendescia_reply",
    [
      (ge,"$g_nino_varon",1),
      (ge,"$g_nina_chica",1),
      (assign, reg5, "$g_nino_varon"),
      (store_sub, reg4, reg5, 1),
      (assign, reg3, "$g_nina_chica"),
      (store_sub, reg2, reg3, 1),
      ],   "Your offspring grow healthy and strong. We have {reg4?{reg5} boys:one boy} and {reg2?{reg3} girls:one girl}.","spouse_descendescia_reply2",[]],
  
  [anyone,"spouse_descendescia_reply",
    [
      ],   "Your offspring? We don't have offspring.","spouse_pretalk",[]],
  
  [anyone|plyr,"spouse_descendescia_reply2",
    [
      ],   "Very well. Take care of them and make sure they lack for nothing.","spouse_pretalk",[]], #pregunta sobre descendencia
  
  
  [anyone|plyr,"spouse_talk",
    [
      (eq,"$g_spouse_embarazada",2),
      (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0),
      ],   "I have had a child!","spouse_show_hijo2",[]],
  
  [anyone, "spouse_show_hijo2",
    [        (str_clear, s4),
      ],"{!}{s4}", "spouse_show_hijo3",[
      (store_random_in_range, ":random", 1, 6),
      (try_begin),
        (le, ":random", 2),
        (str_store_string, s4, "@Oh, Dear! We have been given a boy!"),
        (val_add,"$g_nino_varon",1),
      (else_try),
        (le, ":random", 4),
        (str_store_string, s4, "@Oh, Dear! We have received a girl!"),
        (val_add,"$g_nina_chica",1),
      (else_try),
        (str_store_string, s4, "@Oh, Dear! Twins are bestowed upon us."),
        (val_add,"$g_nino_varon",1),
        (val_add,"$g_nina_chica",1),
      (try_end),
      
      (call_script, "script_change_player_party_morale", 55),
      (add_xp_as_reward, 1000),
      (assign,"$g_spouse_embarazada",1),
  ]],
  
  
  [anyone|plyr,"spouse_show_hijo3",
    [
      ],   "I am so happy!","spouse_pretalk",[]],
  [anyone|plyr,"spouse_show_hijo3",
    [
      ],   "Very well.","spouse_pretalk",[]],
  
  
  [anyone|plyr,"spouse_talk",
    [
      (eq,"$g_spouse_embarazada",2),
      (troop_get_slot, ":days_on_pregnant","$g_talk_troop", slot_troop_days_on_mission),
      (ge, ":days_on_pregnant", 1),
      # (str_store_troop_name,s67,"$g_talk_troop"),
      ],   "How does the mother of my child fare?","spouse_show_hijo",[]],
  
  [anyone, "spouse_show_hijo",
    [],"{!}{s4}", "spouse_pretalk",[
      (str_store_string, s11, "@Oh dear {playername}, I'm so tired. (She smiles at you). Be patient, for the child must be carried for nine months."),
      (str_store_string, s12, "@I'm thinking of a name for the child. If we have a boy, his name will be {playername}, but if we have a girl, her name will be like mine."),
      (str_store_string, s13, "@I'm fine. I will not pay any attention to the banter of the servants. The child isn't the son of our swineherd."),
      (store_random_in_range, ":random", 11, 14),
      (str_store_string_reg, s4, ":random"),
  ]],
  
  
  [anyone|plyr,"spouse_talk",
    [  (is_between, "$g_talk_troop", "trp_knight_1_1_wife", "trp_heroes_end"),
      (eq,"$g_spouse_embarazada",0),
      ],   "I want to show love to my spouse.","spouse_action_h1",[]],
  
  [anyone, "spouse_action_h1",
    [],
    "Of course! What did you have in mind?","spouse_action_h2",[]],
  
  [anyone|plyr, "spouse_action_h2",
    [
      (store_troop_gold,":gold","trp_player"),
      (ge,":gold",3000),
      ],   "A romantic meal and what follows after.","spouse_action_h3",[]],
  
  [anyone|plyr, "spouse_action_h2",[
      (store_troop_gold,":gold","trp_player"),
      (ge,":gold",2000),
      ],"I want to give this beautiful ring, this gold bracelet and this necklace to my wife (2.000 peningas)","spouse_regalocasual",
    [
      (troop_remove_gold,"trp_player",2000),
      (call_script,"script_change_player_relation_with_troop","$g_talk_troop",2),
      (assign,"$g_spouse_embarazada",1), #no embarazada
  ]],
  
  [anyone|plyr, "spouse_action_h2",[],"Actually, I've changed my mind","close_window",
    []],
  
  [anyone, "spouse_regalocasual",
    [],   "Oh, {playername}! You're so generous.","close_window",
    []
  ],
  
  [anyone, "spouse_action_h3",
    [    (ge,"$g_talk_troop_relation",70),
    ],   "I look forward to that, {playername}. I will let the servants buy horse meat and wine. I love being a mother.","spouse_nocheloca",
    [
      (call_script,"script_change_player_relation_with_troop","$g_talk_troop",6),
      (troop_remove_gold,"trp_player",3000),
      #  (assign,"$g_spouse_hijo",1),
    ]
  ],
  
  [anyone, "spouse_action_h3",
    [    (ge,"$g_talk_troop_relation",30),
    ],   "I would like that. I will let the servants buy a chicken and mead, but it is not time to have a child. First, we need to know each other better.","spouse_nocheloca_2",
    [
      (call_script,"script_change_player_relation_with_troop","$g_talk_troop",5),
      (troop_remove_gold,"trp_player",1000),
    ]
  ],
  
  [anyone, "spouse_action_h3",
    [    (ge,"$g_talk_troop_relation",10),
      ],   "Is that some sort of a joke? I'm too young.^^[You need to improve relation with your wife.]","close_window",
    [
      (assign,"$g_spouse_embarazada",1), #no embarazada
    ]
  ],
  
  [anyone, "spouse_action_h3",
    [    (ge,"$g_talk_troop_relation",0),
      ],   "I am so tired today.^^[You need to improve relation with your wife.]","close_window",
    [
      (assign,"$g_spouse_embarazada",1), #no embarazada
    ]
  ],
  
  [anyone, "spouse_action_h3",
    [
      ],   "Ha! some other day.^^[You need to improve relation with your wife.]","close_window",
    [
      (assign,"$g_spouse_embarazada",1), #no embarazada
    ]
  ],
  
  [anyone, "spouse_nocheloca",
    [
      ],   "[You eat dinner in the company of your wife. You both get to know one another a little better.^" +
    "Finally, your wife takes your hand and leads you to the bedroom.]","spouse_action_h4",
    [
    ]
  ],
  
  [anyone, "spouse_action_h4",
    [
      ],   "[Time flies away from war, fear and the rigors of travel... In nine months, you will have a child.]","close_window",
    [
      (add_xp_as_reward, 15),
      (call_script,"script_change_player_relation_with_troop","$g_talk_troop",5),
      (display_message, "@Time flies away from war, fear and the rigors of travel... In nine months, you will have a child."),
      (assign,"$g_spouse_embarazada",2),   #embarazada
      (troop_set_slot, "$g_talk_troop", slot_troop_days_on_mission, 250), #250 days to left
    ]
  ],
  
  [anyone, "spouse_nocheloca_2",
    [
      ],   "[You eat dinner in the company of your wife. You both get to know one another a little better. " +
    "When the evening ends, your wife says goodbye to you before you can propose anything.]","close_window",
    [
      (assign,"$g_spouse_embarazada",1), #no embarazada
    ]
  ],
  
  #/Spouse Talk chief hijos termina
  #esposa events chief
  [anyone|plyr,"spouse_talk",
    [],
    "We shall speak later, my {reg59?husband:wife}.", "close_window",[
      (assign, "$g_leave_encounter", 1),
  ]],
  
  #Bride
  [anyone,"wedding_ceremony_bride_vow",
    [
      #    (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      #	(check_quest_active, "qst_wed_betrothed"),
      #	(quest_slot_eq, "qst_wed_betrothed", slot_quest_target_troop, "$g_talk_troop"),
      #	(quest_slot_eq, "qst_wed_betrothed", slot_quest_current_state, 2),
      #	(neg|quest_slot_ge, "qst_wed_betrothed", slot_quest_expiration_days, 2),
    ],
    "My husband, I hereby pledge to be your wife, to stand with you in good times and bad. May the heavens smile upon us and bless us with children, livestock, and land.", "wedding_ceremony_player_vow",[
      (quest_get_slot, ":bride", "qst_wed_betrothed", slot_quest_target_troop),
      (set_conversation_speaker_troop, ":bride"),
  ]],
  
  [anyone|plyr,"wedding_ceremony_player_vow",
    [],
    "I pledge the same. Let us be husband and wife.", "wedding_ceremony_vows_complete",[
  ]],
  
  [anyone|plyr,"wedding_ceremony_player_vow",
    [],
    "Wait -- hold on... I'm not quite ready for this.", "close_window",[
  ]],
  
  [anyone,"wedding_ceremony_vows_complete",
    [],
    "I now declare you and {s3} to be husband and wife. Go now to the chamber prepared for you, and we shall make arrangements for your bride to join you in your hall in {s11}.", "close_window",[
      (call_script, "script_courtship_event_bride_marry_groom", "$g_player_bride", "trp_player", 0), #parameters from dialog
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_player_bride"),
      (str_store_troop_name, s3, "$g_player_bride"),
      
      (try_begin),
        (neq, reg0, "trp_player"),
        (str_store_string, s11, "str_error__player_not_logged_as_groom"),
      (else_try),
        (str_store_party_name, s11, reg1),
        (troop_set_slot, "$g_player_bride", slot_troop_cur_center, reg1),
      (try_end),
      (store_current_hours, ":hours_marriage"),
      (troop_set_slot, "$g_player_bride", slot_troop_marriage_time, ":hours_marriage"),
  ]],
  #WEDDING CUTSCENE BEGINS HERE
  
  [anyone, "spouse_pretalk",
    [],
    "Is there anything else, my {reg59?wife:husband}?", "spouse_talk",[
  ]],
  
  
  
  
  
  
  #take inventory
  [anyone,"spouse_organize_feast",
    [
      (faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_feast),
      (faction_slot_eq, "$players_kingdom", slot_faction_ai_object, "$g_encountered_party"),
    ],
    "A splendid idea, my {reg59?wife:husband}. However, let us wait for the current feast here to conclude, before organizing another.", "spouse_pretalk",[
  ]],
  
  [anyone,"spouse_organize_feast",
    [
      (eq, "$players_kingdom", "fac_player_supporters_faction"),
      (neg|is_between, "$g_player_court", centers_begin, centers_end),
    ],
    "A splendid idea, my {reg59?wife:husband}. However, we must establish a court before hosting a feast.", "spouse_pretalk",[
  ]],
  
  [anyone,"spouse_organize_feast",
    [
      (eq, "$players_kingdom", "fac_player_supporters_faction"),
      (store_current_hours, ":hours_since_last_feast"),
      (faction_get_slot, ":last_feast_time", "$players_kingdom", slot_faction_last_feast_start_time),
      (val_sub, ":hours_since_last_feast", ":last_feast_time"),
      (try_begin),
        (ge, "$cheat_mode", 1),
        (assign, reg4, ":hours_since_last_feast"),
        (str_store_faction_name, s4, "$players_kingdom"),
        (display_message, "@{!}DEBUG -- {reg4} hours since last feast for the {s4}"),
      (try_end),
      (lt, ":hours_since_last_feast", 120),
      (store_sub, ":days_to_wait", 168, ":hours_since_last_feast"),
      (val_div, ":days_to_wait", 24),
      (assign, reg3, ":days_to_wait"),
    ],
    "A splendid idea, my {reg59?wife:husband}. However, our realm has recently had a feast. Perhaps we should wait another {reg3} days before we organize another one.", "spouse_pretalk",[
  ]],
  
  
  
  
  
  [anyone,"spouse_organize_feast",
    #MOTO chief fix -1 feast location bug
    [
      (this_or_next|neq, "$players_kingdom", "fac_player_supporters_faction"),
      (is_between, "$g_player_court", centers_begin, centers_end),
    ],
    #MOTO fix -1 feast location bug end
    "A splendid idea, my {reg59?wife:husband}. However, not to insult our guests, we must make sure that we can provide a large and varied repast, for the lords, their families, and their retinues. All told, we should count on a couple of hundred mouths to feed, over several days. Let us take an inventory of our household possessions...", "spouse_evaluate_larder_for_feast",[
  ]],
  
  [anyone, "spouse_evaluate_larder_for_feast",
    [
      (call_script, "script_internal_politics_rate_feast_to_s9", "trp_household_possessions", 600, "$players_kingdom", 0),   #party, number of guests, taste, consume items
      (assign, "$feast_quality", reg0),
    ],
    "{!}{s9}",   "spouse_feast_confirm",[]],
  
  
  [anyone|plyr, "spouse_feast_confirm",
    [
    ],
    "Let me add more items to our storehouses",   "spouse_feast_added_items", [
      (change_screen_loot, "trp_household_possessions"),
  ]],
  
  [anyone, "spouse_feast_added_items",
    [],
    "All right, let me re-evaluate what is there...",   "spouse_evaluate_larder_for_feast",[]],
  
  
  
  [anyone|plyr, "spouse_feast_confirm",
    [
      (gt, "$feast_quality", 1),
    ],
    "Let us dispatch the invitations",   "spouse_feast_confirm_yes", []],
  
  [anyone|plyr, "spouse_feast_confirm",
    [
    ],
    "Let us wait, then",   "spouse_pretalk",[]],
  
  
  [anyone, "spouse_feast_confirm_yes",
    [ (neq, "$players_kingdom", "fac_player_supporters_faction"),
      (assign, ":feast_venue", -1),
      (try_begin),
        (is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end),
        (this_or_next|party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
        (party_slot_eq, "$g_encountered_party", slot_town_lord, "$g_talk_troop"),
        (assign, ":feast_venue", "$g_encountered_party"),
      (else_try),
        (try_for_range, ":center", walled_centers_begin, walled_centers_end),
          (eq, ":feast_venue", -1),
          (this_or_next|party_slot_eq, ":center", slot_town_lord, "trp_player"),
          (party_slot_eq, ":center", slot_town_lord, "$g_talk_troop"),
          (assign, ":feast_venue", ":center"),
        (try_end),
        (gt, ":feast_venue", -1),
      (else_try),
        (eq, ":feast_venue", -1),
        (is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end),
        (assign, ":feast_venue", "$g_encountered_party"),
      (try_end),
      (gt, ":feast_venue", -1),
      (assign, "$temp", ":feast_venue"),	],
    "I shall send word, then, that we will host a feast as soon as conditions in the realm permit. You perhaps should continue to stock our larder, so that we may do justice to our reputation for hospitality.",   "spouse_pretalk",[
      
      (str_store_party_name, s9, "$temp"),
      (setup_quest_text, "qst_organize_feast"),
      (str_store_string, s2, "str_you_intend_to_bring_goods_to_s9_in_preparation_for_the_feast_which_will_be_held_as_soon_as_conditions_permit"),
      
      (quest_set_slot, "qst_organize_feast", slot_quest_target_center, "$temp"),
      (quest_set_slot, "qst_organize_feast", slot_quest_expiration_days, 30),
      (call_script, "script_start_quest", "qst_organize_feast", "$g_talk_troop"),
  ]],
  
  [anyone, "spouse_feast_confirm_yes",
    [   (is_between, "$g_player_court", walled_centers_begin, walled_centers_end),],
    "Very well, then. Let the feast begin immediately at our court {reg4?here:} in {s9}. You perhaps should continue to stock our larder, so that we may do justice to our reputation for hospitality. You may declare the feast to be concluded at any time, either by beginning a campaign or by letting it be known that the vassals can return to their homes.",   "spouse_pretalk",[
      
      (str_store_party_name, s9, "$g_player_court"),
      (setup_quest_text, "qst_organize_feast"),
      (str_store_string, s2, "str_you_intend_to_bring_goods_to_s9_in_preparation_for_the_feast_which_will_be_held_as_soon_as_conditions_permit"),
      
      (quest_set_slot, "qst_organize_feast", slot_quest_target_center, "$g_player_court"),
      (quest_set_slot, "qst_organize_feast", slot_quest_expiration_days, 30),
      (call_script, "script_start_quest", "qst_organize_feast", "$g_talk_troop"),
      
      (faction_set_slot, "$players_kingdom", slot_faction_ai_state, sfai_feast),
      (faction_set_slot, "$players_kingdom", slot_faction_ai_object, "$g_player_court"),
      
      (assign, "$player_marshal_ai_state", sfai_feast),
      (assign, "$player_marshal_ai_object", "$g_player_court"),
      (store_current_hours, ":cur_hours"),
      (faction_set_slot,  "$players_kingdom",slot_faction_ai_current_state_started, ":cur_hours"),
      (faction_set_slot, "$players_kingdom", slot_faction_last_feast_start_time, ":cur_hours"), #new
      (assign, "$g_recalculate_ais", 1),
      (assign, reg4, 1),
      (try_begin),
        (neq, "$g_encountered_party", "$g_player_court"),
        (assign, reg4, 0),
      (try_end),
  ]],
  
  [anyone, "spouse_feast_confirm_yes",
    [(neg|is_between, "$g_player_court", walled_centers_begin, walled_centers_end),
      (eq, "$players_kingdom", "fac_player_supporters_faction"),
      (assign, ":feast_venue", -1),
      (try_begin),
        (try_for_range, ":center", walled_centers_begin, walled_centers_end),
          (eq, ":feast_venue", -1),
          (this_or_next|party_slot_eq, ":center", slot_town_lord, "trp_player"),
          (party_slot_eq, ":center", slot_town_lord, "$g_talk_troop"),
          (assign, ":feast_venue", ":center"),
        (try_end),
        (gt, ":feast_venue", -1),
      (else_try),
        (is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end),
        (store_faction_of_party, ":cur_faction", "$g_encountered_party"),
        (eq, ":cur_faction", "$players_kingdom"),
        (assign, ":feast_venue", "$g_encountered_party"),
      (else_try),
        (try_for_range, ":center", walled_centers_begin, walled_centers_end),
          (eq, ":feast_venue", -1),
          (store_faction_of_party, ":cur_faction", "$g_encountered_party"),
          (eq, ":cur_faction", "$players_kingdom"),
          (assign, ":feast_venue", ":center"),
        (try_end),
      (try_end),
      (gt, ":feast_venue", -1),
      (assign, "$temp", ":feast_venue"),],
    "Very well, then. Let the feast begin immediately in {s9}. You perhaps should continue to stock our larder, so that we may do justice to our reputation for hospitality. You may declare the feast to be concluded at any time, either by beginning a campaign or by letting it be known that the vassals can return to their homes.",   "spouse_pretalk",[
      
      (str_store_party_name, s9, "$temp"),
      (setup_quest_text, "qst_organize_feast"),
      (str_store_string, s2, "str_you_intend_to_bring_goods_to_s9_in_preparation_for_the_feast_which_will_be_held_as_soon_as_conditions_permit"),
      
      (quest_set_slot, "qst_organize_feast", slot_quest_target_center, "$temp"),
      (quest_set_slot, "qst_organize_feast", slot_quest_expiration_days, 30),
      (call_script, "script_start_quest", "qst_organize_feast", "$g_talk_troop"),
      
      (faction_set_slot, "$players_kingdom", slot_faction_ai_state, sfai_feast),
      (faction_set_slot, "$players_kingdom", slot_faction_ai_object, "$temp"),
      
      (assign, "$player_marshal_ai_state", sfai_feast),
      (assign, "$player_marshal_ai_object", "$temp"),
      
      (assign, "$g_recalculate_ais", 1),
      (assign, reg4, 1),
      (try_begin),
        (neq, "$g_encountered_party", "$temp"),
        (assign, reg4, 0),
      (try_end),
  ]],
  
  [anyone, "spouse_feast_confirm_yes",[], "Unfortunately, there are no suitable venues available to host the feast.","spouse_pretalk", []],
  
  
  [anyone,"start",	#too early
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_wed_betrothed"),
      (quest_slot_eq, "qst_wed_betrothed", slot_quest_target_troop, "$g_talk_troop"),
      (quest_slot_ge, "qst_wed_betrothed", slot_quest_expiration_days, 2),
    ],
    "How wonderful it is... In a short while, we shall be married! However, I should point out that, in the remaining few days, it is not customary for us to speak too much together.", "close_window",[
      (try_begin),
        (check_quest_active, "qst_visit_lady"),
        (quest_slot_eq, "qst_visit_lady", slot_quest_giver_troop, "$g_talk_troop"),
        (call_script, "script_end_quest", "qst_visit_lady"),
      (try_end),
  ]],
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_wed_betrothed"),
      (quest_slot_eq, "qst_wed_betrothed", slot_quest_target_troop, "$g_talk_troop"),
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      (assign, ":guardian", reg0),
      #	(call_script, "script_get_heroes_attached_to_center", "$g_encountered_party", "p_temp_party"),
      (troop_get_slot, ":guardian_led_party", ":guardian", slot_troop_leaded_party),
      (party_is_active, ":guardian_led_party"),
      (party_get_attached_to, ":guardian_led_party_attached", ":guardian_led_party"),
      (eq, ":guardian_led_party_attached", "$g_encountered_party"),
      
      (call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
      (str_store_troop_name, s4, ":guardian"),
      #use current location, or party is in?
    ],
    "Em, {playername}, you might not be used to our wedding customs, but I had hoped that someone would tell you... Speak first to my {s11}, {s4}.", "close_window",[
  ]],
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_wed_betrothed"),
      (quest_slot_eq, "qst_wed_betrothed", slot_quest_target_troop, "$g_talk_troop"),
      (quest_get_slot, ":giver_troop", "qst_wed_betrothed", slot_quest_giver_troop),
      (call_script, "script_troop_get_family_relation_to_troop", ":giver_troop", "$g_talk_troop"),
      (str_store_troop_name, s10, ":giver_troop"),
    ],
    "I do not know where to find my {s11} {s10}, who by tradition should preside over our wedding. Perhaps we should wait until he can be found...", "close_window",[
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  
  #Captive
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
      (party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord),
      #	(party_get_slot, ":town_lord", "$g_encountered_party"),
      (ge, ":town_lord", active_npcs_begin),
      (str_store_troop_name, s12, ":town_lord"),
    ],
    "The honorable {s12} has agreed to allow us to return home to our families. We shall be departing shortly.", "close_window",[
  ]],
  
  [anyone,"start", #default for time since last talk
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
      (gt, "$g_time_since_last_talk", 24),
    ],
    "So great is my loneliness! How I miss my family!", "kingdom_lady_captive",[
  ]],
  
  
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
      (lt, "$g_talk_troop_relation", 1),
    ],
    "You are a cad, {reg59?madame:sir}, to hold a lady like this...", "kingdom_lady_captive",[
  ]],
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
      (lt, "$g_talk_troop_relation", 11),
    ],
    "It is strange. On occasion, you have shown me such kindness, and yet you continue to hold me here against my will.", "kingdom_lady_captive",[
  ]],
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
    ],
    "Why haven't my family paid my ransom? You may hold me as prisoner, but it seems that you care for me more than they do!", "kingdom_lady_captive",[
  ]],
  
  
  [anyone|auto_proceed, "start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_cur_center, "$g_encountered_party"),
      
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      (assign, ":guardian", reg0),
      (neq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
      
      (store_faction_of_troop, ":guardian_faction", ":guardian"),
      (neq, ":guardian_faction", "$g_encountered_party_faction"),
    ],
    "{!}.", "lady_stranded_next",
    []],
  
  [anyone,"lady_stranded_next",
    [],
    "Greetings, {reg59?my lady:sir}. The tides of war have left me stranded here in this fortress, but I will shortly be departing. ", "close_window",[
  ]],
  
  
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_cur_center, "$g_encountered_party"),
      
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      (assign, ":guardian", reg0),
      (store_faction_of_troop, ":guardian_faction", ":guardian"),
      (neq, ":guardian_faction", "$g_encountered_party_faction"),
      
    ],
    "{playername} -- I assume that you, as a {reg59?lady:man} of honor, will accord gentle-born ladies such as us the right to return to our families, and not demand a ransom.", "lady_talk_refugee",[
  ]],
  
  [anyone,"start", [(eq, "$g_talk_troop", "trp_sacerdote_1"),
      (check_quest_active, "qst_blank_quest_2"),
      (eq, "$talk_context", tc_entering_center_quest_talk),
    ],
    "Thank you for escorting me here, my {reg59?daughter:son}. Please accept this small gift as a token of my gratitude.", "escort_bishop_succeeded",
    [
      (call_script, "script_change_player_relation_with_faction", "fac_christians", 1),
      (call_script, "script_finish_quest", "qst_blank_quest_2", 100),
      (remove_member_from_party,"$g_talk_troop"),
  ]],
  
  [anyone,"start", [(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_escort_lady"),
      (eq, "$talk_context", tc_entering_center_quest_talk),
      (quest_slot_eq, "qst_escort_lady", slot_quest_object_troop, "$g_talk_troop")],
    "Thank you for escorting me here, {playername}. Please accept this gift as a token of my gratitude. " +
    "I hope we shall meet again sometime in the future.", "lady_escort_lady_succeeded",
    [
      (quest_get_slot, ":cur_center", "qst_escort_lady", slot_quest_target_center),
      (add_xp_as_reward, 300),
      (try_begin),
        (neq, "$campaign_type", camp_storyline),
        (call_script, "script_troop_add_gold", "trp_player", 250),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 2),
      (else_try),
        (call_script, "script_troop_add_gold", "trp_player", 450),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 8),
      (try_end),
      (call_script, "script_end_quest", "qst_escort_lady"),
      (troop_set_slot, "$g_talk_troop", slot_troop_cur_center, ":cur_center"),
      (remove_member_from_party,"$g_talk_troop"),
  ]],
  
  [anyone|plyr,"lady_escort_lady_succeeded", [], "It was an honor to serve you, {s65}.", "close_window",[]],
  [anyone|plyr,"escort_bishop_succeeded", [], "It was an honor to serve you, Father.", "close_window",[]],
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (neq, "$g_talk_troop_faction", "$g_encountered_party_faction"),
      (troop_get_slot, ":new_location", "$g_talk_troop", slot_troop_cur_center),
      (str_clear, s5),
      (try_begin),
        (is_between, ":new_location", centers_begin, centers_end),
        (str_store_party_name, s4, ":new_location"),
        (str_store_string, s5, "str_for_s4"),
      (try_end),
    ],
    "We will shortly depart{s5}. It is good to know that some people in this world retain a sense of honor.", "close_window",[
  ]],
  
  
  [anyone|plyr,"lady_talk_refugee",
    [],
    "Of course, my lady", "close_window",[
      (troop_get_slot, ":current_location", "$g_talk_troop", slot_troop_cur_center),
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      (assign, ":new_location", reg1),
      (troop_set_slot, "$g_talk_troop", slot_troop_cur_center, ":new_location"),
      (try_begin),
        (neq, ":current_location", ":new_location"),
        (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 1),
      (try_end),
  ]],
  
  [anyone|plyr,"lady_talk_refugee",
    [],
    "You assume wrong, my lady!", "lady_captive_talk",[
  ]],
  
  [anyone,"lady_captive_talk",
    [],
    "What? What infamy is this?", "lady_captive_confirm",[
  ]],
  
  [anyone|plyr,"lady_captive_confirm",
    [],
    "My apologies - you must have misunderstood me. Of course, you may leave.", "close_window",[
  ]],
  
  [anyone|plyr,"lady_captive_confirm",
    [],
    "Contact your family to arrange for a ransom, my lady.", "close_window",[
      (troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
      (call_script, "script_change_player_honor", -2),
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -10),
      
      #incomplete -- make sure ransoms are offered for ladies
  ]],
  
  
  [anyone|plyr,"kingdom_lady_captive",
    [],
    "Then write to your family, and ask them to hurry up with the ransom!", "close_window",[
  ]],#incomplete
  
  
  
  #  [anyone|plyr,"kingdom_lady_captive",
  #   [
  #    (troop_get_slot, ":is_female", "trp_player"),
  #	(eq, ":is_female", 0),
  
  #   (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
  #   (troop_slot_eq, "trp_player", slot_troop_spouse, -1),
  #   ],
  #   "Then marry me forthwith, and stay here as my wife", "close_window",[
  # ]],#incomplete
  
  
  [anyone|plyr,"kingdom_lady_captive",
    [],
    "I have changed my mind. You are free to go", "close_window",[
      
      (troop_get_slot, ":party", "$g_talk_troop", slot_troop_prisoner_of_party),
      (ge, ":party", 0),
      (party_count_prisoners_of_type, ":prisoner",  ":party", "$g_talk_troop"),
      (gt, ":prisoner", 0),
      (party_remove_prisoners, ":party", "$g_talk_troop", 1),
      
      (troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, -1),
      (call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
  ]],
  
  
  
  
  
  #Kingdom ladies quest resolution
  [anyone,"start", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_blank_quest_13"),
      (check_quest_succeeded, "qst_blank_quest_13"),
      (quest_slot_eq, "qst_blank_quest_13", slot_quest_giver_troop, "$g_talk_troop"),], "I'm happy to tell you, {playername}, that my 'ghost' ex-lover doesn't bother me anymore. You really did it, {playername}! You're my new hero!", "rescue_prisoner_succeed_1",[
      (quest_get_slot,":quest_xp","qst_blank_quest_13", slot_quest_xp_reward),
      (add_xp_as_reward, ":quest_xp"),
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (val_add, ":player_renown", 2),
      (troop_set_slot, "trp_player", slot_troop_renown, ":player_renown"),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 12),
      (call_script, "script_change_player_honor", 2),
      (troop_set_slot, "$g_talk_troop", slot_troop_temp, 1),
      (call_script, "script_end_quest", "qst_blank_quest_13"),
  ]],
  
  [anyone,"start", [  (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_blank_quest_13"),
      (check_quest_failed, "qst_blank_quest_13"),
      (quest_slot_eq, "qst_blank_quest_13", slot_quest_giver_troop, "$g_talk_troop"),],"Oh, {playername}, what a shame! You were beaten by a ghost and yet have the nerve to show up here? My life is ruined because of you! Leave!", "close_window",[
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (val_add, ":player_renown", -5),
      (troop_set_slot, "trp_player", slot_troop_renown, ":player_renown"),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
      (call_script, "script_change_player_honor", -2),
      (troop_set_slot, "$g_talk_troop", slot_troop_temp, 1),
      (call_script, "script_end_quest", "qst_blank_quest_13"),]],
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_duel_courtship_rival"),
      (check_quest_failed, "qst_duel_courtship_rival"),
      (quest_slot_eq, "qst_duel_courtship_rival", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_target_troop", "qst_duel_courtship_rival", slot_quest_target_troop),
      (str_store_troop_name, s10, ":quest_target_troop"),
      (lt, "$g_talk_troop_relation", 0),
    ],
    "Well, {playername}, you fought a duel with {s10} and lost. According to our custom and tradition, I should no longer receive you. Farewell, {playername}.", "close_window",[
      (call_script, "script_end_quest", "qst_duel_courtship_rival"),
      (troop_set_slot, "$g_talk_troop", slot_troop_met, 4),
  ]],#incomplete
  
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_duel_courtship_rival"),
      (check_quest_failed, "qst_duel_courtship_rival"),
      (quest_slot_eq, "qst_duel_courtship_rival", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_target_troop", "qst_duel_courtship_rival", slot_quest_target_troop),
      (str_store_troop_name, s10, ":quest_target_troop"),
    ],
    "Oh, {playername}, I have heard of your duel with {s10}. I wish now that you had never fought him, for our honor and tradition demand that, having lost to him, you must now break off your suit with me. Farewell, {playername}.", "lady_duel_lost",[
      (troop_set_slot, "$g_talk_troop", slot_troop_met, 4),
      (call_script, "script_end_quest", "qst_duel_courtship_rival"),
  ]],
  
  [anyone|plyr,"lady_duel_lost",
    [], "Very well, we must do as tradition demands... Farewell, my lady.", "close_window", [
  ]],
  
  [anyone|plyr,"lady_duel_lost",
    [], "Let honor and tradition hang!", "lady_duel_lost_flaunt_conventions", [
  ]],
  
  [anyone, "lady_duel_lost_flaunt_conventions",
    [], "Oh, {playername}! Although people will talk, it would so break my heart to be able to see you no longer. We shall ignore this silly, cruel tradition.", "close_window", [
      (troop_set_slot, "$g_talk_troop", slot_troop_met, 2),
      (call_script, "script_change_player_honor", -5),
  ]],
  
  [anyone, "lady_duel_lost_flaunt_conventions",
    [], "No, {playername}, I cannot afford to fritter away my good name, and neither can you.", "close_window", [
  ]],
  
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_duel_courtship_rival"),
      (check_quest_succeeded, "qst_duel_courtship_rival"),
      (quest_slot_eq, "qst_duel_courtship_rival", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_target_troop", "qst_duel_courtship_rival", slot_quest_target_troop),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":quest_target_troop"),
      (lt, reg0, 0),
      (str_store_troop_name_link, s10, ":quest_target_troop"),
    ],
    "Oh, {playername}, I have heard that you won your duel with {s10}. I am grateful that you have delivered me from that man's attentions!", "lady_start",[
      (call_script, "script_end_quest", "qst_duel_courtship_rival"),
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 3),
      (add_xp_as_reward, 1000),
      
  ]],#incomplete
  
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_duel_courtship_rival"),
      (check_quest_succeeded, "qst_duel_courtship_rival"),
      (quest_slot_eq, "qst_duel_courtship_rival", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_target_troop", "qst_duel_courtship_rival", slot_quest_target_troop),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":quest_target_troop"),
      (str_store_troop_name_link, s10, ":quest_target_troop"),
      
    ],
    "Well, {playername}, you won your duel with {s10}. Clearly, he was not worthy of my affections.", "lady_start",[
      (call_script, "script_end_quest", "qst_duel_courtship_rival"),
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 2),
      (add_xp_as_reward, 1000),
  ]],
  
  [anyone|auto_proceed,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_duel_courtship_rival"),
      (check_quest_succeeded, "qst_duel_courtship_rival"),
      (quest_slot_eq, "qst_duel_courtship_rival", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_target_troop", "qst_duel_courtship_rival", slot_quest_target_troop),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_conventional),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":quest_target_troop"),
      (str_store_troop_name_link, s10, ":quest_target_troop"),
    ],
    "{!}.", "lady_duel_rep_1",[]],
  
  [anyone,"lady_duel_rep_1",
    [],
    "Well, {playername}, you won your duel with {s10}. Oh, such foolishness, that men should fight over me! Sigh... But it is a bit romantic, I suppose.", "lady_start",[
      (call_script, "script_end_quest", "qst_duel_courtship_rival"),
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 1),
      (add_xp_as_reward, 1000),
  ]],
  
  
  
  [anyone|auto_proceed,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_duel_courtship_rival"),
      (check_quest_succeeded, "qst_duel_courtship_rival"),
      (quest_slot_eq, "qst_duel_courtship_rival", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_target_troop", "qst_duel_courtship_rival", slot_quest_target_troop),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":quest_target_troop"),
      (str_store_troop_name_link, s10, ":quest_target_troop"),
    ],
    "{!}.", "lady_duel_rep_2",[]],
  
  [anyone,"lady_duel_rep_2",
    [],
    "Well, {playername}, you won your duel with {s10}. Honor now demands that he and I no longer meet... I was fond of him, you know. You did me no service by fighting him, sir.", "lady_start",[
      (call_script, "script_end_quest", "qst_duel_courtship_rival"),
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -2),
      (add_xp_as_reward, 1000),
  ]],
  
  
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_duel_for_lady"),
      (check_quest_succeeded, "qst_duel_for_lady"),
      (quest_slot_eq, "qst_duel_for_lady", slot_quest_giver_troop, "$g_talk_troop"),
      #  (le, "$talk_context", tc_siege_commander),
      (this_or_next|le, "$talk_context", tc_siege_commander),
      (eq, "$talk_context",tc_garden),
      (quest_get_slot, ":quest_target_troop", "qst_duel_for_lady", slot_quest_target_troop),
      (str_store_troop_name_link, s13, ":quest_target_troop"),
    ],
    "My dear {playername}, how joyous to see you again! I heard you gave that vile {s13} a well-deserved lesson. " +
    "I hope he never forgets his humiliation. " +
    "I've a reward for you, but I fear it's little compared to what you've done for me.", "lady_qst_duel_for_lady_succeeded_1",[]],
  
  [anyone|plyr,"lady_qst_duel_for_lady_succeeded_1", [], "Oh, it will just have to do.", "lady_qst_duel_for_lady_succeeded_2",[
      (str_store_string,s10,"@Then take it, with my eternal thanks. You are a noble {reg59?woman:man}. " +
      "I will never forget that you helped me in my time of need.")
  ]],
  
  [anyone|plyr,"lady_qst_duel_for_lady_succeeded_1", [], "{s66}, this is far too much!", "lady_qst_duel_for_lady_succeeded_2",[
      (str_store_string,s10,"@Forgive me, {playername}, but I must insist you accept it. " +
        "The money means little to me, and I owe you so much. " +
      "Here, take it, and let us speak no more of this."),
      (call_script, "script_change_player_honor", 1),
  ]],
  
  [anyone|plyr,"lady_qst_duel_for_lady_succeeded_1", [], "Please, {s65}, no reward is necessary.", "lady_qst_duel_for_lady_succeeded_2",[
      (str_store_string,s10,"@{playername}, what a dear {reg59?woman:man} you are, " +
        "but I will not allow you to refuse this. I owe you far more than I can say, " +
      "and I am sure you can put this money to far better use than I."),
      (call_script, "script_change_player_honor", 2),
  ]],
  [anyone,"lady_qst_duel_for_lady_succeeded_2", [], "{!}{s10}", "lady_pretalk",
    [(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 15),
      (add_xp_as_reward, 1000),
      (troop_add_item,"trp_player","itm_jewelry"),
      #    (call_script, "script_troop_add_gold", "trp_player", 3000),
      (call_script, "script_end_quest", "qst_duel_for_lady"),
  ]],
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_duel_for_lady"),
      (check_quest_failed, "qst_duel_for_lady"),
      (quest_slot_eq, "qst_duel_for_lady", slot_quest_giver_troop, "$g_talk_troop"),
      #  (le, "$talk_context", tc_siege_commander),
      (this_or_next|le, "$talk_context", tc_siege_commander),
      (eq, "$talk_context",tc_garden),
      (quest_get_slot, ":quest_target_troop", "qst_duel_for_lady", slot_quest_target_troop),
      (str_store_troop_name_link, s13, ":quest_target_troop"),
    ],
    "I was told that you sought satisfaction from {s13} to prove my innocence, {playername}. " +
    "It was a fine gesture, and I thank you for your efforts.", "lady_qst_duel_for_lady_failed", []],
  [anyone|plyr,"lady_qst_duel_for_lady_failed", [], "I beg your forgiveness for my defeat, {s65}...", "lady_qst_duel_for_lady_failed_2",[]],
  [anyone,"lady_qst_duel_for_lady_failed_2", [], "It matters not, dear {playername}. You tried. " +
    "The truth cannot be proven at the point of a sword, but you willingly put your life at stake for my honour. " +
    "That alone will convince many of my innocence.", "lady_pretalk",
    [(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
      (add_xp_as_reward, 400),
      (call_script, "script_end_quest", "qst_duel_for_lady"),
  ]],
  
  [anyone,"start", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (troop_set_slot, "$g_talk_troop", slot_lady_no_messages, 0), #do this for all
      (check_quest_active, "qst_visit_lady"),
      (quest_slot_eq, "qst_visit_lady", slot_quest_giver_troop, "$g_talk_troop"),
      ], "Ah {playername} - you must have received my message. How happy I am that you could come!", "lady_start",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (call_script, "script_end_quest", "qst_visit_lady"),
      #	(assign, "$g_time_to_spare", 1),
  ]],
  
  
  [anyone,"start", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_formal_marriage_proposal"),
      (quest_slot_eq, "qst_formal_marriage_proposal", slot_quest_giver_troop, "$g_talk_troop"),
      (neg|check_quest_succeeded, "qst_formal_marriage_proposal"),
      (neg|check_quest_failed, "qst_formal_marriage_proposal"),
      ], "{playername} - is there any word from my family?", "lady_proposal_pending",[
  ]],
  
  [anyone,"start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_formal_marriage_proposal"),
      (quest_slot_eq, "qst_formal_marriage_proposal", slot_quest_giver_troop, "$g_talk_troop"),
      (check_quest_failed, "qst_formal_marriage_proposal"),
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      (assign, ":guardian", reg0),
      (call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
    ],
    "I hear that my {s11} has refused your request to marry me. Does that mean that we must part?", "lady_betrothed",[
      (call_script, "script_end_quest", "qst_formal_marriage_proposal"),
  ]],
  
  #Marriage success
  
  
  [anyone,"start", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (le, "$talk_context", tc_siege_commander),
      (check_quest_active, "qst_rescue_lord_by_replace"),
      (check_quest_succeeded, "qst_rescue_lord_by_replace"),
      (quest_slot_eq, "qst_rescue_lord_by_replace", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":cur_lord", "qst_rescue_lord_by_replace", slot_quest_target_troop),
      (call_script, "script_troop_get_family_relation_to_troop", ":cur_lord", "$g_talk_troop"),
    ],
    "Oh, {playername}, you brought him back to me! Thank you ever so much for rescuing my {s11}. " +
    "Please, take this as some small repayment for your noble deed.", "lady_generic_mission_succeeded",
    [
      (call_script, "script_finish_quest", "qst_rescue_lord_by_replace", 100),
  ]],
  
  
  [anyone,"start", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (check_quest_active, "qst_rescue_prisoner"),
      (check_quest_succeeded, "qst_rescue_prisoner"),
      (quest_slot_eq, "qst_rescue_prisoner", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":cur_lord", "qst_rescue_prisoner", slot_quest_target_troop),
      (call_script, "script_troop_get_family_relation_to_troop", ":cur_lord", "$g_talk_troop"),
    ],
    "Oh, {playername}, you brought him back to me! Thank you ever so much for rescuing my {s11}. " +
    "Please, take this as some small repayment for your noble deed.", "rescue_prisoner_succeed_1",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 18),
      (add_xp_as_reward, 2000),
      (call_script, "script_troop_add_gold", "trp_player", 1500),
      (call_script, "script_end_quest", "qst_rescue_prisoner"),
  ]],#rescuerescue
  [anyone|plyr,"rescue_prisoner_succeed_1", [], "Always an honour to serve, {s65}.", "lady_pretalk",[]],
  
  
  
  #first time greetings
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_lady),
      (eq, "$g_talk_troop_met", 0),
      (gt, "$g_player_tournament_placement", 4),
      (str_clear, s8),
      
    ],
    "You must be {playername}. We have just had the honor of watching you distinguish yourself in the recent tournament{s8}.",
    "lady_meet_end", []],
  
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_lady),
      (eq, "$g_talk_troop_met", 0),
      (le,"$talk_context",tc_siege_commander),
      
      (assign, ":known_by_relative", 0),
      (str_clear, s15),
      (try_for_range, ":lord", lords_begin, lords_end),
        (call_script, "script_troop_get_family_relation_to_troop", ":lord", "$g_talk_troop"),
        (gt, reg0, 5),
        
        (call_script, "script_troop_get_relation_with_troop", "trp_player", ":lord"),
        (gt, reg0, 10),
        
        (str_store_string, s15, s11),
        (str_store_troop_name, s16, ":lord"),
        (assign, ":known_by_relative", ":lord"),
      (try_end),
      
      
      (gt, ":known_by_relative", 0),
      
    ],
    "You must be {playername}. My {s15} {s16} has spoken most highly of you. I am delighted to make your acquaintance.",
    "lady_meet_end", []],
  
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_lady),
      (eq, "$g_talk_troop_met", 0),
      (le,"$talk_context",tc_siege_commander),
    ],
    "I say, you don't look familiar...", "lady_premeet", []],
  
  #default greet
  [anyone,"start",
    [(troop_slot_eq, "$g_talk_troop", slot_troop_met, 4),
      (lt, "$g_talk_troop_relation", 0),
    ],
    "Ah, {playername}. How good it is to see you again. However, I believe that I am required elsewhere.", "close_window",[]],
  
  [anyone,"start",
    [(troop_slot_eq, "$g_talk_troop", slot_troop_met, 4),
    ],
    "{playername} -- how good it is to see you. (Whispers:) I still remember your visits fondly.", "lady_start",[]],
  
  [anyone ,"start", [(troop_slot_eq,"$g_talk_troop",slot_troop_occupation, slto_kingdom_lady),
      (eq, "$g_talk_troop_met", 0),
      (gt, "$g_player_tournament_placement", 4),
      (ge, "$g_talk_troop_relation", 0),
    ],
    "Ah, {playername}. How splendid it was to see you distinguish yourself in the recent tournament.",
    "lady_meet_end", []],
  
  
  [anyone,"start", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (str_store_string, s12, "str_hello_playername"),
      #					(assign, "$g_time_to_spare", 1),
    ],
    "{!}{s12}", "lady_start",[]],
  
  
  #lady_start - contains news, quest assignments
  [anyone,"lady_start", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (troop_slot_ge, "$g_talk_troop", slot_troop_met, 2),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_met, 4),
      (troop_get_slot, ":betrothed", "$g_talk_troop", slot_troop_betrothed),
      (gt, ":betrothed", -1),
      (neq, ":betrothed", "trp_player"),
      (str_store_troop_name, s5, ":betrothed"),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":betrothed"),
      (lt, reg0, 0),
      (ge, "$g_talk_troop_relation", 10),
    ],
    "I have sad news. I have become betrothed to {s5} -- against my will, I should say! Oh, {playername}, I would so much rather be wed to you!", "lady_betrothed",[]],
  
  [anyone,"lady_start", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (troop_slot_ge, "$g_talk_troop", slot_troop_met, 2),
      (troop_get_slot, ":betrothed", "$g_talk_troop", slot_troop_betrothed),
      (gt, ":betrothed", -1),
      (neq, ":betrothed", "trp_player"),
      (str_store_troop_name, s5, ":betrothed"),
    ],
    "Good {playername} -- I have become betrothed to {s5}. It is now no longer seemly for us to see each other like this.", "lady_betrothed",[
      #	(try_begin),
      #		(check_quest_active, "qst_visit_lady"),
      #		(quest_slot_eq, "qst_visit_lady", slot_quest_giver_troop, "$g_talk_troop"),
      #		(call_script, "script_end_quest", "qst_visit_lady"),
      #	(try_end),
  ]],
  
  [anyone,"lady_start",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_met, 4),
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_spouse, active_npcs_begin),
      
      (gt, "$g_talk_troop_relation", 0),
      (assign, "$romantic_rival", -1),
      
      (try_for_range, ":rival_lord", lords_begin, lords_end),
        (this_or_next|troop_slot_eq, ":rival_lord", slot_troop_love_interest_1, "$g_talk_troop"),
        (this_or_next|troop_slot_eq, ":rival_lord", slot_troop_love_interest_2, "$g_talk_troop"),
        (troop_slot_eq, ":rival_lord", slot_troop_love_interest_2, "$g_talk_troop"),
        (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":rival_lord"),
        (le, reg0, -4),
        
        (this_or_next|troop_slot_eq, ":rival_lord", slot_lord_reputation_type, lrep_debauched),
        (this_or_next|troop_slot_eq, ":rival_lord", slot_lord_reputation_type, lrep_quarrelsome),
        (this_or_next|troop_slot_eq, ":rival_lord", slot_lord_reputation_type, lrep_roguish),
        (troop_slot_eq, ":rival_lord", slot_lord_reputation_type, lrep_selfrighteous),
        
        (assign, "$romantic_rival", ":rival_lord"),
      (try_end),
      
      (gt, "$romantic_rival", 0),
    ],
    "I must tell you -- there is another lord who has been paying me attentions, although I cannot abide him. I fear he has designs on me, and may try to force me to wed against my will.", "lady_other_suitor",[]],
  
  #romantic news/quest assignments end
  [anyone,"lady_start", [ #friendly reminder that time is short
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (lt, "$g_time_since_last_talk", 24),
      (troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
      (gt, "$g_talk_troop_relation", 0),
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_adventurous),
        (str_store_string, s11, "str_i_do_enjoy_speaking_to_you_but_i_am_sure_you_understand_that_our_people_cluck_their_tongues_at_a_woman_to_spend_too_long_conversing_with_a_man_outside_her_family__although_the_heavens_know_its_never_the_man_who_is_held_to_blame_"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
        (str_store_string, s11, "str_as_much_as_i_enjoy_speaking_to_you_i_do_not_care_to_be_gossiped_about_by_others_who_might_lack_my_grace_and_beauty_"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
        (str_store_string, s11, "str_i_do_so_enjoy_speaking_to_you_but_as_a_daughter_of_one_of_the_great_families_of_this_land_i_must_set_an_example_of_propriety_"),
      (else_try),
        (str_store_string, s11, "str_i_do_so_enjoy_speaking_to_you_but_as_a_daughter_of_good_family_i_must_protect_my_reputation_"),
      (try_end),
    ],
    "{s11}It is probably not suitable for us to tarry too long here in conversation, but I would hope to see you again soon.", "lady_talk",[]],
  
  [anyone,"lady_start", [ #unfriendly reminder that time is short
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (lt, "$g_time_since_last_talk", 24),
      (troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_adventurous),
        (str_store_string, s11, "str_although_it_is_kind_of_you_to_pay_me_such_attentions_i_suspect_that_you_might_find_other_ladies_who_may_be_more_inclined_to_return_your_affection"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
        (str_store_string, s11, "str_as_flattered_as_i_am_by_your_attentions_perhaps_you_should_seek_out_another_lady_of_somewhat_shall_we_say_different_tastes"),
      (else_try),
        (str_store_string, s11, "str_as_flattered_as_i_am_by_your_attentions_i_am_a_daughter_of_good_family_and_must_be_aware_of_my_reputation_it_is_not_seemly_that_i_converse_too_much_at_one_time_with_one_man_i_am_sure_you_understand_now_if_you_will_excuse_me"),
      (try_end),
      
    ],
    "{!}{s11}", "lady_talk",[]],
  
  [anyone, "lady_start", [
      (eq, "$lady_flirtation_location", "$g_encountered_party"),
      (troop_slot_eq, "$g_talk_troop", slot_troop_met, 1),
      ],  "I was planning to retire for a little while, but perhaps we may have a chance to speak later...", "lady_talk", []],
  
  
  #Defeault lady_start - no news, assignments
  [anyone,"lady_start", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      (troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
      (gt, "$g_talk_troop_relation", 0),
      (str_clear, s12),
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
        (gt, "$g_talk_troop_relation", 0),
        (gt, "$g_time_since_last_talk", 24),
        (try_begin),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_otherworldly),
          (str_store_string, s12, "str_ah_my_gentle_playername_how_much_good_it_does_my_heart_to_see_you_again"),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_adventurous),
          (str_store_string, s12, "str_playername__i_am_so_glad_to_see_you_again_i_must_say_i_do_envy_your_freedom_to_ride_out_and_experience_the_world"),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
          (str_store_string, s12, "str_playername__i_am_so_glad_to_see_you_i_trust_that_you_have_been_behaving_honorably_since_last_we_met"),
        (else_try),
          (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
          (str_store_string, s12, "str_greetings_playername__it_is_good_to_see_you_i_hope_that_you_have_had_success_in_your_efforts_to_make_your_name_in_the_world"),
        (else_try),
          (str_store_string, s12, "str_playername__i_am_so_glad_that_you_were_able_to_come"),
        (try_end),
      (try_end),
      ],"It is so delightful to have a chance to spend some time together.{s12}","lady_talk", []],
  
  [anyone,"lady_start", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_lady),
      ],"What brings you here today?","lady_talk", []],
  
  #Betrothed
  [anyone|plyr, "lady_proposal_pending", [],
    "No word so far...", "close_window",[]],
  
  [anyone|plyr, "lady_proposal_pending", [],
    "On second thought, now is not the time for us to marry", "lady_proposal_pending_end",[]],
  
  [anyone,"lady_proposal_pending_end", [
      (try_begin),
        (gt, "$g_talk_troop_effective_relation", 19),
        (str_store_string, s11, "str_very_well__i_will_let_you_choose_the_time"),
      (else_try),
        (str_store_string, s11, "str_good_i_am_glad_that_you_have_abandoned_the_notion_of_pushing_me_into_marriage_before_i_was_ready"),
      (try_end),
    ],
    "{!}{s11}", "close_window",[
      (call_script, "script_end_quest", "qst_formal_marriage_proposal"),
  ]],
  
  
  
  [anyone|plyr,"lady_betrothed", [],
    "Never! We must elope together at once!", "lady_suggest_elope",[]],
  
  [anyone|plyr,"lady_betrothed", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_betrothed, -1),
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      (call_script, "script_troop_get_family_relation_to_troop", reg0, "$g_talk_troop"),
    ],
    "Perhaps I may still be able to change your {s11}'s mind", "lady_pretalk",[]],
  
  [anyone|plyr,"lady_betrothed", [],
    "So be it -- let us then part", "lady_conclude_relationship",[
  ]],
  
  
  [anyone,"lady_suggest_elope", [(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_conventional)],
    "Good {playername} -- you are a good and kind man, but a lady cannot defy her family. Such things are not done!", "lady_conclude_relationship",[]],
  
  
  [anyone,"lady_suggest_elope",
    [
      (assign, "$romantic_rival", -1),
      (try_for_range, ":possible_rival", lords_begin, lords_end),
        (this_or_next|troop_slot_eq, ":possible_rival", slot_troop_love_interest_1, "$g_talk_troop"),
        (this_or_next|troop_slot_eq, ":possible_rival", slot_troop_love_interest_2, "$g_talk_troop"),
        (troop_slot_eq, ":possible_rival", slot_troop_love_interest_2, "$g_talk_troop"),
        (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":possible_rival"),
        
        (try_begin),
          (eq, "$cheat_mode", 1),
          (str_store_troop_name, s4, ":possible_rival"),
          (display_message, "str_rival_found_s4_reg0_relation"),
        (try_end),
        (gt, reg0, "$g_talk_troop_relation"),
        (assign, "$romantic_rival", ":possible_rival"),
      (try_end),
      
      (gt, "$romantic_rival", -1),
    ],
    "Sir -- as you may know, I have been entertaining offers from a number of gentlemen such as yourself. I am not yet at a stage where I can commit to any of them.", "lady_other_suitor",[
  ]],
  
  
  [anyone,"lady_suggest_elope", [
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
      (neg|troop_slot_ge, "trp_player", slot_troop_renown, 350)
    ],
    "Ah {playername}, you must realize. You are still finding your way in the world. I have great affection for you, {playername}, but I will not consign myself to obscurity.", "lady_conclude_relationship",[]],
  
  [anyone,"lady_suggest_elope", [
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
      (lt, "$player_honor", 20)
    ],
    "Ah {playername}, although you are kind to me, I am not certain enough of your moral fiber to risk such a thing. Although I bare little affection for my husband, it would be a weighty thing to go against my family's wishes, and I am not certain enough of you to take that step.", "lady_conclude_relationship",[]],
  
  [anyone,"lady_suggest_elope", [(le, "$g_talk_troop_effective_relation", 20),],
    "Good {playername} -- to elope would be to throw away my ties with my family, which are everything to me! I have a considerable affection for you, but I am not sure that I am prepared to risk that.", "lady_conclude_relationship",[]],
  
  [anyone,"lady_suggest_elope", [
      (assign, "$home_for_spouse", -1),
      (try_for_range, ":player_center", centers_begin, centers_end),
        (eq, "$home_for_spouse", -1),
        (party_slot_eq, ":player_center", slot_town_lord, "trp_player"),
        (is_between, ":player_center", walled_centers_begin, walled_centers_end),
        #		(this_or_next|is_between, ":player_center", walled_centers_begin, walled_centers_end),
        #			(party_slot_eq, ":player_center", slot_center_has_manor, 1),
        (assign, "$home_for_spouse", ":player_center"),
      (try_end),
      (eq, "$home_for_spouse", -1),
    ],
    "Good {playername} -- I am not used to the hardships of campaigning as you are. I want a home to call my own. If you were lord of a castle or town with a great hall, I would gladly go there as your wife, to be mistress of the household. But I do not wish to live like a hunted animal.", "lady_conclude_relationship",[]],
  
  
  [anyone,"lady_suggest_elope", [
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      (call_script, "script_troop_get_family_relation_to_troop", reg0, "$g_talk_troop"),
    ],
    "Elope with you? Yes -- we could do that. It is a great step to defy my family -- but a loveless marriage, and life without you, might be a far worse thing! But be warned -- this will be a terrible blow to my {s11}'s prestige, and he will do everything in his power to bring you down.", "lady_elope_agree",[]],
  
  [anyone|plyr,"lady_elope_agree", [],
    "Quickly, then! There is no time to lose.", "lady_elope_agree_nurse",[
  ]],
  
  [anyone|plyr,"lady_elope_agree", [],
    "Everything in his power, you say? Em... Let me think about this...", "close_window",[
  ]],
  
  [anyone, "lady_elope_agree_nurse", [],
    "Your lordship... Your ladyship... Would you like me to witness your exchange of vows?", "lady_elope_agree_lady_vows",[
      (set_conversation_speaker_troop, trp_nurse_for_lady),
  ]],
  
  [anyone, "lady_elope_agree_lady_vows", [
      (str_store_troop_name, s4, "$g_talk_troop"),
    ],
    "Yes, do that. For my part, I make the following vow: I, {s4}, do swear that I accept {playername} as my husband, according to the ancient law and custom of our land...", "lady_elope_agree_nurse_2",[
  ]],
  
  [anyone, "lady_elope_agree_nurse_2", [],
    "Very good. Do you, {playername}, swear similarly to accept {s4} as your wife?", "lady_elope_agree_player_vows",[
      (set_conversation_speaker_troop, trp_nurse_for_lady),
  ]],
  
  [anyone|plyr,"lady_elope_agree_player_vows", [],
    "I do.", "close_window",[
      (call_script, "script_courtship_event_bride_marry_groom", "$g_talk_troop", "trp_player", 1), #1 is elopement
  ]],
  
  [anyone|plyr,"lady_elope_agree_player_vows", [],
    "Eh, what? This is all moving too fast...", "close_window",[
  ]],
  
  
  
  
  #markspot - do elopement here
  
  [anyone|plyr,"lady_elope_agree", [],
    "Oh, really? My dear -- I could never separate a lady from her family like that...", "lady_conclude_relationship",[
  ]],
  
  [anyone,"lady_conclude_relationship", [],
    "So I suppose our time together must come to an end...", "lady_conclude_relationship_confirm", []],
  
  [anyone|plyr,"lady_conclude_relationship_confirm", [],
    "Yes -- it must be...", "lady_conclude_relationship_confirm_yes", []],
  
  [anyone|plyr,"lady_conclude_relationship_confirm", [],
    "Wait -- perhaps there is still a chance for us!", "lady_conclude_relationship_confirm_no", []],
  
  [anyone,"lady_conclude_relationship_confirm_yes", [],
    "Farewell, {playername}. We will see each other, in the courts and castles of this realm, but we must keep our distance from each other. I will remember these days fondly, nonetheless.", "close_window", [
      (troop_set_slot, "$g_talk_troop", slot_troop_met, 4),
  ]],
  
  [anyone,"lady_conclude_relationship_confirm_no", [],
    "In that case, we shall see what the future brings.", "close_window", [
  ]],
  
  
  
  
  
  
  [anyone|plyr,"lady_generic_mission_succeeded", [], "Always an honour to serve, {s65}.", "lady_pretalk",[]],
  
  [anyone|plyr ,"lady_premeet", [],  "I am {playername}.", "lady_meet", []],
  [anyone|plyr ,"lady_premeet", [],  "My name is {playername}. At your service.", "lady_meet", []],
  
  
  [anyone, "lady_meet", [
      (troop_slot_ge, "trp_player", slot_troop_renown, 200),
      ],  "Of course. How splendid to finally make your acquaintance.", "lady_meet_end", []],
  
  [anyone, "lady_meet", [],  "{playername}? I do not believe I've heard of you before.", "lady_meet_end", []],
  
  [anyone, "lady_meet_end", [
      (eq, "$lady_flirtation_location", "$g_encountered_party"),
      ],  "I am about to retire for a little while, but perhaps we may have a chance to speak later...", "lady_talk", []],
  
  
  [anyone, "lady_meet_end", [
      #   (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
      (call_script, "script_troop_get_romantic_chemistry_with_troop", "$g_talk_troop", "trp_player"),
      (le, reg0, 0),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
      (le, reg0, 0),
      ],  "Now, if you will excuse me...", "lady_talk", []],
  
  [anyone, "lady_meet_end", [],  "Can I help you with anything?", "lady_talk", []],
  
  
  [anyone|plyr,"lady_talk", [(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (ge, "$g_encountered_party_relation", 0),
    ],
    "I want to know the location of someone.", "lord_talk_ask_location",[]],
  
  
  ##### TODO: QUESTS COMMENT OUT BEGIN
  ##  [anyone|plyr,"lady_talk", [(check_quest_active, "qst_deliver_message_to_lover"),
  ##                             (quest_slot_eq, "qst_deliver_message_to_lover", slot_quest_target_troop, "$g_talk_troop"),
  ##                             (quest_get_slot, ":troop_no", "qst_deliver_message_to_lover", slot_quest_giver_troop),
  ##                             (str_store_troop_name_link, 3, ":troop_no")],
  ##   "I have brought you a message from {s3}", "lady_message_from_lover_success",[(call_script, "script_finish_quest", "qst_deliver_message_to_lover", 100)]],
  ##
  ##  [anyone|plyr,"lady_talk", [(check_quest_active, "qst_rescue_lady_under_siege"),
  ##                             (quest_slot_eq, "qst_rescue_lady_under_siege", slot_quest_object_troop, "$g_talk_troop"),
  ##                             (quest_slot_eq, "qst_rescue_lady_under_siege", slot_quest_current_state, 0)],
  ##   "TODO: I'm taking you home!", "lady_rescue_from_siege_check",[]],
  ##
  ##
  ##  [anyone,"lady_rescue_from_siege_check", [(neg|hero_can_join)],
  ##   "TODO: You don't have enough room for me!", "close_window",[]],
  ##
  ##
  ##  [anyone,"lady_rescue_from_siege_check", [], "TODO: Thank you so much!", "lady_pretalk",[(quest_set_slot, "qst_rescue_lady_under_siege", slot_quest_current_state, 1),
  ##                                                                                          (troop_set_slot, "$g_talk_troop", slot_troop_cur_center, 0),
  ##                                                                                          (troop_join, "$g_talk_troop")]],
  ##  [anyone,"lady_message_from_lover_success", [], "TODO: Thank you so much!", "lady_pretalk",[]],
  ##
  
  [anyone,"lady_pretalk", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
      (call_script, "script_troop_get_romantic_chemistry_with_troop", "$g_talk_troop", "trp_player"),
      (le, reg0, 0),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
      (le, reg0, 0),
      ], "Now, if you will excuse me...", "lady_talk",[]],
  
  
  [anyone,"lady_pretalk", [], "Is there anything else?", "lady_talk",[]],
  
  ##[anyone|plyr,"lady_talk",
  ##   [(troop_get_type, ":is_female", "trp_player"),
  ##   [(val_mod, ":is_female", 2),
  ##    (eq, ":is_female", 0),],
  ##   "{!}CHEAT: I want to marry you! (1)", "wedding_ceremony_bride_vow",[]],
  ##[anyone|plyr,"lady_talk",
  ##   [(troop_get_type, ":is_female", "trp_player"),
  ##   [(val_mod, ":is_female", 2),
  ##    (eq, ":is_female", 0),],
  ##   "{!}CHEAT: I want to marry you! (2)", "lady_elope_agree_nurse_2",[]],
  
  [anyone|plyr,"lady_talk",
    [],
    "May I have the honor of knowing more about you, my lady?", "lady_relations",[]],
  
  [anyone,"lady_relations",
    [
      (str_store_string, s12, "str_i_am"),
      (assign, ":relation_found", 0),
      (assign, ":in_castle_of_relative", 0),
      
      (try_for_range, ":lord", active_npcs_begin, kingdom_ladies_end), #use this as the basis for "troop_describe_relation_with_troop"
        (call_script, "script_troop_get_family_relation_to_troop", "$g_talk_troop", ":lord"), #The normal order is reversed, because the lady is describing herself
        (this_or_next|gt, reg0, 5),
        (party_slot_eq, "$g_encountered_party", slot_town_lord, ":lord"),
        (gt, reg0, 0),
        
        (str_store_troop_name, s14, ":lord"),
        (try_begin),
          (eq, ":relation_found", 1),
          (str_store_string, s12, "str_s12_comma"),
        (try_end),
        (str_store_string, s12, "str_s12_s11_to_s14"),
        (assign, ":relation_found", 1),
        
        (try_begin),
          (party_slot_eq, "$g_encountered_party", slot_town_lord, ":lord"),
          (assign, ":in_castle_of_relative", 1),
        (try_end),
      (try_end),
      
      (try_begin),
        # (eq, ":in_castle_of_relative", 1),
        # (str_store_string, s12, "str_s12"),
        # (else_try),
        (eq, ":in_castle_of_relative", 0),
        (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_state, sfai_feast),
        (faction_slot_eq, "$g_talk_troop_faction", slot_faction_ai_object, "$g_encountered_party"),
        (str_store_string, s12, "str_s12_i_am_here_for_the_feast"),
      (else_try),
        (str_store_string, s12, "str_s12_period"),
      (try_end),
      
    ],
    "{!}{s12}", "lady_pretalk",[]],
  
  
  [anyone|plyr,"lady_talk",
    [
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (eq, ":is_female", 0),
      (troop_slot_eq, "$g_talk_troop", slot_troop_met, 1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
      
      (neq, "$lady_flirtation_location", "$g_encountered_party"),
    ],
    "My lady, I would like to profess myself your most ardent admirer", "lady_profess_admiration",
    [
      (call_script, "script_troop_get_romantic_chemistry_with_troop", "$g_talk_troop", "trp_player"),
      (assign, ":reaction_change", reg0),
      
      #	(try_begin),
      #		(gt, "$g_player_tournament_placement", 3),
      #		(val_sub, "$g_player_tournament_placement", 3),
      #		(val_mul, "$g_player_tournament_placement", 4), #Twice normal, but is divided by two
      #	(else_try),
      #		(assign, "$g_player_tournament_placement", 0),
      #	(try_end),
      
      #	(try_begin),
      #		(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_conventional),
      #		(val_mul, "$g_player_tournament_placement", 2),
      #	(else_try),
      #		(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
      #		(val_div, "$g_player_tournament_placement", 2),
      #	(try_end),
      
      #	(val_add, ":reaction_change", "$g_player_tournament_placement"),
      #	(assign, "$g_player_tournament_placement", 0),
      
      (val_div, ":reaction_change", 2),
      (val_max, ":reaction_change", -2),
      
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", ":reaction_change"),
      (assign, "$g_time_to_spare", 0),
      
  ]],
  
  [anyone|plyr,"lady_talk",
    [
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (eq, ":is_female", 0),
      (gt, "$g_player_tournament_placement", 3),
      #	(neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
    ],
    "My lady, I would like to dedicate my successes in this recent tournament to you", "lady_tournament_dedication_reaction",
    [
      
      (try_begin),
        (gt, "$g_player_tournament_placement", 3),
        (val_sub, "$g_player_tournament_placement", 3),
        (val_mul, "$g_player_tournament_placement", 2),
      (else_try),
        (assign, "$g_player_tournament_placement", 0),
      (try_end),
      
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_lady_used_tournament, 1),
        (val_div, "$g_player_tournament_placement", 3),
        (str_store_string, s9, "str_another_tournament_dedication_oh_i_suppose_it_is_always_flattering"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_conventional),
        (val_mul, "$g_player_tournament_placement", 2),
        (str_store_string, s9, "str_do_you_why_what_a_most_gallant_thing_to_say"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
        (val_div, "$g_player_tournament_placement", 2),
        (str_store_string, s9, "str_hmm_i_cannot_say_that_i_altogether_approve_of_such_frivolity_but_i_must_confess_myself_a_bit_flattered"),
      (else_try),
        (str_store_string, s9, "str_why_thank_you_you_are_most_kind_to_do_so"),
      (try_end),
      
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", "$g_player_tournament_placement"),
      (assign, "$g_player_tournament_placement", 0),
      (troop_set_slot, "$g_talk_troop", slot_lady_used_tournament, 1),
  ]],
  
  [anyone,"lady_tournament_dedication_reaction", [],
    "{!}{s9}", "lady_pretalk",
    []],
  
  
  
  [anyone,"lady_profess_admiration", [
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
      (gt, reg0, 0),
      
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
        (str_store_string, s11, "str_you_are_most_courteous_and_courtesy_is_a_fine_virtue_"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
        (str_store_string, s11, "str_hmm_youre_a_bold_one_but_i_like_that_"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_adventurous),
        (str_store_string, s11, "str_ah_well_they_all_say_that_but_no_matter_a_compliment_well_delivered_is_at_least_a_good_start_"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_otherworldly),
        (str_store_string, s11, "str_oh_do_you_mean_that_such_a_kind_thing_to_say"),
      (else_try),
        (str_store_string, s11, "str_you_are_a_most_gallant_young_man_"),
      (try_end),
      
    ],
    "{s11}I would like it very much if we could see more of each other.", "close_window",
    [(troop_set_slot, "$g_talk_troop", slot_troop_met, 2),
      (assign, "$lady_flirtation_location", "$g_encountered_party"),
  ]],
  
  [anyone,"lady_profess_admiration", [
    ],
    "Ah... You are too kind... My, the hour is getting rather late, isn't it? I really must be going.", "lady_pretalk",
    [(troop_set_slot, "$g_talk_troop", slot_troop_met, 2),
  ]],
  
  
  [anyone|plyr,"lady_talk",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
      (eq, "$g_time_to_spare", 1),
      (eq, "$talk_context", tc_courtship),
    ],
    "Do you like poetry, my lady?", "lady_recite_poetry",[
      (assign, "$g_time_to_spare", 0),
  ]],
  
  [anyone,"lady_recite_poetry", [
    ],
    "That would depend on the poem. Did you intend to recite a verse?", "lady_recite_poetry",
    []],
  
  
  [anyone|plyr,"lady_recite_poetry",
    [
      (gt, "$tragic_poem_recitations", 0),
      (troop_slot_eq, "$g_talk_troop", slot_lady_courtship_tragic_recited, 0),
      
    ],
    "The muse Calliope bore to Morpheus a son named Orpheus...", "lady_recite_poetry_response",[
      (assign, "$poem_selected", courtship_poem_tragic),
      (troop_set_slot, "$g_talk_troop", slot_lady_courtship_tragic_recited, 1),
      
  ]],
  
  [anyone|plyr,"lady_recite_poetry",
    [
      (gt, "$comic_poem_recitations", 0),
      (troop_slot_eq, "$g_talk_troop", slot_lady_courtship_comic_recited, 0),
      
    ],
    "A lion was awakened from sleep by a mouse running over his face...", "lady_recite_poetry_response",[
      (assign, "$poem_selected", courtship_poem_comic),
      (troop_set_slot, "$g_talk_troop", slot_lady_courtship_comic_recited, 1),
      
  ]],
  
  [anyone|plyr,"lady_recite_poetry",
    [
      (gt, "$mystic_poem_recitations", 0),
      (troop_slot_eq, "$g_talk_troop", slot_lady_courtship_mystic_recited, 0),
      
    ],
    "There is a distant isle...", "lady_recite_poetry_response",[
      (assign, "$poem_selected", courtship_poem_mystic),
      (troop_set_slot, "$g_talk_troop", slot_lady_courtship_mystic_recited, 1),
      
  ]],
  
  [anyone|plyr,"lady_recite_poetry",
    [
      (gt, "$heroic_poem_recitations", 0),
      (troop_slot_eq, "$g_talk_troop", slot_lady_courtship_heroic_recited, 0),
    ],
    "LO, praise of the prowess of people-kings...", "lady_recite_poetry_response",[
      (assign, "$poem_selected", courtship_poem_heroic),
      (troop_set_slot, "$g_talk_troop", slot_lady_courtship_heroic_recited, 1),
      
  ]],
  
  [anyone|plyr,"lady_recite_poetry",
    [
      (gt, "$allegoric_poem_recitations", 0),
      (troop_slot_eq, "$g_talk_troop", slot_lady_courtship_allegoric_recited, 0),
      
    ],
    "But anxious cares already seized the queen...", "lady_recite_poetry_response",[
      (assign, "$poem_selected", courtship_poem_allegoric),
      (troop_set_slot, "$g_talk_troop", slot_lady_courtship_allegoric_recited, 1),
  ]],
  
  
  [anyone|plyr,"lady_recite_poetry",
    [],"Actually, I can't think of any that I would care to recite...", "lady_pretalk",[]],
  
  [anyone,"lady_recite_poetry_response",
    [
      (call_script, "script_courtship_poem_reactions", "$g_talk_troop", "$poem_selected"),
    ],
    "{!}{s11}", "lady_private_conversation_end",[
      (assign, ":reaction", reg0),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", ":reaction"),
      (call_script, "script_courtship_poem_reactions", "$g_talk_troop", "$poem_selected"), #this needs to be twice, as the above resets s11
  ]],
  
  [anyone,"lady_private_conversation_end",
    [
      (str_clear, s11),
      (try_begin),
        (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
        (gt, reg0, 0),
        (str_store_string, s11, "str__do_come_and_see_me_again_soon"),
      (try_end),
    ],
    "Time is passing quickly, and we cannot linger here too long.", "lady_pretalk",
    [
      (assign, "$g_time_to_spare", 0),
  ]],
  
  [anyone|plyr,"lady_talk",
    [
      (neg|check_quest_active, "qst_formal_marriage_proposal"),
      (neg|troop_slot_ge, "trp_player", slot_troop_betrothed, active_npcs_begin),
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
      
      
      (troop_slot_eq, "$g_talk_troop", slot_troop_met, 2),
      (eq, "$talk_context", tc_courtship),
      (troop_slot_eq, "$g_talk_troop", slot_troop_refused, 0),
    ],
    "Do you think that we may have a future together, my lady?", "lady_marriage_discussion",[
  ]],
  
  [anyone,"lady_marriage_discussion",
    [
      (assign, "$romantic_rival", -1),
      (try_for_range, ":possible_rival", lords_begin, lords_end),
        (this_or_next|troop_slot_eq, ":possible_rival", slot_troop_love_interest_1, "$g_talk_troop"),
        (this_or_next|troop_slot_eq, ":possible_rival", slot_troop_love_interest_2, "$g_talk_troop"),
        (troop_slot_eq, ":possible_rival", slot_troop_love_interest_3, "$g_talk_troop"),
        (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", ":possible_rival"),
        
        (try_begin),
          (eq, "$cheat_mode", 1),
          (str_store_troop_name, s4, ":possible_rival"),
          (display_message, "str_rival_found_s4_reg0_relation"),
        (try_end),
        (gt, reg0, "$g_talk_troop_relation"),
        (assign, "$romantic_rival", ":possible_rival"),
      (try_end),
      (gt, "$romantic_rival", -1),
      
    ],
    "Sir -- as you may know, I have been entertaining offers from a number of gentlemen such as yourself. I am not yet at a stage where I can commit to any of them.", "lady_other_suitor",[
  ]],
  
  
  [anyone,"lady_marriage_discussion",
    [
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
      (neg|troop_slot_ge, "trp_player", slot_troop_renown, 750),
    ],
    "It is good to hear that you are thinking seriously about the future. However, I would like to see you rise a little further in the world before I am ready to commit to marry you.", "lady_proposal_refused",[
      (troop_set_slot, "$g_talk_troop", slot_troop_refused, 1), ]],
  
  [anyone,"lady_marriage_discussion",
    [
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
      (le, "$player_honor", 40)
    ],
    "It is good to hear that your intentions are honorable. However, I have resolved only to marry a man of the strongest moral fiber. I would like you to prove yourself more in that regard.", "lady_proposal_refused",[
      (troop_set_slot, "$g_talk_troop", slot_troop_refused, 1),  ]],
  
  
  [anyone,"lady_marriage_discussion",
    [
      (le, "$g_talk_troop_relation", 40),
    ],
    "Sir -- it is comforting to hear that your intentions towards me are honorable. But perhaps we should take the time to get to allow our affections for each other to grow a little stronger, before making any such decision.", "lady_proposal_refused",[
      (troop_set_slot, "$g_talk_troop", slot_troop_refused, 1),   ]],
  
  
  
  [anyone,"lady_marriage_discussion",
    [(gt, "$g_talk_troop_relation", 60),
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      (assign, ":guardian", reg0),
      (troop_slot_eq, ":guardian", slot_lord_granted_courtship_permission, -1),
      (str_store_troop_name, s4, reg0),
      (call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
      (call_script, "script_troop_get_romantic_chemistry_with_troop", "$g_talk_troop", "trp_player"),
      (gt, reg0, 8),
    ],
    "Oh {playername}, how happy that would make me! But my {s11} {s4} would never allow it... Perhaps it is best that we part...", "lady_betrothed", []],
  
  [anyone,"lady_marriage_discussion",
    [(troop_slot_ge, "trp_player", slot_troop_renown, 500),
      (gt, "$g_talk_troop_relation", 60),
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      (assign, ":guardian", reg0),
      (call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
      (str_store_troop_name, s4, ":guardian"),
      (call_script, "script_troop_get_romantic_chemistry_with_troop", "$g_talk_troop", "trp_player"),
      (gt, reg0, 8),
    ],
    "Oh {playername}, how happy that would make me! Go ask my {s11} {s4} for permission!", "close_window",[
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      (assign, ":guardian", reg0),
      (str_store_troop_name_link, s12, ":guardian"),
      (str_store_troop_name, s15, "$g_talk_troop"),
      (setup_quest_text, "qst_formal_marriage_proposal"),
      (str_store_string, s2, "str_you_intend_to_ask_s12_for_permission_to_marry_s15"),
      
      (quest_set_slot, "qst_formal_marriage_proposal", slot_quest_target_troop, ":guardian"),
      (quest_set_slot, "qst_formal_marriage_proposal", slot_quest_expiration_days, 30),
      (quest_set_slot, "qst_formal_marriage_proposal", slot_quest_current_state, 0),
      (call_script, "script_start_quest", "qst_formal_marriage_proposal", "$g_talk_troop"),
      (quest_set_slot, "qst_formal_marriage_proposal", slot_quest_giver_troop, "$g_talk_troop"),
      
      #Repeated to ensure strings work correctly
      (call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
      (str_store_troop_name, s4, ":guardian"),
  ]],
  [anyone,"lady_marriage_discussion", [], "It is good to hear that your intentions are honorable. However, I am not ready to commit yet.", "lady_proposal_refused",[ (troop_set_slot, "$g_talk_troop", slot_troop_refused, 1),]],
  [anyone|plyr,"lady_proposal_refused",
    [
      (is_between, "$g_talk_troop_relation", 25, 60),
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
      (troop_slot_ge, "trp_player", slot_troop_renown, 450),
      (this_or_next|neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_moralist),
      (ge, "$player_honor", 30),
    ],
    "Perhaps I can persuade you to delay no further.", "lady_proposal_refused_persuade_check",[
  ]],
  
  [anyone,"lady_proposal_refused_persuade_check",
    [
    ],
    "What do you have to say?", "lady_proposal_refused_persuade_player_response",[
      
      (assign, reg4, 60),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
      (assign, ":cur_relation", reg0),
      (assign, reg5, ":cur_relation"),
      (assign, reg9, 1),
      (store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"),
      (store_attribute_level, ":charisma", "trp_player", ca_charisma),
      (store_sub, ":difference", 63, ":cur_relation"),
      (val_div, ":charisma", 2),
      (val_add, ":persuasion_level",":charisma"),
      
      (try_begin),
        (gt, ":difference", ":persuasion_level"),
        (assign, "$g_persuasion_failure_chance", 100),
      (else_try),
        (store_mul, "$g_persuasion_failure_chance", ":difference", 100),
        (val_div, "$g_persuasion_failure_chance", ":persuasion_level"),
      (try_end),
      (assign, reg8, "$g_persuasion_failure_chance"),
      (store_sub, reg7, 100, "$g_persuasion_failure_chance"),
      (dialog_box, "str_persuasion_opportunity"),
      
  ]],
  
  [anyone|plyr,"lady_proposal_refused_persuade_player_response",
    [
    ],
    "Love is as a rose, my lady. Left unplucked, it may wither.", "lady_proposal_refused_persuade_result",[
  ]],
  
  [anyone|plyr,"lady_proposal_refused_persuade_player_response",
    [],
    "Oh, never mind.", "lady_pretalk",
    []],
  
  
  [anyone,"lady_proposal_refused_persuade_result",
    [
      (store_random_in_range, ":random", 0, 100),
      (lt, ":random", "$g_persuasion_failure_chance"),
    ],
    "Enough, sir! I shall not be rushed into marriage, with you or with anyone else! You have made me very cross. Please, leave me alone for a while. I shall let you know when I am ready to speak to you again.", "close_window", [
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", -10),
      (jump_to_menu, "mnu_town"),
      (finish_mission),
  ]],
  
  
  [anyone,"lady_proposal_refused_persuade_result",
    [
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      (assign, ":guardian", reg0),
      (troop_slot_eq, ":guardian", slot_lord_granted_courtship_permission, -1),
      (str_store_troop_name, s4, reg0),
      (call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
    ],
    "Oh {playername}, I could never allow that to happen! Oh, if only we could be wed! But my {s11} {s4} would never give his permission... Perhaps it is best that we part...", "lady_betrothed", [
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 1),
  ]],
  
  [anyone,"lady_proposal_refused_persuade_result",
    [
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      (assign, ":guardian", reg0),
      (call_script, "script_troop_get_family_relation_to_troop", ":guardian", "$g_talk_troop"),
      (str_store_troop_name, s4, ":guardian"),
      
    ],
    "Oh {playername}, I could never allow that to happen! Go ask my {s11} {s4} his permission for us to be wed!", "close_window",[
      
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 1),
      (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      (assign, ":guardian", reg0),
      (str_store_troop_name_link, s12, ":guardian"),
      (str_store_troop_name, s15, "$g_talk_troop"),
      (setup_quest_text, "qst_formal_marriage_proposal"),
      (str_store_string, s2, "str_you_intend_to_ask_s12_for_permission_to_marry_s15"),
      
      (quest_set_slot, "qst_formal_marriage_proposal", slot_quest_target_troop, ":guardian"),
      (quest_set_slot, "qst_formal_marriage_proposal", slot_quest_expiration_days, 30),
      (quest_set_slot, "qst_formal_marriage_proposal", slot_quest_current_state, 0),
      (call_script, "script_start_quest", "qst_formal_marriage_proposal", "$g_talk_troop"),
      (quest_set_slot, "qst_formal_marriage_proposal", slot_quest_giver_troop, "$g_talk_troop"),
  ]],
  
  [anyone|plyr,"lady_proposal_refused",
    [],
    "Very well -- I shall continue to strive to be worthy of your esteem!", "close_window",[
  ]],
  
  # [anyone|plyr,"lady_proposal_refused",
    # [
      # (eq, 1, 0),
      # (neg|check_quest_active, "qst_formal_marriage_proposal"),
    # ],
    # "I am tired of these games! I will speak to your family about arranging a wedding immediately.", "lady_player_threatens_compel",[
  # ]],
  
  # [anyone,"lady_player_threatens_compel",
    # [],
    # "What? Do you mean that?", "lady_player_threatens_compel_2",[
  # ]],
  
  # [anyone|plyr,"lady_player_threatens_compel_2",
    # [],
    # "No, of course not. Please forgive my outburst of temper.", "lady_private_conversation_end",[
  # ]],
  
  # [anyone|plyr,"lady_player_threatens_compel_2",
    # [],
    # "Yes. You clearly do not know what is in your best interests.", "close_window",[
      # (call_script, "script_get_kingdom_lady_social_determinants", "$g_talk_troop"),
      # (assign, ":guardian", reg0),
      # (str_store_troop_name, s10, "$g_talk_troop"),
      # (str_store_troop_name_link, s12, ":guardian"),
      # (setup_quest_text, "qst_formal_marriage_proposal"),
      # (str_store_string, s2, "str_you_intend_to_ask_s12_to_pressure_s10_to_marry_you"),
      
      # (quest_set_slot, "qst_formal_marriage_proposal", slot_quest_target_troop, ":guardian"),
      # (quest_set_slot, "qst_formal_marriage_proposal", slot_quest_expiration_days, 30),
      # (quest_set_slot, "qst_formal_marriage_proposal", slot_quest_current_state, 0),
      # (call_script, "script_start_quest", "qst_formal_marriage_proposal", "$g_talk_troop"),
      # (quest_set_slot, "qst_formal_marriage_proposal", slot_quest_giver_troop, "$g_talk_troop"),
  # ]],
  
  
  
  #rival suitor sequence
  [anyone|plyr,"lady_other_suitor",
    [],
    "It grieves me to hear that, my lady, but such things must be", "lady_pretalk",
    []],
  
  [anyone|plyr,"lady_other_suitor",
    [],
    "Who is the miscreant! Tell me his name!", "lady_other_suitor_challenge",
    []],
  
  # [anyone|plyr,"lady_other_suitor", #similar to other
    # [
      # (eq, 1, 0),
    # ],
    # "I am tired of these games! I will demand that your family compel you to marry me.", "lady_player_threatens_compel",[
  # ]],
  
  [anyone,"lady_other_suitor_challenge",
    [
      (check_quest_active,"qst_duel_courtship_rival"),
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "$romantic_rival"),
      (lt, reg0, 0)
    ],
    "I would be so grateful! But from what I understand, you already have a duel on your hands. He is not honor-bound to fight you, if you are committed to another combat. Please, conclude your other business in a hurry, to rescue me from that man's attentions.", "lady_pretalk",
    []],
  
  [anyone,"lady_other_suitor_challenge",
    [
      (check_quest_active,"qst_duel_courtship_rival")
    ],
    "Ah! Such talk. But from what I hear, you already have a duel on your hands. Finish one before you start another! Sigh... You men can be so silly...", "lady_pretalk",
    []],
  
  [anyone,"lady_other_suitor_challenge",
    [
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "$romantic_rival"),
      (lt, reg0, 0),
      (str_store_troop_name, s5, "$romantic_rival"),
    ],
    "It is {s5}. Please, rescue me from that man's attentions!", "lady_other_suitor_challenge_confirm",
    []],
  
  
  
  [anyone,"lady_other_suitor_challenge",
    [
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
      (str_store_troop_name, s5, "$romantic_rival"),
    ],
    "Will you now? This should be interesting. Very well. Your rival is {s5}. Let us see which of you has the greater mettle.", "lady_other_suitor_challenge_confirm",
    [
      (assign, "$quarrel_penalty", 0),
  ]],
  
  [anyone,"lady_other_suitor_challenge",
    [
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_conventional),
      (str_store_troop_name, s5, "$romantic_rival"),
    ],
    "Oh, fie! I wish that this were not a matter of honor, so I could refuse such a request. But alas, I feel compelled to tell you that your rival is {s5}. I wish that heaven had not granted me such a fair visage, so that I would not inspire such passions in men!", "lady_other_suitor_challenge_confirm",
    [
      (assign, "$quarrel_penalty", -1),
  ]],
  
  [anyone,"lady_other_suitor_challenge",
    [
      (str_store_troop_name, s5, "$romantic_rival"),
    ],
    "I will have none of such talk! It is nonsense for you and {s5} to fight over -- whoops! I beg of you, sir, forget the name that just escaped my lips...", "lady_other_suitor_challenge_confirm",
    [
      (assign, "$quarrel_penalty", -3),
  ]],
  
  [anyone|plyr,"lady_other_suitor_challenge_confirm",
    [],
    "So be it! I shall challenge him to a trial of arms!", "lady_other_suitor_challenge_confirm_yes",
    []],
  
  [anyone|plyr,"lady_other_suitor_challenge_confirm",
    [],
    "On second thought, I let my passions run away with me there. Never mind.", "lady_other_suitor_challenge_confirm_no",
    []],
  
  [anyone,"lady_other_suitor_challenge_confirm_yes",
    [
      (try_begin),
        (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "$romantic_rival"),
        (lt, reg0, 0),
        (str_store_string, s15, "str_do_be_careful_i_am_so_much_endebted_to_you_for_this"),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_ambitious),
        (str_store_string, s15, "str_go_then__we_shall_see_which_of_you_triumphs"),
      (else_try),
        (str_store_string, s15, "str_sigh_i_will_never_truly_understand_men_and_their_rash_actions"),
      (try_end),
    ],
    "{!}{s15}", "lady_pretalk",
    [
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", "$quarrel_penalty"),
      (str_store_troop_name, s11, "$g_talk_troop"),
      (str_store_troop_name_link, s13, "$romantic_rival"),
      (setup_quest_text, "qst_duel_courtship_rival"),
      (str_store_string, s2, "str_you_intend_to_challenge_s13_to_force_him_to_relinquish_his_suit_of_s11"),
      
      (call_script, "script_start_quest", "qst_duel_courtship_rival", "$g_talk_troop"),
      
      (quest_set_slot, "qst_duel_courtship_rival", slot_quest_target_troop, "$romantic_rival"),
      
      (quest_set_slot, "qst_duel_courtship_rival", slot_quest_xp_reward, 400),
      (quest_set_slot, "qst_duel_courtship_rival", slot_quest_expiration_days, 60),
      (quest_set_slot, "qst_duel_courtship_rival", slot_quest_current_state, 0),
  ]],
  
  [anyone,"lady_other_suitor_challenge_confirm_no",
    [],
    "Good. You are wise not to let your temper guide you.", "lady_private_conversation_end",
    []],
  
  
  
  
  [anyone|plyr,"lady_talk", [
      (store_partner_quest, ":ladys_quest"),
      (ge, ":ladys_quest", 0),
      (this_or_next|eq, ":ladys_quest", "qst_blank_quest_17"),
      (eq, ":ladys_quest", "qst_blank_quest_16"),],
    "About the task you asked of me...", "lady_active_mission_1",[]],
  
  [anyone,"lady_active_mission_1", [], "Yes {reg59?madam:sir}, have you made any progress on it?", "lady_active_mission_2",[]],
  
  [anyone|plyr,"lady_active_mission_2",[(store_partner_quest,":ladys_quest"),
      (eq, ":ladys_quest", "qst_blank_quest_16"),
      (quest_get_slot, ":quest_target_amount", "qst_blank_quest_16", slot_quest_target_amount),
      (quest_get_slot,":quest_target_item","qst_blank_quest_16", slot_quest_target_item),
      (call_script, "script_get_troop_item_amount", "trp_player", ":quest_target_item"),
      (assign, ":cur_amount", reg0),
      (str_store_item_name, s33, ":quest_target_item"),
      (ge, ":cur_amount", ":quest_target_amount"),
      (assign, reg5, ":quest_target_amount"),
      (store_sub, reg1, reg5, 1),
    ],
    "Indeed. I brought you {reg5} {reg1?pieces:piece} of {s33}.", "lady_active_mission_thankyou",
    []],
  
  [anyone|plyr,"lady_active_mission_2",[(store_partner_quest,":ladys_quest"),
      (eq, ":ladys_quest", "qst_blank_quest_17"),
      (quest_get_slot, ":quest_target_amount", "qst_blank_quest_17", slot_quest_target_amount),
      (quest_get_slot,":quest_target_item","qst_blank_quest_17", slot_quest_target_item),
      (call_script, "script_get_troop_item_amount", "trp_player", ":quest_target_item"),
      (assign, ":cur_amount", reg0),
      (str_store_item_name, s33, ":quest_target_item"),
      (ge, ":cur_amount", ":quest_target_amount"),
      (assign, reg5, ":quest_target_amount"),
      (store_sub, reg1, reg5, 1),
      (troop_get_inventory_capacity, ":capacity", "trp_player"),
      (assign, ":cap", 0),
      (try_for_range, ":cur_slot", 0, ":capacity"),
        (troop_get_inventory_slot, ":cur_item", "trp_player", ":cur_slot"),
        (eq, ":cur_item", "itm_cheese"),
        (val_add, ":cap", 1),
      (try_end),
      (ge, ":cap", 2),
    ],
    "Indeed. I brought you {reg5} {reg1?bottles:bottle} of {s33} and 2 pieces of cheese.", "lady_active_mission_thankyou1",
    []],
  
  [anyone,"lady_active_mission_thankyou", [],
    "Thank you very much, {playername}! I really appreciate your helping me. I promise I would find a way to reward you for your valiant efforts.", "lady_talk",
    [(quest_get_slot, ":quest_target_amount", "qst_blank_quest_16", slot_quest_target_amount),
      (quest_get_slot,":quest_target_item","qst_blank_quest_16", slot_quest_target_item),
      (troop_remove_items, "trp_player", ":quest_target_item", ":quest_target_amount"),
      (quest_get_slot,":quest_xp","qst_blank_quest_16", slot_quest_xp_reward),
      (add_xp_as_reward, ":quest_xp"),
      (val_mul, ":quest_target_amount", 2),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", ":quest_target_amount"),
      (call_script, "script_end_quest", "qst_blank_quest_16"),
  ]],
  
  [anyone,"lady_active_mission_thankyou1", [],
    "Thank you very much, {playername}! I really appreciate your helping me. I promise I would find a way to reward you for your valiant efforts.", "lady_talk",
    [(quest_get_slot, ":quest_target_amount", "qst_blank_quest_17", slot_quest_target_amount),
      (quest_get_slot,":quest_target_item","qst_blank_quest_17", slot_quest_target_item),
      (troop_remove_items, "trp_player", ":quest_target_item", ":quest_target_amount"),
      (troop_remove_items, "trp_player", "itm_cheese", 2),
      (quest_get_slot,":quest_xp","qst_blank_quest_17", slot_quest_xp_reward),
      (add_xp_as_reward, ":quest_xp"),
      (val_mul, ":quest_target_amount", 2),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", ":quest_target_amount"),
      (call_script, "script_end_quest", "qst_blank_quest_17"),
  ]],
  
  [anyone|plyr,"lady_active_mission_2", [], "I am still working on it.", "lady_active_mission_3",[]],
  [anyone|plyr,"lady_active_mission_2", [], "I am afraid I won't be able to finish it.", "lady_mission_failed",[]],
  
  [anyone,"lady_active_mission_3", [], "Thank you, {reg59?madam:sir}, but please hurry up.", "lady_pretalk",[]],
  
  [anyone,"lady_mission_failed", [], "Ah, I am sorry to hear that {reg59?madam:sir}. I'm very disappointed in you!", "lady_pretalk",
    [(store_partner_quest,":ladys_quest"),
      (call_script, "script_abort_quest", ":ladys_quest", 1),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),]],
  
  
  
  [anyone|plyr,"lady_talk",
    [
      #	 (troop_slot_ge, "$g_talk_troop", slot_troop_spouse, 0),
      #     (troop_slot_ge, "$g_talk_troop", slot_troop_met, 2),
      (store_partner_quest, ":ladys_quest"),
      (lt, ":ladys_quest", 0)
    ],
    "Is there anything I can do to win your favour?", "lady_ask_for_quest",[(call_script, "script_get_quest", "$g_talk_troop"),
      (assign, "$random_quest_no", reg0)]],
  
  [anyone,"lady_ask_for_quest",
    [
      (troop_slot_eq, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
    ],
    "I don't have anything else for you to do right now.", "lady_pretalk", []],
  
  [anyone,"lady_ask_for_quest",
    [ (eq, "$random_quest_no", "qst_blank_quest_18"),
      (quest_get_slot,":quest_target_troop","$random_quest_no", slot_quest_target_troop),
      (str_store_troop_name, s3, ":quest_target_troop"),],"Oh, {playername}, there is a delicate matter. I need you to take a message to my... to {s3}. Do you think you could do me this little favor? {s33}","lady_mission_told",
    [		(str_store_troop_name_link, s11, "$g_talk_troop"),
      (quest_get_slot,":quest_target_troop","$random_quest_no", slot_quest_target_troop),
      (store_faction_of_troop, ":faction", ":quest_target_troop"),
      (store_relation, ":faction_relation", ":faction", "$players_kingdom"),
      (try_begin),
        (lt, ":faction_relation", 0),
        (str_store_string, s33, "@I know, you're at war with his kingdom, so you may have a problem giving him my message, or perhaps your bravery would desert you."),
      (else_try),
        (str_clear, s33),
      (try_end),
      (str_store_troop_name_link, s3, ":quest_target_troop"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s11} asked you to deliver a message to {s3}."),
  ]],
  
  
  
  [anyone,"lady_ask_for_quest",
    [     (eq, "$random_quest_no", "qst_blank_quest_16"),
      (quest_get_slot,":quest_target_amount","$random_quest_no", slot_quest_target_amount),
      (quest_get_slot,":quest_target_item","$random_quest_no", slot_quest_target_item),
      (assign, reg25, ":quest_target_amount"),
      (store_sub, reg1, reg25, 1),
      (str_store_item_name, s17, ":quest_target_item"),
      (try_begin),
        (troop_slot_ge, "$g_talk_troop", slot_troop_spouse, 1),
        (str_store_string, s13, "@Oh, {playername}, my husband is too busy with the affairs of the state. Would you be so kind to bring " +
        "me {reg25} {reg1?pieces:piece} of {s17}?"),
      (else_try),
        (str_store_string, s13, "@Oh, {playername}, could you do me a little favor? I saw a trader the other day, selling some novelties out by the gate. " +
        "Unfortunately, I can't spend money freely. Would you be so kind and bring me {reg25} {reg1?pieces:piece} of {s17}?"),
      (try_end),
    ], "{!}{s13}","lady_mission_told",
    [	(quest_get_slot,":quest_target_amount","$random_quest_no", slot_quest_target_amount),
      (quest_get_slot,":quest_target_item","$random_quest_no", slot_quest_target_item),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (assign, reg25, ":quest_target_amount"),
      (str_store_item_name, s17, ":quest_target_item"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s11} asked you to bring her {reg25} {reg1?pieces:piece} of {s17}."),
  ]],
  
  [anyone,"lady_ask_for_quest",
    [     (eq, "$random_quest_no", "qst_blank_quest_17"),
      (quest_get_slot,":quest_target_amount","$random_quest_no", slot_quest_target_amount),
      (quest_get_slot,":quest_target_item","$random_quest_no", slot_quest_target_item),
      (assign, reg25, ":quest_target_amount"),
      (store_sub, reg1, reg25, 1),
      (str_store_item_name, s17, ":quest_target_item"),
      (troop_get_slot, ":spouse", "$g_talk_troop", slot_troop_spouse),
      (try_begin),
        (ge, ":spouse", 1),
        (str_store_troop_name, s15, ":spouse"),
        (str_store_string, s13, "@Oh, {playername}, my husband, {s15}, is too busy with the affairs of the state, and I would like to have a surprise party " +
        "set up in his honor. Would you be so kind as to bring me {reg25} {reg1?bottles:bottle} of {s17} and 2 pieces of cheese?"),
      (else_try),
        (str_store_string, s13, "@Oh, {playername}, could you do me a little favor? I have some of my lady friends here visiting, and I would like " +
        "to have a small party in their honor. Unfortunately, I can't spend money freely. Would you be so kind and bring me {reg25} {reg1?bottles:bottle} of {s17} and 2 pieces of cheese?"),
      (try_end),
    ], "{!}{s13}","lady_mission_told",
    [	(quest_get_slot,":quest_target_amount","$random_quest_no", slot_quest_target_amount),
      (quest_get_slot,":quest_target_item","$random_quest_no", slot_quest_target_item),
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (assign, reg25, ":quest_target_amount"),
      (str_store_item_name, s17, ":quest_target_item"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s11} asked you to bring her {reg25} {reg1?bottles:bottle} of {s17} and 2 pieces of cheese."),
  ]],
  
  
  
  
  [anyone,"lady_ask_for_quest",
    [
      (this_or_next|eq, "$random_quest_no", "qst_rescue_lord_by_replace"),
      (eq, "$random_quest_no", "qst_rescue_prisoner"),
    ],
    "Oh, I fear I may never see my {s17}, {s13}, again... He is a prisoner in the dungeon of {s14}. " +
    "We have tried to negotiate his ransom, but it has been set too high. " +
    "We can never hope to raise that much money without selling everything we own, " +
    "and God knows {s13} would rather spend his life in prison than make us destitute. " +
    "Instead, I came up with a plan to get him out of there, but it requires someone to make a great sacrifice, " +
    "and so far, my pleas have fallen on deaf ears...", "lady_mission_told",
    [
      
      (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (call_script, "script_troop_get_family_relation_to_troop", ":quest_target_troop", "$g_talk_troop"),
      (str_store_string, s17, s11),
      (str_store_troop_name, s11, "$g_talk_troop"),
      (str_store_troop_name_link, s13, ":quest_target_troop"),
      (str_store_party_name_link, s14, ":quest_target_center"),
      (setup_quest_text,"$random_quest_no"),
      
      (try_begin),
        (eq, "$random_quest_no", "qst_rescue_lord_by_replace"),
        (str_store_string, s2, "@{s11} asked you to rescue her {s17}, {s13}, from {s14} by switching clothes and taking his place in prison."),
      (else_try),
        (str_store_string, s2, "@{s11} asked you to rescue her {s17}, {s13}, from {s14}."),
      (try_end),
  ]],
  
  [anyone,"lady_ask_for_quest", [
      (eq, "$random_quest_no", "qst_deliver_message_to_prisoner_lord"),
      (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
      (call_script, "script_troop_get_family_relation_to_troop", ":quest_target_troop", "$g_talk_troop"),
      
    ],
    "My poor {s11}, {s13}, is a prisoner in the {s14} dungeons. " +
    "The only way we can talk to each other is by exchanging letters whenever we can, " +
    "but the journey is so dangerous that we get little chance to do so. " +
    "Please, would you deliver one for me?", "lady_mission_told",
    [
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
      
      
      (str_store_troop_name, s12, "$g_talk_troop"),
      (str_store_troop_name_link, s13, ":quest_target_troop"),
      (str_store_party_name_link, s14, ":quest_target_center"),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@{s12} asked you to deliver a message to {s13}, who is imprisoned at {s14}."),
  ]],
  
  
  [anyone,"lady_ask_for_quest", [(eq, "$random_quest_no", "qst_duel_for_lady")],
    "Dear {playername}, you are kind to ask, but you know little of my troubles " +
    "and I can't possibly ask you to throw yourself into danger on my behalf.", "lady_quest_duel_for_lady",[]],
  
  [anyone|plyr,"lady_quest_duel_for_lady", [], "Tell me what the problem is, and I can make my own decision.", "lady_quest_duel_for_lady_2",
    [
      (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
      
      (str_store_troop_name, s11, "$g_talk_troop"),
      (str_store_troop_name_link, s13, ":quest_target_troop"),
      (str_store_string, s2, "@You agreed to challenge {s13} to defend {s11}'s honour."),
      (setup_quest_text,"$random_quest_no"),
  ]],
  
  [anyone,"lady_quest_duel_for_lady_2", [], "Very well, as you wish it... " +
    "My husband has made certain enemies in his life, {playername}. One of the most insidious is {s13}. " +
    "He is going around making terrible accusations against me, impugning my honour at every turn! " +
    "Because he cannot harm my husband directly, he is using me as a target to try and stain our name. " +
    "You should hear the awful things he's said! I only wish there was someone brave enough to make him recant his slander, " +
    "but {s13} is a very fine swordsman, and he's widely feared...", "lady_quest_duel_for_lady_3",[]],
  
  [anyone|plyr,"lady_quest_duel_for_lady_3", [], "I fear him not, {s65}. I will make him take back his lies.", "lady_quest_duel_for_lady_3_accepted",[]],
  [anyone,"lady_quest_duel_for_lady_3_accepted", [], "Oh! I can't ask that of you, {playername}, but... " +
    "I would be forever indebted to you, and you are so sure. It would mean so much if you would defend my honour. " +
    "Thank you a thousand times, all my prayers and my favour go with you.", "close_window",
    [
      
      (quest_get_slot, ":quest_target_troop", "$random_quest_no", slot_quest_target_troop),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (call_script, "script_report_quest_troop_positions", "$random_quest_no", ":quest_target_troop", 3),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 8),
  ]],
  
  [anyone|plyr,"lady_quest_duel_for_lady_3", [], "If he is that dangerous, perhaps maybe it would be better to ignore him...", "lady_quest_duel_for_lady_3_rejected",[]],
  [anyone,"lady_quest_duel_for_lady_3_rejected", [], "Oh... Perhaps you're right, {playername}. " +
    "I should let go of these silly childhood ideas of chivalry and courage. {reg59?People:Men} are not like that, " +
    "not anymore. Good day to you.", "close_window",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone,"lady_ask_for_quest", [
      (eq, "$random_quest_no", -1),
      (eq,reg59,tf_male),
      (neq, "$campaign_type", camp_storyline),
      (neg|check_quest_active, "qst_blank_quest_13"),
      (neg|check_quest_succeeded, "qst_blank_quest_13"),
      (neg|check_quest_failed, "qst_blank_quest_13"),
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (ge, ":player_renown", 300),
      (neg|troop_slot_eq, "$g_talk_troop", slot_troop_spouse, "trp_player"),
      (troop_slot_ge, "$g_talk_troop", slot_troop_spouse, 1),
      (troop_get_slot, ":age", "$g_talk_troop", slot_troop_age),
      (ge, ":age", 30),
      (ge, "$g_talk_troop_faction_relation", -5),
      (ge, "$g_talk_troop_faction_kingdom_relation", 0),
      (store_faction_of_troop, ":troop_faction", "$g_talk_troop"),
      (store_faction_of_party, ":party_faction", "$g_encountered_party"),
      (eq, ":troop_faction", ":party_faction"),
      (is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end),
      (call_script, "script_troop_get_player_relation", "$g_talk_troop"),
      (assign, ":relation", reg0),
      (gt,  ":relation", 30),
      (gt, "$player_honor", 30),
      (troop_slot_eq, "$g_talk_troop", slot_troop_temp, 0),
      (store_random_in_range, ":rand", 0, 100),
      (lt,":rand", 15),
      ], "Well, {playername}, there is a delicate matter that I am not sure how to solve. I have been having nightmares lately...", "lady_ask_for_quest_past",[]],
  [anyone|plyr,"lady_ask_for_quest_past", [], "You can count on me, my lady. Your secret is safe with me.", "lady_ask_for_quest_past2",[]],
  [anyone|plyr,"lady_ask_for_quest_past", [], "Nightmares? Hmm. Well, good luck with that.", "lady_mission_rejected",[]],
  [anyone,"lady_ask_for_quest_past2", [], "Well, {playername}, when I was younger, many years ago, there was a very handsome young guard in our castle. I had never seen anyone so handsome. " +
    "Long story short, we fell in love, and..., well, we became lovers. But then I was married off to my husband, and my love was sent away. I have never seen him again. I have always suspected that either my father " +
    "or my husband or both of them learned about our affair and sent him to die somewhere, or just hired an assassin to kill him. It was many years ago, but suddenly I started having these dreams in which " +
    "he is calling me, asking me to go with him and saying that my husband is the one who murdered him. But many years have passed, and I don't feel the infatuation anymore. He's dead, and I'm not, so how can I " +
    "join him, anyway? Is he a ghost now, asking me to die to join him?", "lady_ask_for_quest_past3",[]],
  [anyone|plyr,"lady_ask_for_quest_past3", [], "No need to worry, my lady. I will deal with this 'ghost.' Where exactly is he calling you?", "lady_ask_for_quest_past4",[]],
  [anyone|plyr,"lady_ask_for_quest_past3", [], "Sorry, I can't help you with that.", "lady_mission_rejected",[]],
  [anyone,"lady_ask_for_quest_past4", [
      (assign, ":place", 0),
      (is_between, "$current_town", walled_centers_begin, walled_centers_end),
      (try_for_range, ":village", villages_begin, villages_end),
        (party_get_slot, ":bound_center", ":village", slot_village_bound_center),
        (eq, ":bound_center", "$current_town"),
        (assign, ":place", ":village"),
      (try_end),
      (str_store_party_name, s33, ":place"),
      (assign, "$temp", ":place"),
      ], "He seems to be somewhere around {s33}. Oh, {playername}, I am so grateful. But, please, I beg you, be very discrete about this matter. I don't want my husband or anyone else to know about what happened.", "close_window",[
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (setup_quest_text, "qst_blank_quest_13"),
      (str_store_string, s2, "@{s11} asked you to discretely eliminate her 'ghost' ex-lover, who is believed to be in {s33}."),
      (call_script, "script_start_quest", "qst_blank_quest_13", "$g_talk_troop"),
      (quest_set_slot, "qst_blank_quest_13", slot_quest_xp_reward, 1000),
      (quest_set_slot, "qst_blank_quest_13", slot_quest_expiration_days, 17),
      (quest_set_slot, "qst_blank_quest_13", slot_quest_current_state, 0),
      (quest_set_slot, "qst_blank_quest_13", slot_quest_target_center, "$temp"),
  ]],
  
  
  [anyone,"lady_ask_for_quest", [], "No, {playername}, I've no need for a champion right now.", "lady_pretalk",[
    (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
  ]],
  
  [anyone|plyr,"lady_mission_told", [], "As you wish, {s65}, it shall be done.", "lady_mission_accepted",[]],
  [anyone|plyr,"lady_mission_told", [], "{s66}, I fear I cannot help you right now.", "lady_mission_rejected",[]],
  
  [anyone,"lady_mission_accepted", [], "You are a true {reg59?lady:gentleman}, {playername}. " +
    "Thank you so much for helping me", "close_window",
    [
      (try_begin),
        (eq, "$random_quest_no", "qst_deliver_message_to_prisoner_lord"),
        (try_begin),
          (neq, "$campaign_type", camp_storyline),
          (call_script, "script_troop_add_gold", "trp_player", 10),
        (else_try),
          (call_script, "script_troop_add_gold", "trp_player", 100),
        (try_end),
      (try_end),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
  ]],
  [anyone,"lady_mission_rejected", [], "You'll not help a woman in need? You should be ashamed, {playername}... " +
    "Please leave me. I have some important embroidery to catch up on.", "close_window",
    [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
      (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 5),
  ]],
    
  [anyone|plyr,"lady_talk", [
      (troop_slot_ge, "$g_talk_troop", slot_troop_spouse, 0),
      ], "I want to improve my relation with a lord. Can you help me?", "lady_restore_relation",[]],
  [anyone,"lady_restore_relation", [(le, "$g_talk_troop_relation", 10)], "{playername}, I don't know you well enough to act on your behalf. I am sorry.", "lady_pretalk",[]],
  [anyone,"lady_restore_relation", [], "Hmm. I guess you got on the wrong side of somebody. Very well, with whom do you want to restore your relation?", "lady_restore_relation_2",[]],
  
  [anyone|plyr|repeat_for_troops,"lady_restore_relation_2", [(store_repeat_object, ":troop_no"),
      (is_between, ":troop_no", active_npcs_begin, active_npcs_end),
      (store_troop_faction, ":faction_no", ":troop_no"),
      (eq, "$g_talk_troop_faction", ":faction_no"),
      (call_script, "script_troop_get_player_relation", ":troop_no"),
      (lt, reg0, 0),
      (str_store_troop_name, s1, ":troop_no")],
    "{!}{s1}", "lady_restore_relation_2b",[(store_repeat_object, "$troop_to_restore_relations_with")]],
  [anyone|plyr,"lady_restore_relation_2", [], "Never mind. I get along with everyone well enough.", "lady_pretalk",[]],
  
  [anyone,"lady_restore_relation_2b", [(str_store_troop_name, s10, "$troop_to_restore_relations_with")], "Well I can try to help you there. " +
    "I am sure a few expensive gifts will make {s10} look at you more favorably.", "lady_restore_relation_3",[]],
  
  [anyone,"lady_restore_relation_3", [(str_store_troop_name, s10, "$troop_to_restore_relations_with"),
      (assign, "$lady_restore_cost_1", 1000),
      (assign, "$lady_restore_cost_2", 2000),
      (assign, "$lady_restore_cost_3", 3000),
      (assign, reg10, "$lady_restore_cost_1"),
      (assign, reg11, "$lady_restore_cost_2"),
      (assign, reg12, "$lady_restore_cost_3"),
      (troop_get_type, reg4, "$troop_to_restore_relations_with"),
      (val_mod, reg4, 2),
    ],
    "You can improve your relation with {s10} by sending {reg4?her:him} a gift worth {reg10} peningas. " +
    "But if you can afford spending {reg11} peningas on the gift, it would make a good impression on {reg4?her:him}. " +
    "And if you can go up to {reg12} peningas, that would really help smooth things out.", "lady_restore_relation_4",[]],
  
  [anyone|plyr,"lady_restore_relation_4", [(store_troop_gold,":gold", "trp_player"),
      (ge, ":gold", "$lady_restore_cost_1"),
      (assign, reg10, "$lady_restore_cost_1")],
    "I think a gift of {reg10} peningas will do.", "lady_restore_relation_5",[(assign, "$temp", 1), (assign, "$temp_2", "$lady_restore_cost_1")]],
  [anyone|plyr,"lady_restore_relation_4", [(store_troop_gold,":gold", "trp_player"),
      (ge, ":gold", "$lady_restore_cost_2"),
      (assign, reg11, "$lady_restore_cost_2")],
    "Maybe I can afford {reg11} peningas.", "lady_restore_relation_5",[(assign, "$temp", 2), (assign, "$temp_2", "$lady_restore_cost_2")]],
  [anyone|plyr,"lady_restore_relation_4", [(store_troop_gold,":gold", "trp_player"),
      (ge, ":gold", "$lady_restore_cost_3"),
      (assign, reg12, "$lady_restore_cost_3")],
    "In that case, I am ready to spend {reg12} peningas.", "lady_restore_relation_5",[(assign, "$temp", 3), (assign, "$temp_2", "$lady_restore_cost_3")]],
  
  [anyone|plyr,"lady_restore_relation_4", [], "I don't think I can afford a gift at the moment.", "lady_restore_relation_cant_afford",[]],
  
  [anyone,"lady_restore_relation_5", [], "Excellent. Then I'll choose an appropriate gift for you and send it to {s10} with your compliments. " +
    "I am sure {reg4?she:he} will appreciate the gesture.", "lady_restore_relation_6",[
      (troop_remove_gold, "trp_player","$temp_2"),
      (call_script, "script_change_player_relation_with_troop", "$troop_to_restore_relations_with", "$temp"),
      (troop_get_type, reg4, "$troop_to_restore_relations_with"),
      (val_mod, reg4, 2),
  ]],
  
  [anyone|plyr,"lady_restore_relation_6", [], "Thank you for your help, madame.", "lady_pretalk",[]],
  
  [anyone,"lady_restore_relation_cant_afford", [], "I am afraid that I cannot be of much help in that case, {playername}. I am sorry.", "lady_pretalk",[]],
  
  [anyone|plyr,"lady_talk", [], "I must beg my leave.", "lady_leave",[]],
  
  [anyone|auto_proceed,"lady_leave", [
      (call_script, "script_troop_get_relation_with_troop", "$g_talk_troop", "trp_player"),
      (try_begin),
        (lt, reg0, 0),
        (str_store_string, s12, "str_farewell"),
      (else_try),
        (str_store_string, s12, "str_farewell_playername"),
      (try_end),
      ], "{!}{s12}", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1)]],
  
  
  
  #Convincing bargaining
  [anyone,"convince_begin", [], "I still don't see why I should accept what you're asking of me.", "convince_options",
    [(quest_get_slot, "$convince_value", "$g_convince_quest", slot_quest_convince_value),
  ]],
  
  [anyone|plyr,"convince_options", [(assign, reg8, "$convince_value")], "Then I'll make it worth your while. ({reg8} peningas)", "convince_bribe",[]],
  [anyone|plyr,"convince_options",
    [(store_div, "$convince_relation_penalty", "$convince_value", 300),
      (val_add, "$convince_relation_penalty", 1),
      (assign, reg9, "$convince_relation_penalty")],
    "Please, do it for the sake of our friendship. (-{reg9} to relation)", "convince_friendship",[]],
  [anyone|plyr,"convince_options", [], "Let me try to convince you. (Persuasion)", "convince_persuade_begin", []],
  [anyone|plyr,"convince_options", [], "Never mind.", "lord_pretalk",[]],
  
  [anyone,"convince_bribe", [], "Mmm, a generous gift to my coffers would certainly help matters... " +
    "{reg8} peningas should do it. If you agree, then I'll go with your suggestion.", "convince_bribe_verify",[]],
  
  [anyone|plyr,"convince_bribe_verify", [(store_troop_gold, ":gold", "trp_player"),
      (lt, ":gold", "$convince_value")],
    "I'm afraid my finances will not allow for such a gift.", "convince_bribe_cant_afford",[]],
  [anyone|plyr,"convince_bribe_verify", [(store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", "$convince_value")],
    "Very well, please accept these {reg8} peningas as a token of my gratitude.", "convince_bribe_goon",[]],
  [anyone|plyr,"convince_bribe_verify", [], "Let me think about this some more.", "convince_begin",[]],
  
  [anyone,"convince_bribe_cant_afford", [], "Ah. In that case, there is little I can do, " +
    "unless you have some further argument to make.", "convince_options",[]],
  [anyone,"convince_bribe_goon", [], "My dear {playername}, your generous gift has led me to reconsider what you ask, " +
    "and I have come to appreciate the wisdom of your proposal.", "convince_accept",[(troop_remove_gold, "trp_player","$convince_value")]],
  
  [anyone,"convince_friendship",
    [(store_add, ":min_relation", 5, "$convince_relation_penalty"),
      (ge, "$g_talk_troop_effective_relation", ":min_relation")], "You've done well by me in the past, {playername}, " +
    "and for that, I will go along with your request, but know that I do not like you using our relationship this way.", "convince_friendship_verify",[]],
  
  [anyone|plyr,"convince_friendship_verify", [], "I am sorry, my friend, but I need your help in this.", "convince_friendship_go_on",[]],
  [anyone|plyr,"convince_friendship_verify", [], "If it will not please you, then I'll try something else.", "lord_pretalk",[]],
  
  [anyone,"convince_friendship_go_on", [], "All right then, {playername}. I will accept this for your sake. But remember, you owe me for this.", "convince_accept",
    [(store_sub, ":relation_change", 0, "$convince_relation_penalty"),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",":relation_change")]],
  
  [anyone,"convince_friendship",
    [(ge, "$g_talk_troop_relation", -5)], "I don't think I owe you such a favor {playername}. " +
    "I see no reason to accept this for you.", "lord_pretalk",[]],
  
  [anyone,"convince_friendship", [], "Is this a joke? You've some nerve asking me for favours, {playername}, " +
    "and let me assure you you'll get none.", "lord_pretalk",[]],
  
  [anyone,"convince_persuade_begin",
    [(troop_get_slot, ":last_persuasion_time", "$g_talk_troop", slot_troop_last_persuasion_time),
      (store_current_hours, ":cur_hours"),
      (store_add, ":valid_time", ":last_persuasion_time", 24),
      (gt, ":cur_hours", ":valid_time"),
    ],
    "Very well. Make your case.", "convince_persuade_begin_2",[]],
  
  
  [anyone|plyr,"convince_persuade_begin_2", [], "[Attempt to persuade]", "convince_persuade",[
      (try_begin),
        (store_random_in_range, ":rand", 0, 100),
        (lt, ":rand", 30),
        (store_current_hours, ":cur_hours"),
        (troop_set_slot, "$g_talk_troop", slot_troop_last_persuasion_time, ":cur_hours"),
      (try_end),
      (store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"),
      (store_add, ":persuasion_potential", ":persuasion_level", 5),
      
      (store_random_in_range, ":random_1", 0, ":persuasion_potential"),
      (store_random_in_range, ":random_2", 0, ":persuasion_potential"),
      (store_add, ":rand", ":random_1", ":random_2"),
      
      (assign, ":persuasion_difficulty", "$convince_value"),
      (convert_to_fixed_point, ":persuasion_difficulty"),
      (store_sqrt, ":persuasion_difficulty", ":persuasion_difficulty"),
      (convert_from_fixed_point, ":persuasion_difficulty"),
      (val_div, ":persuasion_difficulty", 10),
      (val_add, ":persuasion_difficulty", 4),
      
      (store_sub, "$persuasion_strength", ":rand", ":persuasion_difficulty"),
      (val_mul, "$persuasion_strength", 20),
      (assign, reg5, "$persuasion_strength"),
      (val_sub, "$convince_value", "$persuasion_strength"),
      (quest_set_slot, "$g_convince_quest", slot_quest_convince_value, "$convince_value"),
      (str_store_troop_name, s50, "$g_talk_troop"),
      (troop_get_type, reg51, "$g_talk_troop"),
      (val_mod, reg51, 2),
      (try_begin),
        (lt, "$persuasion_strength", -30),
        (str_store_string, s5, "str_persuasion_summary_very_bad"),
      (else_try),
        (lt, "$persuasion_strength", -10),
        (str_store_string, s5, "str_persuasion_summary_bad"),
      (else_try),
        (lt, "$persuasion_strength", 10),
        (str_store_string, s5, "str_persuasion_summary_average"),
      (else_try),
        (lt, "$persuasion_strength", 30),
        (str_store_string, s5, "str_persuasion_summary_good"),
      (else_try),
        (str_store_string, s5, "str_persuasion_summary_very_good"),
      (try_end),
      (dialog_box, "@{s5} (Persuasion strength: {reg5})", "@Persuasion Attempt"),
  ]],
  [anyone|plyr,"convince_persuade_begin_2", [], "Wait. Perhaps there is another way to convince you.", "convince_begin",[]],
  
  [anyone,"convince_persuade_begin", [], "Goodness sake, {playername}! " +
    "Haven't we talked enough already? I am tired of listening to you, " +
    "and I do not want to hear any more of it right now.", "lord_pretalk",[]],
  
  [anyone,"convince_persuade", [(le, "$convince_value", 0)], "All right! All right! You have persuaded me to do it. " +
    "I'll go ahead with what you suggest.", "convince_accept",[]],
  [anyone,"convince_persuade", [(gt, "$persuasion_strength", 5)], "You have a point, {playername}. " +
    "I admit that much. However, I am not yet convinced I should do as you bid.", "convince_options",[]],
  [anyone,"convince_persuade", [(gt, "$persuasion_strength", -5)], "Enough, {playername}. " +
    "You've made a lot of arguments, but I find none of them truly convincing. I stand by what I said before.", "convince_options",[]],
  [anyone,"convince_persuade", [], "Truthfully, {playername}, I fail to see the virtue of your reasoning. " +
    "What you ask for makes even less sense now than it did before.", "convince_options",[]],
  
  #Seneschal
  
  [anyone,"start", [(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_seneschal),
      (eq, "$talk_context", tc_siege_won_seneschal),
      (str_store_party_name, s1, "$g_encountered_party"),
    ],
    "I must congratulate you on your victory, my {reg59?lady:lord}. Welcome to {s1}. " +
    "We, the housekeepers of this castle, are at your service.", "siege_won_seneschal_1",[]],
  [anyone|plyr,"siege_won_seneschal_1", [], "Are you the seneschal?", "siege_won_seneschal_2",[]],
  [anyone,"siege_won_seneschal_2", [], "Indeed I am, my {reg59?lady:lord}. " +
    "I have always served the masters of {s1} to the best of my ability, whichever side they might be on. " +
    "Thus you may count on my utmost loyalty for as long as you are the {reg59?lady:lord} of this place. " +
    "Now, do you intend to keep me on as the seneschal? I promise you will not be disappointed.", "siege_won_seneschal_3",[]],
  [anyone|plyr,"siege_won_seneschal_3", [], "Very well, you may keep your post for the time being.", "siege_won_seneschal_4",[]],
  [anyone|plyr,"siege_won_seneschal_3", [], "You can stay, but I shall be keeping a close watch on you.", "siege_won_seneschal_4",[]],
  [anyone,"siege_won_seneschal_4", [], "Thank you, my {reg59?lady:lord}. If you do not mind my impudence, " +
    "may I inquire as to what you wish to do with the castle?", "siege_won_seneschal_5",[]],
  
  [anyone|plyr,"siege_won_seneschal_5", [], "I will sell it to another lord.", "siege_won_seneschal_6",[]],
  [anyone|plyr,"siege_won_seneschal_5", [], "I intend to claim it for myself.", "siege_won_seneschal_6",[]],
  
  [anyone|plyr,"siege_won_seneschal_5", [], "I haven't given it much thought. What are my options?", "siege_won_seneschal_list_options",[]],
  
  [anyone,"siege_won_seneschal_list_options", [], "According to our laws and traditions, " +
    "you can do one of several things. " +
    "First, you could station a garrison here to protect the castle from any immediate counterattacks, " +
    "then request an audience with some wealthy lord and ask him to make you an offer. " +
    "It would be worth a tidy sum, believe you me. " +
    "If you do not wish to sell, then you will have to find yourself a liege lord and protector who would accept homage from you. " +
    "Without a royal investiture and an army at your back, you would have a difficult time holding on to the castle. " +
    "Both you and {s1} would become great big targets for any man with a few soldiers and a scrap of ambition. " +
    "", "siege_won_seneschal_list_options_2",[]],
  
  [anyone|plyr,"siege_won_seneschal_list_options_2", [], "What do you mean, a liege lord and protector? I won this place by my own hand. I don't need anyone else!", "siege_won_seneschal_list_options_3",[]],
  [anyone,"siege_won_seneschal_list_options_3", [], "Of course you don't, my {reg59?lady:lord}. " +
    "However, no lord in the land will recognize your claim to the castle unless it is verified by royal decree. " +
    "They would call {s1} an outlaw stronghold and take it from you at the earliest opportunity. " +
    "Surely, not even you could stand against a whole army.", "siege_won_seneschal_list_options_4",[]],
  [anyone|plyr,"siege_won_seneschal_list_options_4", [], "Hmm. I'll give it some thought.", "siege_won_seneschal_6",[]],
  
  [anyone,"siege_won_seneschal_6", [], "I am very pleased to hear it, my {reg59?lady:lord}. " +
    "I am only trying to serve you to the best of my ability. Now, " +
    "if at any time you find you have further need of me, " +
    "I will be in the great hall arranging a smooth handover of the castle to your forces. " +
    "", "close_window",[]],
  
  
  [anyone,"start", [(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_seneschal),(eq,"$g_talk_troop_met",0),(str_store_party_name,s1,"$g_encountered_party")],
    "Good day, {reg59?madam:sir}. I do not believe I've seen you here before. " +
    "Let me extend my welcome to you as the seneschal of {s1}.", "seneschal_intro_1",[]],
  
  [anyone|plyr,"seneschal_intro_1", [],  "A pleasure to meet you, {s65}.", "seneschal_intro_1a",[]],
  [anyone,"seneschal_intro_1a", [], "How can I help you?", "seneschal_talk",[]],
  [anyone|plyr,"seneschal_intro_1", [],  "What exactly do you do here?", "seneschal_intro_1b",[]],
  [anyone,"seneschal_intro_1b", [], "Ah, a seneschal's duties are many, good {reg59?woman:sire}. " +
    "For example, I collect the rents from my lord's estates, I manage the castle's storerooms, " +
    "I deal with the local peasantry, I take care of castle staff, I arrange supplies for the garrison... " +
    "All mundane matters on this fief are my responsibility, on behalf of my lord. " +
    "Everything except commanding the soldiers themselves.", "seneschal_talk",[]],
  
  [anyone,"start", [(troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_seneschal)],
    "Good day, {reg59?madam:sir}.", "seneschal_talk",[]],
  
  [anyone,"seneschal_pretalk", [], "Anything else?", "seneschal_talk",[]],
  
  
  ##### TODO: QUESTS COMMENT OUT BEGIN
  ##  [anyone|plyr,"seneschal_talk", [(check_quest_active, "qst_deliver_supply_to_center_under_siege"),
  ##                                  (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_target_troop, "$g_talk_troop"),
  ##                                  (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_current_state, 1),
  ##                                  (store_item_kind_count, ":no_supplies", "itm_siege_supply"),
  ##                                  (quest_get_slot, ":target_amount", "qst_deliver_supply_to_center_under_siege", slot_quest_target_amount),
  ##                                  (ge, ":no_supplies", ":target_amount")],
  ##   "TODO: Here are the supplies.", "seneschal_supplies_given",[]],
  ##
  ##  [anyone|plyr,"seneschal_talk", [(check_quest_active, "qst_deliver_supply_to_center_under_siege"),
  ##                                  (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_target_troop, "$g_talk_troop"),
  ##                                  (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_current_state, 1),
  ##                                  (store_item_kind_count, ":no_supplies", "itm_siege_supply"),
  ##                                  (quest_get_slot, ":target_amount", "qst_deliver_supply_to_center_under_siege", slot_quest_target_amount),
  ##                                  (lt, ":no_supplies", ":target_amount"),
  ##                                  (gt, ":no_supplies", 0)],
  ##   "TODO: Here are the supplies, but some of them are missing.", "seneschal_supplies_given_missing",[]],
  ##
  ##  [anyone|plyr,"seneschal_talk", [(check_quest_active, "qst_deliver_supply_to_center_under_siege"),
  ##                                  (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_object_troop, "$g_talk_troop"),
  ##                                  (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_current_state, 0)],
  ##   "TODO: Give me the supplies.", "seneschal_supplies",[]],
  ##
  ##  [anyone,"seneschal_supplies", [(store_free_inventory_capacity, ":free_inventory"),
  ##                                 (quest_get_slot, ":quest_target_amount", "qst_deliver_supply_to_center_under_siege", slot_quest_target_amount),
  ##                                 (ge, ":free_inventory", ":quest_target_amount"),
  ##                                 (quest_get_slot, ":quest_target_center", "qst_deliver_supply_to_center_under_siege", slot_quest_target_center),
  ##                                 (str_store_party_name, 0, ":quest_target_center"),
  ##                                 (troop_add_items, "trp_player", "itm_siege_supply", ":quest_target_amount")],
  ##   "TODO: Here, take these supplies. You must deliver them to {s0} as soon as possible.", "seneschal_pretalk",[(quest_set_slot, "qst_deliver_supply_to_center_under_siege", slot_quest_current_state, 1)]],
  ##
  ##  [anyone,"seneschal_supplies", [],
  ##   "TODO: You don't have enough space to take the supplies. Free your inventory and return back to me.", "seneschal_pretalk",[]],
  ##
  ##
  ##  [anyone,"seneschal_supplies_given", [],
  ##   "TODO: Thank you.", "seneschal_pretalk",[(party_get_slot, ":town_siege_days", "$g_encountered_party", slot_town_siege_days),
  ##                                            (quest_get_slot, ":target_amount", "qst_deliver_supply_to_center_under_siege", slot_quest_target_amount),
  ##                                            (val_sub, ":town_siege_days", ":target_amount"),
  ##                                            (try_begin),
  ##                                              (lt, ":town_siege_days", 0),
  ##                                              (assign, ":town_siege_days", 0),
  ##                                            (try_end),
  ##                                            (party_set_slot, "$g_encountered_party", slot_town_siege_days, ":town_siege_days"),
  ##                                            (troop_remove_items, "trp_player", "itm_siege_supply", ":target_amount"),
  ##                                            (call_script, "script_finish_quest", "qst_deliver_supply_to_center_under_siege", 100)]],
  ##
  ##  [anyone,"seneschal_supplies_given_missing", [],
  ##   "TODO: Thank you but it's not enough...", "seneschal_pretalk",[(store_item_kind_count, ":no_supplies", "itm_siege_supply"),
  ##                                                                  (quest_get_slot, ":target_amount", "qst_deliver_supply_to_center_under_siege", slot_quest_target_amount),
  ##                                                                  (assign, ":percentage_completed", 100),
  ##                                                                  (val_mul, ":percentage_completed", ":no_supplies"),
  ##                                                                  (val_div, ":percentage_completed", ":target_amount"),
  ##                                                                  (call_script, "script_finish_quest", "qst_deliver_supply_to_center_under_siege", ":percentage_completed"),
  ##                                                                  (party_get_slot, ":town_siege_days", "$g_encountered_party", slot_town_siege_days),
  ##                                                                  (val_sub, ":town_siege_days", ":no_supplies"),
  ##                                                                  (try_begin),
  ##                                                                    (lt, ":town_siege_days", 0),
  ##                                                                    (assign, ":town_siege_days", 0),
  ##                                                                  (try_end),
  ##                                                                  (party_set_slot, "$g_encountered_party", slot_town_siege_days, ":town_siege_days"),
  ##                                                                  (troop_remove_items, "trp_player", "itm_siege_supply", ":no_supplies"),
  ##                                                                  (call_script, "script_end_quest", "qst_deliver_supply_to_center_under_siege")]],
  ##
  ##### TODO: QUESTS COMMENT OUT END
  
  [anyone|plyr,"seneschal_talk", [(store_relation, ":cur_rel", "fac_player_faction", "$g_encountered_party_faction"),
      (ge, ":cur_rel", 0),],
    "I would like to ask you a question...", "seneschal_ask_something",[]],
  
  [anyone|plyr,"seneschal_talk", [(store_relation, ":cur_rel", "fac_player_faction", "$g_encountered_party_faction"),
      (ge, ":cur_rel", 0),],
    "I wish to know more about someone...", "seneschal_ask_about_someone",[]],
  
  [anyone,"seneschal_ask_about_someone", [],
    "Perhaps I may be able to help. Whom did you have in mind?", "seneschal_ask_about_someone_2",[]],
  
  #  [anyone|plyr|repeat_for_troops,"seneschal_ask_about_someone_2", [(store_repeat_object, ":troop_no"),
  #                                                                 (is_between, ":troop_no", heroes_begin, heroes_end),
  #                                                                  (store_troop_faction, ":faction_no", ":troop_no"),
  #                                                                 (eq, "$g_encountered_party_faction", ":faction_no"),
  #                                                                 (str_store_troop_name, s1, ":troop_no")],
  #  "{!}{s1}", "seneschal_ask_about_someone_3",[(store_repeat_object, "$hero_requested_to_learn_relations")]],
  
  [anyone|plyr,"seneschal_ask_about_someone_2", [], "Never mind.", "seneschal_pretalk",[]],
  
  #  [anyone, "seneschal_ask_about_someone_3", [(call_script, "script_troop_write_family_relations_to_s1", "$hero_requested_to_learn_relations"),
  #                                          (call_script, "script_troop_write_owned_centers_to_s2", "$hero_requested_to_learn_relations")
  #										   ],
  #   "{s2}{s1}", "seneschal_ask_about_someone_4",[(add_troop_note_from_dialog, "$hero_requested_to_learn_relations", 2)]],
  
  #  [anyone, "seneschal_ask_about_someone_relation", [(call_script, "script_troop_count_number_of_enemy_troops", "$hero_requested_to_learn_relations"),
  #                                            (assign, ":no_enemies", reg0),
  #                                            (try_begin),
  #                                              (gt, ":no_enemies", 1),
  #                                              (try_for_range, ":i_enemy", 1, ":no_enemies"),
  #                                                (store_add, ":slot_no", slot_troop_enemies_begin, ":i_enemy"),
  #                                                (troop_get_slot, ":cur_enemy", "$hero_requested_to_learn_relations", ":slot_no"),
  #                                                (str_store_troop_name_link, s50, ":cur_enemy"),
  #                                                (try_begin),
  #                                                  (eq, ":i_enemy", 1),
  #                                                  (troop_get_slot, ":cur_enemy", "$hero_requested_to_learn_relations", slot_troop_enemy_1),
  #                                                  (str_store_troop_name_link, s51, ":cur_enemy"),
  #                                                  (str_store_string, s51, "str_s50_and_s51"),
  #                                                (else_try),
  #                                                  (str_store_string, s51, "str_s50_comma_s51"),
  #                                                (try_end),
  #                                              (try_end),
  #                                            (else_try),
  #                                              (eq, ":no_enemies", 1),
  #                                              (troop_get_slot, ":cur_enemy", "$hero_requested_to_learn_relations", slot_troop_enemy_1),
  #                                              (str_store_troop_name_link, s51, ":cur_enemy"),
  #                                            (else_try),
  #                                              (str_store_string, s51, "str_no one"),
  #                                            (try_end),
  #                                            (troop_get_type, reg1, "$hero_requested_to_learn_relations")],
  #                                            (val_mod, reg1, 2),
  #   "{reg1?She:He} hates {s51}.", "seneschal_ask_about_someone_4",[(add_troop_note_from_dialog, "$hero_requested_to_learn_relations", 3)]],
  # Ryan END
  
  #  [anyone|plyr,"seneschal_ask_about_someone_4", [], "Where does {s1} stand with others?", "seneschal_ask_about_someone_relation",[]],
  #  [anyone|plyr,"seneschal_ask_about_someone_4", [], "My thanks, that was helpful.", "seneschal_pretalk",[]],
  
  
  [anyone|plyr,"seneschal_talk", [], "I must take my leave of you now. Farewell.", "close_window",[]],
  
  
  [anyone,"seneschal_ask_something", [],
    "I'll do what I can to help, of course. What did you wish to ask?", "seneschal_ask_something_2",[]],
  
  [anyone|plyr,"seneschal_ask_something_2", [],
    "Perhaps you know where to find someone...", "seneschal_ask_location",[]],
  
  [anyone,"seneschal_ask_location", [],
    "Well, a man in my position does hear a lot of things. Of whom were you thinking?", "seneschal_ask_location_2",[]],
  
  [anyone|plyr|repeat_for_troops,"seneschal_ask_location_2", [(store_repeat_object, ":troop_no"),
      (is_between, ":troop_no", heroes_begin, heroes_end),
      (store_troop_faction, ":faction_no", ":troop_no"),
      (eq, "$g_encountered_party_faction", ":faction_no"),
      (str_store_troop_name, s1, ":troop_no")],
    "{!}{s1}", "seneschal_ask_location_3",[(store_repeat_object, "$hero_requested_to_learn_location")]],
  
  [anyone|plyr,"seneschal_ask_location_2", [], "Never mind.", "seneschal_pretalk",[]],
  
  [anyone,"seneschal_ask_location_3", [(call_script, "script_get_information_about_troops_position", "$hero_requested_to_learn_location", 0)],
    "{!}{s1}", "seneschal_pretalk",[]],
  
  #caravan merchants
  [anyone,"start",
    [(eq, "$caravan_escort_state",1),
      (eq, "$g_encountered_party","$caravan_escort_party_id"),
      (le, "$talk_context",tc_party_encounter),
      (store_distance_to_party_from_party, reg0, "$caravan_escort_destination_town", "$caravan_escort_party_id"),
      (lt, reg0, 5),
      (str_store_party_name, s3, "$caravan_escort_destination_town"),
      (assign, reg3, "$caravan_escort_agreed_reward"),
    ],
    "There! I can see the walls of {s3} in the distance. We've made it safely. " +
    "Here, take this purse of {reg3} peningas, as I promised. I hope we can travel together again someday.", "close_window",
    [
      (assign,"$caravan_escort_state",0),
      (call_script, "script_troop_add_gold", "trp_player", "$caravan_escort_agreed_reward"),
      (assign,reg(4), "$caravan_escort_agreed_reward"),
      (val_mul,reg(4), 1),
      (add_xp_as_reward,reg(4)),
      (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone,"start",
    [(eq, "$caravan_escort_state", 1),
      (eq, "$g_encountered_party", "$caravan_escort_party_id"),
      (eq, "$talk_context", tc_party_encounter),
    ],
    "We've made it this far... Is everything clear up ahead?", "talk_caravan_escort",[]],
  [anyone|plyr,"talk_caravan_escort", [],
    "There might be bandits nearby. Stay close.", "talk_caravan_escort_2a",[]],
  [anyone,"talk_caravan_escort_2a", [],
    "Trust me, {playername}. We're already staying as close to you as we can. Lead the way.", "close_window",[(assign, "$g_leave_encounter",1)]],
  [anyone|plyr,"talk_caravan_escort", [],
    "No sign of trouble, we can breathe easy.", "talk_caravan_escort_2b",[]],
  [anyone,"talk_caravan_escort_2b", [],
    "I'll breathe easy when we reach {s1} and not a moment sooner. Let's keep moving.", "close_window",[[str_store_party_name,s1,"$caravan_escort_destination_town"],(assign, "$g_leave_encounter",1)]],
  
  [anyone,"start", [(eq,"$talk_context", tc_party_encounter),
      (eq, "$g_encountered_party_type", spt_kingdom_caravan),
      (party_slot_ge, "$g_encountered_party", slot_party_last_toll_paid_hours, "$g_current_hours"),
    ],
    "What do you want? We paid our toll to you less than three days ago.", "merchant_talk",[]],
  
  [anyone,"start", [(eq,"$talk_context", tc_party_encounter),
      (eq, "$g_encountered_party_type", spt_kingdom_caravan),
      (ge,"$g_encountered_party_relation",0)
    ],
    "Hail, friend.", "merchant_talk",[]],
  
  [anyone,"start", [(eq,"$talk_context", tc_party_encounter),
      (eq, "$g_encountered_party_type", spt_kingdom_caravan),
      (lt,"$g_encountered_party_relation",0),
      (eq, "$g_encountered_party_faction", "fac_merchants"),
    ],
    "What do you want? We are but simple merchants. We have no quarrel with you, so leave us alone.", "merchant_talk",[]],
  
  [anyone,"start", [(eq,"$talk_context", tc_party_encounter),
      (eq, "$g_encountered_party_type", spt_kingdom_caravan),
      (lt,"$g_encountered_party_relation",0),
      (faction_get_slot, ":faction_leader", "$g_encountered_party_faction",slot_faction_leader),
      (str_store_troop_name, s9, ":faction_leader"),
    ],
    "Be warned, knave! This caravan is under the protection of {s9}. " +
    "Step out of our way or you will face his fury!", "merchant_talk",[]],
  
  [anyone,"start", [
      (this_or_next|eq,"$talk_context", tc_party_encounter),
      (eq,"$talk_context", 0),
      (eq, "$g_encountered_party_type", spt_kingdom_caravan),
    ],
    "Yes? What do you want?", "merchant_talk",[]],
    
  [anyone,"merchant_pretalk", [], "Anything else?", "merchant_talk",[]],
  
  [anyone|plyr,"merchant_talk", [
      (check_quest_active, "qst_cause_provocation"),
      (neg|check_quest_concluded, "qst_cause_provocation"),
      (quest_slot_eq, "qst_cause_provocation", slot_quest_target_faction, "$g_encountered_party_faction"),
      (quest_get_slot, ":giver_troop", "qst_cause_provocation", slot_quest_giver_troop),
      (store_faction_of_troop, ":giver_troop_faction", ":giver_troop"),
      (str_store_faction_name, s17, ":giver_troop_faction"),
    ],
    "You are trespassing in the territory of the {s17}. I am confiscating this caravan and all its goods!", "caravan_start_war_quest_1",[]],
  [anyone,"caravan_start_war_quest_1", [(quest_get_slot, ":giver_troop", "qst_cause_provocation", slot_quest_giver_troop),
      (store_faction_of_troop, ":giver_troop_faction", ":giver_troop"),
      (str_store_faction_name, s17, ":giver_troop_faction"),
    ],
    "What? What nonsense is this? We are at peace with the {s17}, and are free to cross its lands!", "caravan_start_war_quest_2",[]],
  [anyone|plyr,"caravan_start_war_quest_2", [], "We'll see about that! Defend yourselves!", "merchant_attack",[]],
  [anyone|plyr,"caravan_start_war_quest_2", [], "Hmm. Maybe this was all a misunderstanding. Farewell.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  
  [anyone|plyr,"merchant_talk", [(eq, "$g_encountered_party_faction", "$players_kingdom")], "I have an offer for you.", "merchant_talk_offer",[]],
  [anyone,"merchant_talk_offer", [], "What is it?", "merchant_talk_offer_2",[]],
  
  [anyone|plyr,"merchant_talk_offer_2", [(eq,"$talk_context", tc_party_encounter),(eq, "$g_encountered_party_faction", "$players_kingdom")],
    "I can escort you to your destination for a price.", "caravan_offer_protection",[]],
  
  
  
  ##  [anyone|plyr,"merchant_talk_offer_2", [(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
  ##                                 (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"), #he is not a faction leader!
  ##                                 (call_script, "script_get_number_of_hero_centers", "$g_talk_troop"),
  ##                                 (eq, reg0, 0), #he has no castles or towns
  ##                                 (hero_can_join),
  ##                             ],
  ##   "I need capable men like you. Will you join me?", "knight_offer_join",[
  ##       ]],
  
  [anyone|plyr,"merchant_talk_offer_2", [], "Nothing. Forget it", "merchant_pretalk",[]],
  
  [anyone|plyr,"merchant_talk", [(check_quest_active, "qst_track_down_bandits"),
      ], "I am hunting a group of bandits with the following description... Have you seen them?", "merchant_bandit_information",[]],
  [anyone,"merchant_bandit_information", [
      (call_script, "script_get_manhunt_information_to_s15", "qst_track_down_bandits"),
      ], "{!}{s15}", "merchant_pretalk",[]],
  
  
  [anyone|plyr,"merchant_talk", [(eq,"$talk_context", tc_party_encounter),
      ], "Tell me about your journey.", "merchant_trip_explanation",[]],
  
  [anyone, "merchant_trip_explanation", [
      (party_get_slot, ":origin", "$g_encountered_party", slot_party_last_traded_center),
      (party_get_slot, ":destination", "$g_encountered_party", slot_party_ai_object),
      (str_store_party_name, s11, ":origin"),
      (str_store_party_name, s12, ":destination"),
      
      (str_store_string, s14, "str___we_believe_that_there_is_money_to_be_made_selling_"),
      (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin),
      (assign, ":at_least_one_item_found", 0),
      (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
        (store_add, ":cur_goods_price_slot", ":cur_goods", ":item_to_price_slot"),
        (party_get_slot, ":origin_price", ":origin", ":cur_goods_price_slot"),
        (party_get_slot, ":destination_price", ":destination", ":cur_goods_price_slot"),
        
        (gt, ":destination_price", ":origin_price"),
        (store_sub, ":price_dif", ":destination_price", ":origin_price"),
        
        (gt, ":price_dif", 200),
        (str_store_item_name, s15, ":cur_goods"),
        (str_store_string, s14, "str_s14s15_"),
        
        (assign, ":at_least_one_item_found", 1),
      (try_end),
      
      (try_begin),
        (eq, ":at_least_one_item_found", 0),
        (str_store_string, s14, "str__we_carry_a_selection_of_goods_although_the_difference_in_prices_for_each_is_not_so_great_we_hope_to_make_a_profit_off_of_the_whole"),
      (else_try),
        (str_store_string, s14, "str_s14and_other_goods"),
        
      (try_end),
      
      ], "We are coming from {s11} and heading to {s12}.{s14}", "merchant_pretalk", []],
  
  
  
  [anyone|plyr,"merchant_talk", [(eq,"$talk_context", tc_party_encounter), #TODO: For the moment don't let attacking if merchant has paid toll.
      (neq,"$g_encountered_party_faction","$players_kingdom"),
      # (ge, "$g_talk_troop_faction_kingdom_relation", 0),  should be here, as toll shouldn't be allowed in wartime and other option duplicated (see below)
      (neg|party_slot_ge, "$g_encountered_party", slot_party_last_toll_paid_hours, "$g_current_hours"),
      ], "I demand something from you!", "merchant_demand",[]],
      
  [anyone,"merchant_demand", [(eq,"$talk_context", tc_party_encounter)], "What do you want?", "merchant_demand_2",[]],
  
  [anyone|plyr,"merchant_demand_2", [], "There is a toll for free passage here!", "merchant_demand_toll",[]],
  
  [anyone,"merchant_demand_toll", [(gt, "$g_strength_ratio", 170),
      (store_div, reg6, "$g_ally_strength", 2),
      (val_add, reg6, 40),
      (val_min, reg6, 3000),
      (assign, "$temp", reg6),
      ], "Please, I don't want any trouble. I can give you {reg6} peningas. Just let us go.", "merchant_demand_toll_2",[]],
  [anyone,"merchant_demand_toll", [
      (store_div, reg6, "$g_ally_strength", 4),
      (val_add, reg6, 10),
      (val_min, reg6, 1000),
      (assign, "$temp", reg6),
      ], "I don't want any trouble. I can give you {reg6} peningas if you'll let us go.", "merchant_demand_toll_2",[]],
  
  [anyone|plyr,"merchant_demand_toll_2", [], "Agreed. Hand it over and you may go in peace.", "merchant_demand_toll_accept",[]],
  [anyone,"merchant_demand_toll_accept", [(assign, reg6, "$temp")], "Very well then. Here's {reg6} peningas. ", "close_window",
    [(assign, "$g_leave_encounter",1),
      (call_script, "script_troop_add_gold", "trp_player", "$temp"),
      (store_add, ":toll_finish_time", "$g_current_hours", merchant_toll_duration),
      (party_set_slot, "$g_encountered_party", slot_party_last_toll_paid_hours, ":toll_finish_time"),
      (try_begin),
        (ge, "$g_encountered_party_relation", -5),
        (store_relation,":rel", "$g_encountered_party_faction","fac_player_faction"),
        (try_begin),
          (gt, ":rel", 0),
          (assign, ":difference", -2),
        (else_try),
          (assign, ":difference", -1),
        (try_end),
        (call_script, "script_change_player_relation_with_faction", "$g_encountered_party_faction", ":difference"),
      (try_end),
      ### Troop commentaries changes begin
      (call_script, "script_add_log_entry", logent_caravan_accosted, "trp_player",  -1, -1, "$g_encountered_party_faction"),
      ### Troop commentaries changes end
      (assign, reg6, "$temp"),
  ]],
  
  [anyone|plyr,"merchant_demand_toll_2", [], "I changed my mind. I can't take your money.", "merchant_pretalk",[]],
  
  [anyone|plyr,"merchant_demand_toll_2", [], "No, I want everything you have! [Attack]", "merchant_attack",[]],
  
  [anyone|plyr,"merchant_demand_2", [], "Hand over your gold and valuables now!", "merchant_attack_begin",[]],
  [anyone|plyr,"merchant_demand_2", [], "Nothing. Forget it.", "merchant_pretalk",[]],
  
  
  [anyone,"merchant_attack_begin", [], "Are you robbing us?{s11}", "merchant_attack_verify",[
      (str_clear, s11),
      (try_begin),
        (faction_slot_ge, "$g_encountered_party_faction", slot_faction_truce_days_with_factions_begin, 1),
        (str_store_string, s11, "str__have_you_not_signed_a_truce_with_our_lord"),
      (try_end),
  ]],
  [anyone|plyr,"merchant_attack_verify", [], "Robbing you? No, no! It was a joke.", "merchant_attack_verify_norob",[]],
  [anyone,"merchant_attack_verify_norob", [], "God, don't joke about that, {reg59?lass:lad}. For a moment, I thought we were in real trouble.", "close_window",[(assign, "$g_leave_encounter",1)]],
  [anyone|plyr,"merchant_attack_verify", [], "Of course I'm robbing you. Now hand over your goods.", "merchant_attack",[]],
  
  [anyone,"merchant_attack", [], "Damn you, you won't get anything from us without a fight!", "close_window",
    [
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -5),
      ### Troop commentaries changes begin
      (call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
      ### Troop commentaries changes end
      (assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),
      (call_script,"script_let_nearby_parties_join_current_battle", 0,0),
  ]],
  
  [anyone,"caravan_offer_protection", [],
    "These roads are dangerous indeed. One can never have enough protection.", "caravan_offer_protection_2",
    [(get_party_ai_object,":caravan_destination","$g_encountered_party"),
      (store_distance_to_party_from_party, "$caravan_distance_to_target",":caravan_destination","$g_encountered_party"),
      (assign,"$caravan_escort_offer","$caravan_distance_to_target"),
      (val_sub, "$caravan_escort_offer", 10),
      (call_script, "script_party_calculate_strength", "p_main_party",0),
      (assign, ":player_strength", reg0),
      (val_min, ":player_strength", 200),
      (val_add, ":player_strength", 20),
      (val_mul,"$caravan_escort_offer",":player_strength"),
      (val_div,"$caravan_escort_offer",50),
      (val_max, "$caravan_escort_offer", 5),
  ]],
  [anyone,"caravan_offer_protection_2", [[lt,"$caravan_distance_to_target",10]],
    "An escort? We're almost there already! Thank you for the offer, though.", "close_window",[(assign, "$g_leave_encounter",1)]],
  [anyone,"caravan_offer_protection_2", [(get_party_ai_object,":caravan_destination","$g_encountered_party"),
      (str_store_party_name,1,":caravan_destination"),
      (assign,reg(2),"$caravan_escort_offer")],
    "We are heading to {s1}. I will pay you {reg2} peningas if you escort us there.", "caravan_offer_protection_3",
    []],
  [anyone|plyr,"caravan_offer_protection_3", [],
    "Agreed.", "caravan_offer_protection_4",[]],
  [anyone,"caravan_offer_protection_4", [],
    "I want you to stay close to us along the way. " +
    "We'll need your help if we get ambushed by bandits.", "caravan_offer_protection_5",[]],
  [anyone|plyr,"caravan_offer_protection_5", [],
    "Don't worry. You can trust me.", "caravan_offer_protection_6",[]],
  [anyone,"caravan_offer_protection_6", [(get_party_ai_object,":caravan_destination","$g_encountered_party"),
      (str_store_party_name,1,":caravan_destination")],
    "Good. Come and collect your money when we're within sight of {s1}. For now, let's just get underway.", "close_window",
    [(get_party_ai_object,":caravan_destination","$g_encountered_party"),
      (assign, "$caravan_escort_destination_town", ":caravan_destination"),
      (assign, "$caravan_escort_party_id", "$g_encountered_party"),
      (assign, "$caravan_escort_agreed_reward", "$caravan_escort_offer"),
      (assign, "$caravan_escort_state", 1),
      (assign, "$g_leave_encounter",1)
  ]],
  [anyone|plyr,"caravan_offer_protection_3", [],
    "Forget it.", "caravan_offer_protection_4b",[]],
  [anyone,"caravan_offer_protection_4b", [],
    "Perhaps another time, then.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  [anyone|plyr,"merchant_talk", [(eq,"$talk_context", tc_party_encounter),
    (lt, "$g_talk_troop_faction_kingdom_relation", 0)],
    "Not so fast. First, hand over all your goods and money.", "talk_caravan_enemy_2",[]],
  
  [anyone,"talk_caravan_enemy_2", [],
    "Never. It is our duty to protect these goods. You shall have to fight us, brigand!", "close_window",
    [
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -4),
      (call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
  ]],
  
  [anyone|plyr,"merchant_talk", [], "[Leave]", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  
  
  
  # Prison Guards
  [anyone,"start", [(eq, "$talk_context", 0),
      # (faction_slot_eq, "$g_encountered_party_faction", slot_faction_prison_guard_troop, "$g_talk_troop"),
      (this_or_next|eq, "$g_talk_troop","trp_irish_prison_guard"),
      (this_or_next|eq, "$g_talk_troop","trp_angle_prison_guard"),
      (this_or_next|eq, "$g_talk_troop","trp_scotch_prison_guard"),
      (this_or_next|eq, "$g_talk_troop","trp_saxon_prison_guard"),
      (this_or_next|eq, "$g_talk_troop","trp_briton_prison_guard"),
      (eq, "$g_talk_troop","trp_norse_prison_guard"),
      #                  (this_or_next|eq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
      (party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
    ],
    "Good day, my {reg59?lady:lord}. Will you be visiting the prison?", "prison_guard_players",[]],
    
  [anyone|plyr,"prison_guard_players", [
    (assign, reg1, 0),
    (call_script, "script_get_heroes_attached_to_center_as_prisoner", "$current_town", "p_temp_party"),
    (party_get_num_companion_stacks, ":num_stacks", "p_temp_party"),
    (try_for_range, ":i_stack", 0, ":num_stacks"),
      (party_stack_get_troop_id, ":stack_troop", "p_temp_party", ":i_stack"),
      (troop_slot_ge, ":stack_troop", slot_troop_tortured, 1),  #see script_enter_dungeon
      (store_troop_health, ":health", ":stack_troop", 0),
      (le, ":health", 60),
      (val_add, reg1, 1),
    (try_end),
    (eq, reg1, 0),
  ], "Yes. Unlock the door.", "close_window", [
    (call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle")
  ]],
    
  [anyone|plyr,"prison_guard_players", [
    (gt, reg1, 0),
  ], "Yes. Unlock the door.", "prison_guard_report_missing", [
  ]],

  [anyone|plyr,"prison_guard_players", [],
    "No, not now.", "close_window",[]],
  
  [anyone,"prison_guard_report_missing", [
    (eq, reg1, 1),
  ], "My {reg59?lady:lord}, just so you know, one of your prisoners is not yet conscious. Do you still desire to enter?", "prison_guard_player_2", [
  ]],

  [anyone,"prison_guard_report_missing", [
    (gt, reg1, 1),
  ], "My {reg59?lady:lord}, just so you know, some of your prisoners are not yet conscious. Do you still desire to enter?", "prison_guard_player_2", [
  ]],

  [anyone|plyr,"prison_guard_player_2", [
    (gt, reg1, 0),
  ], "Yes, I do.", "close_window",[
    (call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle")
  ]],
  
  [anyone|plyr,"prison_guard_player_2", [],
    "No, not now.", "close_window",[]],
  
  [anyone,"start", [(eq, "$talk_context", 0),
      (this_or_next|eq, "$g_talk_troop","trp_irish_prison_guard"),
      (this_or_next|eq, "$g_talk_troop","trp_angle_prison_guard"),
      (this_or_next|eq, "$g_talk_troop","trp_scotch_prison_guard"),
      (this_or_next|eq, "$g_talk_troop","trp_saxon_prison_guard"),
      (this_or_next|eq, "$g_talk_troop","trp_briton_prison_guard"),
      (eq, "$g_talk_troop","trp_norse_prison_guard"),
      (neg|faction_slot_eq,"$g_encountered_party_faction",slot_faction_leader,"trp_player"),
      # (faction_slot_eq, "$g_encountered_party_faction", slot_faction_prison_guard_troop, "$g_talk_troop")
    ],
    "Yes? What do you want?", "prison_guard_talk",[]],
  [anyone,"start", [(eq, "$talk_context", 0),
      (this_or_next|eq, "$g_talk_troop","trp_irish_prison_guard"),
      (this_or_next|eq, "$g_talk_troop","trp_angle_prison_guard"),
      (this_or_next|eq, "$g_talk_troop","trp_scotch_prison_guard"),
      (this_or_next|eq, "$g_talk_troop","trp_saxon_prison_guard"),
      (this_or_next|eq, "$g_talk_troop","trp_briton_prison_guard"),
      (eq, "$g_talk_troop","trp_norse_prison_guard"),
      (faction_slot_eq,"$g_encountered_party_faction",slot_faction_leader,"trp_player"),
      # (faction_slot_eq, "$g_encountered_party_faction", slot_faction_prison_guard_troop, "$g_talk_troop")
    ],
    "Yes, your majesty?", "prison_guard_talk",[]],
  [anyone|plyr,"prison_guard_talk", [],
    "Who is imprisoned here?", "prison_guard_ask_prisoners",[]],
  [anyone|plyr,"prison_guard_talk", [],
    "I want to speak with a prisoner.", "prison_guard_visit_prison",[]],
  [anyone|plyr,"prison_guard_talk", [
      (this_or_next|faction_slot_eq, "$g_encountered_party_faction", slot_faction_marshal, "trp_player"),
      (faction_slot_eq,"$g_encountered_party_faction",slot_faction_leader,"trp_player"),
      (assign, ":num", 0),
      (try_for_range, ":npc", active_npcs_begin, active_npcs_end),
        (troop_slot_eq, ":npc", slot_troop_prisoner_of_party, "$g_encountered_party"),
        (val_add, ":num", 1),
      (try_end),
      (gt, ":num", 0),],
    "I order you to release the prisoners.", "prison_guard_release",[]],
  [anyone, "prison_guard_release", [],"You certainly have the authority to make this demand, but our lord may take offence. Whom do you wish to release?","prison_guard_release1",[]],
  [anyone|plyr|repeat_for_troops,"prison_guard_release1", [
      (store_repeat_object, ":troop"),
      (this_or_next|troop_slot_eq, ":troop", slot_troop_occupation, slto_kingdom_hero),
      (troop_slot_eq, ":troop", slot_troop_occupation, slto_player_companion),
      (neq, "trp_player", ":troop"),
      (troop_slot_eq, ":troop", slot_troop_prisoner_of_party, "$g_encountered_party"),
      (str_store_troop_name, s31, ":troop"),],"{!}{s31}","prison_guard_release2",[(store_repeat_object, "$temp"),]],
  [anyone|plyr,"prison_guard_release1",[], "Never mind", "prison_guard_talk", []],
  [anyone, "prison_guard_release2", [],"As you wish.","prison_guard_talk",[
      (party_remove_prisoners, "$g_encountered_party", "$temp", 1),
      (troop_set_slot, "$temp", slot_troop_prisoner_of_party, -1),
      (party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord),
      (try_begin),
        (gt, ":town_lord", 0),
        (call_script, "script_change_player_relation_with_troop", ":town_lord", -3),
      (try_end),
  ]],
  
  [anyone,"prison_guard_ask_prisoners", [],
    "Currently, {s50} {reg1?are:is} imprisoned here.{s49}","prison_guard_talk",[
      (party_clear, "p_temp_party"),
      (party_clear, "p_temp_party_2"),
      (assign, ":num_heroes_in_dungeon", 0),
      (assign, ":num_heroes_given_parole", 0),
      
      (party_get_num_prisoner_stacks, ":num_stacks","$g_encountered_party"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_prisoner_stack_get_troop_id, ":stack_troop","$g_encountered_party",":i_stack"),
        (troop_is_hero, ":stack_troop"),
        (try_begin),
          (call_script, "script_cf_prisoner_offered_parole", ":stack_troop"),
          (party_add_members, "p_temp_party_2", ":stack_troop", 1),
          (val_add, ":num_heroes_given_parole", 1),
        (else_try),
          (party_add_members, "p_temp_party", ":stack_troop", 1),
          (val_add, ":num_heroes_in_dungeon", 1),
        (try_end),
      (try_end),
      (call_script, "script_print_party_members", "p_temp_party"),
      (str_store_string, s50, "str_s51"),
      (try_begin),
        (gt, ":num_heroes_in_dungeon", 1),
        (assign, reg1, 1),
      (else_try),
        (assign, reg1, 0),
      (try_end),
      
      (str_clear, s49),
      (try_begin),
        (ge, ":num_heroes_given_parole", 1),
        (call_script, "script_print_party_members", "p_temp_party_2"),
        (try_begin),
          (ge, ":num_heroes_given_parole", 2),
          (assign, reg2, 1),
        (else_try),
          (assign, reg2, 0),
        (try_end),
        (str_store_string, s49, "str__meanwhile_s51_reg2areis_being_held_in_the_castle_but_reg2havehas_made_pledges_not_to_escape_and_reg2areis_being_held_in_more_comfortable_quarters" ), #somewhat awkward wording prevents both gender and singular/plural pronoun issues
      (try_end)
  ]],
  
  [anyone,"prison_guard_visit_prison",
    [
      (this_or_next|faction_slot_eq, "$g_encountered_party_faction", slot_faction_marshal, "trp_player"),
      (this_or_next|party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
      (faction_slot_eq,"$g_encountered_party_faction",slot_faction_leader,"trp_player"),
    ],
    "Of course, {reg59?madam:sir}. Go in.", "close_window",
    [
      (call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle")
  ]],
  
  [anyone, "prison_guard_visit_prison",
    [
      #below condition is added by ozan, please let's discuss if it is needed or not. But I think this condition is needed because if there is nobody in prison
      #prison guard should not say you need to get permission, or take me money ext to let player go inside.
      (assign, ":num_heroes_in_dungeon", 0),
      (party_get_num_prisoner_stacks, ":num_stacks", "$g_encountered_party"),
      (assign, ":end_condition", ":num_stacks"),
      (try_for_range, ":i_stack", 0, ":end_condition"),
        (party_prisoner_stack_get_troop_id, ":stack_troop","$g_encountered_party",":i_stack"),
        (troop_is_hero, ":stack_troop"),
        (try_begin),
          (call_script, "script_cf_prisoner_offered_parole", ":stack_troop"),
        (else_try),
          (val_add, ":num_heroes_in_dungeon", 1),
          (assign, ":end_condition", 0),
        (try_end),
      (try_end),
      
      (ge, ":num_heroes_in_dungeon", 1),
    ],
    "You need to get permission from the lord to talk to prisoners.", "prison_guard_visit_prison_2",[]],
  
  [anyone, "prison_guard_visit_prison", [], "There is nobody inside. Therefore, you can freely go inside and look around.", "prison_guard_visit_prison_nobody", []],
  
  [anyone|plyr,"prison_guard_visit_prison_nobody", [], "All right, then I'll take a look at the prison.", "close_window",
    [
      (call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle"),
  ]],
  
  [anyone|plyr,"prison_guard_visit_prison_nobody", [], "I have more important business to do.", "close_window",[]],
  
  [anyone|plyr,"prison_guard_visit_prison_2", [], "All right, then I'll try that.", "close_window",[]],
  [anyone|plyr,"prison_guard_visit_prison_2", [], "Come on now. I thought you were the boss here.", "prison_guard_visit_prison_3",[]],
  [anyone,"prison_guard_visit_prison_3", [], "Heh-heh. You got that right. Still, I can't let you into the prison.", "prison_guard_visit_prison_4",[]],
  
  [anyone|plyr,"prison_guard_visit_prison_4", [], "All right, then I'll leave now.", "close_window",[]],
  [anyone|plyr,"prison_guard_visit_prison_4", [(store_troop_gold,":gold","trp_player"),(ge,":gold",100)],
    "I found a purse with 100 peningas a few paces away. I reckon it belongs to you.", "prison_guard_visit_prison_5",[]],
  
  [anyone,"prison_guard_visit_prison_5", [], "Ah! I was looking for this all day. How good of you to bring it back, {reg59?madam:sir}. " +
    "Well, now that I know what an honest {reg59?lady:man} you are, there can be no harm in letting you inside for a look. Go in... Just so you know, though -- I'll be hanging onto the keys, in case you were thinking about undoing anyone's chains.", "close_window",
    [(troop_remove_gold, "trp_player",100),(call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle")]],
  
  [anyone|plyr,"prison_guard_visit_prison_4", [],
    "Give me the keys to the cells -- now!", "prison_guard_visit_break",[
  ]],
  
  [anyone,"prison_guard_visit_break", [], "Help! Help! Prison break!", "close_window",[
      (call_script, "script_activate_town_guard"),
      (assign, "$g_main_attacker_agent", "$g_talk_agent"),
      (assign, "$talk_context", tc_prison_break),
      
      #  (try_begin),
      #		(store_relation, ":relation", "fac_player_faction", "$g_encountered_party_faction"),
      #	Reduce relation with town
      # (try_end),
      
      (assign, ":end_cond", kingdom_ladies_end),
      (try_for_range, ":prisoner", active_npcs_begin, ":end_cond"),
        (troop_set_slot, ":prisoner", slot_troop_mission_participation, 0), #new
      (try_end),
  ]],
  
  
  [anyone|plyr,"prison_guard_talk", [],
    "Never mind.", "close_window",[]],
  
  
  
  
  # Castle Guards
  [anyone,"start", [(eq, "$talk_context", 0),(faction_slot_eq, "$g_encountered_party_faction", slot_faction_castle_guard_troop, "$g_talk_troop"),
      (this_or_next|eq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
      (             party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player")
    ],
    "Your orders, {reg59?Lady:Lord}?", "castle_guard_players",[]],
  [anyone|plyr,"castle_guard_players", [],
    "Open the door. I'll go in.", "close_window",[(call_script, "script_enter_court", "$current_town")]],
  [anyone|plyr,"castle_guard_players", [],
    "Never mind.", "close_window",[]],
  
  
  [anyone,"start", [(eq, "$talk_context", 0),(faction_slot_eq, "$g_encountered_party_faction", slot_faction_castle_guard_troop, "$g_talk_troop"),(eq, "$sneaked_into_town",1),
      (gt,"$g_time_since_last_talk",0)],
    "Get out of my sight, beggar! You stink!", "castle_guard_sneaked_intro_1",[]],
  [anyone,"start", [(eq, "$talk_context", 0),(faction_slot_eq, "$g_encountered_party_faction", slot_faction_castle_guard_troop, "$g_talk_troop"),(eq, "$sneaked_into_town",1)],
    "Get lost before I lose my temper, you vile beggar!", "close_window",[]],
  [anyone|plyr,"castle_guard_sneaked_intro_1", [], "I want to enter the hall and speak to the lord.", "castle_guard_sneaked_intro_2",[]],
  [anyone|plyr,"castle_guard_sneaked_intro_1", [], "[Leave]", "close_window",[]],
  [anyone,"castle_guard_sneaked_intro_2", [], "Are you out of your mind, {reg59?woman:man}? " +
    "Beggars are not allowed into the hall. Now get lost or I'll beat you bloody.", "close_window",[]],
  
  
  [anyone,"start", [(eq, "$talk_context", 0),(faction_slot_eq, "$g_encountered_party_faction", slot_faction_castle_guard_troop, "$g_talk_troop")],
    "What do you want?", "castle_guard_intro_1",[]],
  [anyone|plyr,"castle_guard_intro_1", [],
    "I want to enter the hall and speak to the lord.", "castle_guard_intro_2",[]],
  [anyone|plyr,"castle_guard_intro_1", [],
    "Never mind.", "close_window",[]],
  
  [anyone,"castle_guard_intro_2", [
      (faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_state, sfai_feast),
      (faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_object, "$current_town"),
      
      (this_or_next|neq, "$players_kingdom", "$g_encountered_party_faction"),
      (neg|troop_slot_ge, "trp_player", slot_troop_renown, 50),
      
      (neg|troop_slot_ge, "trp_player", slot_troop_renown, 125),
      (neq, "$g_player_eligible_feast_center_no", "$current_town"),
      
      (neg|check_quest_active, "qst_wed_betrothed"),
      (neg|check_quest_active, "qst_wed_betrothed_female"),
      
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, 1), #Married players always make the cut
      
    ], "I'm afraid there is a feast in progress, and you are not invited.", "close_window",
    []],
  
  
  [anyone,"castle_guard_intro_2", [], "You can go in after leaving your weapons with me. No one is allowed to carry arms into the lord's hall.", "castle_guard_intro_3",
    []],
  
  [anyone|plyr,"castle_guard_intro_3", [], "Here, take my arms. I'll go in.", "close_window", [(call_script, "script_enter_court", "$current_town")]],
  
  [anyone|plyr,"castle_guard_intro_3", [], "No, I give my arms to no one.", "castle_guard_intro_2b", []],
  [anyone,"castle_guard_intro_2b", [], "Then you can't go in.", "close_window", []],
  
  ##  [anyone|plyr,"castle_guard_intro_1", [],
  ##   "Never mind.", "close_window",[]],
  ##  [anyone,"castle_guard_intro_2", [],
  ##   "Does the lord expect you?", "castle_guard_intro_3",[]],
  ##  [anyone|plyr,"castle_guard_intro_3", [], "Yes.", "castle_guard_intro_check",[]],
  ##  [anyone|plyr,"castle_guard_intro_3", [], "No.", "castle_guard_intro_no",[]],
  ##  [anyone,"castle_guard_intro_check", [], "Hmm. All right {reg59?madam:sir}.\
  ## You can go in. But you must leave your weapons with me. Noone's allowed into the court with weapons.", "close_window",[]],
  ##  [anyone,"castle_guard_intro_check", [], "You liar!\
  ## Our lord would have no business with a filthy vagabond like you. Get lost now before I kick your butt.", "close_window",[]],
  ##  [anyone,"castle_guard_intro_no", [], "Well... What business do you have here then?", "castle_guard_intro_4",[]],
  ##  [anyone|plyr,"castle_guard_intro_4", [], "I wish to present the lord some gifts.", "castle_guard_intro_gifts",[]],
  ##  [anyone|plyr,"castle_guard_intro_4", [], "I have an important matter to discuss with the lord. Make way now.", "castle_guard_intro_check",[]],
  ##  [anyone,"castle_guard_intro_gifts", [], "Really? What gifts?", "castle_guard_intro_5",[]],
  ##  [anyone|plyr,"castle_guard_intro_4", [], "Many gifts. For example, I have a gift of 20 peningas here for his loyal servants.", "castle_guard_intro_gifts",[]],
  ##  [anyone|plyr,"castle_guard_intro_4", [], "My gifts are of no concern to you. They are for your lords and ladies..", "castle_guard_intro_check",[]],
  ##  [anyone,"castle_guard_intro_gifts", [], "Oh! you can give those 20 peningas to me. I can distribute them for you.\
  ## You can enter the court and present your gifts to the lord. I'm sure he'll be pleased.\
  ## But you must leave your weapons with me. Noone's allowed into the court with weapons.", "close_window",[]],
  
  #Kingdom Parties
  #  [anyone,"start", [(this_or_next|eq,"$g_encountered_party_template","pt_swadian_foragers"),
  #                    (eq,"$g_encountered_party_template","pt_vaegir_foragers"),
  ##  [anyone,"start", [(this_or_next|party_slot_eq,"$g_encountered_party",slot_party_type, spt_forager),
  ##                    (this_or_next|party_slot_eq,"$g_encountered_party",slot_party_type, spt_scout),
  ##                    (party_slot_eq,"$g_encountered_party",slot_party_type, spt_patrol),
  ##                    (str_store_faction_name,5,"$g_encountered_party_faction")],
  ##   "In the name of the {s5}.", "kingdom_party_encounter",[]],
  ##
  ##  [anyone,"kingdom_party_encounter", [(le,"$g_encountered_party_relation",-10)],
  ##   "Surrender now, and save yourself the indignity of defeat!", "kingdom_party_encounter_war",[]],
  ##  [anyone|plyr,"kingdom_party_encounter_war", [],  "[Go to Battle]", "close_window",[(encounter_attack)]],
  ##
  ##  [anyone,"kingdom_party_encounter", [(ge,"$g_encountered_party_relation",10)],
  ##   "Greetings, fellow warrior.", "close_window",[(eq,"$talk_context",tc_party_encounter),(assign, "$g_leave_encounter", 1)]],
  ##
  ##  [anyone,"kingdom_party_encounter", [],
  ##   "You can go.", "close_window",[]],
  
  
  
  
  
  
  
  
  #Player Parties
  ##  [party_tpl|pt_old_garrison,"start", [],
  ##   "They told us to leave the castle to the new garrison {reg59?madam:sir}. So we left and came to rejoin you.", "player_old_garrison_encounter",[]],
  ##
  ##  [anyone|plyr,"player_old_garrison_encounter", [(party_can_join)],
  ##   "You have done well. You'll join my command now.", "close_window",[(assign, "$g_move_heroes", 1),
  ##                                        (call_script, "script_party_add_party", "p_main_party", "$g_encountered_party"),
  ##                                        (remove_party, "$g_encountered_party"),
  ##                                        (assign, "$g_leave_encounter", 1)]],
  ##  [anyone|plyr,"player_old_garrison_encounter", [(assign, reg1, 0),
  ##                                                 (try_begin),
  ##                                                   (neg|party_can_join),
  ##                                                   (assign, reg1, 1),
  ##                                                 (try_end)],
  ##   "You can't join us now{reg1?, I can't command all the lot of you:}. Follow our lead.", "close_window",[(party_set_ai_behavior, "$g_encountered_party", ai_bhvr_attack_party),
  ##                                                                         (party_set_ai_object, "$g_encountered_party", "p_main_party"),
  ##                                                                         (party_set_flags, "$g_encountered_party", pf_default_behavior, 0),
  ##                                                                         (assign, "$g_leave_encounter", 1)]],
  ##
  ##  [anyone|plyr,"player_old_garrison_encounter", [(assign, reg1, 0),
  ##                                                 (try_begin),
  ##                                                   (neg|party_can_join),
  ##                                                   (assign, reg1, 1),
  ##                                                 (try_end)],
  ##   "You can't join us now{reg1?, I can't command all the lot of you:}. Stay here and wait for me.", "close_window",[
  ##       (party_set_ai_behavior, "$g_encountered_party", ai_bhvr_travel_to_point),
  ##       (party_get_position, pos1, "$g_encountered_party"),
  ##       (party_set_ai_target_position, "$g_encountered_party", pos1),
  ##       (party_set_flags, "$g_encountered_party", pf_default_behavior, 0),
  ##       (assign, "$g_leave_encounter", 1)]],
  ##
  
  
  
  
  
  
  [anyone,"start", [(eq, "$talk_context", tc_castle_gate)],
    "What do you want?", "castle_gate_guard_talk",[]],
  
  [anyone,"castle_gate_guard_pretalk", [],
    "Yes?", "castle_gate_guard_talk",[]],
  
  [anyone|plyr,"castle_gate_guard_talk", [(ge, "$g_encountered_party_relation", 0)],
    "We need shelter for the night. Will you let us in?", "castle_gate_open",[]],
  [anyone|plyr,"castle_gate_guard_talk", [(party_slot_ge, "$g_encountered_party", slot_town_lord, 1)], "I want to speak with the lord of the castle.", "request_meeting_castle_lord",[]],
  [anyone|plyr,"castle_gate_guard_talk", [], "I want to speak with someone in the castle.", "request_meeting_other",[]],
  
  [anyone|plyr,"castle_gate_guard_talk", [], "[Leave]", "close_window",[]],
  
  [anyone,"request_meeting_castle_lord", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
      (call_script, "script_get_troop_attached_party", ":castle_lord"),
      (eq, "$g_encountered_party", reg0),
      (str_store_troop_name, s2, ":castle_lord"),
      (assign, "$lord_requested_to_talk_to", ":castle_lord"),
      ],  "Wait here. {s2} will see you.", "close_window",[]],
  
  [anyone,"request_meeting_castle_lord", [],  "My lord is not here now.", "castle_gate_guard_pretalk",[]],
  
  [anyone,"request_meeting_other", [],  "Who is that?", "request_meeting_3",[]],
  
  [anyone|plyr|repeat_for_troops,"request_meeting_3", [(store_repeat_object, ":troop_no"),
      (troop_is_hero, ":troop_no"),
      (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (call_script, "script_get_troop_attached_party", ":troop_no"),
      (eq, "$g_encountered_party", reg0),
      (str_store_troop_name, s3, ":troop_no"),
    ],
    "{!}{s3}", "request_meeting_4",[(store_repeat_object, "$lord_requested_to_talk_to")]],
  
  [anyone|plyr,"request_meeting_3", [], "Never mind.", "close_window",[(assign, "$lord_requested_to_talk_to", 0)]],
  
  [anyone,"request_meeting_4", [], "Wait there. I'll send him your request.", "request_meeting_5",[]],
  
  [anyone|plyr,"request_meeting_5", [], "I'm waiting...", "request_meeting_6",[]],
  
  [anyone,"request_meeting_6",
    [
      (call_script, "script_troop_get_player_relation", "$lord_requested_to_talk_to"),
      (assign, ":lord_relation", reg0),
      (gt, ":lord_relation", -20),
      ], "{reg59?Madam:Sir}, {s2} will talk to you now.", "close_window",[(str_store_troop_name, s2, "$lord_requested_to_talk_to")]],
  
  [anyone,"request_meeting_6", [(str_store_troop_name, s2, "$lord_requested_to_talk_to")], "{s2} says he will not see you. Begone now.", "close_window",[]],
  
  [anyone,"castle_gate_open", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
      (call_script, "script_get_troop_attached_party", ":castle_lord"),
      (eq, "$g_encountered_party", reg0),
      (ge, "$g_encountered_party_relation", 0),
      (call_script, "script_troop_get_player_relation", ":castle_lord"),
      (assign, ":castle_lord_relation", reg0),
      #(troop_get_slot, ":castle_lord_relation", ":castle_lord", slot_troop_player_relation),
      (ge, ":castle_lord_relation", 10),
      (str_store_troop_name, s2, ":castle_lord")
    ],  "My lord, {s2}, will be happy to see you {reg59?madam:sir}. " +
    "Come on in. I am opening the gates for you.", "close_window",[(assign,"$g_permitted_to_center",1)]],
  
  
  [anyone,"castle_gate_open", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
      (call_script, "script_get_troop_attached_party", ":castle_lord"),
      (neq, "$g_encountered_party", reg0),
      (ge, "$g_encountered_party_relation", 0),
      (call_script, "script_troop_get_player_relation", ":castle_lord"),
      (assign, ":castle_lord_relation", reg0),
      #(troop_get_slot, ":castle_lord_relation", ":castle_lord", slot_troop_player_relation),
      (ge, ":castle_lord_relation", 5),
      (str_store_troop_name, s2, ":castle_lord")
    ],  "My lord, {s2}, is not in the castle now. " +
    "But I think he would approve of you taking shelter here. " +
    "Come on in. I am opening the gates for you.", "close_window",[(assign,"$g_permitted_to_center",1)]],
  
  [anyone,"castle_gate_open", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
      (call_script, "script_troop_get_player_relation", ":castle_lord"),
      (assign, ":castle_lord_relation", reg0),
      #(troop_get_slot, ":castle_lord_relation", ":castle_lord", slot_troop_player_relation),
      (ge, ":castle_lord_relation", -2),
      ],  "Come on in. I am opening the gates for you.", "close_window",[(assign,"$g_permitted_to_center",1)]],
  
  [anyone,"castle_gate_open", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
      (call_script, "script_troop_get_player_relation", ":castle_lord"),
      (assign, ":castle_lord_relation", reg0),
      #(troop_get_slot, ":castle_lord_relation", ":castle_lord", slot_troop_player_relation),
      (ge, ":castle_lord_relation", -19),
      (str_store_troop_name, s2, ":castle_lord")
    ],  "Come on in. But make sure your men behave sensibly within the walls. " +
    "My lord, {s2}, does not want trouble here.", "close_window",[(assign,"$g_permitted_to_center",1)]],
  
  [anyone,"castle_gate_open", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
      (str_store_troop_name, s2, ":castle_lord"),
      ],  "My lord, {s2}, does not want you here. Begone now.", "close_window",[]],
  
  
  #Enemy Kingdom Meetings
  
  
  #  [anyone,"start", [(eq, "$talk_context", tc_lord_talk_in_center)],
  #   "Greetings {playername}.", "request_meeting_1",[]],
  
  #  [anyone,"request_meeting_pretalk", [(eq, "$talk_context", tc_lord_talk_in_center)],
  #   "Yes?", "request_meeting_1",[]],
  
  #  [anyone|plyr,"request_meeting_1", [(ge, "$g_encountered_party_faction", 0)], "Open the gates and let me in!", "request_meeting_open_gates",[]],
  
  #  [anyone|plyr,"request_meeting_1", [(party_slot_ge, "$g_encountered_party", slot_town_lord, 1)], "I want to speak with the lord of the castle.", "request_meeting_castle_lord",[]],
  #  [anyone|plyr,"request_meeting_1", [], "I want to speak with someone in the castle.", "request_meeting_other",[]],
  
  ##### TODO: QUESTS COMMENT OUT BEGIN
  ##  [anyone|plyr,"request_meeting_1",[(check_quest_active,"qst_bring_prisoners_to_enemy"),
  ##                                    (neg|check_quest_succeeded, "qst_bring_prisoners_to_enemy"),
  ##                                    (quest_get_slot, ":quest_giver_troop", "qst_bring_prisoners_to_enemy", slot_quest_giver_troop),
  ##                                    (quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
  ##                                    (quest_get_slot, ":quest_object_troop", "qst_bring_prisoners_to_enemy", slot_quest_object_troop),
  ##                                    (quest_slot_eq, "qst_bring_prisoners_to_enemy", slot_quest_target_center, "$g_encountered_party"),
  ##                                    (party_count_prisoners_of_type, ":num_prisoners", "p_main_party", ":quest_object_troop"),
  ##                                    (ge, ":num_prisoners", ":quest_target_amount"),
  ##                                    (str_store_troop_name,1,":quest_giver_troop"),
  ##                                    (assign, reg1, ":quest_target_amount"),
  ##                                    (str_store_troop_name_plural,2,":quest_object_troop")],
  ##   "TODO: Sir, lord {s1} ordered me to bring {reg1} {s2} for ransom.", "guard_prisoners_brought",
  ##   [(quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
  ##    (quest_get_slot, ":quest_target_center", "qst_bring_prisoners_to_enemy", slot_quest_target_center),
  ##    (quest_get_slot, ":quest_object_troop", "qst_bring_prisoners_to_enemy", slot_quest_object_troop),
  ##    (party_remove_prisoners, "p_main_party", ":quest_object_troop", ":quest_target_amount"),
  ##    (party_add_members, ":quest_target_center", ":quest_object_troop", ":quest_target_amount"),
  ##    (call_script, "script_game_get_join_cost", ":quest_object_troop"),
  ##    (assign, ":reward", reg0),
  ##    (val_mul, ":reward", ":quest_target_amount"),
  ##    (val_div, ":reward", 2),
  ##    (call_script, "script_troop_add_gold", "trp_player", ":reward"),
  ##    (party_get_slot, ":cur_lord", "$g_encountered_party", slot_town_lord),#Removing gold from the town owner's wealth
  ##    (troop_get_slot, ":cur_wealth", ":cur_lord", slot_troop_wealth),
  ##    (val_sub, ":cur_wealth", ":reward"),
  ##    (troop_set_slot, ":cur_lord", slot_troop_wealth, ":cur_wealth"),
  ##    (quest_set_slot, "qst_bring_prisoners_to_enemy", slot_quest_target_amount, ":reward"),
  ##    (succeed_quest, "qst_bring_prisoners_to_enemy"),
  ##    ]],
  ##
  ##  [anyone|plyr,"request_meeting_1",[(check_quest_active,"qst_bring_prisoners_to_enemy"),
  ##                                    (neg|check_quest_succeeded, "qst_bring_prisoners_to_enemy"),
  ##                                    (quest_get_slot, ":quest_giver_troop", "qst_bring_prisoners_to_enemy", slot_quest_giver_troop),
  ##                                    (quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
  ##                                    (quest_get_slot, ":quest_object_troop", "qst_bring_prisoners_to_enemy", slot_quest_object_troop),
  ##                                    (quest_slot_eq, "qst_bring_prisoners_to_enemy", slot_quest_target_center, "$g_encountered_party"),
  ##                                    (party_count_prisoners_of_type, ":num_prisoners", "p_main_party", ":quest_object_troop"),
  ##                                    (lt, ":num_prisoners", ":quest_target_amount"),
  ##                                    (gt, ":num_prisoners", 0),
  ##                                    (str_store_troop_name,1,":quest_giver_troop"),
  ##                                    (assign, reg1, ":quest_target_amount"),
  ##                                    (str_store_troop_name_plural,2,":quest_object_troop")],
  ##   "TODO: Sir, lord {s1} ordered me to bring {reg1} {s2} for ransom, but some of them died during my expedition.", "guard_prisoners_brought_some",
  ##   [(quest_get_slot, ":quest_target_amount", "qst_bring_prisoners_to_enemy", slot_quest_target_amount),
  ##    (quest_get_slot, ":quest_target_center", "qst_bring_prisoners_to_enemy", slot_quest_target_center),
  ##    (quest_get_slot, ":quest_object_troop", "qst_bring_prisoners_to_enemy", slot_quest_object_troop),
  ##    (party_count_prisoners_of_type, ":num_prisoners", "p_main_party", ":quest_object_troop"),
  ##    (party_remove_prisoners, "p_main_party", ":quest_object_troop", ":num_prisoners"),
  ##    (party_add_members, ":quest_target_center", ":quest_object_troop", ":num_prisoners"),
  ##    (call_script, "script_game_get_join_cost", ":quest_object_troop"),
  ##    (assign, ":reward", reg0),
  ##    (val_mul, ":reward", ":num_prisoners"),
  ##    (val_div, ":reward", 2),
  ##    (call_script, "script_troop_add_gold", "trp_player", ":reward"),
  ##    (party_get_slot, ":cur_lord", "$g_encountered_party", slot_town_lord),#Removing gold from the town owner's wealth
  ##    (troop_get_slot, ":cur_wealth", ":cur_lord", slot_troop_wealth),
  ##    (val_sub, ":cur_wealth", ":reward"),
  ##    (troop_set_slot, ":cur_lord", slot_troop_wealth, ":cur_wealth"),
  ##    (call_script, "script_game_get_join_cost", ":quest_object_troop"),
  ##    (assign, ":reward", reg0),
  ##    (val_mul, ":reward", ":quest_target_amount"),
  ##    (val_div, ":reward", 2),
  ##    (quest_set_slot, "qst_bring_prisoners_to_enemy", slot_quest_current_state, 1),#Some of the prisoners are given, so it's state will change for remembering that.
  ##    (quest_set_slot, "qst_bring_prisoners_to_enemy", slot_quest_target_amount, ":reward"),#Still needs to pay the lord the full price of the prisoners
  ##    (succeed_quest, "qst_bring_prisoners_to_enemy"),
  ##    ]],
  ##
  ##
  ##  [anyone,"guard_prisoners_brought", [],
  ##   "TODO: Thank you. Here is the money for prisoners.", "request_meeting_pretalk",[]],
  ##
  ##  [anyone,"guard_prisoners_brought_some", [],
  ##   "TODO: Thank you, but that's not enough. Here is the money for prisoners.", "request_meeting_pretalk",[]],
  
  #  [anyone|plyr,"request_meeting_1", [], "[Leave]", "close_window",[]],
  
  
  
  
  
  ##  [anyone,"request_meeting_open_gates", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
  ##                                         (call_script, "script_get_troop_attached_party", ":castle_lord"),
  ##                                         (eq, "$g_encountered_party", reg0),
  ##                                         (str_store_troop_name, 1, ":castle_lord")
  ##                                         ],  "My lord {s1} is in the castle now. You must ask his permission to enter.", "request_meeting_pretalk",[]],
  ##
  ##  [anyone,"request_meeting_open_gates", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),
  ##                                         (call_script, "script_get_troop_attached_party", ":castle_lord"),
  ##                                         (neq, "$g_encountered_party", reg0),
  ##                                         (ge, "$g_encountered_party_relation", 0),
  ##                                         (troop_get_slot, ":castle_lord_relation", ":castle_lord", slot_troop_player_relation),
  ##                                         (ge, ":castle_lord_relation", 20),
  ##                                         (str_store_troop_name, 1, ":castle_lord")
  ##                                         ],  "My lord {s1} is not in the castle now.\
  ## But I think he would approve of you taking shelter here, {reg59?madam:sir}.\
  ## Come on in. I am opening the gates for you.", "close_window",[]],
  ##
  ##  [anyone,"request_meeting_open_gates", [(party_get_slot, ":castle_lord", "$g_encountered_party", slot_town_lord),(str_store_troop_name, 1, ":castle_lord")],
  ##   "My lord {s1} is not in the castle now. I can't allow you into the castle without his orders.", "request_meeting_pretalk",[]],
  
  
  
  
  # Quest conversations
  
  ##### TODO: QUESTS COMMENT OUT BEGIN
  
  ##  [party_tpl|pt_peasant_rebels,"start", [],
  ##   "TODO: What.", "peasant_rebel_talk",[]],
  ##  [anyone|plyr, "peasant_rebel_talk", [], "TODO: Die.", "close_window",[]],
  ##  [anyone|plyr, "peasant_rebel_talk", [], "TODO: Nothing.", "close_window",[(assign, "$g_leave_encounter",1)]],
  ##
  ##  [party_tpl|pt_noble_refugees,"start", [],
  ##   "TODO: What.", "noble_refugee_talk",[]],
  ##  [anyone|plyr, "noble_refugee_talk", [], "TODO: Nothing.", "close_window",[(assign, "$g_leave_encounter",1)]],
  ##
  
  
  [anyone,"start", [(eq,"$talk_context",tc_join_battle_ally),
    ],
    "You have come just in time. Let us join our forces now and teach our enemy a lesson.", "close_window",
    []],
  
  [anyone,"start", [(eq,"$talk_context",tc_join_battle_enemy),
    ],
    "You are making a big mistake by fighting against us.", "close_window",
    []],
  
  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
      (troop_is_hero, "$g_talk_troop"),
      (eq, "$g_talk_troop_met", 0),
      (ge, "$g_talk_troop_relation", 17),
    ],
    "I don't think we have met properly my friend. You just saved my life out there, and I still don't know your name...", "ally_thanks_meet", []],
  
  
  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
      (troop_is_hero, "$g_talk_troop"),
      (eq, "$g_talk_troop_met", 0),
      (ge, "$g_talk_troop_relation", 5),
      (str_store_troop_name, s1, "$g_talk_troop"),
    ],
    "Your help was most welcome stranger. My name is {s1}. Can I learn yours?", "ally_thanks_meet", []],
  
  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
      (troop_is_hero, "$g_talk_troop"),
      (eq, "$g_talk_troop_met", 0),
      (ge, "$g_talk_troop_relation", 0),
      (str_store_troop_name, s1, "$g_talk_troop"),
    ],
    "Thanks for your help, stranger. We haven't met properly yet, have we? What is your name?", "ally_thanks_meet", []],
  
  [anyone|plyr,"ally_thanks_meet", [], "My name is {playername}.", "ally_thanks_meet_2", []],
  
  [anyone, "ally_thanks_meet_2", [(ge, "$g_talk_troop_relation", 15),(str_store_troop_name, s1, "$g_talk_troop")],
    "Well met indeed, {playername}. My name is {s1}, and I am forever in your debt. If there is ever anything I can help you with, just let me know...", "close_window", []],
  [anyone, "ally_thanks_meet_2", [(ge, "$g_talk_troop_relation", 5),], "Well met, {playername}. I am in your debt for what you just did. I hope one day I will find a way to repay it.", "close_window", []],
  [anyone, "ally_thanks_meet_2", [], "Well met, {playername}. I am {s1}. Thanks for your help and I hope we meet again.", "close_window", []],
  
  #Post 0907 changes begin
  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
      (troop_is_hero, "$g_talk_troop"),
      (ge, "$g_talk_troop_relation", 30),
      (ge, "$g_relation_boost", 10),
    ],
    "Again you save our necks, {playername}! Truly, you are the best of friends. {s43}", "close_window", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_battle_won_default"),
      (try_begin),
        (party_stack_get_troop_id, ":enemy_party_leader", "p_encountered_party_backup", 0),
        (is_between, ":enemy_party_leader", active_npcs_begin, active_npcs_end),
        (call_script, "script_add_log_entry", logent_lord_helped_by_player, "trp_player",  -1, ":enemy_party_leader", -1),
      (try_end),
  ]],
  
  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
      (troop_is_hero, "$g_talk_troop"),
      (ge, "$g_talk_troop_relation", 20),
      (ge, "$g_relation_boost", 5),
    ],
    "You arrived just in the nick of time, {playername}! You have my deepest thanks! {s43}", "close_window", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_battle_won_default"),
      #       (try_begin),
      #         (party_stack_get_troop_id, ":enemy_party_leader", "p_encountered_party_backup", 0),
      #         (is_between, ":enemy_party_leader", active_npcs_begin, active_npcs_end),
      (call_script, "script_add_log_entry", logent_lord_helped_by_player, "trp_player",  -1, "$g_talk_troop", -1),
      #       (try_end),
  ]],
  
  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
      (troop_is_hero, "$g_talk_troop"),
      (ge, "$g_talk_troop_relation", 0),
      (ge, "$g_relation_boost", 3),
    ],
    "You turned up just in time, {playername}. I will not forget your help. {s43}", "close_window", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_battle_won_default"),
      #       (try_begin),
      #         (party_stack_get_troop_id, ":enemy_party_leader", "p_encountered_party_backup", 0),
      #         (is_between, ":enemy_party_leader", active_npcs_begin, active_npcs_end),
      (call_script, "script_add_log_entry", logent_lord_helped_by_player, "trp_player",  -1, "$g_talk_troop", -1),
      #       (try_end),
  ]],
  
  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
      (troop_is_hero, "$g_talk_troop"),
      (ge, "$g_talk_troop_relation", -5),
    ],
    "Good to see you here, {playername}. {s43}", "close_window", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_battle_won_default"),
      (call_script, "script_troop_change_relation_with_troop", "$g_talk_troop", "trp_player", 1),
  ]],
  
  
  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
      (troop_is_hero, "$g_talk_troop"),
      (ge, "$g_relation_boost", 4),
    ],
    "{!}{s43}", "close_window", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_battle_won_grudging_default"),
  ]],
  
  
  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
      (troop_is_hero, "$g_talk_troop"),
    ],
    "{!}{s43}", "close_window", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_battle_won_unfriendly_default"),
  ]],
  
  
  #  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
  #                    (troop_is_hero, "$g_talk_troop"),
  #                    (ge, "$g_talk_troop_relation", -20),
  #                    ],
  #   "So, this is {playername}. Well, your help wasn't really needed, but I guess you had nothing better to do, right?", "close_window", []],
  
  #  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
  #                    (troop_is_hero, "$g_talk_troop"),
  #                    ],
  #   "Who told you to come to our help? I certainly didn't. Begone now. I want nothing from you and I will not let you steal my victory.", "close_window", []],
  
  #Post 0907 changes begin
  
  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
      (ge, "$g_relation_boost", 10),
      (party_get_num_companions, reg1, "$g_encountered_party"),
      (val_sub, reg1, 1),
    ],
    "Thank you for your help, {reg59?madam:sir}. You saved {reg1?our lives:my life} out there.", "close_window", []],
  
  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks),
      (ge, "$g_relation_boost", 5),
    ],
    "Thank you for your help {reg59?madam:sir}. Things didn't look very well for us but then you came up and everything changed.", "close_window", []],
  
  [anyone,"start", [(eq,"$talk_context",tc_ally_thanks)],
    "Thank you for your help, {reg59?madam:sir}. It was fortunate to have you nearby.", "close_window", []],
  
  [anyone,"start", [(eq, "$talk_context", tc_hero_freed),
      (store_conversation_troop,":cur_troop"),
      (eq,":cur_troop","trp_kidnapped_girl"),],
    "Oh, {reg59?madam:sir}, thank you so much for rescuing me. Will you take me to my family now?", "kidnapped_girl_liberated_battle",[]],
  
  [anyone,"start", [(eq,"$talk_context",tc_hero_freed)],
    "I am in your debt for freeing me, friend.", "freed_hero_answer",
    []],
  
  [anyone|plyr,"freed_hero_answer", [],
    "You're not going anywhere. You'll be my prisoner now!", "freed_hero_answer_1",
    [
      (store_conversation_troop, ":cur_troop_id"),
      (party_add_prisoners, "p_main_party", ":cur_troop_id", 1),#take prisoner
  ]],
  
  [anyone,"freed_hero_answer_1", [],
    "Alas. Will my luck never change?", "close_window",
    []],
  
  [anyone|plyr,"freed_hero_answer", [],
    "You're free to go, {s65}.", "freed_hero_answer_2",
    [
  ]],
  
  [anyone,"freed_hero_answer_2", [],
    "Thank you, good {reg59?lady:sire}. I never forget someone who's done me a good turn.", "close_window",
    []],
  
  [anyone|plyr,"freed_hero_answer", [],
    "Would you like to join me?", "freed_hero_answer_3",
    []],
  
  [anyone,"freed_hero_answer_3", [(store_random_in_range, ":random_no",0,2),(eq, ":random_no", 0)],
    "All right, I will join you.", "close_window",
    [
      (store_conversation_troop, ":cur_troop_id"),
      (party_add_members, "p_main_party", ":cur_troop_id", 1),#join hero
  ]],
  
  [anyone,"freed_hero_answer_3", [],
    "No, I want to go on my own.", "close_window",
    [
  ]],
  
  [anyone,"start", [(eq,"$talk_context",tc_hero_defeated)],
    "You'll not live long to enjoy your victory. My kinsmen will soon wipe out the stain of this defeat.", "defeat_hero_answer",
    [
  ]],
  
  [anyone|plyr,"defeat_hero_answer", [],
    "You are my prisoner now.", "defeat_hero_answer_1",
    [
      (party_add_prisoners, "p_main_party", "$g_talk_troop", 1),#take prisoner
      #(troop_set_slot, "$g_talk_troop", slot_troop_is_prisoner, 1),
      (troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, "p_main_party"),
      (call_script, "script_event_hero_taken_prisoner_by_player", "$g_talk_troop"),
  ]],
  
  [anyone,"defeat_hero_answer_1", [],
    "Damn you. You will regret this.", "close_window",
    []],
  
  [anyone|plyr,"defeat_hero_answer", [],
    "You're free to go this time, but don't cross my path again.", "defeat_hero_answer_2",
    []],
  
  [anyone,"defeat_hero_answer_2", [],
    "We will meet again.", "close_window",
    []],
  
  
  
  
  [anyone,"combined_political_quests", [
      (eq, "$political_quest_found", "qst_resolve_dispute"),
    ],
    "{!}{s9}", "political_quest_suggested",
    [
      (quest_set_slot, "qst_resolve_dispute", slot_quest_target_troop, "$political_quest_target_troop"),
      (quest_set_slot, "qst_resolve_dispute", slot_quest_object_troop, "$political_quest_object_troop"),
      (quest_set_slot, "qst_offer_gift", slot_quest_giver_troop, "$g_talk_troop"),
      
      (quest_get_slot, ":target_troop", "qst_resolve_dispute", slot_quest_target_troop),
      (quest_get_slot, ":object_troop", "qst_resolve_dispute", slot_quest_object_troop),
      (str_store_troop_name, s4, ":target_troop"),
      (str_store_troop_name, s5, ":object_troop"),
      (faction_get_slot, ":faction_leader", "$players_kingdom", slot_faction_leader),
      (str_store_troop_name, s7, ":faction_leader"),
      (try_begin),
        (eq, "$players_kingdom", "fac_player_supporters_faction"),
        (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
        (str_store_string, s9, "str_you_may_be_aware_my_lord_of_the_quarrel_between_s4_and_s5_which_is_damaging_the_unity_of_this_realm_and_sapping_your_authority_if_you_could_persuade_the_lords_to_reconcile_it_would_boost_your_own_standing_however_in_taking_this_on_you_run_the_risk_of_one_the_lords_deciding_that_you_have_taken_the_rivals_side"),
      (else_try),
        (str_store_string, s9, "str_you_may_be_aware_my_lord_of_the_quarrel_between_s4_and_s5_which_is_damaging_the_unity_of_this_realm_and_sapping_your_authority_if_you_could_persuade_the_lords_to_reconcile_i_imagine_that_s7_would_be_most_pleased_however_in_taking_this_on_you_run_the_risk_of_one_the_lords_deciding_that_you_have_taken_the_rivals_side"),
      (try_end),
  ]],
  
  [anyone,"political_quest_follow_on", [
      (eq, "$political_quest_found", "qst_resolve_dispute"),
    ],
    "I think that is a wise move. Good luck to you.", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
      (setup_quest_text,"qst_resolve_dispute"),
      
      (quest_get_slot, ":lord_1", "qst_resolve_dispute", slot_quest_target_troop),
      (str_store_troop_name_link, s11, ":lord_1"),
      
      (quest_get_slot, ":lord_2", "qst_resolve_dispute", slot_quest_object_troop),
      (str_store_troop_name_link, s12, ":lord_2"),
      
      (str_store_string, s2, "str_resolve_the_dispute_between_s11_and_s12"),
      (call_script, "script_start_quest", "qst_resolve_dispute", -1),
      (quest_set_slot, "qst_resolve_dispute", slot_quest_expiration_days, 30),
      (quest_set_slot, "qst_resolve_dispute", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_set_slot, "qst_resolve_dispute", slot_quest_target_state, 0),
      (quest_set_slot, "qst_resolve_dispute", slot_quest_object_state, 0),
      
      (quest_get_slot, ":lord_1", "qst_resolve_dispute", slot_quest_target_troop), #this block just to check if the slots work
      (str_store_troop_name, s11, ":lord_1"),
      (quest_get_slot, ":lord_2", "qst_resolve_dispute", slot_quest_object_troop),
      (str_store_troop_name, s12, ":lord_2"),
    ],
  ],
  
  
  [anyone,"combined_political_quests", [
      
      (eq, "$political_quest_found", "qst_offer_gift"),
      (quest_set_slot, "qst_offer_gift", slot_quest_target_troop, "$political_quest_target_troop"),
      #(quest_set_slot, "qst_offer_gift", slot_quest_giver_troop, "$g_talk_troop"),
      
      (quest_get_slot, ":target_troop", "qst_offer_gift", slot_quest_target_troop),
      (str_store_troop_name, s4, ":target_troop"),
      (troop_get_type, reg4, ":target_troop"),
      (val_mod, reg4, 2),
      (call_script, "script_troop_get_family_relation_to_troop", ":target_troop", "$g_talk_troop"),
      
    ],
    "Your relations with {s4} are not all that they could be. As {reg4?she:he} is my {s11}, I can mediate to attempt to mend your quarrel. Perhaps the best way for me to do this would be to send {reg4?her:him} a gift, perhaps, if I may suggest, some bracelets and brooches, and a length of silver fox fur. If you can provide me with these items, I can have them sent to {reg4?her:him} on your behalf.", "political_quest_suggested",
    [
      (quest_get_slot, ":target_troop", "qst_offer_gift", slot_quest_target_troop),
      (troop_get_type, reg4, ":target_troop"),
      (val_mod, reg4, 2),
  ]],
  
  
  
  [anyone,"political_quest_follow_on", [
      (eq, "$political_quest_found", "qst_offer_gift"),
    ],
    "Splendid. I shall await the materials.", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
      (setup_quest_text,"qst_offer_gift"),
      
      (quest_get_slot, ":lord_1", "qst_offer_gift", slot_quest_target_troop),
      (str_store_troop_name, s14, ":lord_1"),
      (str_store_troop_name, s12, "$g_talk_troop"),
      (troop_get_type, reg4, "$g_talk_troop"),
      (val_mod, reg4, 2),
      
      (str_store_string, s2, "str_you_intend_to_bring_gift_for_s14"),
      
      (call_script, "script_start_quest", "qst_offer_gift", "$g_talk_troop"),
      (quest_set_slot, "qst_offer_gift", slot_quest_expiration_days, 30),
      (quest_set_slot, "qst_offer_gift", slot_quest_current_state, 0), ##CABA - bugfix
  ]],
  
  
  
  
  [anyone,"combined_political_quests", [
      (eq, "$political_quest_found", "qst_denounce_lord"),
      (this_or_next|eq, "$g_talk_troop", "$g_player_minister"),
      (troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      
      (str_store_troop_name, s4, "$political_quest_target_troop"),
      (troop_get_type, reg4, "$political_quest_target_troop"),
      (val_mod, reg4, 2),
      (str_store_faction_name, s5, "$players_kingdom"),
      
      (troop_get_slot, ":reputation_string", "$political_quest_target_troop", slot_lord_reputation_type),
      (val_add, ":reputation_string", "str_lord_derogatory_default"),
      (str_store_string, s7, ":reputation_string"),
      
      (troop_get_slot, ":reputation_string", "$political_quest_target_troop", slot_lord_reputation_type),
      (val_add, ":reputation_string", "str_lord_derogatory_result"),
      (str_store_string, s8, ":reputation_string"),
      
    ],
    "As you may realize, {s4} has many enemies among the lords of the {s5}. In particular, they feel that {reg4?she:he} is {s7}, and worry that {reg4?she:he} will {s8}. Were you to denounce {s4} to {reg4?her:his} face, you may reap much popularity -- although, of course, you would make an enemy of {reg4?her:him} and risk being challenged to a duel.", "political_quest_suggested",
    [
  ]],
  
  [anyone,"combined_political_quests", [
      (eq, "$political_quest_found", "qst_denounce_lord"),
      (troop_get_type, reg4, "$political_quest_target_troop"),
      (val_mod, reg4, 2),
      
      (str_clear, s9),
      (call_script, "script_troop_get_relation_with_troop", "trp_player", "$g_talk_troop"),
      (assign, ":player_relation_with_target", reg0),
      
      (str_store_troop_name, s4, "$political_quest_target_troop"),
      (try_begin),
        (ge, ":player_relation_with_target", 2),
        (neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
        (neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
        (str_store_string, s9, "str_i_realize_that_you_are_on_good_terms_with_s4_but_we_ask_you_to_do_this_for_the_good_of_the_realm"),
      (else_try),
        (ge, ":player_relation_with_target", 2),
        (str_store_string, s9, "str_i_realize_that_you_are_on_good_terms_with_s4_but_the_blow_will_hurt_him_more"),
      (try_end),
      
      (str_store_faction_name, s5, "$players_kingdom"),
      (str_store_troop_name, s4, "$political_quest_target_troop"),
      
      (troop_get_slot, ":reputation_string", "$political_quest_target_troop", slot_lord_reputation_type),
      (val_add, ":reputation_string", "str_lord_derogatory_default"),
      (str_store_string, s7, ":reputation_string"),
      
      (troop_get_slot, ":reputation_string", "$political_quest_target_troop", slot_lord_reputation_type),
      (val_add, ":reputation_string", "str_lord_derogatory_result"),
      (str_store_string, s8, ":reputation_string"),
      
      
    ],
    
    "As you may realize, many of us in the peerage of the {s5} consider {s4} to be {s7}, and a liability to our cause. We worry that {reg4?she:he} will {s8}. People know my views on {s4} already, but if you were to denounce {reg4?her:him} to {reg4?her:his} face, you would further erode his standing -- and discourage our liege from entrusting {reg4?her:him} with any more power or responsibility. Of course, you would make an enemy of {reg4?her:him} and risk being challenged to a duel.{s9}", "political_quest_suggested",
    [
      
      
  ]],
  
  
  [anyone,"political_quest_follow_on", [
      (eq, "$political_quest_found", "qst_denounce_lord"),
      (this_or_next|eq, "$g_talk_troop", "$g_player_minister"),
      (troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
    ],
    "We appreciate what you are doing. I find such intrigues distasteful, but it is all for the good of the {s5}.", "close_window",
    [
      (quest_set_slot, "qst_denounce_lord", slot_quest_target_troop, "$political_quest_target_troop"),
      
      (quest_get_slot, ":target_troop", "qst_denounce_lord", slot_quest_target_troop),
      (str_store_troop_name_link, s14, ":target_troop"),
      (str_store_troop_name_link, s12, "$g_talk_troop"),
      
      (str_store_string, s2, "str_you_intend_to_denounce_s14_to_his_face_on_behalf_of_s14"),
      (setup_quest_text, "qst_denounce_lord"),
      
      (call_script, "script_start_quest", "$political_quest_found", "$g_talk_troop"),
      (quest_set_slot, "qst_denounce_lord", slot_quest_expiration_days, 60),
      
      (str_store_faction_name, s5, "$players_kingdom"),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  [anyone,"political_quest_follow_on", [
      (eq, "$political_quest_found", "qst_denounce_lord"),
    ],
    "Very well. It is always risky to involve yourself in intrigues of this sort, but in this case, I think you will benefit.", "close_window",
    [
      (quest_set_slot, "qst_denounce_lord", slot_quest_target_troop, "$political_quest_target_troop"),
      
      (quest_get_slot, ":target_troop", "qst_denounce_lord", slot_quest_target_troop),
      (str_store_troop_name_link, s14, ":target_troop"),
      (str_store_troop_name_link, s12, "$g_talk_troop"),
      
      (str_store_string, s2, "str_you_intend_to_denounce_s14_to_his_face_on_behalf_of_s14"),
      (setup_quest_text, "qst_denounce_lord"),
      
      (call_script, "script_start_quest", "$political_quest_found", "$g_talk_troop"),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  
  
  [anyone,"combined_political_quests", [
      (eq, "$political_quest_found", "qst_intrigue_against_lord"),
      (str_store_troop_name, s4, "$political_quest_target_troop"),
      (troop_get_type, reg4, "$political_quest_target_troop"),
      (val_mod, reg4, 2),
      (str_store_faction_name, s5, "$players_kingdom"),
      (troop_get_slot, ":reputation_string", "$political_quest_target_troop", slot_lord_reputation_type),
      (val_add, ":reputation_string", "str_lord_derogatory_default"),
      (str_store_string, s7, ":reputation_string"),
      
      (troop_get_slot, ":reputation_string_2", "$political_quest_target_troop", slot_lord_reputation_type),
      (val_add, ":reputation_string_2", "str_lord_derogatory_result"),
      (str_store_string, s8, ":reputation_string_2"),
      
      (faction_get_slot, ":faction_leader", "$players_kingdom", slot_faction_leader),
      (str_store_troop_name, s9, ":faction_leader"),
    ],
    "You and I have a common interest in seeking to curtail the rise of {s4}. I feel that {reg4?she:he} is {s7}, and worry that {reg4?she:he} will {s8}. Were you to tell our liege {s9} your opinion of {s4}, it might discourage {s9} from granting {s4} any further powers or responsibilities, at least for a while, and I would be much obliged to you.", "political_quest_suggested",
    []],
  
  #Intrigue lord for
  [anyone,"political_quest_follow_on", [
      (eq, "$political_quest_found", "qst_intrigue_against_lord"),
      #	(this_or_next|eq, "$g_talk_troop", "$g_player_minister"),
      #		(troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
      (str_store_faction_name, s5, "$players_kingdom"),
      
    ],
    "We appreciate what you are doing. I find such intrigues distasteful, but it is all for the good of the {s5}.", "close_window",
    [
      (quest_set_slot, "qst_intrigue_against_lord", slot_quest_target_troop, "$political_quest_target_troop"),
      
      (quest_get_slot, ":target_troop", "qst_intrigue_against_lord", slot_quest_target_troop),
      (store_faction_of_troop, ":target_troop_faction", ":target_troop"),
      (faction_get_slot, ":faction_liege", ":target_troop_faction", slot_faction_leader),
      (str_store_troop_name_link, s14, ":target_troop"),
      (str_store_troop_name_link, s13, ":faction_liege"),
      (str_store_troop_name_link, s12, "$g_talk_troop"),
      
      (str_store_string, s2, "str_you_intend_to_denounce_s14_to_s13_on_behalf_of_s12"),
      (setup_quest_text, "qst_intrigue_against_lord"),
      
      (call_script, "script_start_quest", "$political_quest_found", "$g_talk_troop"),
      (quest_set_slot, "qst_intrigue_against_lord", slot_quest_expiration_days, 60),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  [anyone,"combined_political_quests", [],
    "I cannot think of anything right now, but we will have some items of mutual interest in the future.", "political_quest_suggested",
    []],
  
  [anyone|plyr,"political_quest_suggested", [
      (gt, "$political_quest_found", 0),
    ],
    "I like that idea.", "political_quest_follow_on",
    [
  ]],
  
  [anyone|plyr,"political_quest_suggested", [
      (gt, "$political_quest_found", 0),
    ],
    "Hmm... Maybe you can think of something else.", "combined_political_quests",
    [
      (quest_set_slot, "$political_quest_found", slot_quest_dont_give_again_remaining_days, 3),
      (call_script, "script_get_political_quest", "$g_talk_troop"),
      (assign, "$political_quest_found", reg0),
      (assign, "$political_quest_target_troop", reg1),
      (assign, "$political_quest_object_troop", reg2),
      
  ]],
  
  [anyone|plyr,"political_quest_suggested", [],
    "Let us discuss another topic", "political_quests_end",
    []],
  
  
  
  
  
  
  
  
  [anyone,"political_quests_end", [
      (troop_slot_eq, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
    ],
    "Very well.", "lord_pretalk",
    []],
  
  [anyone,"political_quests_end", [
      (troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
    ],
    "Very well.", "spouse_pretalk",
    []],
  
  [anyone,"political_quests_end", [
      (eq, "$g_talk_troop", "$g_player_minister"),
    ],
    "Very well.", "minister_pretalk",
    []],
  
  [anyone,"political_quests_end", [
    ],
    "Very well.", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  
  
  # Local merchant
  
  [trp_local_merchant,"start", [], "Mercy! Please don't kill me!", "local_merchant_mercy",[]],
  [anyone|plyr,"local_merchant_mercy", [(quest_get_slot, ":quest_giver_troop", "qst_kill_local_merchant", slot_quest_giver_troop),(str_store_troop_name, s2, ":quest_giver_troop")],
    "I have nothing against you man. But {s2} wants you dead. Sorry.", "local_merchant_mercy_no",[]],
  [anyone,"local_merchant_mercy_no", [], "Damn you! May you burn in Hell!", "close_window",[]],
  [anyone|plyr,"local_merchant_mercy", [], "I'll let you live, if you promise me...", "local_merchant_mercy_yes",[]],
  
  [anyone,"local_merchant_mercy_yes", [], "Of course, I promise, I'll do anything. Just spare my life... ", "local_merchant_mercy_yes_2",[]],
  [anyone|plyr,"local_merchant_mercy_yes_2", [], "You are going to forget about {s2}'s debt to you. " +
    "And you will sign a paper stating that he owes you nothing.", "local_merchant_mercy_yes_3",[]],
  [anyone,"local_merchant_mercy_yes_3", [], "Yes, of course. I'll do as you say.", "local_merchant_mercy_yes_4",[]],
  [anyone|plyr,"local_merchant_mercy_yes_4", [], "And if my lord hears so much of a hint of a complaint about this issue, then I'll come back for you, " +
    "and it won't matter how much you scream for mercy then. " +
    "Do you understand me?", "local_merchant_mercy_yes_5",[]],
  [anyone,"local_merchant_mercy_yes_5", [], "Yes {reg59?madam:sir}. Don't worry. I won't make any complaint.", "local_merchant_mercy_yes_6",[]],
  [anyone|plyr,"local_merchant_mercy_yes_6", [], "Good. Go now, before I change my mind.", "close_window",
    [(quest_set_slot, "qst_kill_local_merchant", slot_quest_current_state, 2),
      (call_script, "script_succeed_quest", "qst_kill_local_merchant"),
      (finish_mission),
  ]],
  
  # Village traitor
  
  [trp_fugitive,"start", [], "What do you want?", "fugitive_1",[]],
  [trp_fugitive|plyr,"fugitive_1", [
      (quest_get_slot, ":quest_target_dna", "qst_hunt_down_fugitive", slot_quest_target_dna),
      (call_script, "script_get_name_from_dna_to_s50", ":quest_target_dna"),
      (str_store_string, s4, s50),
      ], "I am looking for a murderer by the name of {s4}. You fit his description.", "fugitive_2",[]],
  [trp_fugitive|plyr,"fugitive_1", [], "Nothing. Sorry to trouble you.", "close_window",[]],
  [trp_fugitive,"fugitive_2", [], "I don't understand, {reg59?madam:sir}. " +
    "I never killed anyone. I think you've got the wrong man.", "fugitive_3",[]],
  [trp_fugitive|plyr,"fugitive_3", [], "Then drop your sword. If you are innocent, you have nothing to fear. " +
    "We'll go now and talk to your neighbours, and if they verify your story, I'll go on my way.", "fugitive_4",[]],
  [anyone,"fugitive_4", [], "I'm not going anywhere, friend. You're going to have to fight for your silver, today.", "fugitive_5",
    []],
  
  [trp_fugitive|plyr,"fugitive_5", [], "No problem. I really just need your head, anyway.", "fugitive_fight_start",[    (quest_set_slot, "qst_hunt_down_fugitive", slot_quest_current_state, 1),]],
  [trp_fugitive|plyr,"fugitive_5", [], "I come not for money, but to execute the law!", "fugitive_fight_start",[    (quest_set_slot, "qst_hunt_down_fugitive", slot_quest_current_state, 1),]],
  [trp_fugitive|plyr,"fugitive_5", [], "Alas, that you cannot be made to see reason.", "fugitive_fight_start",[    (quest_set_slot, "qst_hunt_down_fugitive", slot_quest_current_state, 1),]],
  
  [anyone,"fugitive_fight_start", [], "Die, dog!", "close_window",[
      (try_for_agents, ":cur_agent"),
        (agent_get_troop_id , ":troop", ":cur_agent"),
        (eq, ":troop", "trp_fugitive"),
        (call_script, "script_equip_best_melee_weapon", ":cur_agent", 0, 0, 0),
      (try_end),]],
  #####################
  
  [anyone,"start", [
      (check_quest_active, "qst_blank_quest_10"),
      (neg|check_quest_succeeded, "qst_blank_quest_10"),
      (neg|check_quest_failed, "qst_blank_quest_10"),
      (quest_get_slot, ":center", "qst_blank_quest_10", slot_quest_target_center),
      (this_or_next|eq, "$g_talk_troop","trp_irish_deserter"),
      (this_or_next|eq, "$g_talk_troop","trp_angle_deserter"),
      (this_or_next|eq, "$g_talk_troop","trp_scotch_deserter"),
      (this_or_next|eq, "$g_talk_troop","trp_saxon_deserter"),
      (this_or_next|eq, "$g_talk_troop","trp_briton_deserter"),
      (eq, "$g_talk_troop","trp_norse_deserter"),
      (eq, ":center", "$current_town"),
      ], "What do you want?", "music_1",[]],
  
  [anyone|plyr,"music_1", [(quest_slot_eq,"qst_blank_quest_10",slot_quest_current_state, 0),
      (quest_get_slot, ":quest_giver_troop", "qst_blank_quest_10", slot_quest_giver_troop),
      (quest_get_slot, ":item", "qst_blank_quest_10", slot_quest_target_item),
      (quest_get_slot, ":giver_center", "qst_blank_quest_10", slot_quest_giver_center),
      (str_store_item_name, s13, ":item"),
      (str_store_troop_name, s9, ":quest_giver_troop"),
      (str_store_party_name, s3, ":giver_center"),
      ], "I am looking for a {s13} stolen from {s9} of {s3}. You look like the fellow I am looking for.", "music_2",[]],
  
  [anyone|plyr,"music_1", [], "Nothing. Sorry to trouble you.", "close_window",[]],
  
  [anyone,"music_2", [], "I don't understand, {reg59?madam:sir}. " +
    "I never stole anything. I think you've got the wrong man.", "music_3",[]],
  
  [anyone|plyr,"music_3", [
      (quest_get_slot, ":quest_giver_troop", "qst_blank_quest_10", slot_quest_giver_troop),
      (quest_get_slot, ":item", "qst_blank_quest_10", slot_quest_target_item),
      (quest_get_slot, ":giver_center", "qst_blank_quest_10", slot_quest_giver_center),
      (str_store_item_name, s13, ":item"),
      (str_store_troop_name, s9, ":quest_giver_troop"),
      (str_store_party_name, s3, ":giver_center"),
      
    ], "Then come with me. If you are innocent, you have nothing to fear. " +
    "We'll go now and talk to {s9} of {s3}, and if he says you are not the man who stole his {s13}, you'll be free to go.", "music_4",[]],
  
  [anyone,"music_4", [], "I'm not going anywhere, friend. You're going to have to fight for your silver today.", "music_5",
    []],
  
  [anyone|plyr,"music_5", [], "No problem. Too bad you can't see reason.", "music_fight_start",[    (quest_set_slot, "qst_blank_quest_10", slot_quest_current_state, 1),]],
  
  [anyone,"music_fight_start", [], "Die, scum!", "close_window",[
      (quest_get_slot, ":target_troop", "qst_blank_quest_10", slot_quest_target_troop),
      (try_for_agents, ":cur_agent"),
        (agent_get_troop_id , ":troop", ":cur_agent"),
        (eq, ":troop", ":target_troop"),
        (call_script, "script_equip_best_melee_weapon", ":cur_agent", 0, 0, 0),
      (try_end),
  ]],
  
  # Assasination dialogs
  [trp_mercenaries_end, "start", [(check_quest_active, "qst_blank_quest_14"),
      (quest_slot_eq, "qst_blank_quest_14", slot_quest_current_state,0),
      ], "Who the hell are you? What do you want?", "reveal_1", []],
  
  [trp_mercenaries_end, "start", [(neg|quest_slot_eq, "qst_blank_quest_14", slot_quest_current_state,0),
      ], "I told you everything I know. Now leave me alone!", "close_window",[]],
  
  [trp_mercenaries_end|plyr, "reveal_1", [], "My name is {playername}. Sound familiar? I have some questions for you.","reveal_2", []],
  
  [trp_mercenaries_end|plyr, "reveal_1", [], "My name is {playername}. Sound familiar? I came to fetch your head.","reveal_fight", [(quest_set_slot, "qst_blank_quest_14", slot_quest_current_state, 1),]],
  
  [anyone,"reveal_fight", [], "Well, you asked for it, {playername}!", "close_window",
    [(try_for_agents, ":cur_agent"),
        (agent_get_troop_id , ":troop", ":cur_agent"),
        (eq, ":troop", "trp_mercenaries_end"),
        (call_script, "script_equip_best_melee_weapon", ":cur_agent", 0, 0, 0),
      (try_end),
  ]],
  
  [trp_mercenaries_end, "reveal_2", [], "Questions? I am not going to answer any questions, and I have no idea who you are!", "reveal_3",[]],
  
  [trp_mercenaries_end|plyr, "reveal_3", [], "This is the last warning: answer me or die!","reveal_4", []],
  
  [trp_mercenaries_end|plyr, "reveal_3", [], "I've had enough of you! Prepare to die!","reveal_fight", [(quest_set_slot, "qst_blank_quest_14", slot_quest_current_state, 1),]],
  
  [trp_mercenaries_end, "reveal_4", [(troop_slot_ge, "trp_player", slot_troop_renown, 450),],
    "Now I recognize you, {playername}. I'll answer your questions if you spare my life.", "reveal_5",[]],
  
  [trp_mercenaries_end, "reveal_4", [(neg|troop_slot_ge, "trp_player", slot_troop_renown, 450),],
    "I still don't know who you are and what you are talking about. I'll try to answer your questions, but stop threatening me.", "reveal_5",[]],
  
  [trp_mercenaries_end|plyr, "reveal_5", [
      (quest_get_slot, ":quest_target_center", "qst_blank_quest_14", slot_quest_target_center),
      (str_store_party_name, s3, ":quest_target_center"),],
    "I was attacked by some thugs not so long ago. I managed to dispose of the attackers and found a note saying to meet a contact in {s3}. Both you and I know you are that contact. I really don't care about you, but rather need to know who ordered this and why.","reveal_6", [(store_random_in_range,":random", 4, 17),(assign, "$temp_2", ":random"),(assign, "$temp", 0),]],
  
  [trp_mercenaries_end, "reveal_6", [(str_clear, s10),
      (str_clear, s9),
      (store_faction_of_party, ":town_faction", "$current_town"),
      (store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"),
      (assign, ":enemy_lord", 0),
      (gt, ":persuasion_level", "$temp_2"),
      (try_for_range, ":enemy", active_npcs_begin, active_npcs_end),
        (troop_slot_eq, ":enemy", slot_troop_occupation, slto_kingdom_hero),
        (store_faction_of_troop, ":faction", ":enemy"),
        (neq, ":faction", "fac_adventurers"),
        (try_begin),
          (this_or_next|troop_slot_eq, ":enemy", slot_lord_reputation_type, lrep_debauched),
          (this_or_next|troop_slot_eq, ":enemy", slot_lord_reputation_type, lrep_quarrelsome),
          (this_or_next|troop_slot_eq, ":enemy", slot_lord_reputation_type, lrep_cunning),
          (troop_slot_eq, ":enemy", slot_lord_reputation_type, lrep_roguish),
          #			(eq, ":faction", ":town_faction"),
          (call_script, "script_troop_get_player_relation", ":enemy"),
          (assign, ":relation_with_lord_1", reg0),
          (try_begin),
            (le, ":relation_with_lord_1", 0),
            (assign, ":enemy_lord", ":enemy"),
            (assign, ":enemy_faction", ":faction"),
          (try_end),
        (else_try),
          (this_or_next|troop_slot_eq, ":enemy", slot_lord_reputation_type, lrep_martial),
          (troop_slot_eq, ":enemy", slot_lord_reputation_type, lrep_selfrighteous),
          (eq, ":faction", ":town_faction"),
          (call_script, "script_troop_get_player_relation", ":enemy"),
          (assign, ":relation_with_lord_1", reg0),
          (try_begin),
            (le, ":relation_with_lord_1", -5),
            (assign, ":enemy_lord", ":enemy"),
            (assign, ":enemy_faction", ":faction"),
          (try_end),
        (else_try),
          (this_or_next|troop_slot_eq, ":enemy", slot_lord_reputation_type, lrep_goodnatured),
          (this_or_next|troop_slot_eq, ":enemy", slot_lord_reputation_type, lrep_benefactor),
          (troop_slot_eq, ":enemy", slot_lord_reputation_type, lrep_upstanding),
          (eq, ":faction", ":town_faction"),
          (call_script, "script_troop_get_player_relation", ":enemy"),
          (assign, ":relation_with_lord_1", reg0),
          (try_begin),
            (le, ":relation_with_lord_1", -20),
            (assign, ":enemy_lord", ":enemy"),
            (assign, ":enemy_faction", ":faction"),
          (try_end),
        (else_try),
          (call_script, "script_troop_get_player_relation", ":enemy"),
          (assign, ":relation_with_lord_1", reg0),
          (try_begin),
            (le, ":relation_with_lord_1", -20),
            (assign, ":enemy_lord", ":enemy"),
            (assign, ":enemy_faction", ":faction"),
          (try_end),
        (try_end),
      (try_end),
      (gt, ":enemy_lord", 0),
      (str_store_troop_name_link, s9, ":enemy_lord"),
      (str_store_faction_name_link, s10, ":enemy_faction"),
      (assign, "$temp", ":enemy_lord"),
    ],
    "Alright, if you promise to let me go... 'Twas {s9} of {s10}. Don't ask me why; I don't know.", "reveal_7",[(assign, "$temp_3", 0),]],
  
  [trp_mercenaries_end, "reveal_6",[
      (store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"),
      (this_or_next|le, ":persuasion_level", "$temp_2"),
      (eq, "$temp", 0),
    ],
    "I am sorry to hear about your mishaps, but I have nothing to tell you. Be gone now.", "reveal_7",[(assign, "$temp_3", 1),]],
  
  [trp_mercenaries_end|plyr, "reveal_7",[(eq, "$temp_3", 0),],"Thanks! You've both helped me and saved yourself. Be gone now.","close_window",[
      (quest_set_slot, "qst_blank_quest_14", slot_quest_current_state, 2),
      (call_script, "script_succeed_quest", "qst_blank_quest_14"),
      (call_script, "script_end_quest", "qst_blank_quest_14"),
      (assign, ":quest_expiration_days", 30),
      (assign, ":quest_target_troop", "$temp"),
      (quest_set_slot, "qst_blank_quest_15", slot_quest_expiration_days, ":quest_expiration_days"),
      (quest_set_slot, "qst_blank_quest_15", slot_quest_current_state, 0),
      (quest_set_slot,"qst_blank_quest_15", slot_quest_target_troop, ":quest_target_troop"),
      (str_store_troop_name_link,s9, ":quest_target_troop"),
      (str_store_string, s2, "str_reveal_ass2"),
      (setup_quest_text, "qst_blank_quest_15"),
      (call_script, "script_start_quest", "qst_blank_quest_15", -1),
  ]],
  
  [trp_mercenaries_end|plyr, "reveal_7", [(eq, "$temp_3", 1),],"Then prepare to die!","reveal_fight", [(quest_set_slot, "qst_blank_quest_14", slot_quest_current_state, 1),]],
  
  [trp_mercenaries_end|plyr, "reveal_7", [(eq, "$temp_3", 1),],"Sorry to bother you, sir.","close_window", [
      (quest_set_slot, "qst_blank_quest_14", slot_quest_current_state, 2),
      (call_script, "script_cancel_quest", "qst_blank_quest_14"),
  ]],
  #Assasination dialogs end
  #Lord Assasination talk
  
  [anyone, "lord_reveal", [], "Excuse me, {playername}? Don't tell me you believe everything people say on the street. People who want to bring me down or destroy our friendship spread those rumors.","lord_reveal2",[]],
  
  [anyone|plyr, "lord_reveal2", [], "True, most rumors are nothing more than lies. Not, in this case though. I have met someone who told me all about your involvement in this matter. Would you like to meet him too?", "lord_reveal3",[]],
  
  [anyone, "lord_reveal3", [(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),],
    "Hmm, you see, {playername}, it wasn't really my choice. Some lords are not very happy with your rise in power, so they all ordered me to organize this err... accident. What could I do? I didn't want to do this, but what choice did I have?", "lord_reveal4",[(assign, "$info_inquired", 0)]],
  
  [anyone, "lord_reveal3", [(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),],
    "So what, {playername}? No one likes you. You are nothing more than a stupid upstart among us real nobles! Too bad those idiots couldn't finish the job!", "lord_reveal4",[(assign, "$info_inquired", 0),]],
  
  [anyone, "lord_reveal3", [],
    "Well, {playername}, welcome to real world. If you rise fast, be prepared to pay the price. Some lords are unhappy with you, and I guarantee this is not the last time something like that happens, so be prepared. Don't say I didn't warn you.", "lord_reveal4",[(assign, "$info_inquired", 0),]],
  
  [anyone|plyr, "lord_reveal4", [		(eq, "$info_inquired", 0),
      #												(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (troop_get_slot, ":renown", "$g_talk_troop", slot_troop_renown),
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
        (store_mul, ":fee", ":renown", 3),
        (assign, reg22, ":fee"),
        (str_store_string, s10, "@I think your dilemma can be solved for {reg22} peningas."),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
        (store_mul, ":fee", ":renown", 1),
        (assign, reg22, ":fee"),
        (str_store_string, s10, "@Thank you for the warning. {reg22} peningas will make me forget everything."),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
        (store_mul, ":fee", ":renown", 2),
        (assign, reg22, ":fee"),
        (str_store_string, s10, "@Pay {reg22} peningas for your rudeness or else..."),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
        (store_mul, ":fee", ":renown", 5),
        (val_div, ":fee", 4),
        (assign, reg22, ":fee"),
        (str_store_string, s10, "@{reg22} peningas is the price of my silence. Otherwise..."),
      (else_try),
        ##												(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_benefactor),
        ##												(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
        ##												(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
        (store_mul, ":fee", ":renown", 3),
        (val_div, ":fee", 4),
        (assign, reg22, ":fee"),
        (str_store_string, s10, "@I understand you were forced to do it, but I'm entitled to compensation, and I think {reg22} peningas will be acceptable. I would hate to tell on you, but I have no choice either."),
      (try_end),
      (assign, "$temp", reg22),
      ], "{!}{s10}", "lord_reveal5",[(assign, "$info_inquired", 1),]],
  
  [anyone|plyr, "lord_reveal4", [], "Whatever the reason, I demand satisfaction.","lord_duel_yes", []],
  
  [anyone|plyr, "lord_reveal4", [],  "Then it's my duty to inform your liege of your criminal deeds.","lord_reveal5aa", []],
  
  [anyone|plyr, "lord_reveal4", [], "I apologize. I acted rashly.", "close_window", [
      (call_script, "script_cancel_quest", "qst_blank_quest_15"),
      (assign, "$g_leave_encounter", 1),]],
  
  
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (assign, reg22, "$temp"),
      (lt, ":wealth", reg22),
      ], "Sorry, I don't have that kind of money","lord_reveal4", []],
  
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (assign, reg22, "$temp"),
      (ge, ":wealth", reg22),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_benefactor),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (store_random_in_range, ":rand", 1,5),
      (assign,"$temp2", ":rand"),
      #									(assign, reg41,"$temp2"),
      #									(display_message, "@Selected random is {reg41}"),
      (val_add, ":troop_persuasion_skill", ":rand"),
      (gt, ":player_persuasion_skill", ":troop_persuasion_skill"),
      ], "Fine, {playername}. I will give you the money, although you come across as a blackmailer.","lord_reveal6", [(assign,"$temp", reg22),]],
  
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (assign, reg22, "$temp"),
      (ge, ":wealth", reg22),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_benefactor),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (val_add, ":troop_persuasion_skill", "$temp2"),
      #									(assign, reg44,"$temp2"),
      #									(display_message, "@Random is {reg44}"),
      (le, ":player_persuasion_skill", ":troop_persuasion_skill"),
      (store_party_size_wo_prisoners, ":lord_party", "$g_encountered_party"),
      (store_party_size_wo_prisoners, ":player_party", "p_main_party"),
      #VC-3402 begins
      (troop_get_slot, "$g_talk_troop_party", "$g_talk_troop", slot_troop_leaded_party),
      (party_get_attached_to, ":attached_to", "$g_talk_troop_party"),
      (this_or_next|is_between, ":attached_to", walled_centers_begin, walled_centers_end),
      #VC-3402 ends
      (le, ":lord_party", ":player_party"),
      ], "Sorry, {playername}, you sound like a dirty blackmailer, and I don't pay them no matter what.","lord_duel_start", []],
  
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (assign, reg22, "$temp"),
      (ge, ":wealth", reg22),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_benefactor),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (val_add, ":troop_persuasion_skill", "$temp2"),
      #									(assign, reg44,"$temp2"),
      #									(display_message, "@Random is {reg44}"),
      (le, ":player_persuasion_skill", ":troop_persuasion_skill"),
      (store_party_size_wo_prisoners, ":lord_party", "$g_encountered_party"),
      (store_party_size_wo_prisoners, ":player_party", "p_main_party"),
      (gt, ":lord_party", ":player_party"),
      ], "{playername}, you are nothing but a dirty blackmailer, and I have no choice but to defend my honor.","lord_fight_start", []],
  
  [anyone,"lord_fight_start", [],
    "{!}{s43}", "close_window", [
      (str_store_string, s43, "@Prepare to die, you, insolent crook!"),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -30),
      
      (troop_get_slot, ":controversy", "$g_talk_troop", slot_troop_controversy),
      (val_add, ":controversy", 5),
      (troop_set_slot, "$g_talk_troop", slot_troop_controversy, ":controversy"),
      (assign,"$encountered_party_hostile",1),
      (assign,"$encountered_party_friendly",0),
      (assign,"$cant_leave_encounter", 1),]],
  
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (assign, reg22, "$temp"),
      (ge, ":wealth", reg22),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
      (store_mul, reg23, reg22, 2),
      (val_div, reg23, 3),
      ], "Well, I think that {reg22} peningas is a bit too much. How about {reg23}?","lord_reveal5a", [(assign, "$temp", reg23),(assign,"$temp_2", reg22),]],
  
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (assign, reg22, "$temp"),
      (ge, ":wealth", reg22),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (val_add, ":troop_persuasion_skill", "$temp2"),
      #																		(assign, reg44,"$temp2"),
      #									(display_message, "@Random is {reg44}"),
      (gt, ":player_persuasion_skill", ":troop_persuasion_skill"),
      ], "Just like I thought of you, {playername}: full of greed. Here, take your dirty money!","lord_reveal6", [(assign,"$temp", reg22),]],
  
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
      (assign, reg22, "$temp"),
      (ge, ":wealth", reg22),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (val_add, ":troop_persuasion_skill", "$temp2"),
      #									(assign, reg44,"$temp2"),
      #									(display_message, "@Random is {reg44}"),
      (le, ":player_persuasion_skill", ":troop_persuasion_skill"),
      (store_party_size_wo_prisoners, ":lord_party", "$g_encountered_party"),
      (store_party_size_wo_prisoners, ":player_party", "p_main_party"),
      #VC-3402 begins
      (troop_get_slot, "$g_talk_troop_party", "$g_talk_troop", slot_troop_leaded_party),
      (party_get_attached_to, ":attached_to", "$g_talk_troop_party"),
      (this_or_next|is_between, ":attached_to", walled_centers_begin, walled_centers_end),
      #VC-3402 ends
      (le, ":lord_party", ":player_party"),
      ], "I will never pay such a low life like you, {playername}! I have no choice but to fight such scum, but heaven knows someone has to do the dirty job!","lord_duel_start", []],
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
      (assign, reg22, "$temp"),
      (ge, ":wealth", reg22),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (val_add, ":troop_persuasion_skill", "$temp2"),
      #									(assign, reg44,"$temp2"),
      #									(display_message, "@Random is {reg44}"),
      (le, ":player_persuasion_skill", ":troop_persuasion_skill"),
      (store_party_size_wo_prisoners, ":lord_party", "$g_encountered_party"),
      (store_party_size_wo_prisoners, ":player_party", "p_main_party"),
      (gt, ":lord_party", ":player_party"),
      ], "I will never pay such a low life like you, {playername}! I have no choice but to fight such scum, but heaven knows someone has to do the dirty job!","lord_fight_start", []],
  
  
  
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
      (assign, reg22, "$temp"),
      (ge, ":wealth", reg22),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (val_add, ":troop_persuasion_skill", "$temp2"),
      #									(assign, reg44,"$temp2"),
      #									(display_message, "@Random is {reg44}"),
      (le, ":player_persuasion_skill", ":troop_persuasion_skill"),
      (store_party_size_wo_prisoners, ":lord_party", "$g_encountered_party"),
      (store_party_size_wo_prisoners, ":player_party", "p_main_party"),
      #VC-3402 begins
      (troop_get_slot, "$g_talk_troop_party", "$g_talk_troop", slot_troop_leaded_party),
      (party_get_attached_to, ":attached_to", "$g_talk_troop_party"),
      (this_or_next|is_between, ":attached_to", walled_centers_begin, walled_centers_end),
      #VC-3402 ends
      (le, ":lord_party", ":player_party"),
      ], "Ha-ha-ha, what is this? Extortion? Prepare to fight!","lord_duel_start", []],
  
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
      (assign, reg22, "$temp"),
      (ge, ":wealth", reg22),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (val_add, ":troop_persuasion_skill", "$temp2"),
      #									(assign, reg44,"$temp2"),
      #									(display_message, "@Random is {reg44}"),
      (le, ":player_persuasion_skill", ":troop_persuasion_skill"),
      (store_party_size_wo_prisoners, ":lord_party", "$g_encountered_party"),
      (store_party_size_wo_prisoners, ":player_party", "p_main_party"),
      (gt, ":lord_party", ":player_party"),
      ], "Ha-ha-ha, what is this? Extortion? Prepare to fight!","lord_fight_start", []],
  
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (assign, reg22, "$temp"),
      (ge, ":wealth", reg22),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (val_add, ":troop_persuasion_skill", "$temp2"),
      #																		(assign, reg44,"$temp2"),
      #									(display_message, "@Random is {reg44}"),
      (gt, ":player_persuasion_skill", ":troop_persuasion_skill"),
      ], "I don't like it, but I guess I have to pay you off.","lord_reveal6", [(assign,"$temp", reg22),]],
  
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (assign, reg22, "$temp"),
      (ge, ":wealth", reg22),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (val_add, ":player_persuasion_skill", 1),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (val_add, ":troop_persuasion_skill", "$temp2"),
      #																		(assign, reg44,"$temp2"),
      #									(display_message, "@Random is {reg44}"),
      (le, ":player_persuasion_skill", ":troop_persuasion_skill"),
      (store_party_size_wo_prisoners, ":lord_party", "$g_encountered_party"),
      (store_party_size_wo_prisoners, ":player_party", "p_main_party"),
      #VC-3402 begins
      (troop_get_slot, "$g_talk_troop_party", "$g_talk_troop", slot_troop_leaded_party),
      (party_get_attached_to, ":attached_to", "$g_talk_troop_party"),
      (this_or_next|is_between, ":attached_to", walled_centers_begin, walled_centers_end),
      #VC-3402 ends
      (le, ":lord_party", ":player_party"),
      ], "Ha-ha-ha, what is this? Extortion? Prepare to fight!","lord_duel_start", []],
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (assign, reg22, "$temp"),
      (ge, ":wealth", reg22),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (val_add, ":player_persuasion_skill", 1),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (val_add, ":troop_persuasion_skill", "$temp2"),
      #																		(assign, reg44,"$temp2"),
      #									(display_message, "@Random is {reg44}"),
      (le, ":player_persuasion_skill", ":troop_persuasion_skill"),
      (store_party_size_wo_prisoners, ":lord_party", "$g_encountered_party"),
      (store_party_size_wo_prisoners, ":player_party", "p_main_party"),
      (gt, ":lord_party", ":player_party"),
      ], "Ha-ha-ha, what is this? Extortion? Prepare to fight!","lord_fight_start", []],
  
  [anyone, "lord_reveal5", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (assign, reg22, "$temp"),
      (ge, ":wealth", reg22),
      (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (val_add, ":player_persuasion_skill", 1),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (val_add, ":troop_persuasion_skill", "$temp2"),
      #									(assign, reg44,"$temp2"),
      #									(display_message, "@Random is {reg44}"),
      (gt, ":player_persuasion_skill", ":troop_persuasion_skill"),
      ], "I don't like it, but I guess I have to pay you off. Watch your back, though!","lord_reveal6", [(assign, "$temp", reg22),]],
  
  [anyone|plyr, "lord_reveal6",[],"Nice doing business with you.", "lord_reveal_pay",[]],
  
  [anyone|plyr, "lord_reveal6",[], "I forgive you", "lord_reveal5af", []],
  
  [anyone, "lord_duel_yes",[
      (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
      (check_quest_active,"qst_blank_quest_15"),
      (neg|check_quest_concluded,"qst_blank_quest_15"),
      (quest_slot_eq, "qst_blank_quest_15", slot_quest_target_troop, "$g_talk_troop"),
      (str_store_string, s1, "@Ah, a duel. Well, if you insist, {playername}, I will oblige."),
      ], "{!}{s1}", "lord_duel_start",[]],
  
  [anyone|plyr, "lord_duel_start", [], "Marvellous. Let's go.", "close_window", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -15),
      (call_script, "script_set_up_duel_with_troop", "$g_talk_troop"),]],
  
  
  [anyone|plyr, "lord_reveal5a", [
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (val_add, ":troop_persuasion_skill", "$temp2"),
      #									(assign, reg44,"$temp2"),
      #									(display_message, "@Random is {reg44}"),
      (gt, ":player_persuasion_skill", ":troop_persuasion_skill"),
      (assign, reg22, "$temp_2"),],
    "When it comes to honor, bargaining is inappropriate. {reg22} peningas it is.","lord_reveal_pay", [(assign, "$temp", reg22),]],
  
  [anyone|plyr, "lord_reveal5a", [
      (store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
      (store_skill_level, ":troop_persuasion_skill", "skl_persuasion", "$g_talk_troop"),
      (val_add, ":troop_persuasion_skill", "$temp2"),
      #									(assign, reg44,"$temp2"),
      #									(display_message, "@Random is {reg44}"),
      (le, ":player_persuasion_skill", ":troop_persuasion_skill"),
      (assign, reg23, "$temp"),],
    "Then {reg23} peningas will do.","lord_reveal_pay", [(assign, "$temp", reg23),]],
  
  [anyone, "lord_reveal_pay", [
      (troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (assign, reg22, "$temp"),
      (store_sub, ":pay", ":wealth", reg22),
      (assign, reg23, ":pay"),
    ],
    "Here is the money. I will take care of that village idiot myself.", "lord_talk", [
      (troop_set_slot, "$g_talk_troop", slot_troop_wealth, reg23),
      (troop_add_gold, "trp_player", reg22),
      (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", -15),
      (call_script, "script_succeed_quest", "qst_blank_quest_15"),
      (call_script, "script_end_quest", "qst_blank_quest_15"),],
  ],
  
  [anyone, "lord_reveal5aa", [ (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
      (store_party_size_wo_prisoners, ":lord_party", "$g_encountered_party"),
      (store_party_size_wo_prisoners, ":player_party", "p_main_party"),
      (gt, ":lord_party", ":player_party"),
      #VC-3402
      (troop_get_slot, "$g_talk_troop_party", "$g_talk_troop", slot_troop_leaded_party),
      (party_get_attached_to, ":attached_to", "$g_talk_troop_party"),
      (neg|is_between, ":attached_to", walled_centers_begin, walled_centers_end),
    ],
    "Argh! Aren't you a little scummy tattle teller! I have to teach you a lesson!", "lord_fight_start",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -20),]],
  
  [anyone, "lord_reveal5aa", [ (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
      (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
      (store_party_size_wo_prisoners, ":lord_party", "$g_encountered_party"),
      (store_party_size_wo_prisoners, ":player_party", "p_main_party"),
      (le, ":lord_party", ":player_party"),],
    "Argh! Aren't you a little scummy tattle teller! I have to teach you a lesson!", "lord_duel_start",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -20),]],
  
  [anyone, "lord_reveal5aa",[(try_begin),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
        (str_store_string, s11, "@Hmm, are you sure? I don't think you would want to ruin our relationship completely..."),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
        (str_store_string, s11, "@Hmm, isn't this all a bit rash? Perhaps you and I can solve this problem in a more rewarding fashion..."),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
        (str_store_string, s11, "@I always knew, {playername}, that you were of such poor moral fiber. Truly, only the lowest of the low would attempt to besmirch and blackmail someone so clearly superior to {reg59?him:her}. But, alas, however serious this accusation, it is hardly worth my time to answer."),
      (else_try),
        #(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
        #(this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
        #(troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_benefactor),      #Outcommented because we need catch all possible conditions
        (str_store_string, s11, "@{playername}, is it worth it to come to blows over this? I admitted that was wrong of me to do such a thing. What else do you want?"),
      (try_end),],
    "{!}{s11}", "lord_reveal5ab",[]],
  
  [anyone|plyr, "lord_reveal5ab",[], "Ok, I changed my mind. I will take the money instead.","lord_reveal5ad",[]],
  
  [anyone|plyr, "lord_reveal5ab",[], "My honor is not for sale. Your liege needs to know about your dirty deeds.","lord_reveal5ac",[]],
  
  [anyone|plyr, "lord_reveal5ab",[], "That's an insult. I demand satisfaction!","lord_duel_yes",[]],
  
  [anyone, "lord_reveal5ac", 	[
      (store_party_size_wo_prisoners, ":lord_party", "$g_encountered_party"),
      (store_party_size_wo_prisoners, ":player_party", "p_main_party"),
      #VC-3402 begins
      (troop_get_slot, "$g_talk_troop_party", "$g_talk_troop", slot_troop_leaded_party),
      (party_get_attached_to, ":attached_to", "$g_talk_troop_party"),
      (this_or_next|is_between, ":attached_to", walled_centers_begin, walled_centers_end),
      #VC-3402 ends
      (le, ":lord_party", ":player_party"),
      ],	"You will tell my liege no such thing!", "lord_duel_start",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -20),
      (call_script, "script_change_player_honor", 2),]],
  
  [anyone, "lord_reveal5ac", 	[
      (store_party_size_wo_prisoners, ":lord_party", "$g_encountered_party"),
      (store_party_size_wo_prisoners, ":player_party", "p_main_party"),
      (gt, ":lord_party", ":player_party"),
      ],	"You will tell my liege no such thing!", "lord_fight_start",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -20),
      (call_script, "script_change_player_honor", 2),]],
  
  [anyone, "lord_reveal5ad", [(troop_get_slot, ":wealth", "$g_talk_troop", slot_troop_wealth),
      (troop_get_slot, ":renown", "$g_talk_troop", slot_troop_renown),
      (store_mul, ":pay", ":renown", 2),
      (str_clear, s10),
      (try_begin),
        (gt, ":wealth", 400),
        (try_begin),
          (ge, ":wealth", ":pay"),
          (assign, reg22, ":pay"),
          (str_store_string, s10, "@I can pay you {reg22} peningas for your troubles and not a penny more!"),
        (else_try),
          (lt, ":pay", ":wealth"),
          (assign, reg22, 400),
          (str_store_string, s10, "@Given my poor finances, I think {reg22} peningas for your troubles would be enough."),
        (try_end),
      (else_try),
        (is_between, ":wealth", 100, 400),
        (assign, reg22, ":wealth"),
        (str_store_string, s10, "@I only have mere {reg22} peningas. Take them and leave me alone."),
      (else_try),
        (assign, reg22, 0),
        (str_store_string, s10, "@I have no money to pay you."),
      (try_end),
      (assign, "$temp", reg22),
      ],"{!}{s10}", "lord_reveal5ae",[]],
  
  [anyone|plyr, "lord_reveal5ae",[(gt,  "$temp", 0)], "I will take the money", "lord_reveal_pay", []],
  
  [anyone|plyr, "lord_reveal5ae", [(eq, "$temp", 0),], "I forgive you.", "lord_reveal5af", []],
  
  [anyone|plyr, "lord_reveal5ae", [], "This is unacceptable! I demand satisfaction!", "lord_duel_yes",[]],
  
  [anyone, "lord_reveal5af", [(str_clear, s11),
      (try_begin),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_benefactor),
        (str_store_string, s11, "@Bless you, {playername}. This is an honorable decision, and I will remember it."),
        (assign, ":relation", 10),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
        (str_store_string, s11, "@Bless you, {playername}. This is an honorable decision, and I will remember it."),
        (assign, ":relation", 7),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
        (str_store_string, s11, "@This is not only an honorable decision but a sign of your political maturity, {playername}."),
        (assign, ":relation", 5),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_debauched),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_quarrelsome),
        (str_store_string, s11, "@Well, thank you, {playername}. I surely appreciate your kindness."),
        (assign, ":relation", 1),
      (else_try),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
        (str_store_string, s11, "@Maybe I was wrong about you, {playername}. Only time will tell."),
        (assign, ":relation", 2),
      (try_end),
      (assign, reg21, ":relation"),],
    "{!}{s11}","lord_talk", [ (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", reg21),
      (call_script, "script_change_player_honor", 10),
      (call_script, "script_succeed_quest", "qst_blank_quest_15"),
      (call_script, "script_end_quest", "qst_blank_quest_15"),]],
  
  
  
  [anyone,"member_chat", [(check_quest_active, "qst_incriminate_loyal_commander"),
      (quest_slot_eq, "qst_incriminate_loyal_commander", slot_quest_current_state, 0),
      (store_conversation_troop, "$g_talk_troop"),
      (eq, "$g_talk_troop", "$incriminate_quest_sacrificed_troop"),
      (quest_get_slot, ":quest_target_center", "qst_incriminate_loyal_commander", slot_quest_target_center),
      (store_distance_to_party_from_party, ":distance", "p_main_party", ":quest_target_center"),
      (lt, ":distance", 10),
      ], "Yes {reg59?madam:sir}?", "sacrificed_messenger_1",[]],
  
  [anyone|plyr,"sacrificed_messenger_1", [(quest_get_slot, ":quest_target_center", "qst_incriminate_loyal_commander", slot_quest_target_center),
      (str_store_party_name, s1, ":quest_target_center"),
      (quest_get_slot, ":quest_object_troop", "qst_incriminate_loyal_commander", slot_quest_object_troop),
      (str_store_troop_name, s2, ":quest_object_troop"),],
    "Take this letter to {s1} and give it to {s2}.", "sacrificed_messenger_2",[]],
  [anyone|plyr,"sacrificed_messenger_1", [],
    "Nothing. Nothing at all.", "close_window",[]],
  
  [anyone,"sacrificed_messenger_2", [],
    "Yes {reg59?madam:sir}. You can trust me. I will not fail you.", "sacrificed_messenger_3",[]],
  
  [anyone|plyr,"sacrificed_messenger_3", [],
    "Good. I will not forget your service. You will be rewarded when you return.", "close_window",[(party_remove_members, "p_main_party", "$g_talk_troop", 1),
      (set_spawn_radius, 0),
      (spawn_around_party, "p_main_party", "pt_sacrificed_messenger"),
      (assign, ":new_party", reg0),
      (party_add_members, ":new_party", "$g_talk_troop", 1),
      (party_set_ai_behavior, ":new_party", ai_bhvr_travel_to_party),
      (quest_get_slot, ":quest_target_center", "qst_incriminate_loyal_commander", slot_quest_target_center),
      (party_set_ai_object, ":new_party", ":quest_target_center"),
      (party_set_flags, ":new_party", pf_default_behavior, 0),
      (quest_set_slot, "qst_incriminate_loyal_commander", slot_quest_current_state, 2),
      (quest_set_slot, "qst_incriminate_loyal_commander", slot_quest_target_party, ":new_party")]],
  [anyone|plyr,"sacrificed_messenger_3", [], "Arggh! I can't do this. I can't send you to your own death!", "sacrificed_messenger_cancel",[]],
  [anyone,"sacrificed_messenger_cancel", [], "What do you mean, {reg59?madam:sir}?", "sacrificed_messenger_cancel_2",[]],
  [anyone|plyr,"sacrificed_messenger_cancel_2", [(quest_get_slot, ":quest_giver", "qst_incriminate_loyal_commander", slot_quest_giver_troop),
      (str_store_troop_name, s3, ":quest_giver"),
    ], "There's a trap set up for you in the town. " +
    "{s3} ordered me to sacrifice one of my chosen warriors to fool the enemy, " +
    "but he will just need to find another way.", "sacrificed_messenger_cancel_3",[
      (quest_get_slot, ":quest_giver", "qst_incriminate_loyal_commander", slot_quest_giver_troop),
      (quest_set_slot, "qst_incriminate_loyal_commander", slot_quest_current_state, 1),
      (call_script, "script_change_player_relation_with_troop",":quest_giver",-5),
      (call_script, "script_change_player_honor", 3),
      (call_script, "script_fail_quest", "qst_incriminate_loyal_commander"),
  ]],
  [anyone,"sacrificed_messenger_cancel_3", [], "Thank you, {reg59?madam:sir}. " +
    "I will follow you to the gates of hell. But this would not be a good death.", "close_window",[]],
  
  [party_tpl|pt_sacrificed_messenger,"start", [],
    "Don't worry, {reg59?madam:sir}, I'm on my way.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  #Spy
  
  [party_tpl|pt_spy,"start", [], "Good day, {reg59?madam:sir}. Such fine weather, don't you think? If you'll excuse me now, I must go on my way.", "follow_spy_talk",[]],
  
  [anyone|plyr, "follow_spy_talk",
    [
      (quest_get_slot, ":quest_giver", "qst_follow_spy", slot_quest_giver_troop),
      (str_store_troop_name, s1, ":quest_giver"),
    ],
    "In the name of {s1}, you are under arrest!", "follow_spy_talk_2", []],
  [anyone, "follow_spy_talk_2", [], "You won't get me alive!", "close_window", []],
  [anyone|plyr, "follow_spy_talk", [], "Never mind me. I was just passing by.", "close_window", [(assign, "$g_leave_encounter",1)]],
  
  [party_tpl|pt_spy_partners,"start", [], "Greetings.", "spy_partners_talk",[]],
  
  [anyone|plyr,"spy_partners_talk",
    [
      (quest_get_slot, ":quest_giver", "qst_follow_spy", slot_quest_giver_troop),
      (str_store_troop_name, s1, ":quest_giver"),
    ],
    "In the name of {s1}, you are under arrest!", "spy_partners_talk_2",[]],
  [anyone,"spy_partners_talk_2", [], "You will have to fight us first!", "close_window",[]],
  [anyone|plyr,"spy_partners_talk", [], "Never mind me. I was just passing by.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  
  ###Conspirator
  ##
  ##  [party_tpl|pt_conspirator_leader,"start", [], "TODO: Hello.", "conspirator_talk",[]],
  ##  [party_tpl|pt_conspirator,"start", [], "TODO: Hello.", "conspirator_talk",[]],
  ##
  ##  [anyone|plyr,"conspirator_talk", [(gt, "$qst_capture_conspirators_leave_meeting_counter", 0),
  ##                                    (quest_get_slot,":quest_giver","qst_capture_conspirators",slot_quest_giver_troop),
  ##                                    (str_store_troop_name,s1,":quest_giver")],
  ##   "TODO: In the name of {s1}, you are under arrest!", "conspirator_talk_2",[]],
  ##
  ##  [anyone|plyr,"conspirator_talk", [], "TODO: Bye.", "close_window",[(assign, "$g_leave_encounter",1)]],
  ##
  ##  [anyone,"conspirator_talk_2", [], "You won't get me alive!", "close_window",[]],
  ##
  #Runaway Peasants
  
  
  [party_tpl|pt_runaway_serfs,"start", [(party_slot_eq, "$g_encountered_party", slot_town_center, 0)],#slot_town_center is used for first time meeting
    "Good day, {reg59?madam:sir}.", "runaway_serf_intro_1",
    [(party_set_slot, "$g_encountered_party", slot_town_center, 1)]],
  
  [anyone|plyr,"runaway_serf_intro_1", [(quest_get_slot, ":lord", "qst_bring_back_runaway_serfs", slot_quest_giver_troop),
      (str_store_troop_name, s4, ":lord")],
    "I have been sent by your {s4}, whom you are running from. He will not punish you if you return now.", "runaway_serf_intro_2",[]],
  
  [anyone,"runaway_serf_intro_2", [(quest_get_slot, ":target_center", "qst_bring_back_runaway_serfs", slot_quest_target_center),
      (str_store_party_name, s6, ":target_center"),
      (quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
      (str_store_party_name, s1, ":quest_object_center")],
    "My good {reg59?madam:sir}. Our lives at our village {s1} was unbearable. We worked all day long and still went to bed hungry. " +
    "And now this swine, our lord, forced us to become warriors! We are going to {s6} to start a new life, where we will be treated like humans.", "runaway_serf_intro_3",[]],
  
  [anyone|plyr,"runaway_serf_intro_3", [(quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
      (str_store_party_name, s1, ":quest_object_center"),],
    "You have gone against our laws by running from your bondage. You will go back to {s1} now!", "runaway_serf_go_back",
    [(quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
      (call_script, "script_change_player_relation_with_center", ":quest_object_center", -5)]],
  
  [anyone|plyr,"runaway_serf_intro_3", [], "Well, maybe you are right. All right, then, but if anyone asks, I haven't seen you.", "runaway_serf_let_go",
    [(quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
      (call_script, "script_change_player_relation_with_center", ":quest_object_center", 5)]],
  
  [party_tpl|pt_runaway_serfs,"runaway_serf_go_back", [(quest_get_slot, ":home_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
      (str_store_party_name, s5, ":home_center")],
    "All right, {reg59?madam:sir}. As you wish. We'll head back to {s5} now.", "close_window",
    [(quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
      (party_set_ai_object, "$g_encountered_party", ":quest_object_center"),
      (assign, "$g_leave_encounter",1)]],
  
  [anyone,"runaway_serf_let_go", [], "God bless you, {reg59?madam:sir}. We will not forget your help.", "close_window",
    [(party_set_slot, "$g_encountered_party", slot_town_castle, 1),
      (assign, "$g_leave_encounter",1)]],
  
  
  [party_tpl|pt_runaway_serfs,"start", [(party_slot_eq, "$g_encountered_party", slot_town_castle, 1),
    ],
    "Good day and many thanks, {reg59?madam:sir}. Don't worry. If anyone asks, we haven't seen you.", "runaway_serf_reconsider",[]],
  
  [anyone|plyr,"runaway_serf_reconsider", [], "I have changed my mind. You must back to your village!", "runaway_serf_go_back",
    [(party_set_slot, "$g_encountered_party", slot_town_castle, 0),
      (quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
      (call_script, "script_change_player_relation_with_center", ":quest_object_center", -2)]],
  
  [anyone|plyr,"runaway_serf_reconsider", [], "Good. Go quickly now, before I change my mind.", "runaway_serf_let_go",[]],
  
  
  [party_tpl|pt_runaway_serfs,"start", [(party_slot_eq, "$g_encountered_party", slot_town_castle, 0),
      (get_party_ai_object, ":cur_ai_object"),
      (quest_get_slot, ":home_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
      (neq, ":home_center", ":cur_ai_object")],
    "Good day {reg59?madam:sir}. We were heading back to {s5}, but I am afraid we lost our way.", "runaway_serf_talk_caught",[]],
  
  [anyone|plyr,"runaway_serf_talk_caught", [], "Do not test my patience. You are going back now!", "runaway_serf_go_back",[]],
  [anyone|plyr,"runaway_serf_talk_caught", [], "Well, if you are that eager to go, then go.", "runaway_serf_let_go",
    [(quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
      (call_script, "script_change_player_relation_with_center", ":quest_object_center", 1)]],
  
  [party_tpl|pt_runaway_serfs,"start",
    [(quest_get_slot, ":home_center", "qst_bring_back_runaway_serfs", slot_quest_object_center),
      (str_store_party_name, s5, ":home_center")], "We are on our way back to {s5} {reg59?madam:sir}.", "runaway_serf_talk_again_return",[]],
  
  [anyone|plyr,"runaway_serf_talk_again_return", [], "Make haste now. The sooner you return the better.", "runaway_serf_talk_again_return_2",[]],
  [anyone|plyr,"runaway_serf_talk_again_return", [], "Good. Keep going.", "runaway_serf_talk_again_return_2",[]],
  
  [anyone|plyr,"runaway_serf_talk_again_return_2", [], "Yes {reg59?madam:sir}. As you wish.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  
  
  #Quest bandits
  [anyone,"start", [
      (check_quest_active, "qst_track_down_bandits"),
      (quest_slot_eq, "qst_track_down_bandits", slot_quest_target_party, "$g_encountered_party"),
      (neg|is_between, "$g_encountered_party_faction", kingdoms_begin, kingdoms_end), #ie, the party has not respawned as a non-bandit
    ],
    "This must be your unlucky day, mate. We're just about the worst people you could run into, in these parts.", "troublesome_bandits_intro_1",[
  ]],
  
  [anyone,"start", [
      (check_quest_active, "qst_blank_quest_4"),
      (quest_slot_eq, "qst_blank_quest_4", slot_quest_target_party, "$g_encountered_party"),
      (neg|is_between, "$g_encountered_party_faction", kingdoms_begin, kingdoms_end), #ie, the party has not respawned as a non-bandit
    ],
    "This must be your unlucky day, mate. We're just about the worst people you could run into in these parts.", "troublesome_bandits_intro_1a",[
  ]],
  
  [anyone|plyr,"troublesome_bandits_intro_1a", [],
    "Heh. For me, you are nothing more than walking moneybags. " +
    "{s1} offered me good money for your heads.",
    "troublesome_bandits_intro_2", [(quest_get_slot, ":quest_giver", "qst_blank_quest_4", slot_quest_giver_troop),
      (str_store_troop_name, s1, ":quest_giver")
  ]],
  
  [anyone|plyr,"troublesome_bandits_intro_1", [],
    "Heh. For me, you are nothing more than walking moneybags. " +
    "A merchant in {s1} offered me good money for your heads.",
    "troublesome_bandits_intro_2", [(quest_get_slot, ":quest_giver_center", "qst_track_down_bandits", slot_quest_giver_center),
      (str_store_party_name, s1, ":quest_giver_center")
  ]],
  [anyone,"troublesome_bandits_intro_2", [],
    "A bounty hunter! I hate bounty hunters! Kill {reg59?her:him}! Kill {reg59?her:him} now!", "close_window",[
      (encounter_attack)]],
  
  
  #Deserters
  [party_tpl|pt_deserters, "start", [(eq,"$talk_context",tc_party_encounter),
      (party_get_slot,":protected_until_hours", "$g_encountered_party",slot_party_ignore_player_until),
      (store_current_hours,":cur_hours"),
      (store_sub, ":protection_remaining",":protected_until_hours",":cur_hours"),
      (gt, ":protection_remaining", 0)], "What do you want? " +
    "You want to pay us some more money?", "deserter_paid_talk",[]],
  [anyone|plyr,"deserter_paid_talk", [], "Sorry to trouble you. I'll be on my way now.", "deserter_paid_talk_2a",[]],
  [anyone,"deserter_paid_talk_2a", [], "Yeah. Stop fooling around and go make some money. " +
    "I want to see that purse full next time I see you.", "close_window",[(assign, "$g_leave_encounter",1)]],
  [anyone|plyr,"deserter_paid_talk", [], "No. It's your turn to pay me this time.", "deserter_paid_talk_2b",[]],
  [anyone,"deserter_paid_talk_2b", [], "What nonsense are you talking about? You want trouble? You got it.", "close_window",[
      (party_set_slot,"$g_encountered_party",slot_party_ignore_player_until,0),
      (party_ignore_player, "$g_encountered_party", 0),
  ]],
  
  
  [party_tpl|pt_deserters,"start", [
      (eq,"$talk_context",tc_party_encounter)
    ], "We are the free brothers. " +
    "We will fight only for ourselves from now on. " +
    "Now give us your gold or taste our steel.", "deserter_talk",[]],
  ##  [anyone|plyr,"deserter_talk", [(check_quest_active, "qst_bring_back_deserters"),
  ##                                 (quest_get_slot, ":target_deserter_troop", "qst_bring_back_deserters", slot_quest_target_troop),
  ##                                 (party_count_members_of_type, ":num_deserters", "$g_encountered_party",":target_deserter_troop"),
  ##                                 (gt, ":num_deserters", 1)],
  ##   "If you surrender to me now, you will rejoin the army of your kingdom without being punished. Otherwise you'll get a taste of my sword.", "deserter_join_as_prisoner",[]],
  [anyone|plyr,"deserter_talk", [], "When I'm done with you, you'll regret ever leaving your lord.", "close_window",[(call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),]],
  [anyone|plyr,"deserter_talk", [], "There's no need to fight. I am ready to pay for free passage.", "deserter_barter",[]],
  #bandit bribery chief#############
  [anyone|plyr,"deserter_talk", [], "Do you know whom you address? I will not kill you if you join me.", "deserters_2bribe",
    []],
  
  [anyone,"deserters_2bribe", [
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (gt, ":player_renown", 150), # you have to be someone
      (gt, "$player_honor", -25),
      (store_random_in_range,":rand",0,20),
      (gt,":rand",9),
    ], "I care very little who you are. It's time for you to die.","close_window",
    [
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  [anyone,"deserters_2bribe", [
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (le, ":player_renown", 150), # you have to be someone
    ], "I care very little who you are. It's time for you to die.","close_window",
    [
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  [anyone,"deserters_2bribe", [
      (le, "$player_honor", -25),
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (gt, ":player_renown", 150), # you have to be someone
      (store_random_in_range,":rand",0,20),
      (gt,":rand",15),#from 10, too often
      (store_party_size_wo_prisoners, ":size", "$g_encountered_party"),
      (lt, ":size", 50),
      ], "Yes, I've heard of you. They say your men collect the best loot. Forgive us, and we will be delighted to join such a fierce leader","deserters_2bribeg",[]],
  
  [anyone,"deserters_2bribe",[
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (gt, ":player_renown", 150), # you have to be someone
      (store_encountered_party,":party"),
      (assign, ":total", 0),
      (party_get_num_companion_stacks, ":num_stacks",":party"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop",":party",":i_stack"),
        (party_stack_get_size, ":stack_size",":party",":i_stack"),
        (store_character_level, ":troop_level", ":stack_troop"),
        (store_mul, ":troop_total",":troop_level", ":stack_size"),
        (val_add, ":total", ":troop_total"),
      (try_end),
      #     (store_party_size,":size",":party"),
      (store_mul,reg0,":total",12),# 70 to cheap, you get mercenaries for hundreds
      (assign, "$temp", reg0),
      ],"We would consider your offer if you fronted us {reg0} peningas.","deserters_2bribere",[]],
  
  [anyone|plyr,"deserters_2bribere",
    [
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", "$temp"),
      (party_can_join),
    ],"It is a good bargain, considering your proven head busting skills. Welcome to the band, lads.","close_window",
    [
      (troop_remove_gold, "trp_player", "$temp"),
      (party_join),
      (call_script, "script_change_player_honor", -5),
      (call_script, "script_change_player_party_morale", -5),
      (assign, "$g_leave_encounter", 1)
  ]],
  [anyone|plyr,"deserters_2bribere",[        (store_troop_gold, ":gold", "trp_player"),
      (le, ":gold", "$temp"),
      ],"I don't have enough money...","deserters_bribe12",[]],
  [anyone|plyr,"deserters_2bribere",[],"Ouch! You value your worth over much, methinks. Forget it. ","deserters_bribe12",[]],
  
  [anyone|plyr,"deserters_2bribeg",
    [
      (party_can_join),
    ],"Why, you are just the sort of gentle lads I dream of accompanying me!","close_window",
    [
      (party_join),
      (call_script, "script_change_player_honor", -5),
      (call_script, "script_change_player_party_morale", -5),
      (assign, "$g_leave_encounter", 1)
  ]],
  
  [anyone|plyr,"deserters_2bribeg",[],"Never mind. On second thought, we have enough lads to split the wealth with.","deserters_bribe13",[]],
  
  [anyone,"deserters_bribe12", [
    ], "Ooh. Well, we'll let you do the valuating then.","close_window",
    [(party_set_slot, "$g_encountered_party", slot_party_bribed, 1),
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  [anyone,"deserters_bribe13", [
    ], "Not to worry, dearie. We'll reduce that number for you!","close_window",
    [
      (party_set_slot, "$g_encountered_party", slot_party_bribed, 1),
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  #bandit bribery end########
  ##se puede ir si no es atacante
  [anyone|plyr,"deserter_talk", [(eq,"$talk_context",tc_party_encounter),
      (neg|encountered_party_is_attacker),
    ],
    "We'll leave you in peace.", "close_window", [(assign, "$g_leave_encounter",1)]],
  ###
  
  ##  [anyone,"deserter_join_as_prisoner", [(call_script, "script_party_calculate_strength", "p_main_party"),
  ##                                        (assign, ":player_strength", reg0),
  ##                                        (store_encountered_party,":encountered_party"),
  ##                                        (call_script, "script_party_calculate_strength", ":encountered_party"),
  ##                                        (assign, ":enemy_strength", reg0),
  ##                                        (val_mul, ":enemy_strength", 2),
  ##                                        (ge, ":player_strength", ":enemy_strength")],
  ##   "All right we join you then.", "close_window",[(assign, "$g_enemy_surrenders", 1)]],
  ##  [anyone,"deserter_join_as_prisoner", [], "TODO: We will never surrender!", "close_window",[(encounter_attack)]],
  
  [anyone,"deserter_barter", [], "Good. You are clever. Now, having a look at your baggage, I reckon a fellow like you could pretty easily afford {reg5} peningas. We wouldn't want to be too greedy, now would we? Pay us, and then you can go.", "deserter_barter_2",[
      (store_troop_gold, ":total_value", "trp_player"),
      (troop_get_inventory_capacity, ":inv_size", "trp_player"),
      (try_for_range, ":i_slot", 0, ":inv_size"),
        (troop_get_inventory_slot, ":item_id", "trp_player", ":i_slot"),
        (ge, ":item_id", 0),
        (try_begin),
          (is_between, ":item_id", trade_goods_begin, trade_goods_end),
          (store_item_value, ":item_value", ":item_id"),
          (val_add, ":total_value", ":item_value"),
        (try_end),
      (try_end),
      (store_div, "$g_tribute_amount", ":total_value", 10), #10000 gold = excellent_target
      (val_max, "$g_tribute_amount", 10),
      (assign,reg(5),"$g_tribute_amount")]],
  [anyone|plyr,"deserter_barter_2", [(store_troop_gold,reg(2)),(ge,reg(2),"$g_tribute_amount"),(assign,reg(5),"$g_tribute_amount")],
    "All right, here's your {reg5} peningas.", "deserter_barter_3a",[(troop_remove_gold, "trp_player","$g_tribute_amount")]],
  [anyone|plyr,"deserter_barter_2", [],
    "I don't have that much money with me", "deserter_barter_3b",[]],
  [anyone,"deserter_barter_3b", [],
    "Too bad. Then we'll have to sell you to the slavers.", "close_window",[
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),]],
  
  
  [anyone,"deserter_barter_3a", [], "Heh. That wasn't difficult, now, was it? All right, you may go.", "close_window",[
      (store_current_hours,":protected_until"),
      (val_add, ":protected_until", 72),
      (party_set_slot,"$g_encountered_party",slot_party_ignore_player_until,":protected_until"),
      (party_ignore_player, "$g_encountered_party", 72),
      
      (assign, "$g_leave_encounter",1)
  ]],
  
  ##### TODO: QUESTS COMMENT OUT END
  #Tavernkeepers
  
  [anyone ,"start", [(store_conversation_troop,reg(1)),(ge,reg(1),tavernkeepers_begin),(lt,reg(1),tavernkeepers_end),
      (str_clear, s4),
      (str_clear, s11),
      (str_clear, s12),
      (str_clear, s13),
    ],
    "{!}{s4}", "tavernkeeper_talk",
    [
      (str_store_string, s11, "@Welcome to Maedelstede, where foreigners are welcome -- especially if they bring silver."),
      (str_store_string, s12, "@My mead hall is the biggest in town. You are welcome here."),
      (str_store_string, s13, "@Make yourselves comfortable. I will give you drink and accommodation."),
      (store_random_in_range, ":random", 11, 14),
      (str_store_string_reg, s4, ":random"),
  ]],
  
  [anyone,"tavernkeeper_pretalk", [], "Anything else?", "tavernkeeper_talk",[]],
  
  [anyone|plyr,"tavernkeeper_talk", [(check_quest_active,"qst_deliver_wine"),
      (quest_slot_eq, "qst_deliver_wine", slot_quest_target_center, "$g_encountered_party"),
      (quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
      (quest_get_slot, ":quest_target_amount", "qst_deliver_wine", slot_quest_target_amount),
      (store_item_kind_count, ":item_count", ":quest_target_item"),
      (ge, ":item_count", ":quest_target_amount"),
      (assign, reg9, ":quest_target_amount"),
      (str_store_item_name, s4, ":quest_target_item"),
    ],
    "I was told to deliver to you {reg9} units of {s4}.", "tavernkeeper_deliver_wine",[]],
  [anyone,"tavernkeeper_deliver_wine", [],
    "At last! My stock was almost depleted. " +
    "I had paid the cost of the {s4} in advance. " +
    "Here, take these {reg5} peningas. That should cover your pay. " +
    "And give {s9} my regards. " +
    "I'll put in a good word for you next time I deal with him.", "tavernkeeper_pretalk",
    [(quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
      (quest_get_slot, ":quest_target_amount", "qst_deliver_wine", slot_quest_target_amount),
      (quest_get_slot, ":quest_gold_reward", "qst_deliver_wine", slot_quest_gold_reward),
      (quest_get_slot, ":quest_giver_troop", "qst_deliver_wine", slot_quest_giver_troop),
      (troop_remove_items, "trp_player", ":quest_target_item", ":quest_target_amount"),
      (call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
      (assign, ":xp_reward", ":quest_gold_reward"),
      (val_mul, ":xp_reward", 4),
      (add_xp_as_reward, ":xp_reward"),
      (assign, reg5, ":quest_gold_reward"),
      (str_store_item_name, s4, ":quest_target_item"),
      (str_store_troop_name, s9, ":quest_giver_troop"),
      
      (quest_get_slot, ":giver_town", "qst_deliver_wine", slot_quest_giver_center),
      (call_script, "script_change_player_relation_with_center", ":giver_town", 7),
      (call_script, "script_change_player_relation_with_center", "$current_town", 5),
      (call_script, "script_end_quest", "qst_deliver_wine"),
  ]],
  
  [anyone|plyr,"tavernkeeper_talk", [(check_quest_active,"qst_deliver_wine"),
      (quest_slot_eq, "qst_deliver_wine", slot_quest_target_center, "$g_encountered_party"),
      (quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
      (quest_get_slot, ":quest_target_amount", "qst_deliver_wine", slot_quest_target_amount),
      (store_item_kind_count, ":item_count", ":quest_target_item"),
      (lt, ":item_count", ":quest_target_amount"),
      (gt, ":item_count", 0),
      (assign, reg9, ":quest_target_amount"),
      (str_store_item_name, s4, ":quest_target_item"),
    ],
    "I was told to deliver to you {reg9} units of {s4}, but I lost some of the cargo on the way.", "tavernkeeper_deliver_wine_incomplete",[]],
  [anyone,"tavernkeeper_deliver_wine_incomplete", [],
    "Attacked by bandits, eh? " +
    "You are lucky they left you alive. " +
    "Anyway, I can pay no more than {reg5} peningas for this. " +
    "You can be sure, though, that I will let {s1} know that the delivery was short. " +
    "They will probably charge you for the loss.", "tavernkeeper_pretalk",
    [(quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
      (quest_get_slot, ":quest_target_amount", "qst_deliver_wine", slot_quest_target_amount),
      (quest_get_slot, ":quest_gold_reward", "qst_deliver_wine", slot_quest_gold_reward),
      (quest_get_slot, ":quest_giver_troop", "qst_deliver_wine", slot_quest_giver_troop),
      (store_item_kind_count, ":item_count", ":quest_target_item"),
      (troop_remove_items, "trp_player", ":quest_target_item", ":item_count"),
      (val_mul, ":quest_gold_reward", ":item_count"),
      (val_div, ":quest_gold_reward", ":quest_target_amount"),
      (call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
      (assign, reg5, ":quest_gold_reward"),
      (assign, ":xp_reward", ":quest_gold_reward"),
      (val_mul, ":xp_reward", 4),
      (add_xp_as_reward, ":xp_reward"),
      (str_store_troop_name, s1, ":quest_giver_troop"),
      (assign, ":debt", "$qst_deliver_wine_debt"),
      (store_sub, ":item_left", ":quest_target_amount", ":item_count"),
      (val_mul, ":debt", ":item_left"),
      (val_div, ":debt", ":quest_target_amount"),
      (val_add, "$debt_to_merchants_guild", ":debt"),
      (quest_get_slot, ":giver_town", "qst_deliver_wine", slot_quest_giver_center),
      (call_script, "script_change_player_relation_with_center", ":giver_town", 1),
      (call_script, "script_end_quest", "qst_deliver_wine"),
  ]],
  
  [anyone|plyr,"tavernkeeper_talk", [(check_quest_active,"qst_deliver_wine"),
      (quest_slot_eq, "qst_deliver_wine", slot_quest_target_center, "$g_encountered_party"),
      (quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
      (store_item_kind_count, ":item_count", ":quest_target_item"),
      (eq, ":item_count", 0),
      (quest_get_slot, reg9, "qst_deliver_wine", slot_quest_target_amount),
      (str_store_item_name, s4, ":quest_target_item"),
    ],
    "I was told to deliver to you {reg9} units of {s4}, but I lost the cargo on the way.", "tavernkeeper_deliver_wine_lost",[]],
  
  [anyone,"tavernkeeper_deliver_wine_lost", [],
    "What? I have been waiting for that {s4} for weeks, " +
    "and now you tell me that you lost it? " +
    "You may rest assured that I will let {s1} know about this.", "tavernkeeper_pretalk",
    [(add_xp_as_reward, 80),
      (quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
      (quest_get_slot, ":quest_giver_troop", "qst_deliver_wine", slot_quest_giver_troop),
      (str_store_item_name, s4, ":quest_target_item"),
      (str_store_troop_name, s1, ":quest_giver_troop"),
      (val_add, "$debt_to_merchants_guild", "$qst_deliver_wine_debt"),
      (call_script, "script_end_quest", "qst_deliver_wine"),
  ]],
  
  ##  [anyone|plyr,"tavernkeeper_talk", [], "I need to hire some soldiers. Can you help me?", "tavernkeeper_buy_peasants",[]],
  ##  [anyone,"tavernkeeper_buy_peasants",
  ##   [
  ##       (store_encountered_party,reg(3)),
  ##       (store_faction_of_party,reg(4),reg(3)),
  ##       (store_relation,reg(5),"fac_player_faction",reg(4)),
  ##       (lt, reg(5), -3),
  ##    ], "I don't think anyone from this town will follow somebody like you. Try your luck elsewhere.", "tavernkeeper_buy_peasants_2",[]],
  ##  [anyone,"tavernkeeper_buy_peasants", [], "I know a few fellows who would follow you if you paid for their equipment.", "tavernkeeper_buy_peasants_2",[(set_mercenary_source_party,"$tavernkeeper_party"),[change_screen_buy_mercenaries]]],
  ##  [anyone,"tavernkeeper_buy_peasants_2", [], "Anything else?", "tavernkeeper_talk",[]],
  ##
  ##  [anyone|plyr,"tavernkeeper_talk", [], "I want to rest for a while.", "tavernkeeper_rest",[]],
  ###  [anyone,"tavernkeeper_rest", [], "Of course... How long do you want to rest?", "tavernkeeper_rest_2",[]],
  ##  [anyone,"tavernkeeper_rest",
  ##   [
  ##       (store_encountered_party,reg(3)),
  ##       (store_faction_of_party,reg(4),reg(3)),
  ##       (store_relation,reg(5),"fac_player_faction",reg(4)),
  ##       (lt, reg(5), -3),
  ##      ], "You look like trouble stranger. I can't allow you to stay for the night. No.", "close_window",
  ##   []],
  ##  [anyone,"tavernkeeper_rest", [], "Of course... That will be {reg3} peningas for the room and food. How long do you want to rest?", "tavernkeeper_rest_2",
  ##   [(store_party_size,reg(3)),
  ##    (val_add,reg(3),1),
  ##    (val_div,reg(3),3),
  ##    (val_max,reg(3),1),
  ##    (assign,"$tavern_rest_cost",reg(3))]],
  ##  [anyone|plyr,"tavernkeeper_rest_2", [(store_time_of_day,reg(1)),
  ##                                       (val_add,reg(1),7),
  ##                                       (val_mod,reg(1),24),
  ##                                       (lt,reg(1),12),
  ##                                       (store_troop_gold,reg(8),"trp_player"),
  ##                                       (ge,reg(8),"$tavern_rest_cost"),
  ##                                       ],
  ##   "I want to rest until morning.", "close_window",
  ##   [(assign, reg(2), 13),(val_sub,reg(2),reg(1)),(assign, "$g_town_visit_after_rest", 1),(rest_for_hours, reg(2)),(troop_remove_gold, "trp_player","$tavern_rest_cost"),(call_script, "script_change_player_party_morale", 2)]],
  ##  [anyone|plyr,"tavernkeeper_rest_2", [(store_time_of_day,reg(1)),
  ##                                       (val_add,reg(1),7),
  ##                                       (val_mod,reg(1),24),
  ##                                       (ge,reg(1),12),
  ##                                       (store_troop_gold,reg(8),"trp_player"),
  ##                                       (ge,reg(8),"$tavern_rest_cost"),
  ##                                       ],
  ##   "I want to rest until evening.", "close_window",
  ##   [(assign, reg(2), 28),(val_sub,reg(2),reg(1)),(assign, "$g_town_visit_after_rest", 1),(rest_for_hours, reg(2)),(troop_remove_gold, "trp_player","$tavern_rest_cost"),(call_script, "script_change_player_party_morale", 2)]],
  ##  [anyone|plyr,"tavernkeeper_rest_2", [], "Forget it.", "close_window",[]],
  
  ###messenger system, more inmersive if player talk to somebody chief
  [anyone|plyr,"tavernkeeper_talk",[(eq,"$message_sent",0),
      ], "I want to send a message.", "tavernkeeper_messenger_system1",[
  ]],
  
  [anyone, "tavernkeeper_messenger_system1",
    [
    ],
    "We can do that. Who do you want to sent it to? I've heard the following are nearby:", "tavernkeeper_messenger_system2",[
  ]],
  
  [anyone|plyr|repeat_for_parties, "tavernkeeper_messenger_system2", #lord reino player
    [
      (store_repeat_object, ":party_no"),
      (store_faction_of_party, ":party_faction", ":party_no"),
      (party_is_active, ":party_no"),
      (party_get_slot, ":party_type",":party_no",slot_party_type),
      (eq, ":party_type", spt_kingdom_hero_party),
      (party_get_battle_opponent, ":opponent",":party_no"),
      (lt, ":opponent", 0), #party is not itself involved in a battle
      (party_get_attached_to, ":attached_to",":party_no"),
      (lt, ":attached_to", 0), #party is not attached to another party in battle
      (get_party_ai_behavior, ":behavior", ":party_no"),
      (neq, ":behavior", 8),#party is not in a town/castle
      (neq, ":party_no","p_main_party"),
      (store_distance_to_party_from_party, ":cur_distance", ":party_no", "p_main_party"),
      (lt, ":cur_distance", 90),  #party is within distance
      (eq, ":party_faction", "fac_player_supporters_faction"),
      (str_store_party_name, s1, ":party_no"),
    ],"{!}{s1}", "tavernkeeper_messenger_system3",
    [
      (store_repeat_object, "$message_target"),
      (assign, "$message_target_type", 1),  # 1 player's kingdom lord , 2 no player's kingdom lord , 3 King of other kingdom
  ]],
  
  
  [anyone|plyr|repeat_for_parties, "tavernkeeper_messenger_system2", #lord de otro reino
    [
      (store_repeat_object, ":party_no"),
      (store_faction_of_party, ":party_faction", ":party_no"),
      (party_is_active, ":party_no"),
      (party_get_slot, ":party_type",":party_no",slot_party_type),
      (eq, ":party_type", spt_kingdom_hero_party),
      (party_get_battle_opponent, ":opponent",":party_no"),
      (lt, ":opponent", 0), #party is not itself involved in a battle
      (party_get_attached_to, ":attached_to",":party_no"),
      (lt, ":attached_to", 0), #party is not attached to another party in battle
      #(get_party_ai_behavior, ":behavior", ":party_no"),
      #(neq, ":behavior", 8),#party is not in a town/castle
      (neq, ":party_no","p_main_party"),
      (store_distance_to_party_from_party, ":cur_distance", ":party_no", "p_main_party"),
      (lt, ":cur_distance", 90),  #party is within distance
      (neq, ":party_faction", "fac_player_supporters_faction"),
      (party_stack_get_troop_id, ":leader", ":party_no", 0),
      (neg|is_between, ":leader", kings_begin, kings_end),
      (str_store_party_name, s1, ":party_no"),
    ],"{!}{s1}.", "tavernkeeper_messenger_system3",
    [
      (store_repeat_object, "$message_target"),
      (assign, "$message_target_type", 2),  # 1 player's kingdom lord , 2 no player's kingdom lord , 3 King of other kingdom
  ]],
  
  [anyone|plyr|repeat_for_parties, "tavernkeeper_messenger_system2", #lord de otro reino
    [
      (store_repeat_object, ":party_no"),
      (store_faction_of_party, ":party_faction", ":party_no"),
      (party_is_active, ":party_no"),
      (party_get_slot, ":party_type",":party_no",slot_party_type),
      (eq, ":party_type", spt_kingdom_hero_party),
      (party_get_battle_opponent, ":opponent",":party_no"),
      (lt, ":opponent", 0), #party is not itself involved in a battle
      (party_get_attached_to, ":attached_to",":party_no"),
      (lt, ":attached_to", 0), #party is not attached to another party in battle
      #(get_party_ai_behavior, ":behavior", ":party_no"),
      #(neq, ":behavior", 8),#party is not in a town/castle
      (neq, ":party_no","p_main_party"),
      (store_distance_to_party_from_party, ":cur_distance", ":party_no", "p_main_party"),
      (lt, ":cur_distance", 90),  #party is within distance
      (neq, ":party_faction", "fac_player_supporters_faction"),
      (party_stack_get_troop_id, ":leader", ":party_no", 0),
      (is_between, ":leader", kings_begin, kings_end),
      (str_store_party_name, s1, ":party_no"),
    ],"{!}{s1}.", "tavernkeeper_messenger_system3",
    [
      (store_repeat_object, "$message_target"),
      (assign, "$message_target_type", 3),  # 1 player's kingdom lord , 2 no player's kingdom lord , 3 King of other kingdom
  ]],
  
  
  [anyone|plyr, "tavernkeeper_messenger_system2",
    [],"No, none of those. Later, perhaps.", "tavernkeeper_pretalk",
    []],
  
  
  [anyone, "tavernkeeper_messenger_system3",
    [
      (str_store_party_name, s4, "$message_target"),
    ],
    "Very well. What is the message?", "tavernkeeper_messenger_system4",[
  ]],
  
  [anyone|plyr, "tavernkeeper_messenger_system4",
    [],"It is this...", "close_window",
    [
      ##  (change_screen_return),
      ##    (assign, "$ship_menu_state", 8),
      ##    (assign, "$vc_menu_active", "prsnt_messenger_system"),
      (set_fixed_point_multiplier, 100),
      (get_player_agent_no, ":player_agent"),
      (agent_get_position, pos1, ":player_agent"),
      (position_rotate_z, pos1, -70),
      (agent_set_position, ":player_agent", pos1),
      
      (assign, "$message_type", no_menssage_choosed),
      (assign,"$message_sent",0), #message sent
      # (finish_mission),
      (start_presentation, "prsnt_messenger_system"),
  ]],
  
  
  ##############################
  
  
  
  [anyone|plyr,"tavernkeeper_talk", [
      (store_current_hours,":cur_hours"),
      (val_sub, ":cur_hours", 48),
      (gt, ":cur_hours", "$buy_drinks_last_time"),
      ], "I'd like to buy every man who comes in here tonight a jar of your best mead.", "tavernkeeper_buy_drinks",[]],
  
  [anyone,"tavernkeeper_buy_drinks",
    [
      ], "Of course, {reg59?my lady:my lord}. I reckon {reg5} peningas should be enough for that. What should I tell the lads?", "tavernkeeper_buy_drinks_2",[
      (assign, "$temp", 1000),
      (assign, reg5, "$temp"),
  ]],
  
  [anyone|plyr,"tavernkeeper_buy_drinks_2",
    [
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", "$temp"),
      (str_store_party_name, s10, "$current_town"),
      ], "Let everyone know of the generosity of {playername} to the people of {s10}.", "tavernkeeper_buy_drinks_end",[
      
  ]],
  
  [anyone|plyr,"tavernkeeper_buy_drinks_2", [], "Actually, forget this.", "tavernkeeper_pretalk",[]],
  
  [anyone,"tavernkeeper_buy_drinks_end",
    [], "Don't worry {reg59?madam:sir}. Your name will be cheered and toasted here all night.", "tavernkeeper_pretalk",
    [
      (troop_remove_gold, "trp_player", "$temp"),
      (call_script, "script_change_player_relation_with_center", "$current_town", 2), #= to 50 days and 50.000 coins to get 100% with a center.
      (store_current_hours,":cur_hours"),
      (assign, "$buy_drinks_last_time", ":cur_hours"),
  ]],
  
  #chief barrel empieza
  [anyone|plyr,"tavernkeeper_talk", [
      (store_current_hours,":cur_hours"),
      (val_sub, ":cur_hours", 24),
      (gt, ":cur_hours", "$buy_drinks_last_time"),
      ], "I'd like to buy me and my men a barrel of your best ale.", "tavernkeeper_buy_drinks_troops",[]],
  
  [anyone,"tavernkeeper_buy_drinks_troops",
    [
      ], "Of course, {reg59?my lady:my lord}. I reckon {reg5} peningas should be enough for that. What should I tell the lads?", "tavernkeeper_buy_drinks_troops_2",[
      (assign, "$temp", 20),
      (store_party_size_wo_prisoners, reg5, "p_main_party"),
      (store_mul, "$temp", "$temp", reg5),
      (assign, reg5, "$temp"),
  ]],
  
  [anyone|plyr,"tavernkeeper_buy_drinks_troops_2",
    [
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", "$temp"),
      ], "The price is fair enough. Let my men have at it.", "tavernkeeper_buy_drinks_troops_end",[
      
  ]],
  
  [anyone,"tavernkeeper_buy_drinks_troops_end",
    [], "Don't worry {reg59?madam:sir}. Your men will enjoy their pints.", "tavernkeeper_pretalk",
    [
      (troop_remove_gold, "trp_player", "$temp"),
      (call_script, "script_change_player_party_morale", 10),
      (store_current_hours,":cur_hours"),
      (assign, "$buy_drinks_last_time", ":cur_hours"),
      (rest_for_hours, 2, 5, 0)
  ]],
  
  [anyone|plyr,"tavernkeeper_buy_drinks_troops_2", [], "Actually, forget this.", "tavernkeeper_pretalk",[]],
  #chief anade barrel acaba
  
  [anyone|plyr,"tavernkeeper_talk", [
      (neq, "$g_encountered_party_faction", "fac_player_supporters_faction"),
    ],
    "Have you heard of anyone in this realm who might have a job for a {reg59?woman:man} like me?", "tavernkeeper_job_ask",[
  ]],
  
  [anyone,"tavernkeeper_job_ask",
    [
      (str_store_string, s9, "str__of_course_the_land_is_currently_at_peace_so_you_may_have_better_luck_in_other_realms"),
      (try_for_range, ":faction", kingdoms_begin, kingdoms_end),
        (store_relation, ":relation", "$g_encountered_party_faction", ":faction"),
        (lt, ":relation", 0),
        (str_clear, s9),
      (try_end),
      (faction_get_slot, ":leader",  "$g_encountered_party_faction", slot_faction_leader),
      (str_store_troop_name, s10, ":leader"),
      
    ], "Hmm... Well, {s10} is often looking for mercenaries to fight in his wars.{s9}", "tavernkeeper_job_search",
    [
      (assign, "$g_troop_list_no", 0),
  ]],
  
  
  #tabernero informa sobre herreros unicos chief
  [anyone|plyr,"tavernkeeper_talk", [],
    "Where can I get special weapons and armor?", "tavernkeeper_herrero",[]],
  [anyone,"tavernkeeper_herrero",
    [   ], "Hmm... Well, there are talented blacksmiths that can make them. But, if you want to know their names, you must pay me fifty peningas for the information.", "tavernkeeper_herrero2", []],
  
  [anyone|plyr,"tavernkeeper_herrero2", [],
    "Sure. Talk!", "tavernkeeper_herrero3",[
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",49),
        (troop_remove_gold, "trp_player", 50),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  [anyone|plyr,"tavernkeeper_herrero2", [],
    "You are a rat. Farewell!", "close_window",[]],
  
  [anyone,"tavernkeeper_herrero3",
    [   ], "Well, several towns can boast of talented blacksmiths: Eadwine of Dunwic,^Donnchadh of Scuin,^Paega of Witan_Ceaster,^" +
    "Lifris of Bosvenegh,^Fearchair of Ceall_Cainnigh,^Atli of Tunsberg,^Harenbili of Dun_Breatann,^Egil of Dubh Linn,^Godgyfu Cirren Ceaster,^and Uormuin of Caer_Dyf.", "tavernkeeper_herrero4", []],
  [anyone|plyr,"tavernkeeper_herrero4", [],
    "Thank you. Farewell!", "close_window",[]],
  
  
  #tabernero informa acaba
  
  [anyone, "tavernkeeper_job_search",
    [],
    "Let me think some more...", "tavernkeeper_job_result",
    [
      (call_script, "script_npc_find_quest_for_player_to_s11", "$g_encountered_party_faction"),
      (assign, ":quest_giver", reg0),
      
      (call_script, "script_get_dynamic_quest", ":quest_giver"),
      (assign, ":quest_type", reg0),
      
      (try_begin),
        (gt, ":quest_giver", -1),
        (str_store_troop_name, s7, ":quest_giver"),
        (str_clear, s9), #location string
        
        (assign, ":location", -1),
        (try_begin),
          (troop_slot_eq, ":quest_giver", slot_troop_occupation, slto_kingdom_hero),
          (troop_get_slot, ":quest_giver_party", ":quest_giver", slot_troop_leaded_party),
          (party_is_active, ":quest_giver_party"),
          (party_get_attached_to, ":location", ":quest_giver_party"),
        (else_try),
          (is_between, ":quest_giver", mayors_begin, mayors_end),
          (try_for_range, ":town", towns_begin, towns_end),
            (party_slot_eq, ":town", slot_town_elder, ":quest_giver"),
            (assign, ":location", ":town"),
          (try_end),
        (try_end),
        
        (try_begin),
          (gt, ":location", -1),
          (try_begin),
            (eq, ":location", "$g_encountered_party"),
            (str_store_string, s8, "str_here"),
          (else_try),
            (str_store_string, s8, "str_over"),
          (try_end),
          (str_store_party_name, s12, ":location"),
          (str_store_string, s9, "str_s8_in_s12"),
        (try_end),
        
        (try_begin),
          (eq, ":quest_type", "qst_track_down_bandits"),
          (str_store_string, s10, "str__has_put_together_a_bounty_on_some_bandits_who_have_been_attacking_travellers_in_the_area"),
        (else_try),
          (eq, ":quest_type", "qst_blank_quest_4"),
          (str_store_string, s10, "@has put together a bounty on some bandits who have raided one of his villages."),
        (else_try),
          (eq, ":quest_type", "qst_destroy_bandit_lair"),
          (str_store_string, s10, "str__has_been_worried_about_bandits_establishing_a_hideout_near_his_home"),
        (else_try),
          (eq, ":quest_type", "qst_retaliate_for_border_incident"),
          (str_store_string, s10, "str__is_looking_for_a_way_to_avoid_an_impending_war"),
        (else_try),
          (eq, ":quest_type", "qst_rescue_prisoner"),
          (str_store_string, s10, "str__may_need_help_rescuing_an_imprisoned_family_member"),
        (else_try),
          (eq, ":quest_type", "qst_cause_provocation"),
          (str_store_string, s10, "str__has_been_asking_around_for_someone_who_might_want_work_id_watch_yourself_with_him_though"),
        (else_try),
          (str_store_string, s10, "str_tavernkeeper_invalid_quest"),
        (try_end),
        
        (troop_get_type, reg4, ":quest_giver"),
        (val_mod, reg4, 2),
      (try_end),
      
  ]],
  
  
  [anyone, "tavernkeeper_job_result", [
      (store_sub, ":last_troop", mayors_end, 1),
      (lt, "$g_troop_list_no", ":last_troop"),
    ], "I have heard that {s7} {s9}{s10} You may want to speak with {reg4?her:him}.", "tavernkeeper_job_search",
    [
  ]],
  
  [anyone, "tavernkeeper_job_result", [
      (store_sub, ":last_troop", mayors_end, 1),
      (ge, "$g_troop_list_no", ":last_troop"),
    ], "There may be other work, of course -- lords and village mayors often have other tasks which we don't hear about. Also, the villages around here frequently need help, although they'd be more likely to pay you with a wedge of cheese and goodwill than with cold hard peningas.", "tavernkeeper_job_result_2",
    [
  ]],
  
  [anyone,"tavernkeeper_job_result_2", [], "I'll keep my ears open for other opportunities. You may want to ask again from time to time.", "close_window",[]],
  
  [anyone|plyr,"tavernkeeper_talk", [], "Any news in this part of the world?", "tavernkeeper_rumor",[(store_random_in_range, "$temp2", 0, 8),]],
  
  [anyone,"tavernkeeper_rumor", [(eq,"$temp2",0),], "I guess it's not exactly news, but the world is becoming increasingly dangerous. The roads are full of bandits.", "tavernkeeper_rumor2",[]],
  [anyone,"tavernkeeper_rumor", [(eq,"$temp2",1),], "A storm is coming. It's not thunder and lightning but war.", "tavernkeeper_rumor2",[]],
  [anyone,"tavernkeeper_rumor", [(eq,"$temp2",2),], "They say that Hild is now the most beautiful woman in all of Englaland. That's why she never comes here anymore! (wink)", "tavernkeeper_rumor2",[]],
  [anyone,"tavernkeeper_rumor", [(eq,"$temp2",3),], "Bards say that King Aelle of Bernaccia ordered Ragnar to be thrown into a pit of vipers. That's why his sons are now attacking Englaland.", "tavernkeeper_rumor2",[]],
  [anyone,"tavernkeeper_rumor", [(eq,"$temp2",4),], "When Aethelwulf of West Seaxe died, Aethelbald, his eldest son, married Judith, his widow! Ach, that's what queens are for, eh?", "tavernkeeper_rumor2",[]],
  [anyone,"tavernkeeper_rumor", [(eq,"$temp2",5),], "Recently, Aelfred, secundarius of West Seaxe, married Ealhswith, daughter of Aethelred Mucil, ealdorman of the Gaini, and of Lady Eadburh. That puts him in the royal line of the Mercians.", "tavernkeeper_rumor2",[]],
  [anyone,"tavernkeeper_rumor", [(eq,"$temp2",6),], "It's no secret that Harald of Norway aims to be king of all Norwegians so he can marry a certain princess. He's vowed not to comb his hair until then.", "tavernkeeper_rumor2",[]],
  [anyone,"tavernkeeper_rumor", [(eq,"$temp2",7),], "In the Kingdom of Alban, the king has trouble resolving disputes between Picts and Goidels. They seem to be always at war with each other.", "tavernkeeper_rumor2",[]],
  [anyone,"tavernkeeper_rumor", [], "I have not heard anything notable to tell.", "tavernkeeper_rumor2",[]],
  
  
  [anyone|plyr,"tavernkeeper_rumor2", [], "Thank you.", "tavernkeeper_pretalk",[
      (assign,"$temp2",0),
  ]],
  
  
  [anyone|plyr,"tavernkeeper_talk", [], "I guess I should leave now.", "close_window",[]],
  
  #Tavern Talk (with companions)
  #  [anyone, "companion_recruit_yes", [(neg|hero_can_join, "p_main_party"),], "I don't think can lead any more men than you do now.\
  # You need to release someone from service if you want me to join your party.", "close_window", []],
  
  
  
  
  #Tavern Talk (with ransom brokers)
  
  
  [anyone,"start", [(is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
      (eq, "$g_talk_troop_met", 0)],
    "Greetings to you, {reg59?madam:sir}. You look like someone who should get to know me.", "ransom_broker_intro",[]],
  
  [anyone|plyr,"ransom_broker_intro",[], "Why is that?", "ransom_broker_intro_2",[]],
  [anyone, "ransom_broker_intro_2", [], "I broker ransoms for the poor wretches who are captured in these endless wars. " +
    "Normally I travel between the salt mines and the slave markets on the coast, on commission from those whose relatives have gone missing. " +
    "But if I'm out on my errands of mercy, and I come across a fellow dragging around a captive or two, " +
    "well, there's no harm in a little speculative investment, is there? " +
    "And you look like the type who might have a prisoner to sell.", "ransom_broker_info_talk",[(assign, "$ransom_broker_families_told",0),
      (assign, "$ransom_broker_prices_told",0),
      (assign, "$ransom_broker_ransom_me_told",0),
  ]],
  
  [anyone|plyr,"ransom_broker_info_talk",[(eq, "$ransom_broker_families_told",0)], "What if their families can't pay?", "ransom_broker_families",[]],
  [anyone, "ransom_broker_families", [], "Oh, then I spin them a few heartwarming tales of life on the galleys. " +
    "You'd be surprised what sorts of treasures a peasant can dig out of his cowshed or wheedle out of his cousins, " +
    "assuming he's got the proper motivation! " +
    "If, in the end, they cannot come up with the silver, then there are always slave merchants who are looking for galley slaves. " +
    "One cannot do Heaven's work with an empty purse, you see.", "ransom_broker_info_talk",[(assign, "$ransom_broker_families_told",1)]],
  [anyone|plyr,"ransom_broker_info_talk",[(eq, "$ransom_broker_prices_told",0)], "What can I get for a prisoner?", "ransom_broker_prices",[]],
  [anyone, "ransom_broker_prices", [], "It varies. I fancy that I have a fine eye for assessing a ransom. " +
    "There are a dozen little things about a man that will tell you whether he goes to bed hungry, or dines each night on soft dumplings and goose. " +
    "The real money of course is in the gentry, and if you ever want to do my job you'll want to learn about every landowning family in the Northlands, " +
    "their estates, their heraldry, their offspring both lawful and bastard, and, of course, their credit with the merchants.", "ransom_broker_info_talk",[(assign, "$ransom_broker_prices_told",1)]],
  [anyone|plyr,"ransom_broker_info_talk",[(eq, "$ransom_broker_ransom_me_told",0)], "Would you be able to ransom me if I were taken?", "ransom_broker_ransom_me",[]],
  [anyone, "ransom_broker_ransom_me", [], "Of course. I'm welcome in every court in the Northlands. " +
    "There are not many who can say that! So always be sure to keep a pot of peningas buried somewhere, " +
    "and a loyal servant who can find it in a hurry.", "ransom_broker_info_talk",[(assign, "$ransom_broker_ransom_me_told",1)]],
  [anyone|plyr,"ransom_broker_info_talk",[], "That's all I need to know. Thank you.", "ransom_broker_pretalk",[]],
  
  [anyone,"start", [(is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
    ],
    "Greetings. If you have any prisoners, I will be happy to buy them from you.", "ransom_broker_talk",[]],
  [anyone,"ransom_broker_pretalk", [],
    "Anyway, if you have any prisoners, I will be happy to buy them from you.", "ransom_broker_talk",[]],
  
  [anyone|plyr,"ransom_broker_talk",
    [[store_num_regular_prisoners,reg(0)],[ge,reg(0),1]],
    "Then you'd better bring your purse. I have prisoners to sell.", "ransom_broker_sell_prisoners",[]],
  
  [anyone|plyr,"ransom_broker_talk",
    [(store_num_regular_prisoners,reg0),(ge,reg0,1)],
    "I want to sell all prisoners I have.", "ransom_broker_sell_prisoners_done",[
      (assign, ":total_income", 0),
      (party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
      (try_for_range_backwards, ":i_stack", 0, ":num_stacks"),
        (party_prisoner_stack_get_troop_id, ":troop_no", "p_main_party", ":i_stack"),
        (neg|troop_is_hero, ":troop_no"),
        (party_prisoner_stack_get_size, ":stack_size", "p_main_party", ":i_stack"),
        (call_script, "script_game_get_prisoner_price", ":troop_no"),
        (assign, ":sell_price", reg0),
        (store_mul, ":stack_total_price", ":sell_price", ":stack_size"),
        (val_add, ":total_income", ":stack_total_price"),
        (party_remove_prisoners, "p_main_party", ":troop_no", ":stack_size"),
      (try_end),
      (troop_add_gold, "trp_player", ":total_income"),
  ]],
  [anyone, "ransom_broker_sell_prisoners_done", [], "Well, come back when you have more slaves for me.", "ransom_broker_pretalk",[]],
  [anyone|plyr,"ransom_broker_talk", [], "Tell me about what you do again.", "ransom_broker_intro_2",[]],
  
  
  [anyone|plyr,"ransom_broker_talk",[
      ], "I wish to ransom one of my companions.", "ransom_broker_ransom_companion",[]],
  
  [anyone,"ransom_broker_ransom_companion",[], "Whom do you wish to ransom?", "ransom_broker_ransom_companion_choose",[]],
  
  [anyone|plyr|repeat_for_troops,"ransom_broker_ransom_companion_choose",[
      (store_repeat_object, ":imprisoned_companion"),
      (neg|troop_slot_eq, ":imprisoned_companion", slot_troop_occupation, slto_kingdom_hero),
      (is_between, ":imprisoned_companion", companions_begin, companions_end),
      (troop_slot_ge, ":imprisoned_companion", slot_troop_prisoner_of_party, centers_begin),
      (str_store_troop_name, s4, ":imprisoned_companion"),
      ], "{!}{s4}", "ransom_broker_ransom_companion_name_sum",[
      
      (store_repeat_object, "$companion_to_be_ransomed"),
  ]],
  
  [anyone|plyr,"ransom_broker_ransom_companion_choose",[
      ], "Never mind", "ransom_broker_pretalk",[]],
  
  
  [anyone,"ransom_broker_ransom_companion_name_sum",[], "Let me check my ledger, here... Yes. Your friend is being held in the dungeon at {s7}. How interesting! I remember hearing that the rats down there are unusually large -- like mastiffs, they say... Now... For the very reasonable sum of {reg5} peningas, which includes both the ransom and my commission and expenses, we can arrange it so that {s5} can once again enjoy {reg4?her:his} freedom. What do you say?", "ransom_broker_ransom_companion_verify",[
      (str_store_troop_name, s5, "$companion_to_be_ransomed"),
      (troop_get_type, reg4, "$companion_to_be_ransomed"),
      (val_mod, reg4, 2),
      
      (troop_get_slot, ":prison_location", "$companion_to_be_ransomed", slot_troop_prisoner_of_party),
      (str_store_party_name, s7, ":prison_location"),
      
      (store_character_level, ":companion_level", "$companion_to_be_ransomed"),
      (store_add, "$companion_ransom_amount", ":companion_level", 20),
      (val_mul, "$companion_ransom_amount", ":companion_level"),
      (val_mul, "$companion_ransom_amount", 5), #Level 1: 110, level 40: 12,000
      (assign, reg5, "$companion_ransom_amount"),
  ]],
  
  [anyone|plyr,"ransom_broker_ransom_companion_verify",[
      (store_troop_gold, ":player_gold", "trp_player"),
      (ge, ":player_gold", "$companion_ransom_amount"),
      
      ], "Here's your money.", "ransom_broker_ransom_companion_accept",[
      (troop_remove_gold, "trp_player", "$companion_ransom_amount"),
      
      
      
      
      (troop_set_slot, "$companion_to_be_ransomed", slot_troop_occupation, slto_player_companion),
      (troop_set_slot, "$companion_to_be_ransomed", slot_troop_current_mission, npc_mission_rejoin_when_possible),
      (troop_set_slot, "$companion_to_be_ransomed", slot_troop_days_on_mission, 1),
      
      (try_begin),
        (troop_get_slot, ":held_at_prison", "$companion_to_be_ransomed", slot_troop_prisoner_of_party),
        (party_count_prisoners_of_type, ":holding_as_prisoner",  ":held_at_prison", "$companion_to_be_ransomed"),
        (gt, ":holding_as_prisoner", 0),
        (party_remove_prisoners, ":held_at_prison", "$companion_to_be_ransomed", 1),
      (try_end),
      (troop_set_slot, "$companion_to_be_ransomed", slot_troop_prisoner_of_party, -1),
      
      (troop_set_slot, "$companion_to_be_ransomed", slot_troop_personalityclash_penalties, 0),
      (troop_set_slot, "$companion_to_be_ransomed", slot_troop_morality_penalties, 0),
      
  ]],
  
  [anyone|plyr,"ransom_broker_ransom_companion_verify",[
      ], "I can't afford that right now.", "ransom_broker_ransom_companion_refuse",[]],
  
  
  [anyone,"ransom_broker_ransom_companion_accept",[], "Splendid! In a few days, I would think, you should find {s5} riding to rejoin you, blinking in the sunlight and no doubt very grateful! Is there any other way in which I can help you?", "ransom_broker_talk",[
      (str_store_troop_name, s5, "$companion_to_be_ransomed"),
      
  ]],
  
  [anyone,"ransom_broker_ransom_companion_refuse",[], "Of course, of course... Never mind what they say about the rats, by the way -- I've never actually seen one myself, on account of the pitch-black darkness. Anyway, I'm sure that {s5} will understand why it's important for you to control expenditures. Now... Was there anything else?", "ransom_broker_talk",[
      (str_store_troop_name, s5, "$companion_to_be_ransomed"),
  ]],
  
  
  [anyone|plyr,"ransom_broker_talk",[], "Not this time. Farewell.", "close_window",[]],
  [anyone,"ransom_broker_sell_prisoners", [],
    "Let me see what you have...", "ransom_broker_sell_prisoners_2",
    [[change_screen_trade_prisoners]]],
  #  [anyone, "ransom_broker_sell_prisoners_2", [], "You take more prisoners, bring them to me. I will pay well.", "close_window",[]],
  [anyone, "ransom_broker_sell_prisoners_2", [], "I will be staying here for a few days. Let me know if you need my services.", "close_window",[]],
  
  
  #Tavern Talk (with travelers)
  [anyone, "start", [(is_between, "$g_talk_troop", tavern_travelers_begin, tavern_travelers_end),
      (str_store_troop_name, s10, "$g_talk_troop"),
      (eq,"$g_talk_troop_met",0),
    ],
    "Greetings, friend. You look like the kind of {reg59?person:man} who'd do well to know me. " +
    "I travel a lot all across the Northlands and keep an open ear. " +
    "I can provide you information that you might find useful. For a meager price of course.", "tavern_traveler_talk", [(assign, "$traveler_land_asked", 0)]],
  
  [anyone, "start",
    [
      (is_between, "$g_talk_troop", tavern_travelers_begin, tavern_travelers_end),
      (gt, "$last_lost_companion", 0),
      (assign, ":companion_found_town", -1),
      (troop_get_slot, ":companion_found_town", "$last_lost_companion", slot_troop_cur_center),
      (is_between, ":companion_found_town", towns_begin, towns_end),
      (neq, "$last_lost_companion", "trp_npc1"), #no caio
      (neq, "$last_lost_companion", "trp_npc7"),  #no Dwywei
      (str_store_troop_name, s10, "$last_lost_companion"),
      (str_store_party_name, s11, ":companion_found_town"),
    ],
    "Greetings, {playername}. I saw your companion {s10} at in a mead hall in {s11} some days ago. I thought you might like to know.", "tavern_traveler_lost_companion_thanks",
    [(assign, "$last_lost_companion", 0)]],
  
  [anyone|plyr, "tavern_traveler_lost_companion_thanks", [(troop_get_type, reg3, "$last_lost_companion"),(val_mod, reg3, 2)], "Thanks. I'll go and find {reg3?her:him} there.", "tavern_traveler_pretalk", []],
  [anyone|plyr, "tavern_traveler_lost_companion_thanks", [], "Thanks, but I don't really care.", "tavern_traveler_pretalk", []],
  
  [anyone, "start", [(is_between, "$g_talk_troop", tavern_travelers_begin, tavern_travelers_end),
    ],
    "Greetings, {playername}.", "tavern_traveler_talk", [(assign, "$traveler_land_asked", 0)]],
  
  
  
  [anyone, "tavern_traveler_pretalk", [], "Yes?", "tavern_traveler_talk", []],
  
  [anyone|plyr, "tavern_traveler_talk", [(eq, "$traveler_land_asked", 0)], "What can you tell me about this land?", "tavern_traveler_tell_kingdoms", [(assign, "$traveler_land_asked", 1)]],
  [anyone, "tavern_traveler_tell_kingdoms", [], "The Northlands is divided into many kingdoms that can neither manage to live in peace with their neighbours " +
    "nor eliminate them. " +
    "As a result, there's seldom a break in the bitter wars that plague this land and drain its lifeblood. " +
    "Well, at least this ought to be a good place to be for an adventurer such as you. " +
    "With some luck and skill, you can make a name for yourself here, amass a fortune perhaps, or gain great power. " +
    "Opportunities are endless, and so are the rewards, if you are willing to risk your life for them.", "tavern_traveler_tell_kingdoms_2", []],
  
  [anyone|plyr, "tavern_traveler_tell_kingdoms_2", [], "Tell me more about these opportunities.", "tavern_traveler_tell_kingdoms_3", []],
  [anyone|plyr, "tavern_traveler_tell_kingdoms_2", [], "Thank you. That was all I needed to know", "close_window", []],
  
  [anyone, "tavern_traveler_tell_kingdoms_3", [(gt, "$player_has_homage", 0)], "Well, you probably know everything I could tell you already. You seem to be doing pretty well.",
    "tavern_traveler_tell_kingdoms_4", []],
  [anyone, "tavern_traveler_tell_kingdoms_3", [], "The kingdoms will pay good money for mercenaries if they are engaged in a war. " +
    "If you have done a bit of fighting, speaking with one of their lords will probably result in being offered a mercenary contract.^^" +
    "Better rewards come if you can manage to become a vassal to a king. " +
    "A vassal can own villages, castles and towns and get rich with the taxes and revenues of these estates. " +
    "Normally, only nobles of the realm own land in this way, " +
    "but in time of war, a king will not hesitate to accept someone who distinguishes {reg59?herself:himself} on the battlefield as a vassal, and grant {reg59?her:him} the right to own land.",
    "tavern_traveler_tell_kingdoms_4a", []],
  
  [anyone, "tavern_traveler_tell_kingdoms_4a", [], "It is not unheard-of for adventurers to renounce allegiance to a king altogether, declare themselves kings, and claim land in their own name. This is a difficult path, however, as the great nobles of the land, with their long ancestries, are not likely to accept such upstarts as their monarch. Such rulers would need to be very careful in establishing their right to rule, or they would be set upon from all sides.",
    "tavern_traveler_tell_kingdoms_4", []],
  
  
  [anyone, "tavern_traveler_tell_kingdoms_4", [], "It might be easier for an adventurer like you to pledge support to an existing king's rival. " +
    "There are many such pretenders in the Northlands -- those who are born to the right family, who go around and stir up trouble saying they have a better claim to the throne than the current king does. " +
    "If those claim holders could find supporters, they could easily start civil wars and perhaps even replace the king one day.",
    "tavern_traveler_tell_kingdoms_5", []],
  
  [anyone|plyr, "tavern_traveler_tell_kingdoms_5", [], "Interesting. Where can I find these claim holders?", "tavern_traveler_tell_kingdoms_6", []],
  [anyone|plyr, "tavern_traveler_tell_kingdoms_5", [], "I guess I heard enough already. Thank you.", "close_window", []],
  
  [anyone, "tavern_traveler_tell_kingdoms_6", [], "A claim holder's life would be in danger in his own country of course. " +
    "Therefore, they usually stay at rival courts, raising support and hoping to find someone willing to champion their cause. " +
    "I usually hear news about some of them, and may be able to tell you their location with some precision. " +
    "But of course, I would ask for a little something for such a service.",
    "tavern_traveler_pretalk", [(assign, "$traveller_claimants_mentioned", 1)]],
  
  [anyone|plyr, "tavern_traveler_talk", [(eq, "$traveller_claimants_mentioned", 1)], "I want to know the location of a claimant.", "tavern_traveler_pretender_location", []],
  [anyone, "tavern_traveler_pretender_location", [], "Whose location do you want to know?", "tavern_traveler_pretender_location_ask", []],
  
  [anyone|plyr|repeat_for_troops, "tavern_traveler_pretender_location_ask",
    [
      (store_repeat_object, ":troop_no"),
      (is_between, ":troop_no", pretenders_begin, pretenders_end),
      (neg|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (troop_slot_ge, ":troop_no", slot_troop_cur_center, 1),
      (str_store_troop_name, s11, ":troop_no"),
      (neq, ":troop_no", "$supported_pretender"),
    ],  "{!}{s11}", "tavern_traveler_pretender_location_ask_2",
    [
      (store_repeat_object, "$temp"),
  ]],
  
  [anyone|plyr, "tavern_traveler_pretender_location_ask",
    [],  "Never mind.", "tavern_traveler_pretalk", []],
  
  
  [anyone, "tavern_traveler_pretender_location_ask_2", [], "I can reveal this information to you for a small price. Let's say 30 peningas.", "tavern_traveler_pretender_location_ask_money", []],
  
  [anyone|plyr, "tavern_traveler_pretender_location_ask_money",
    [
      (store_troop_gold, ":cur_gold", "trp_player"),
      (ge, ":cur_gold", 30),
    ],
    "All right, here are thirty peningas.", "tavern_traveler_pretender_location_tell",
    [
      (troop_remove_gold, "trp_player", 30),
  ]],
  
  [anyone|plyr, "tavern_traveler_pretender_location_ask_money", [], "Never mind.", "tavern_traveler_pretalk", []],
  
  [anyone, "tavern_traveler_pretender_location_tell", [], "{s15} is currently at {s11}.", "tavern_traveler_pretalk",
    [
      (str_store_troop_name, s15, "$temp"),
      (troop_get_slot, ":cur_center", "$temp", slot_troop_cur_center),
      (str_store_party_name, s11, ":cur_center"),
  ]],
  
  [anyone|plyr, "tavern_traveler_talk", [ (neq, "$campaign_type", camp_storyline), #chief only in sandbox
      ], "I am looking for one of my companions...", "tavern_traveler_companion_location", []],
  
  [anyone, "tavern_traveler_companion_location", [], "Maybe I can help you. Who are you looking for?", "tavern_traveler_companion_location_ask", []],
  
  [anyone|plyr|repeat_for_troops, "tavern_traveler_companion_location_ask",
    [
      (store_repeat_object, ":troop_no"),
      (is_between, ":troop_no", companions_begin, companions_end),
      (neq, ":troop_no", "trp_npc1"), #no caio
      (neq, ":troop_no", "trp_npc7"),  #no Dwywei
      (troop_slot_eq,":troop_no", slot_troop_occupation, slto_player_companion),
      (troop_slot_ge, ":troop_no", slot_troop_playerparty_history, 1),
      
      
      (assign, ":continue", 0),
      (try_begin),
        (troop_get_slot, ":center", ":troop_no", slot_troop_cur_center),
        (ge, ":center", 1),
        (assign, ":continue", 1),
      (else_try),
        (troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 1),
        (troop_get_slot, ":prison", ":troop_no", slot_troop_prisoner_of_party),
        (neg|party_slot_eq, ":prison", slot_town_lord, "trp_player"),
        (assign, ":continue", 1),
      (try_end),
      
      (eq, ":continue", 1),
      
      (str_store_troop_name, s11, ":troop_no"),
    ],
    "{!}{s11}", "tavern_traveler_companion_location_ask_2",
    [
      (store_repeat_object, "$temp"),
  ]],
  
  [anyone|plyr, "tavern_traveler_companion_location_ask",
    [],  "Never mind.", "tavern_traveler_pretalk", []],
  
  [anyone, "tavern_traveler_companion_location_ask_2", [(str_store_troop_name, s15, "$temp")], "I guess I know where {s15} is. For 30 peningas, I'll tell you.", "tavern_traveler_companion_location_ask_money", []],
  
  [anyone|plyr, "tavern_traveler_companion_location_ask_money",
    [
      (store_troop_gold, ":cur_gold", "trp_player"),
      (ge, ":cur_gold", 30),
    ], "All right, here are thirty peningas.", "tavern_traveler_companion_location_tell",
    [
      (troop_remove_gold, "trp_player", 30),
  ]],
  
  [anyone|plyr, "tavern_traveler_companion_location_ask_money", [], "Never mind.", "tavern_traveler_pretalk", []],
  
  [anyone, "tavern_traveler_companion_location_tell", [], "{s15} is currently at {s11}.{s12}", "tavern_traveler_pretalk",
    [
      (str_store_troop_name, s15, "$temp"),
      
      (try_begin),
        (troop_slot_ge, "$temp", slot_troop_cur_center, 1),
        (troop_get_slot, ":cur_center", "$temp", slot_troop_cur_center),
        (str_store_string, s12, "str_space"),
      (else_try),
        (troop_get_slot, ":cur_center", "$temp", slot_troop_prisoner_of_party),
        
        (try_begin),
          (is_between, ":cur_center", towns_begin, towns_end),
          (str_store_string, s13, "str_town"),
        (else_try),
          (str_store_string, s13, "str_castle"),
        (try_end),
        (troop_get_type, reg4, "$temp"),
        (val_mod, reg4, 2),
        (str_store_string, s12, "str__but_he_is_holding_there_as_a_prisoner_at_dungeon_of_s13"), #[TODO : Control Grammer] New text, control grammer of text later. s13 can be "castle" or "town".
      (try_end),
      
      (try_begin),
        (party_is_active, ":cur_center"),
        (str_store_party_name, s11, ":cur_center"),
      (else_try),
        (str_store_party_name, s11, "str_prisoner_at_large"),
      (try_end),
  ]],
  
  [anyone|plyr, "tavern_traveler_talk", [(troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0)],
    "I know you travel a lot. Could you spread some rumors while travelling?", "tavern_traveler_rumors", []],
  [anyone, "tavern_traveler_rumors", [], "Hmm, everything is possible, for the right price, of course. What kind of rumors do you have in mind?", "tavern_traveler_rumors1", []],
  [anyone|plyr, "tavern_traveler_rumors1", [],
    "I would like you to spread rumors about a lord's disloyalty.", "tavern_traveler_rumors2", [(assign, "$temp_2", 1),]],
  [anyone|plyr, "tavern_traveler_rumors1", [],
    "I would like you to spread rumors about a lord's indiscretion.", "tavern_traveler_rumors2", [(assign, "$temp_2", 2),]],
  [anyone|plyr, "tavern_traveler_rumors1", [],
    "I just want to start a quarrel between two lords.", "tavern_traveler_rumors2", [(assign, "$temp_2", 3),]],
  [anyone, "tavern_traveler_rumors2", [
      (try_begin),
        (eq,"$temp_2", 1),
        (str_store_string, s33, "@This is not that simple, but I can give it a try. I think 300 peningas should suffice. What faction are you talking about?"),
      (else_try),
        (eq, "$temp_2", 2),
        (str_store_string, s33, "@Aha, my favorite one. I think 150 peningas should suffice. Can you tell me what the lord's faction is?"),
      (else_try),
        (eq, "$temp_2", 3),
        (str_store_string, s33, "@Doable, since so many lords are only too eager to pull their swords out. Two hundred and fifty peningas will be plenty, I think. What is the first lord's faction?"),
      (try_end),
      ], "{!}{s33}", "tavern_traveler_rumors3", []],
  [anyone|plyr|repeat_for_factions, "tavern_traveler_rumors3", [
      (store_repeat_object, ":faction_no"),
      (is_between, ":faction_no", kingdoms_begin, kingdoms_end),
      (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
      (str_store_faction_name, s34, ":faction_no"),],"{!}{s34}", "tavern_traveler_rumors4",[(store_repeat_object, "$faction_selected"),]],
  [anyone, "tavern_traveler_rumors4", [(str_store_faction_name, s32, "$faction_selected"),
      ], "Which lord from {s32} do you have in mind?", "tavern_traveler_rumors5", []],
  [anyone|plyr|repeat_for_troops, "tavern_traveler_rumors5", [
      (store_repeat_object, ":troop_no"),
      (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (neq, "trp_player", ":troop_no"),
      (store_troop_faction, ":faction_no", ":troop_no"),
      (eq, ":faction_no", "$faction_selected"),
      (troop_get_slot, ":renown", ":troop_no", slot_troop_renown),
      (assign, ":cont", 0),
      (try_begin),
        (faction_slot_eq, ":faction_no", slot_faction_leader, ":troop_no"),
        (lt, ":renown", 600),
        (assign, ":cont", 1),
      (else_try),
        (lt, ":renown", 400),
        (assign, ":cont", 1),
      (try_end),
      (try_begin),
        (eq, "$temp_2",1),
        (faction_slot_eq, ":faction_no", slot_faction_leader, ":troop_no"),
        (assign, ":cont", 1),
      (try_end),
      (eq, ":cont", 0),
      #			(neg|faction_slot_eq, ":faction_no", slot_faction_leader, ":troop_no"),
      (str_store_troop_name, s11, ":troop_no"),],"{!}{s11}", "tavern_traveler_rumors6",[(store_repeat_object, "$temp2"),]],
  [anyone|plyr, "tavern_traveler_rumors5", [], "Never mind.", "tavern_traveler_pretalk",[]],
  [anyone, "tavern_traveler_rumors6", [
      (this_or_next|eq, "$temp_2", 1),
      (eq, "$temp_2", 2),
      (str_store_troop_name, s31, "$temp2"),
      ], "Very well. Do you want to spread rumors about {s31}?", "tavern_traveler_rumors7a", [(assign, "$temp3", 0),]],
  
  [anyone, "tavern_traveler_rumors6", [
      (eq, "$temp_2", 3),
      (str_store_troop_name, s31, "$temp2"),
      ], "Very well. What is the second lord's faction?", "tavern_traveler_rumors7b", []],
  
  [anyone|plyr|repeat_for_factions, "tavern_traveler_rumors7b", [
      (store_repeat_object, ":faction_no"),
      (is_between, ":faction_no", kingdoms_begin, kingdoms_end),
      (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
      (str_store_faction_name, s34, ":faction_no"),],"{!}{s34}", "tavern_traveler_rumors7c",[(store_repeat_object, "$faction_selected"),]],
  [anyone, "tavern_traveler_rumors7c", [(str_store_faction_name, s32, "$faction_selected"),
      ], "Which lord from the {s32} do you have in mind?", "tavern_traveler_rumors7d", []],
  [anyone|plyr|repeat_for_troops, "tavern_traveler_rumors7d", [
      (store_repeat_object, ":troop_no"),
      (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (neq, "trp_player", ":troop_no"),
      (neq, ":troop_no", "$temp2"),
      (store_troop_faction, ":faction_no", ":troop_no"),
      (eq, ":faction_no", "$faction_selected"),
      (neg|faction_slot_eq, ":faction_no", slot_faction_leader, ":troop_no"),
      (str_store_troop_name, s11, ":troop_no"),],"{!}{s11}", "tavern_traveler_rumors7e",[(store_repeat_object, "$temp3"),]],
  
  [anyone, "tavern_traveler_rumors7e", [
      (eq, "$temp_2", 3),
      (str_store_troop_name, s31, "$temp2"),
      (str_store_troop_name, s35, "$temp3"),
      ], "Very well. Do you want to start a quarrel between {s31} and {s35}?", "tavern_traveler_rumors7a", []],
  [anyone|plyr, "tavern_traveler_rumors7a",
    [   (store_troop_gold, ":gold", "trp_player"),
      (try_begin),
        (eq, "$temp_2", 1),
        (assign, ":cost", 300),
      (else_try),
        (eq, "$temp_2", 2),
        (assign, ":cost", 150),
      (else_try),
        (eq, "$temp_2", 3),
        (assign, ":cost", 250),
      (try_end),
      (ge, ":gold", ":cost"),
      (assign, "$temp", ":cost"),
      ], "Yes, that is exactly what I want you to do.", "tavern_traveler_rumors7aa",[
      (troop_remove_gold,"trp_player","$temp"),
      (troop_set_slot,"$g_talk_troop",slot_troop_days_on_mission,7),#7 days cooldown
      (try_begin),
        (eq, "$temp_2", 1),
        (troop_set_slot, "$g_talk_troop", slot_troop_current_mission, npc_mission_test_waters),
      (else_try),
        (troop_set_slot, "$g_talk_troop", slot_troop_current_mission, npc_mission_improve_relations),
      (try_end),
      #			(troop_get_slot, ":mission", "$g_talk_troop", slot_troop_current_mission),
      #			(assign, reg43, ":mission"),
      #			(display_message,"@Mission is {reg43}"),
      
      (try_begin),
        (eq, "$temp_2", 3),
        (troop_set_slot, "$g_talk_troop", slot_troop_mission_target , "$temp3"),
      (else_try),
        (troop_set_slot, "$g_talk_troop", slot_troop_mission_target , -1),
      (try_end),
      (troop_set_slot, "$g_talk_troop", slot_troop_mission_object , "$temp2"),
      #			(str_store_troop_name, s51, "$temp3"),
      #			(str_store_troop_name, s52, "$temp2"),
      #			(display_message, "@mission target is {s51} and mission object is {s52}"),
  ]],
  [anyone, "tavern_traveler_rumors7aa", [
      ], "Very well. I will try to sow some rumors per your wish. Check back in a week to see if the rumors are working.", "tavern_traveler_pretalk", []],
  
  [anyone|plyr, "tavern_traveler_rumors7a",
    [   (store_troop_gold, ":gold", "trp_player"),
      (try_begin),
        (eq, "$temp_2", 1),
        (assign, ":cost", 300),
      (else_try),
        (eq, "$temp_2", 2),
        (assign, ":cost", 150),
      (else_try),
        (eq, "$temp_2", 3),
        (assign, ":cost", 250),
      (try_end),
      (lt, ":gold", ":cost"),
      ], "Sorry, I don't have the money.", "tavern_traveler_pretalk",[]],
  
  [anyone|plyr, "tavern_traveler_rumors7a", [], "Actually, I changed my mind.", "tavern_traveler_pretalk", []],
  
  
  
  
  
  
  
  
  
  [anyone, "start", [(is_between, "$g_talk_troop", tavern_travelers_begin, tavern_travelers_end),
      (party_get_slot, ":info_faction", "$g_encountered_party", slot_center_traveler_info_faction),
      (str_store_faction_name, s17, ":info_faction"),
    ],
    "Greetings. They say you're the kind of {reg59?woman:man} who'd be interested to hear that I travel frequently to the {s17}. I'll tell you all I know for a mere 100 peningas.", "tavern_traveler_answer", []],
  
  [anyone|plyr, "tavern_traveler_answer", [(store_troop_gold, ":cur_gold", "trp_player"),
      (ge, ":cur_gold", 100)],
    "Here's 100 peningas. Tell me what you know.", "tavern_traveler_continue", [(party_get_slot, ":info_faction", "$g_encountered_party", slot_center_traveler_info_faction),
      (call_script, "script_update_faction_traveler_notes", ":info_faction"),
      (change_screen_notes, 2, ":info_faction"),
  ]],
  
  [anyone|plyr, "tavern_traveler_answer", [],
    "Sorry, friend. I am not interested.", "close_window", []],
  
  [anyone, "tavern_traveler_continue", [],
    "Well, that's all I can tell you. Farewell.", "close_window", [(troop_remove_gold, "trp_player", 100),]],
  
  [anyone|plyr, "tavern_traveler_talk", [],
    "Farewell.", "close_window", []],
  
  #Tavern Talk (with book sellers)
  [anyone, "start", [(is_between, "$g_talk_troop", tavern_booksellers_begin, tavern_booksellers_end),
    ],
    "Good day {reg59?madam:sir}, will you be looking at my books?", "bookseller_talk", []],
  [anyone|plyr, "bookseller_talk", [], "Yes. Show me what you have for sale.", "bookseller_buy", []],
  
  [anyone,"bookseller_buy", [], "Of course {reg59?madam:sir}.", "book_trade_completed",[[change_screen_trade]]],
  [anyone,"book_trade_completed", [], "Anything else?", "bookseller_talk",[]],
  
  [anyone|plyr,"bookseller_talk", [], "Nothing. Thanks.", "close_window",[]],
  
  #herreros especiales chief
  [anyone|plyr, "town_merchant_talk", [(is_between, "$g_talk_troop", herrero_troops_begin, herrero_troops_end),], "I like your weapons, but I need something more... special.", "herrero_buy", []],
  [trp_town_30_weaponsmith|plyr, "town_merchant_talk", [], "I like your weapons, but I need something more... special.", "herrero_buy", []],
  
  [anyone,"herrero_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 600),], "But of course, {reg59?madam:sir}.", "herrero_trade",[]],
  [anyone,"herrero_buy", [], "Sorry, friend, but my art is for the men of fame only. Come back when you've made a name for yourself (600 renown).", "close_window",[]],
  
  [anyone,"herrero_trade", [], "I sell specialty items. I can make a noble sword or elite spear, or I can sell you an axe from Frankia, and more... The quality depends on the material that I have today. What would you like?", "herrero_choose",[]],
  
  [anyone|plyr,"herrero_choose", [], "I'd like the sword. I'll call it Widow Maker (13000 peningas).", "herrero_window",[
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",12999),
        (troop_remove_gold, "trp_player", 13000),
        (troop_add_item, "trp_player", "itm_widow_maker", 0), #chief
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  [anyone|plyr,"herrero_choose", [], "The spear, please (8000 peningas).", "herrero_window",[
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",7999),
        (troop_remove_gold, "trp_player", 8000),
        (troop_add_item, "trp_player", "itm_new_mace", 0), #chief
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  [anyone|plyr,"herrero_choose", [], "I'd like the Frankish axe. It's a symbol of wealth (11000 peningas).", "herrero_window",[
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",10999),
        (troop_remove_gold, "trp_player", 11000),
        (troop_add_item, "trp_player", "itm_frankish_axe", 0), #chief
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  [anyone|plyr,"herrero_choose", [], "I'd like something else. Surprise me (4 options, 10000 peningas).", "herrero_window",[
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",9999),
        (troop_remove_gold, "trp_player", 10000),
        (store_random_in_range, ":rand", 0, 5),
        (try_begin),
          (eq, ":rand", 0),
          (troop_add_item, "trp_player", "itm_siren_song", 0),
          (display_message, "@You get an elite Saxon sword.", 0xFF0000),
        (else_try),
          (eq, ":rand", 1),
          (troop_add_item, "trp_player", "itm_longseax8", 0),
          (display_message, "@You get a Long Seax.", 0xFF0000),
        (else_try),
          (eq, ":rand", 2),
          (troop_add_item, "trp_player", "itm_long_axe_b", 0),
          (display_message, "@You get a beautiful Long Axe.", 0xFF0000), #axe 2 hands cannt be godelic
        (else_try),
          (troop_add_item, "trp_player", "itm_long_bow3", 0),
          (display_message, "@You get a great long bow.", 0xFF0000),
        (try_end),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  
  [anyone|plyr,"herrero_choose", [], "Nothing. Thank you.", "close_window",[]],
  
  [anyone,"herrero_window", [], "Good luck. Remember my name if you need something else. Farewell.", "close_window",[]],
  
  
  ###armor
  [anyone|plyr, "town_merchant_talk", [(is_between, "$g_talk_troop", armorer_troops_begin, armorer_troops_end),], "I like your armors, but I need something more... special.", "armorer_buy", []],
  [trp_town_30_armorer|plyr, "town_merchant_talk", [], "I like your armors, but I need something more... special.", "armorer_buy", []],
  
  [anyone,"armorer_buy", [(troop_slot_ge, "trp_player", slot_troop_renown, 600),], "Sure thing, {reg59?madam:sir}.", "armorer_trade",[]],
  [anyone,"armorer_buy", [], "Sorry, friend, but my art is for the men of fame only. Come back when you've made a name for yourself (600 renown).", "close_window",[]],
  
  [anyone,"armorer_trade", [], "I sell specialty items. I can sell you a suit of mail from Frankia. If you need a helmet, I can make you a noble helmet or a hersir helmet, and more... The quality depends on the material that I have today. What would you like?", "armorer_choose",[]],
  
  [anyone|plyr,"armorer_choose", [], "The mail, please. I'd like to have it (17000 peningas).", "armorer_window",[
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",16999),
        (troop_remove_gold, "trp_player", 17000),
        (troop_add_item, "trp_player", "itm_mail_shirt_12", 0), #chief
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  [anyone|plyr,"armorer_choose", [], "I'd like the noble helm. It's a symbol of wealth (9000 peningas).", "armorer_window",[
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",8999),
        (troop_remove_gold, "trp_player", 9000),
        (troop_add_item, "trp_player", "itm_noble_helm_smith", 0), #chief
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  [anyone|plyr,"armorer_choose", [], "I'd like the hersir helm. I love how it accentuates my facial features (12000 peningas).", "armorer_window",[
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",11999),
        (troop_remove_gold, "trp_player", 12000),
        (troop_add_item, "trp_player", "itm_hersir_helm", 0), #chief
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  
  [anyone|plyr,"armorer_choose", [], "I'd like something else. Surprise me (4 options, 19000 peningas).", "armorer_window",[
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",18999),
        (troop_remove_gold, "trp_player", 19000),
        (store_random_in_range, ":rand", 0, 5),
        (try_begin),
          (eq, ":rand", 0),
          (troop_add_item, "trp_player", "itm_addon_mail7", 0),
          (display_message, "@You get an expensive mail.", 0xFF0000),
        (else_try),
          (eq, ":rand", 1),
          (troop_add_item, "trp_player", "itm_addon_mail4", 0), #berserker
          (display_message, "@You get an expensive mail.", 0xFF0000),
        (else_try),
          (eq, ":rand", 2),
          (troop_add_item, "trp_player", "itm_mail_shirt_10", 0),
          (display_message, "@You get an expensive mail shirt.", 0xFF0000),
        (else_try),
          (troop_add_item, "trp_player", "itm_viking_noblehelm2", 0),
          (display_message, "@You get an expensive helmet.", 0xFF0000),
        (try_end),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  
  [anyone|plyr,"armorer_choose", [], "Nothing. Thank you.", "close_window",[]],
  
  [anyone,"armorer_window", [], "Good luck. Remember my name if you need something else. Farewell.", "close_window",[]],
  
  #dialogo quastuosa chief
  [anyone, "start", [(is_between, "$g_talk_troop", quastuosa_begin, quastuosa_end),
    ],
    "Hello, {reg59?my lady:my lord} - she smiles and looks at you provocatively -, How can I serve you?", "quastuosa_talk", []],
  [anyone, "quastuosa_pretalk", [],
    "I am at your service, {playername}.", "quastuosa_talk", []],
  [anyone|plyr,"quastuosa_talk", [  (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0),],
    "I need to raise the morale of my men.", "quastuosa_serve",[]],
  [anyone|plyr,"quastuosa_talk", [],
    "I do not want anything for my men. I would like your company.", "quastuosa_serve2",[]],
  [anyone|plyr, "quastuosa_talk", [],
    "I'm not interested. Farewell.", "close_window", []],
  
  [anyone,"quastuosa_serve", [],
    "Your men will have a big feast, with our girls serving the best mead, our finest food, and bards... It will cost you 1500 peningas.", "quastuosa_serve3", []],
  [anyone|plyr,"quastuosa_serve3", [(store_troop_gold,":money","trp_player"),(gt,":money",1499),],
    "I suppose my men have earned it. This time.", "quastuosa_pretalk",
    [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",1499),
        (troop_remove_gold, "trp_player", 1500),
        (call_script, "script_change_player_party_morale", 13),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
      (troop_set_slot, "$g_talk_troop", slot_troop_days_on_mission, 5),
  ]],
  [anyone|plyr, "quastuosa_serve3", [],
    "Alas, my lady, your charms are beyond the reach of my purse.", "close_window", []],
  
  [anyone,"quastuosa_serve2", [],
    "Nice. You like me, {reg59?my lady:my lord}, don't you? Well, for you, there is a special price of only 100 coins. As a token of our 'friendship'...", "quastuosa_serve4",[]],
  [anyone|plyr, "quastuosa_serve4", [],
    "Great, here, take these coins as a 'gift.'", "quastuosa_serve5", [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",99),
        (troop_remove_gold, "trp_player", 100),
        (add_xp_as_reward, 40),
        (call_script, "script_change_player_party_morale", -2),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  [anyone|plyr, "quastuosa_serve4", [],
    "No thanks. You are trying to rob me.", "close_window", []],
  [anyone,"quastuosa_serve5", [],
    "(Time passes, and you forget the rigors and fatigue from the journey that had lingered upon your body and soul. For a few hours, your armor and sword, the fear of dying in any skirmish, the punishment of the rain and wind, and the dust of the roads are all shoved under a small patch of happiness. But, in the end, it ends all too soon, when your 'friend' quietly leaves the room.)", "quastuosa_pretalk",
    []],
  #quastuosa chief dialogo acaba
  
  #Tavern Talk (with minstrels) textos bardos cambiados chief
  [anyone, "start", [(is_between, "$g_talk_troop", tavern_minstrels_begin, tavern_minstrels_end),
    ],
    "Greetings to you, {reg59?most noble lady:most noble sir}.", "minstrel_1", []],
  
  [anyone|plyr, "minstrel_1", [(eq, "$minstrels_introduced", 0),],
    "What is it that you do?", "minstrel_job_description",
    [(assign, "$minstrels_introduced", 1), ]],
  
  [anyone|plyr, "minstrel_1", [(eq, "$minstrels_introduced", 1)  ],
    "I have some questions about courtship in these lands.",
    "minstrel_courtship_questions", []],
  
  [anyone|plyr, "minstrel_1", [(eq, "$minstrels_introduced", 1)  ],
    "Can you teach me any poems?",
    "minstrel_courtship_poem", []],
  
  
  [anyone, "minstrel_courtship_poem", [
      (eq, "$allegoric_poem_recitations", 0),
      (this_or_next|eq, "$g_talk_troop", "trp_tavern_minstrel_1"),
      (eq, "$g_talk_troop", "trp_tavern_minstrel_5"),
    ],
    "I can teach you the tale of Aeneas and Dido, from the Aeneid. It is an allegoric poem that describes how Dido, the Queen of Carthage, fell in love, under the influence of the gods, with the Trojan hero Aeneas. When reminded by Jupiter, he leaves his lover to fulfill his duty to found a new city, Dido commits suicide, cursing Aeneas and calling down revenge in a symbolic anticipation of the fierce wars between Carthage and Rome. Its theme -- of strong love separated by fate and cursed by suicide -- is appreciated by some noble ladies, but not all.",
    "minstrel_courtship_poem_teach", [
      (assign, "$poem_selected", courtship_poem_allegoric),
  ]],
  
  [anyone, "minstrel_courtship_poem", [
      (eq, "$mystic_poem_recitations", 0),
      (this_or_next|eq, "$g_talk_troop", "trp_tavern_minstrel_3"),
      (eq, "$g_talk_troop", "trp_tavern_minstrel_1"),
    ],
    "I can teach you The Voyage of Bran. This Goidelic saga can be interpreted either erotically or prophetically. Bran, son o Fedbal, and his expedition of twenty-one companions journey to a distant island of luxury and pleasure. Upon return, he learns that ages have passed, and he and his expedition have already passed into myth. He can never again touch the soil of his homeland and sails off again. I believe that it appeals to women of a certain romantic temperament, but you risk scandalizing or boring others.",
    "minstrel_courtship_poem_teach", [
      (assign, "$poem_selected", courtship_poem_mystic),
  ]],
  #chief cambiamos textos de bardos
  #ashik poem
  [anyone, "minstrel_courtship_poem", [
      (eq, "$tragic_poem_recitations", 0),
      (this_or_next|eq, "$g_talk_troop", "trp_tavern_minstrel_3"),
      (eq, "$g_talk_troop", "trp_tavern_minstrel_2"),  ],
    "I can teach you the tragic tale of Orpheus, son of Morpheus and the muse Calliope. It is a sad and powerful story. He travels to the Underworld to bring back Euridyce, his deceased wife, but is unable to obey the condition imposed by Hades and Persephone. Hear me.",
    "minstrel_courtship_poem_teach", [
      (assign, "$poem_selected", courtship_poem_tragic),
      
  ]],
  
  
  #nord saga
  [anyone, "minstrel_courtship_poem", [
      (eq, "$heroic_poem_recitations", 0),
      (this_or_next|eq, "$g_talk_troop", "trp_tavern_minstrel_4"),
      (eq, "$g_talk_troop", "trp_tavern_minstrel_2"),
      
    ],
    "I can teach you the saga of Beowulf. It is a heroic tale, full of blood and battle. Beowulf, a hero of the Geats, battles three powerful antagonists: Grendel, a horrid monster, who has been attacking the resident warriors of the mead hall of Hrodgar, king of the Danish, Grendel's mother, and a terrible dragon. Hear me.",
    "minstrel_courtship_poem_teach", [
      (assign, "$poem_selected", courtship_poem_heroic),
  ]],
  
  
  [anyone, "minstrel_courtship_poem", [
      (eq, "$comic_poem_recitations", 0),
      (this_or_next|eq, "$g_talk_troop", "trp_tavern_minstrel_5"),
      (eq, "$g_talk_troop", "trp_tavern_minstrel_4"),
    ],
    "I can teach you the Aesopica, the famous fables of Aesop. The tales of this slave and storyteller usually feature animals, and are both comical, satirizing man and animal, and moral, for its practical lessons on life. Pay you heed.",
    "minstrel_courtship_poem_teach", [
      (assign, "$poem_selected", courtship_poem_comic),
  ]],
  
  #chief cambiados textos bardos acaba
  [anyone, "minstrel_courtship_poem_teach", [],
    "To teach it to you, I will need some hours of your time -- and, of course, a small fee for my services. About 300 peningas would suffice.",
    "minstrel_courtship_poem_teach_2", []],
  
  [anyone, "minstrel_courtship_poem", [],
    "I believe you already know the poems I am best equipped to teach.",
    "minstrel_pretalk", []],
  
  [anyone|plyr, "minstrel_courtship_poem_teach_2", [
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 300),
    ],
    "Yes -- teach me that one",
    "minstrel_courtship_poem_teach_3", []],
  
  [anyone|plyr, "minstrel_courtship_poem_teach_2", [],
    "Never mind",
    "minstrel_pretalk", []],
  
  
  [anyone, "minstrel_courtship_poem_teach_3", [
      (eq, "$poem_selected", courtship_poem_allegoric),
    ],
    "Very well -- repeat after me:^" +
    "But anxious cares already seized the queen^" +
    "She fed within her veins a flame unseen^" +
    "The hero's valor, acts, and birth inspire^" +
    "Her soul with love, and fan the secret fire...",
    "minstrel_courtship_poem_teach_4", []],
  
  
  [anyone, "minstrel_courtship_poem_teach_3", [
      (eq, "$poem_selected", courtship_poem_mystic),
    ],
    "Very well -- repeat after me:^" +
    "There is a distant isle,^" +
    "Around which sea-horses glisten^" +
    "A fair course against the white-swelling surge,^" +
    "Four feet uphold it.^" +
    "A delight of the eyes, a glorious range,^" +
    "Is the plain on which the hosts hold games^" +
    "Coracle contends against chariot^" +
    "In southern Mag Findargat...",
    "minstrel_courtship_poem_teach_4", []],
  
  
  [anyone, "minstrel_courtship_poem_teach_3", [
      (eq, "$poem_selected", courtship_poem_tragic),
    ],
    "Very well -- repeat after me:^" +
    "The muse Calliope bore to Morpheus a son named Orpheus^" +
    "Who practised minstrelsy and by his songs moved stones and trees^" +
    "When his wife Eurydice died, bitten by a snake, he went down to Hades, being fain to bring her up,^" +
    "He persuaded Hades to send her up with him, back to life^" +
    "The god promised to do so, if on the way Orpheus would not turn round until he should be come to his own house.^" +
    "But he disobeyed and turning round beheld his wife; and she turned back to the Underworld, forever lost...",
    "minstrel_courtship_poem_teach_4", []],
  
  
  [anyone, "minstrel_courtship_poem_teach_3", [
      (eq, "$poem_selected", courtship_poem_heroic),
    ],
    "Very well -- repeat after me:^" +
    "Lo, praise of the prowess of people-kings^" +
    "Of spear-armed Danes, in days long sped,^" +
    "We have heard, and what honor the aethelings won!^" +
    "Oft Scyld the Scefing from squadroned foes,^" +
    "From many a tribe, the mead-bench tore, awing the earls...",
    "minstrel_courtship_poem_teach_4", []],
  
  
  [anyone, "minstrel_courtship_poem_teach_3", [
      (eq, "$poem_selected", courtship_poem_comic),
    ],
    "Very well -- repeat after me:^" +
    "A Lion was awakened from sleep by a Mouse running over his face^" +
    "Rising up angrily, he caught him and was about to kill him, when the Mouse piteously entreated, saying:^" +
    "If you would only spare my life, I would be sure to repay your kindness.^" +
    "The Lion laughed and let him go... ",
    "minstrel_courtship_poem_teach_4", [
  ]],
  
  
  [anyone|plyr, "minstrel_courtship_poem_teach_4", [
      (eq, "$poem_selected", courtship_poem_allegoric),
    ],
    "'But anxious cares already seized the queen...'",
    "minstrel_learn_poem_continue", [
      (troop_remove_gold, "trp_player", 300),
      (val_add, "$allegoric_poem_recitations", 1),
      
  ]],
  
  
  [anyone|plyr, "minstrel_courtship_poem_teach_4", [
      (eq, "$poem_selected", courtship_poem_mystic),
    ],
    "'There is a distant isle...'",
    "minstrel_learn_poem_continue", [
      (troop_remove_gold, "trp_player", 300),
      (val_add, "$mystic_poem_recitations", 1),
  ]],
  
  
  
  
  [anyone|plyr, "minstrel_courtship_poem_teach_4", [
      (eq, "$poem_selected", courtship_poem_tragic),
    ],
    "'The muse Calliope bore to Morpheus a son named Orpheus...'",
    "minstrel_learn_poem_continue", [
      (troop_remove_gold, "trp_player", 300),
      (val_add, "$tragic_poem_recitations", 1),
  ]],
  
  
  [anyone|plyr, "minstrel_courtship_poem_teach_4", [
      (eq, "$poem_selected", courtship_poem_heroic),
    ],
    "'LO, praise of the prowess of people-kings...'",
    "minstrel_learn_poem_continue", [
      (troop_remove_gold, "trp_player", 300),
      (val_add, "$heroic_poem_recitations", 1),
  ]],
  
  
  [anyone|plyr, "minstrel_courtship_poem_teach_4", [
      (eq, "$poem_selected", courtship_poem_comic),
    ],
    "'A Lion was awakened from sleep by a Mouse running over his face...'",
    "minstrel_learn_poem_continue", [
      (troop_remove_gold, "trp_player", 300),
      (val_add, "$comic_poem_recitations", 1),
  ]],
  
  
  [anyone|plyr, "minstrel_courtship_poem_teach_4", [
    ],
    "Pshaw... What kind of doggerel is that?",
    "minstrel_courtship_poem_teach_reject", []],
  
  [anyone, "minstrel_courtship_poem_teach_reject", [
    ],
    "Very well. If the poem is not to your taste, then keep your money. Only, remember: with poets and with lovers, what is important is not what pleases you but what pleases your audience. If you wish to learn the poem, I am still willing to teach.",
    "minstrel_pretalk", []],
  
  
  [anyone, "minstrel_learn_poem_continue", [
    ],
    "Very good -- but there are many stanzas to go. Now, listen closely...", "close_window",
    [
      (try_begin),
        (try_begin),
          (eq, "$poem_selected", courtship_poem_mystic),
          (set_achievement_stat, ACHIEVEMENT_ROMANTIC_WARRIOR, 0, 1),
        (else_try),
          (eq, "$poem_selected", courtship_poem_tragic),
          (set_achievement_stat, ACHIEVEMENT_ROMANTIC_WARRIOR, 1, 1),
        (else_try),
          (eq, "$poem_selected", courtship_poem_heroic),
          (set_achievement_stat, ACHIEVEMENT_ROMANTIC_WARRIOR, 2, 1),
        (else_try),
          (eq, "$poem_selected", courtship_poem_comic),
          (set_achievement_stat, ACHIEVEMENT_ROMANTIC_WARRIOR, 3, 1),
        (else_try),
          (eq, "$poem_selected", courtship_poem_allegoric),
          (set_achievement_stat, ACHIEVEMENT_ROMANTIC_WARRIOR, 4, 1),
        (try_end),
        
        (assign, ":number_of_poems_player_know", 0),
        (try_for_range, ":poem_number", 0, 5),
          (get_achievement_stat, ":poem_is_known", ACHIEVEMENT_ROMANTIC_WARRIOR, ":poem_number"),
          (eq, ":poem_is_known", 1),
          (val_add, ":number_of_poems_player_know", 1),
        (try_end),
        
        (try_begin),
          (ge, ":number_of_poems_player_know", 3),
          (unlock_achievement, ACHIEVEMENT_ROMANTIC_WARRIOR),
        (try_end),
      (try_end),
      
      (assign, "$g_leave_town",1),
      (rest_for_hours, 2, 2, 0),
      (finish_mission),
  ]],
  
  
  [anyone|plyr, "minstrel_1", [(eq, "$minstrels_introduced", 1)  ],
    "Can you tell me anything about the eligible maidens in this realm?",
    "minstrel_gossip", [
  ]],
  
  [anyone, "minstrel_gossip",
    [],
    "About whom did you wish to know?",
    "minstrel_gossip_select", []],
  
  [anyone|plyr,"minstrel_gossip_select",
    [],
    "Just tell me the latest piece of gossip",
    "minstrel_gossip_maiden_selected_2", [
      
      (assign, "$lady_selected", -1),
      (assign, "$romantic_rival", -1),
      
      (try_for_range, ":log_entry", 0, "$num_log_entries"),
        (troop_get_slot, ":lady", "trp_log_array_actor", ":log_entry"),
        (is_between, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
        (neg|troop_slot_eq, "trp_player", slot_troop_spouse, ":lady"),
        
        (troop_get_slot, ":type", "trp_log_array_entry_type", ":log_entry"),
        (is_between, ":type", 50, 65), #excludes log entries in which a party is an actor
        
        (store_faction_of_troop, ":lady_faction", ":lady"),
        (store_faction_of_party, ":town_faction", "$g_encountered_party"),
        (eq, ":lady_faction", ":town_faction"),
        (assign, "$lady_selected", ":lady"),
        (try_begin),
          (eq, "$cheat_mode", 1),
          (str_store_troop_name, s4, ":lady"),
          (troop_get_slot, reg4, "trp_log_array_entry_type", ":log_entry"),
          (assign, reg5, "$num_log_entries"),
          (display_message, "str_log_entry_type_reg4_for_s4_total_entries_reg5"),
        (try_end),
      (try_end),
      
  ]],
  
  
  [anyone|plyr|repeat_for_troops,"minstrel_gossip_select",
    [
      (store_repeat_object, "$temp"),
      (troop_slot_eq, "$temp", slot_troop_occupation, slto_kingdom_lady),
      (troop_slot_eq, "$temp", slot_troop_spouse, -1),
      (store_faction_of_troop, ":lady_faction", "$temp"),
      (store_faction_of_party, ":town_faction", "$g_encountered_party"),
      (eq, ":lady_faction", ":town_faction"),
      (str_store_troop_name, s10, "$temp"),
    ],
    "{!}{s10}",
    "minstrel_gossip_maiden_selected", [
      (store_repeat_object, "$lady_selected"),
  ]],
  
  [anyone|plyr,"minstrel_gossip_select",
    [], "Never mind", "minstrel_pretalk", []],
  
  
  [anyone,"minstrel_gossip_maiden_selected",
    [
      (try_begin),
        (eq, "$cheat_mode", 1),
        (assign, reg3, "$lady_selected"),
        (display_message, "@{!}DEBUG: Gossip for troop {reg3}"),
        (gt, reg3, -1),
        (display_message, "@{!}DEBUG: {s3}"),
      (try_end),
      
      (try_begin),
        (gt, "$lady_selected", -1),
        (str_store_troop_name, s9, "$lady_selected"), #lady
        
        
        (str_store_string, s10, "str_error__reputation_type_for_s9_not_within_range"),
        (try_begin),
          (troop_slot_eq, "$lady_selected", slot_lord_reputation_type, lrep_conventional),
          (str_store_string, s16, "str_they_say_that_s9_is_a_most_conventional_maiden__devoted_to_her_family_of_a_kind_and_gentle_temperament_a_lady_in_all_her_way"),
        (else_try),
          (troop_slot_eq, "$lady_selected", slot_lord_reputation_type, lrep_otherworldly),
          (str_store_string, s16, "str_they_say_that_s9_is_a_bit_of_a_romantic_a_dreamer__of_a_gentle_temperament_yet_unpredictable_she_is_likely_to_be_led_by_her_passions_and_will_be_trouble_for_her_family_ill_wager"),
        (else_try),
          (troop_slot_eq, "$lady_selected", slot_lord_reputation_type, lrep_ambitious),
          (str_store_string, s16, "str_they_say_that_s9_is_determined_to_marry_well_and_make_her_mark_in_the_world_she_may_be_a_tremendous_asset_for_her_husband__provided_he_can_satisfy_her_ambition"),
        (else_try),
          (troop_slot_eq, "$lady_selected", slot_lord_reputation_type, lrep_adventurous),
          (str_store_string, s16, "str_they_say_that_s9_loves_to_hunt_and_ride_maybe_she_wishes_she_were_a_man_whoever_she_marries_will_have_a_tough_job_keeping_the_upper_hand_i_would_say"),
        (else_try),
          (troop_slot_eq, "$lady_selected", slot_lord_reputation_type, lrep_moralist),
          (str_store_string, s16, "str_they_say_that_s9_is_a_lady_of_the_highest_moral_standards_very_admirable_very_admirable__and_very_hard_to_please_ill_warrant"),
        (try_end),
        
        (call_script, "script_add_rumor_string_to_troop_notes", "$lady_selected", -1, 16),
      (try_end),
    ],
    "{!}{s16}",
    "minstrel_gossip_maiden_selected_2", [
  ]],
  
  
  [anyone,"minstrel_gossip_maiden_selected_2",
    [
      (troop_slot_eq, "trp_player", slot_troop_spouse, "$lady_selected"),
      (is_between, "$lady_selected", kingdom_ladies_begin, kingdom_ladies_end),
    ],
    "She is married to you, of course! Clearly, no one would dream that she would do anything to engender gossip.",
    "minstrel_postgossip",
    []],
  
  
  [anyone,"minstrel_gossip_maiden_selected_2",
    [
      (gt, "$lady_selected", -1),
      (assign, ":lady", "$lady_selected"),
      (neg|troop_slot_ge, ":lady", slot_troop_spouse, active_npcs_begin),
      (troop_get_slot, ":betrothed", ":lady", slot_troop_betrothed),
      (is_between, ":betrothed", active_npcs_begin, active_npcs_end),
      
      (str_store_troop_name, s9, ":lady"),
      (str_store_troop_name, s11, ":betrothed"),
      
      (str_store_string, s12, "str_s9_is_now_betrothed_to_s11_soon_we_believe_there_shall_be_a_wedding"),
      (try_begin),
        (troop_slot_eq, ":lady", slot_troop_met, 2),
        (assign, "$romantic_rival", ":betrothed"),
      (try_end),
    ],
    "{!}{s12}.",
    "minstrel_postgossip", []],
  
  
  
  
  
  [anyone,"minstrel_gossip_maiden_selected_2",
    [
      (try_begin),
        (is_between, "$lady_selected", kingdom_ladies_begin, kingdom_ladies_end),
        (str_store_string, s12, "str_i_have_not_heard_any_news_about_her"),
        
        (str_store_troop_name, s9, "$lady_selected"), #lady
        
        (try_begin),
          (eq, "$cheat_mode", 1), #for some reason, speaking to tavern merchant does not yield rumor. Try for Lady Baoth, Lord Etr
          (display_message, "str_searching_for_rumors_for_s9"),
        (try_end),
        
        (assign, "$romantic_rival", -1),
        (assign, ":last_lady_noted", 0),
        (try_for_range, ":log_entry", 0, "$num_log_entries"),
          (troop_slot_eq, "trp_log_array_actor", ":log_entry", "$lady_selected"),
          
          
          #Presumably possible for some events involving a lady to not involve troops
          (troop_get_slot, ":suitor", "trp_log_array_troop_object", ":log_entry"),
          (str_clear, s11),
          (try_begin),
            (is_between, ":suitor", 0, kingdom_ladies_end),
            (str_store_troop_name, s11, ":suitor"),
          (try_end),
          
          (troop_get_slot, ":third_party", "trp_log_array_center_object", ":log_entry"),
          (str_clear, s10),
          (try_begin),
            (is_between, ":third_party", 0, kingdom_ladies_end),
            (str_store_troop_name, s10, ":third_party"),
          (try_end),
          
          (assign, ":lady", "$lady_selected"),
          
          (try_begin),
            (troop_slot_eq, "trp_log_array_entry_type",  ":log_entry", logent_lady_favors_suitor),
            (str_store_string, s12, "str_they_say_that_s9_has_shown_favor_to_s11_perhaps_it_will_not_be_long_until_they_are_betrothed__if_her_family_permits"),
            (assign, ":last_lady_noted", ":lady"),
            (assign, ":last_suitor_noted", ":suitor"),
            
            (try_begin),
              (troop_slot_eq, ":lady", slot_troop_met, 2),
              (this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_1, ":lady"),
              (this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_2, ":lady"),
              (troop_slot_eq, ":suitor", slot_troop_love_interest_3, ":lady"),
              
              (assign, "$romantic_rival", ":suitor"),
            (try_end),
          (else_try),
            (troop_slot_eq, "trp_log_array_entry_type",  ":log_entry", logent_lady_betrothed_to_suitor_by_family),
            (str_store_string, s12, "str_they_say_that_s9_has_been_forced_by_her_family_into_betrothal_with_s11"),
            (assign, ":last_lady_noted", ":lady"),
            (assign, ":last_suitor_noted", ":suitor"),
            
            (try_begin),
              (troop_slot_eq, ":lady", slot_troop_met, 2),
              (assign, "$romantic_rival", ":suitor"),
            (try_end),
          (else_try),
            (troop_slot_eq, "trp_log_array_entry_type",  ":log_entry", logent_lady_betrothed_to_suitor_by_choice),
            (str_store_string, s12, "str_they_say_that_s9_has_agreed_to_s11s_suit_and_the_two_are_now_betrothed"),
            (assign, ":last_lady_noted", ":lady"),
            (assign, ":last_suitor_noted", ":suitor"),
            
            (try_begin),
              (troop_slot_eq, ":lady", slot_troop_met, 2),
              (this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_1, ":lady"),
              (this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_2, ":lady"),
              (troop_slot_eq, ":suitor", slot_troop_love_interest_3, ":lady"),
              
              
              (assign, "$romantic_rival", ":suitor"),
            (try_end),
            
          (else_try),
            (troop_slot_eq, "trp_log_array_entry_type",  ":log_entry", logent_lady_betrothed_to_suitor_by_pressure),
            (str_store_string, s12, "str_they_say_that_s9_under_pressure_from_her_family_has_agreed_to_betrothal_with_s11"),
            (assign, ":last_lady_noted", ":lady"),
            (assign, ":last_suitor_noted", ":suitor"),
            
            (try_begin),
              (troop_slot_eq, ":lady", slot_troop_met, 2),
              (this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_1, ":lady"),
              (this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_2, ":lady"),
              (troop_slot_eq, ":suitor", slot_troop_love_interest_3, ":lady"),
              
              (assign, "$romantic_rival", ":suitor"),
            (try_end),
            
          (else_try),
            
            (troop_slot_eq, "trp_log_array_entry_type",  ":log_entry", logent_lady_rejects_suitor),
            (str_store_string, s12, "str_they_say_that_s9_has_refused_s11s_suit"),
            (assign, ":last_lady_noted", ":lady"),
            (assign, ":last_suitor_noted", ":suitor"),
            
          (else_try),
            
            (troop_slot_eq, "trp_log_array_entry_type",  ":log_entry", logent_lady_rejected_by_suitor),
            (str_store_string, s12, "str_they_say_that_s11_has_tired_of_pursuing_s9"),
            (assign, ":last_lady_noted", ":lady"),
            (assign, ":last_suitor_noted", ":suitor"),
            
            
          (else_try),
            (troop_slot_eq, "trp_log_array_entry_type",  ":log_entry", logent_lady_father_rejects_suitor),
            (str_store_string, s12, "str_they_say_that_s9s_family_has_forced_her_to_renounce_s11_whom_she_much_loved"),
            (assign, ":last_lady_noted", ":lady"),
            (assign, ":last_suitor_noted", ":suitor"),
            
          (else_try),
            (troop_slot_eq, "trp_log_array_entry_type",  ":log_entry", logent_lady_elopes_with_lord),
            (str_store_string, s12, "str_they_say_that_s9_has_run_away_with_s11_causing_her_family_much_grievance"),
            (assign, ":last_lady_noted", ":lady"),
            (assign, ":last_suitor_noted", ":suitor"),
            
          (else_try),
            (troop_slot_eq, "trp_log_array_entry_type",  ":log_entry", logent_lady_marries_lord),
            (str_store_string, s12, "str_they_say_that_s9_and_s11_have_wed"),
            (assign, ":last_lady_noted", ":lady"),
            (assign, ":last_suitor_noted", ":suitor"),
          (else_try),
            (troop_get_slot, ":suitor", ":lady", slot_lady_last_suitor),
            (is_between, ":suitor", active_npcs_begin, active_npcs_end),
            (str_store_troop_name, s11, ":suitor"),
            
            (str_store_string, s12, "str_they_say_that_s9_was_recently_visited_by_s11_who_knows_where_that_might_lead"),
            (assign, ":last_lady_noted", ":lady"),
            (assign, ":last_suitor_noted", ":suitor"),
            (try_begin),
              (troop_slot_eq, ":lady", slot_troop_met, 2),
              (this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_1, ":lady"),
              (this_or_next|troop_slot_eq, ":suitor", slot_troop_love_interest_2, ":lady"),
              (troop_slot_eq, ":suitor", slot_troop_love_interest_3, ":lady"),
              
              (assign, "$romantic_rival", ":suitor"),
            (try_end),
          (try_end),
          
        (try_end),
        
        (try_begin),
          (neq, ":last_suitor_noted", "$romantic_rival"),
          (assign, "$romantic_rival", -1),
        (try_end),
        
        (try_begin),
          (gt, ":last_lady_noted", 0),
          (call_script, "script_add_rumor_string_to_troop_notes", ":last_lady_noted", ":last_suitor_noted", 12),
        (try_end),
      (else_try),
        (eq, "$lady_selected", -1),
        (str_store_string, s12, "str_there_is_not_much_to_tell_but_it_is_still_early_in_the_season"),
      (else_try),
        (assign, reg4, "$lady_selected"),
        (str_store_troop_name, s9, "$lady_selected"),
        (str_store_string, s12, "str_error_lady_selected_=_s9"),
      (try_end),
    ],
    "{!}{s12}.",
    "minstrel_postgossip", []],
  
  [anyone|plyr, "minstrel_postgossip", [],
    "Very interesting -- but let us speak of something else.",
    "minstrel_pretalk", []],
  
  [anyone|plyr, "minstrel_postgossip", [],
    "Very interesting -- is there any more news?",
    "minstrel_gossip", []],
  
  [anyone|plyr, "minstrel_postgossip", [
      (is_between, "$romantic_rival", active_npcs_begin, active_npcs_end),
      (neg|check_quest_active, "qst_duel_courtship_rival"),
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, kingdom_ladies_begin),
    ],
    "What? I'll have that miscreant face my sword.",
    "minstrel_duel_confirm", []],
  
  [anyone, "minstrel_duel_confirm", [
      (str_store_troop_name, s11, "$romantic_rival"),
    ],
    "Do you mean that? {s11} will be honor-bound to fight you, but challenging a lord to duel over a woman is seen as a bit hotheaded, even in this warlike age.",
    "minstrel_duel_confirm_2", []],
  
  [anyone|plyr, "minstrel_duel_confirm_2", [
      (str_store_troop_name, s11, "$romantic_rival"),
      (str_store_troop_name, s12, "$lady_selected"),
    ],
    "Yes -- I intend to force {s11} to relinquish his suit of {s12}",
    "minstrel_duel_issued", []],
  
  [anyone|plyr, "minstrel_duel_confirm_2", [
    ],
    "No -- I let my passions run away with me, there",
    "minstrel_pretalk", []],
  
  [anyone, "minstrel_duel_issued", [
    ],
    "As you wish. I will spread the word of your intentions, so that {s13} does not try to back out...",
    "minstrel_pretalk", [
      (str_store_troop_name, s11, "$lady_selected"),
      (str_store_troop_name_link, s13, "$romantic_rival"),
      (str_store_string, s2, "str_you_intend_to_challenge_s13_to_force_him_to_relinquish_his_suit_of_s11"),
      (setup_quest_text, "qst_duel_courtship_rival"),
      (call_script, "script_start_quest", "qst_duel_courtship_rival", "$lady_selected"),
      (quest_set_slot, "qst_duel_courtship_rival", slot_quest_giver_troop, "$lady_selected"),
      
      (quest_set_slot, "qst_duel_courtship_rival", slot_quest_target_troop, "$romantic_rival"),
      (quest_set_slot, "qst_duel_courtship_rival", slot_quest_xp_reward, 400),
      (quest_set_slot, "qst_duel_courtship_rival", slot_quest_expiration_days, 60),
      (quest_set_slot, "qst_duel_courtship_rival", slot_quest_current_state, 0),
  ]],
  
  
  
  
  [anyone|plyr, "minstrel_1", [(eq, "$minstrels_introduced", 1)  ],
    "Do you know of any ongoing feasts?",
    "minstrel_courtship_locations", []],
  
  [anyone, "minstrel_courtship_locations", [
      
      (str_clear, s12),
      (assign, ":feast_found", 0),
      (try_for_range, ":kingdom", kingdoms_begin, kingdoms_end),
        (faction_slot_eq, ":kingdom", slot_faction_ai_state, sfai_feast),
        (assign, ":feast_found", 1),
        
        (faction_get_slot, ":feast_venue", ":kingdom", slot_faction_ai_object),
        (str_store_party_name, s4, ":feast_venue"),
        (str_store_faction_name, s3, ":kingdom"),
        
        (store_current_hours, ":hours_since_start"),
        (faction_get_slot, ":feast_time", ":kingdom", slot_faction_last_feast_start_time),
        (val_sub, ":hours_since_start", ":feast_time"),
        
        (try_begin),
          (gt, ":hours_since_start", 48),
          (str_store_string, s12, "str_s12there_is_a_feast_of_the_s3_in_progress_at_s4_but_it_has_been_going_on_for_a_couple_of_days_and_is_about_to_end_"),
        (else_try),
          (gt, ":hours_since_start", 24),
          (str_store_string, s12, "str_s12there_is_a_feast_of_the_s3_in_progress_at_s4_which_should_last_for_at_least_another_day_"),
        (else_try),
          (str_store_string, s12, "str_s12there_is_a_feast_of_the_s3_in_progress_at_s4_which_has_only_just_begun_"),
        (try_end),
      (try_end),
      
      (try_begin),
        (eq, ":feast_found", 0),
        (str_store_string, s12, "str_not_at_this_time_no"),
      (else_try),
        (str_store_string, s12, "str_s12the_great_lords_bring_their_daughters_and_sisters_to_these_occasions_to_see_and_be_seen_so_they_represent_an_excellent_opportunity_to_make_a_ladys_acquaintance"),
      (try_end),
      
    ],
    "{!}{s12}",
    "minstrel_pretalk", []],
  
  [anyone|plyr, "minstrel_1", [],
    "Farewell.", "close_window", []],
  
  [anyone, "minstrel_courtship_questions", [],
    "What do you wish to know?",
    "minstrel_courtship_questions_2", []],
  
  [anyone, "minstrel_courtship_prequestions", [],
    "Can I answer any other questions for you?",
    "minstrel_courtship_questions_2", []],
  
  [anyone|plyr, "minstrel_courtship_questions_2", [
      (eq, "$minstrels_discussed_love", 1),
    ],
    "Is there a place for me in the game of love?",
    "minstrel_player_role", [
      (assign, "$minstrels_discussed_player_role", 1),
  ]],
  
  [anyone|plyr, "minstrel_courtship_questions_2", [
      (eq, "$minstrels_discussed_player_role", 1),
    ],
    "How would a suitor meet a lady?",
    "minstrel_player_advice_meet", [
      (assign, "$minstrels_discussed_meetings", 1),
  ]],
  
  [anyone|plyr, "minstrel_courtship_questions_2", [
      (eq, "$minstrels_discussed_meetings", 1),
    ],
    "Having met a lady, how would the suitor woo her?",
    "minstrel_player_advice_woo", [
  ]],
  
  
  
  [anyone|plyr, "minstrel_courtship_questions_2", [],
    "Tell me about marriage and love among the nobility of the Northlands",
    "minstrel_nobles", [
      (assign, "$minstrels_discussed_love", 1),
  ]],
  
  [anyone, "minstrel_nobles", [],
    "Nobles are an odd lot. In the Northlands, a daughter is a political asset, to be given away to a lord with whom her father wishes to make an alliance. Yet the great families of this land idealize pure love between man and woman, and I have seen many a hardened warrior weep copious tears at the doomed ardour of Gwenhwyfar and Llwch Llenlleawg in the bards' songs -- even as he made plans to break his own daughter's heart.",
    "minstrel_nobles_2", []],
  
  [anyone, "minstrel_nobles_2", [],
    "Fathers differ, of course. Some nobles will let their daughters choose a husband who pleases them. Others, however, feel that to allow their daughters any choice at all would be to diminish their own authority, and insist on imposing a groom whether she likes it or not.",
    "minstrel_nobles_3", []],
  
  [anyone, "minstrel_nobles_3", [], "But the majority will steer a middle course -- they will want to make the final decision about a groom, but will weigh their daughter's preferences heavily. Among other factors, a happy marriage is more likely to produce heirs, so there is still a place for courtship and for the use of skill and passion to win a lady's heart.",
    "minstrel_prequestions", []],
  
  [anyone|plyr, "minstrel_courtship_questions_2", [
      (eq, "$minstrels_discussed_love", 1),
    ],
    "What if a lady and her father disagree about a suitor?",
    "minstrel_daughter_father", []],
  
  [anyone, "minstrel_daughter_father", [], "It happens sometimes that a bride elopes. This is a major blow to the father's prestige, leading to lasting enmities. Indeed, a war may be fought over a woman. Now, that is a fine topic for a song.",
    "minstrel_daughter_father_2", []],
  
  [anyone, "minstrel_daughter_father_2", [], "In the end, however, most brides will submit to their parents' choice. A noblewoman's family is everything to her, and few are brave enough to risk its disapproval for the sake of man she barely knows. She may pine for her lover, but still accept the groom -- and without tragic love, what would we have to sing about?",
    "minstrel_prequestions", []],
  
  
  
  [anyone, "minstrel_player_role", [
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (eq, ":is_female", 0),
    ], "Of course! Lords make a great deal of lineage, but in the end, lands and money speak louder than one's ancestors. Even though you are a foreigner, if you are coming up in the world, then many parents will consider you a fine catch.",
    "minstrel_player_role_2", []],
  
  [anyone, "minstrel_player_role_2", [
    ], "You will have to compete with many other lords of your realm, however, who will have an advantage. They have known these ladies from childhood and have been sized up as grooms by carefully discerning mothers and aunts. Some ladies may be fascinated by the stranger, yet opt for the familiar.",
    "minstrel_player_role_3", []],
  
  [anyone, "minstrel_player_role_3", [
    ], "So know this -- you may have your heart broken. But to enter the arena of love fearing heartbreak is like entering the battlefield fearing the enemy's arrows. Be brave, and shrug off the sting of rejection, and victory may yet be yours.",
    "minstrel_prequestions", []],
  
  
  [anyone, "minstrel_player_role", [
    ], "Lady -- I will speak bluntly. Most of the lords of this land are looking for a demure maiden, whose skin as fair as snow -- and your skin is burnt brown by the sun. They want a maiden whose voice is soft as bells -- and your voice is hoarse from commanding men in battle. Also, although the lords of the Northlands appreciate poems about love, most also want heirs, and few women can ride and fight while with child.",
    "minstrel_female_player_3", []],
  
  
  [anyone, "minstrel_female_player_3", [
    ], "However, not all lords will be so conventionally minded. We poets sing of shield maidens and of huntresses, of women who forged their own path without having sacrificed the chance for love. I would not tell you that it would be easy for you to find a devoted husband who will accept your ways, but I would not say that it is impossible.",
    "minstrel_prequestions", []],
  
  
  [anyone|plyr, "minstrel_courtship_questions_2", [
      (eq, "$minstrels_discussed_love", 1),
    ],
    "What advantage is there in seeking a {reg59?husband:wife}?",
    "minstrel_spouse_benefits", []],
  
  [anyone, "minstrel_spouse_benefits", [
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (eq, ":is_female", 0),
    ],
    "Ah! You are quite the romantic, I see! Well, aside from the obvious benefits of love, companionship and other, em, domestic matters, to marry among the nobility brings great assets. You may forge a strong alliance with the bride's family, and a wife may also assist you in manipulating the politics of the realm to your advantage.",
    "minstrel_wife_benefits_2", []],
  
  [anyone, "minstrel_wife_benefits_2", [
    ],
    "What's more, most of the great families of the Northlands have at some point intermarried with royalty, which would boost your own claim to rule -- should you ever choose to assert it...",
    "minstrel_prequestions", []],
  
  [anyone, "minstrel_spouse_benefits", [
      (troop_get_type, ":is_female", "trp_player"),
      (val_mod, ":is_female", 2),
      (eq, ":is_female", 1),
    ],
    "Ah! You are quite the romantic, I see! Well, aside from the obvious benefits of love, companionship and other, em, domestic matters, to marry among the nobility brings great assets. You may have access to the groom's castles and properties, and be able to work with him to advance both of your standings in the realm.",
    "minstrel_wife_benefits_2", []],
  
  
  
  [anyone, "minstrel_player_advice_meet", [
    ], "Every so often, a king or great lord of the Northlands will hold a feast. In towns, they will often be accompanied by tournaments. In castles, they will be accompanied by hunts. The feasts provide a chance for the lords to repair some of the rivalries that may undermine the strength of the realm. They also provide an opportunity for families to show off their eligible daughters, and ladies will often be allowed to mingle unsupervised with the guests.",
    "minstrel_player_advice_meet_2", []],
  
  [anyone, "minstrel_player_advice_meet_2", [
    ], "If you have the opportunity, you may attempt to pay the lady a compliment. This indicates to her that you are a potential suitor, and she will usually know if she wishes you to continue your suit. Incidentally, if you come to her fresh from having distinguished yourself in the tournament or in the hunt, then you may make a stronger first impression than otherwise.",
    "minstrel_prequestions", []],
  
  
  [anyone, "minstrel_player_advice_woo", [
    ], "To woo a lady takes a certain amount of time and patience, and several meetings spaced over a period of months. A lady who is interested in you will often find ways of letting you know if she wishes you to come visit her. Alternately, you may simply go and ask her father or brother for permission. If you do not have permission from her guardian, it may be possible to arrange an assignation through other means.",
    "minstrel_player_advice_woo_2", []],
  
  [anyone, "minstrel_player_advice_woo_2", [
    ], "Having arranged an assignment, you may then attempt to charm her and win her favor. Perhaps one of the most difficult aspects of this is finding a topic of conversation. Most noblewomen lead a cloistered life, at least until they are married, and thus will have little to say that will interest you. On other hand, she will soon tire of hearing of your own deeds in the outside world.",
    "minstrel_player_advice_woo_3", []],
  
  [anyone, "minstrel_player_advice_woo_3", [
    ], "One time-tested mode of courtship is simply to recite a popular poem, and discuss it. This way, you are both on an equal footing, and neither will have an advantage in knowledge or experience. Of course, different ladies will have different tastes in poetry.",
    "minstrel_player_advice_woo_4", []],
  
  [anyone, "minstrel_player_advice_woo_4", [
    ], "At some point, you will be able to discuss directly the issue of marriage. She will then let you know if you measure up to what she wants in a husband. Some ladies will coolly assess who is the most prestigious of her suitors, while others will be guided by their passions. Some will look to your companions, to see whether you are the kind of husband who will treat her as an equal, while others will follow the lead of their fathers.",
    "minstrel_player_advice_woo_5", []],
  
  [anyone, "minstrel_player_advice_woo_5", [
    ], "At any rate, it is a challenging business -- and do not forget, you may find that your suit prospers with a lady, only to have it falter on a father's political ambitions. So you must ask yourself: are you willing to risk disappointment and heartbreak? Alternately, are you willing to throw away your standing in society, to make enemies of allies, in pursuit of a forbidden love? Because if you are, then perhaps someday we will write poems about you.",
    "minstrel_prequestions", []],
  
  
  [anyone|plyr, "minstrel_courtship_questions_2", [],
    "What is it that you poets and musicians do again?",
    "minstrel_job_description", []],
  
  [anyone, "minstrel_job_description", [],
    "I compose and write songs for the lords of the land, and their ladies. Sometimes I sing about war, sometimes about the virtues of kings, and sometimes, for the more sophisticated audiences, about the virtues of wine. For most audiences, however, I sing of love.", "minstrel_courtship_prequestions", []],
  
  [anyone|plyr, "minstrel_courtship_questions_2", [],
    "No, that is all.",
    "minstrel_pretalk", []],
  
  [anyone, "minstrel_prequestions", [
    ], "Do you have any other questions?",
    "minstrel_courtship_questions_2", []],
  
  [anyone, "minstrel_pretalk", [],
    "Is there anything else?",
    "minstrel_1", []],
  
  
  
  
  
  
  
  
  #Tavern Talk (with farmers)
  [anyone, "start", [(eq, "$talk_context", tc_tavern_talk),
      (eq, "$g_talk_troop", "trp_farmer_from_bandit_village"),
      (neg|check_quest_active, "qst_eliminate_bandits_infesting_village"),
      (neg|check_quest_active, "qst_deal_with_bandits_at_lords_village"),
      (assign, ":end_cond", villages_end),
      (try_for_range, ":cur_village", villages_begin, ":end_cond"),
        (party_slot_eq, ":cur_village", slot_village_bound_center, "$g_encountered_party"),
        (party_slot_ge, ":cur_village", slot_village_infested_by_bandits, 1),
        (str_store_party_name, s1, ":cur_village"),
        (quest_set_slot, "qst_eliminate_bandits_infesting_village", slot_quest_target_center, ":cur_village"),
        (quest_set_slot, "qst_eliminate_bandits_infesting_village", slot_quest_current_state, 0),
        (party_get_slot, ":village_elder", ":cur_village", slot_town_elder),
        (quest_set_slot, "qst_eliminate_bandits_infesting_village", slot_quest_giver_troop, ":village_elder"),
        (quest_set_slot, "qst_eliminate_bandits_infesting_village", slot_quest_giver_center, ":cur_village"),
        (assign, ":end_cond", 0),
      (try_end),
    ],
    "{reg59?My lady:My lord}, you look like a {reg59?lady:man} of the sword and someone who could help us. " +
    "Will you hear my plea?", "farmer_from_bandit_village_1", []],
  
  [anyone|plyr, "farmer_from_bandit_village_1", [],
    "What is the matter, my good man?", "farmer_from_bandit_village_2", []],
  [anyone|plyr, "farmer_from_bandit_village_1", [],
    "What are you babbling about, peasant? Speak up.", "farmer_from_bandit_village_2", []],
  
  [anyone, "farmer_from_bandit_village_2", [],
    "A band of brigands has taken refuge in our village. They take everything we have, force us to serve them, and do us much evil. " +
    "If one of us so much as breathes a word of protest, they kill the poor soul on the spot right away. " +
    "Our lives have become unbearable. I risked my skin and ran away to find someone who can help us.", "farmer_from_bandit_village_3", []],
  [anyone|plyr, "farmer_from_bandit_village_3", [],
    "Why don't you go to the lord of your village? He should take care of the vermin.", "farmer_from_bandit_village_4", []],
  [anyone, "farmer_from_bandit_village_4", [],
    "I did, {reg59?my lady:my lord}, but our lord's men did not let me see him and said he was occupied with more important matters and that we should deal with our own problem ourselves. " +
    "Please {reg59?my lady:my lord}, you look like a {reg59?lady:man} of valor and a fearsome warrior, and you have no doubt many friends and soldiers at your service. " +
    "If there is anyone who can help us, it's you.", "farmer_from_bandit_village_5", [(assign, "$temp", 0)]],
  [anyone|plyr, "farmer_from_bandit_village_5", [],
    "Very well, I'll help you. Where is this village?", "farmer_from_bandit_village_accepted", []],
  [anyone|plyr, "farmer_from_bandit_village_5", [],
    "I can't be bothered with this right now.", "farmer_from_bandit_village_denied", []],
  [anyone|plyr, "farmer_from_bandit_village_5", [(eq, "$temp", 0)],
    "Why would I fight these bandits? What's in it for me?", "farmer_from_bandit_village_barter", []],
  
  
  [anyone, "farmer_from_bandit_village_accepted", [],
    "God bless you, {reg59?lady:lord}. Our village is {s7}. It is not too far from here.", "close_window",
    [(quest_get_slot, ":target_center", "qst_eliminate_bandits_infesting_village", slot_quest_target_center),
      (str_store_party_name_link,s7,":target_center"),
      (setup_quest_text, "qst_eliminate_bandits_infesting_village"),
      (str_store_string, s2, "@A villager from {s7} begged you to save their village from the bandits that took refuge there."),
      (call_script, "script_start_quest", "qst_eliminate_bandits_infesting_village", "$g_talk_troop"),
  ]],
  
  [anyone, "farmer_from_bandit_village_denied", [],"As you say, {reg59?my lady:my lord}. Forgive me for bothering you.", "close_window", []],
  
  [anyone, "farmer_from_bandit_village_barter", [],
    "We are but poor farmers, {reg59?my lady:my lord}, and the bandits have already taken most of what we had in this world, " +
    "but we'll be glad to share with you whatever we have left, " +
    "and we'll always be in gratitude to you if you help us.", "farmer_from_bandit_village_5", [(assign, "$temp", 1)]],
  
  [anyone, "start", [(eq, "$talk_context", tc_tavern_talk),
      (eq, "$g_talk_troop", "trp_farmer_from_bandit_village"),
      (check_quest_active, "qst_eliminate_bandits_infesting_village"),
    ],
    "Thank you for helping us, {reg59?my lady:my lord}. Crush those bandits!", "close_window", []],
  
  
  
  #Tavern Talk (with troops)
  
  [anyone, "start", [
      (eq, "$talk_context", tc_tavern_talk),
      (neg|troop_is_hero, "$g_talk_troop"),
      (neg|is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      (party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type),
      (party_get_slot, ":mercenary_amount", "$g_encountered_party", slot_center_mercenary_troop_amount),
      (gt, ":mercenary_amount", 0),
      (store_sub, reg3, ":mercenary_amount", 1),
      (store_sub, reg4, reg3, 1),
      (call_script, "script_game_get_join_cost", ":mercenary_troop"),
      (assign, ":join_cost", reg0),
      (store_mul, reg5, ":mercenary_amount", reg0),
      (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
      (val_min, ":mercenary_amount", ":free_capacity"),
      (store_troop_gold, ":cur_gold", "trp_player"),
      (try_begin),
        (gt, ":join_cost", 0),
        (val_div, ":cur_gold", ":join_cost"),
        (val_min, ":mercenary_amount", ":cur_gold"),
      (try_end),
      (assign, "$temp", ":mercenary_amount"),
      (str_clear, s4),
      (str_clear, s11),
      (str_clear, s12),
      (str_clear, s13),
    ],
    "{!}{s4}", "mercenary_tavern_talk01", [
      (str_store_string, s11, "@Hey, what do you want? We're drinking."),
      (str_store_string, s12, "@Are you looking for men who are willing to risk their skin for glory and wealth?"),
      (str_store_string, s13, "@There is food and drink for all. Do you want to join in?"),
      (store_random_in_range, ":random", 11, 14),
      (str_store_string_reg, s4, ":random"),
  ]],
  
  [anyone|plyr, "mercenary_tavern_talk01", [],
    "You seem somebody strong and accustomed to hard life. I am interested in recruiting you.", "mercenary_tavern_talk02", []],
  
  [anyone|plyr, "mercenary_tavern_talk01", [],
    "Sorry, I did not mean to bother you. Farewell.", "close_window", []],
  
  
  [anyone, "mercenary_tavern_talk02", [
      (store_character_level,":talk_troop_level","$g_talk_troop"),
      #  (is_between, "$g_talk_troop", "trp_mercenary_swordsman", "trp_mercenaries_end"),
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (ge, ":talk_troop_level", 26),
      (le, ":player_renown", 150),
    ],
    "Don't you see I am busy? I do not have time or inclination to join you.^^(You need 150 renown to recruit high-level troops).", "close_window", [
  ]],
  
  [anyone, "mercenary_tavern_talk02", [
      (eq, "$talk_context", tc_tavern_talk),
      (neg|troop_is_hero, "$g_talk_troop"),
      (neg|is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      (party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type),
      (party_get_slot, ":mercenary_amount", "$g_encountered_party", slot_center_mercenary_troop_amount),
      (gt, ":mercenary_amount", 0),
      (store_sub, reg3, ":mercenary_amount", 1),
      (store_sub, reg4, reg3, 1),
      (call_script, "script_game_get_join_cost", ":mercenary_troop"),
      (assign, ":join_cost", reg0),
      (store_mul, reg5, ":mercenary_amount", reg0),
      (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
      (val_min, ":mercenary_amount", ":free_capacity"),
      (store_troop_gold, ":cur_gold", "trp_player"),
      (try_begin),
        (gt, ":join_cost", 0),
        (val_div, ":cur_gold", ":join_cost"),
        (val_min, ":mercenary_amount", ":cur_gold"),
      (try_end),
      (assign, "$temp", ":mercenary_amount"),
    ],
    "We are traveling through these lands, but we might consider staying if you hire us, {reg59?madam:sir}. " +
    "{reg3?Me and {reg4?{reg3} of my mates:one of my mates}:I} will join you for " +
    "{reg5} peningas.", "mercenary_tavern_talk", []],
  
  
  
  [anyone, "start", [
      (eq, "$talk_context", tc_tavern_talk),
    ],
    "Any orders, {reg59?madam:sir}?", "mercenary_after_recruited", []],
  
  [anyone|plyr, "mercenary_after_recruited", [],
    "Make your preparations. We'll be moving at dawn.", "mercenary_after_recruited_2", []],
  [anyone|plyr, "mercenary_after_recruited", [],
    "Take your time. We'll be staying in this town for a while.", "mercenary_after_recruited_2", []],
  
  [anyone, "mercenary_after_recruited_2", [], "Yes {reg59?madam:sir}. We'll be ready when you tell us to leave.", "close_window", []],
  
  [anyone|plyr, "mercenary_tavern_talk", [(party_get_slot, ":mercenary_amount", "$g_encountered_party", slot_center_mercenary_troop_amount),
      (eq, ":mercenary_amount", "$temp"),
      (party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type),
      (call_script, "script_game_get_join_cost", ":mercenary_troop"),
      (store_mul, reg5, "$temp", reg0),
    ],
    "All right, I will hire you. Here are {reg5} peningas.", "mercenary_tavern_talk_hire", []],
  
  [anyone|plyr, "mercenary_tavern_talk", [(party_get_slot, ":mercenary_amount", "$g_encountered_party", slot_center_mercenary_troop_amount),
      (lt, "$temp", ":mercenary_amount"),
      (gt, "$temp", 0),
      (assign, reg6, "$temp"),
      (party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type),
      (call_script, "script_game_get_join_cost", ":mercenary_troop"),
      (store_mul, reg5, "$temp", reg0),
    ],
    "All right, but I can only hire {reg6} of you. Here are {reg5} peningas.", "mercenary_tavern_talk_hire", []],
  
  
  [anyone, "mercenary_tavern_talk_hire", [(store_random_in_range, ":rand", 0, 4),
      (try_begin),
        (eq, ":rand", 0),
        (gt, "$temp", 1),
        (str_store_string, s17,
        "@You chose well, {reg59?madam:sir}. My lads know how to keep their word and earn their pay."),
      (else_try),
        (eq, ":rand", 1),
        (str_store_string, s17,
        "@Well done, {reg59?madam:sir}. Keep the money and wine coming our way, and there's no foe in the world you need fear."),
      (else_try),
        (eq, ":rand", 2),
        (str_store_string, s17,
        "@We are at your service, {reg59?madam:sir}. Point us in the direction of those who need hurting, and we'll do the rest."),
      (else_try),
        (str_store_string, s17,
        "str_you_will_not_be_disappointed_sirmadam_you_will_not_find_better_warriors_in_all_calradia"),
      (try_end),],
    "{!}{s17}", "close_window", [
      (party_get_slot, ":mercenary_troop", "$g_encountered_party", slot_center_mercenary_troop_type),
      (call_script, "script_game_get_join_cost", ":mercenary_troop"),
      (store_mul, ":total_cost", "$temp", reg0),
      (troop_remove_gold, "trp_player", ":total_cost"),
      (party_add_members, "p_main_party", ":mercenary_troop", "$temp"),
      (party_set_slot, "$g_encountered_party", slot_center_mercenary_troop_amount, 0),
  ]],
  
  [anyone|plyr, "mercenary_tavern_talk", [(eq, "$temp", 0),
      (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
      (ge, ":free_capacity", 1)],
    "That sounds good, but I can't afford to hire any more men right now.", "tavern_mercenary_cant_lead", []],
  
  [anyone, "tavern_mercenary_cant_lead", [], "That's a pity. Well, {reg3?we will:I will} be lingering around here for a while, " +
    "if you need to hire anyone.", "close_window", []],
  
  [anyone|plyr, "mercenary_tavern_talk", [(eq, "$temp", 0),
      (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
      (eq, ":free_capacity", 0)],
    "That sounds good, but I can't lead any more men right now.", "tavern_mercenary_cant_lead", []],
  
  
  [anyone|plyr, "mercenary_tavern_talk", [],
    "Sorry. I don't need any other men right now.", "close_window", []],
  ###roman ruins refugiados
  [anyone,"start", [(is_between, "$g_talk_troop", dungeon_prisoners_begin, dungeon_prisoners_end),
    ],
    "Be careful! I won't move until it's all over.", "dungeon_reply1",
    [
  ]],
  
  [anyone|plyr,"dungeon_reply1", [],
    "I will kill all the bandits, and you will be free.", "dungeon_reply2",
    [    (call_script, "script_change_player_honor", 5), #chief cambiado
  ]],#take prisoner
  
  [anyone,"dungeon_reply2", [],
    "Thank you, good {reg59?lady:sire}. I will never forget this!", "close_window",
    [
  ]],
  #roman ruins acaba chief
  
  
  ###main quest trainer in ship begin chief
  
  [anyone,"start", [(store_current_scene,":current_scene"),
      (eq,":current_scene","scn_mainquest_1ship"),
      (eq, "$mainquest_barco", 1),
      (eq, "$g_talk_troop", "trp_trainer_1"),
      #  (is_between, "$g_talk_troop", training_gound_trainers_begin, training_gound_trainers_end),
      #(eq, "$g_talk_troop_met", 0)
    ],
    "Good day to you, {reg59?lass:lad}. The captain hired me to protect his ship. Here, on matters of defense, my word is the law.", "trainer_intro_11",[]],
  
  [anyone|plyr, "trainer_intro_11", [(eq, "$hablo_bodo", 1),],
    "I see. You must be the veteran. Can I learn about fighting from you?", "trainer_intro_21", []],
  
  [anyone|plyr, "trainer_intro_11", [],
    "Nice to meet you. I will be back later.", "close_window", []],
  
  [anyone,"trainer_intro_21", [],
    "Indeed, you can. I don't have anything better to do while we aren't in combat! I can find you some opponents to practice with if you like. Or if you have any questions about theory of combat, feel free to ask.", "trainer_intro_31",[]],
  
  [anyone|plyr, "trainer_intro_31", [],
    "As a matter of fact, I do have a few questions.", "trainer_intro_41a", []],
  [anyone|plyr, "trainer_intro_31", [],
    "Actually, I can move on to practice.", "trainer_intro_41b", []],
  
  [anyone, "trainer_intro_41a", [],
    "Well, ask anything you like.", "trainer_talk_combat1", []],
  [anyone, "trainer_intro_41b", [],
    "Good. It's good to find someone eager for practice. Let's see what you will do.", "trainer_practice_11", []],
  
  [anyone,"start", [(eq, "$mainquest_barco", 1),
      (eq, "$g_talk_troop", "trp_trainer_1"),
      (neq,"$waiting_for_training_fight_result", 0),
      (neq,"$training_fight_won", 0)],
    "That was a good fight. ", "trainer_practice_11",
    [
      (assign,"$waiting_for_training_fight_result",0),
  ]],
  [anyone,"start", [(eq, "$mainquest_barco", 1),
      (eq, "$g_talk_troop", "trp_trainer_1"),
      (neq, "$waiting_for_training_fight_result", 0)],
    "Ha! Looks like you've developed a bit of a limp there. Don't worry. Even losses have their value, provided you learn from them. Shake the stars out of your eyes and get back in there. There's no other way to win.", "trainer_practice_11",
    [(assign,"$num_opponents_to_beat_in_a_row",3),(assign,"$waiting_for_training_fight_result",0)]],
  
  [anyone,"start", [(eq, "$mainquest_barco", 1),
      (eq, "$g_talk_troop", "trp_trainer_1"),],
    "Good day. Ready for some training today?", "trainer_talk2",[]],
  
  [anyone,"trainer_pretalk2", [(eq, "$mainquest_barco", 1),],
    "Well, are you ready for some training?", "trainer_talk2",[]],
  
  [anyone|plyr,"trainer_talk2", [(eq, "$hablo_bodo", 1),],
    "I am ready for some practice.", "trainer_practice_11",[]],
  
  [anyone|plyr,"trainer_talk2", [(eq, "$hablo_bodo", 1),],
    "First, tell me something about combat...", "trainer_combat_begin1",[]],
  
  [anyone|plyr,"trainer_talk2", [],
    "I need to leave now. Farewell.", "close_window",[]],
  
  
  [anyone,"trainer_combat_begin1", [],
    "What do you want to know?", "trainer_talk_combat1",[]],
  [anyone,"trainer_combat_pretalk", [(eq, "$mainquest_barco", 1),],
    "What else do you want to know?", "trainer_talk_combat1",[]],
  
  [anyone|plyr,"trainer_talk_combat1", [], "Tell me about combat.", "trainer_explain_combat",[]],
  [anyone|plyr,"trainer_talk_combat1", [], "I guess I know all theory I need. Let's talk about something else.", "trainer_pretalk2",[]],
  
  [anyone,"trainer_explain_combat", [], "Good question. The first thing you should know as a fighter is how to defend yourself. " +
    "Keeping yourself out of harm's way is the first rule of combat, and it is much more important than giving harm to others. " +
    "Everybody can swing a sword around and hope to cut some flesh, but only those fighters that are experts at defense live to tell of it.",
    "trainer_explain_combat_2",[]],
  [anyone,"trainer_explain_combat_2", [], "Now. Defending yourself is easiest if you are equipped with a shield. " +
    "Just block with your shield. [Hold down the right mouse button to defend yourself with the shield.] In this state, you will be able to deflect all attacks that come from your front. However, you will still be open to strikes from your sides or your back.", "trainer_explain_combat_3",[]],
  [anyone|plyr,"trainer_explain_combat_3", [], "What if I don't have a shield?", "trainer_explain_combat_4",[]],
  [anyone,"trainer_explain_combat_4", [], "Then you will have to use your weapon to block your opponent. " +
    "This is a bit more difficult than defending with a shield. " +
    "Defending with a weapon, you can block against only ONE attack direction. " +
    "That is, you block against either overhead swings, side swings or thrusts. " +
    "Therefore, you must watch your opponent carefully and start to block AFTER he starts his attack. " +
    "In this way, you will be able to block against the direction of his current attack. " +
    "If you start to block BEFORE he makes his move, he may just attack in another direction than the one you are blocking against and score a hit.", "trainer_explain_combat_5",[]],
  [anyone,"trainer_explain_combat_5", [], "Finally, Attacking is the best defence, they say. " +
    "A tactic many fighters find useful is taking an offensive stance and readying your weapon for attack, waiting for the right moment for swinging it. " +
    "[You can ready your weapon for attack by pressing and holding down the left mouse button.]", "trainer_explain_combat_6",[]],
  [anyone|plyr,"trainer_explain_combat_6", [], "That sounds useful.", "trainer_explain_combat_7",[]],
  [anyone,"trainer_explain_combat_7", [], "It is a good tactic, but remember that, your opponent may see that and take a defensive stance against the direction you are swinging your weapon. " +
    "If that happens, you must break your attack and quickly attack from another direction " +
    "[You may cancel your current attack by quickly tapping the right mouse button].", "trainer_explain_combat_8",[]],
  [anyone|plyr,"trainer_explain_combat_8", [], "If my opponent is defending against the direction I am attacking from, I will break and use another direction.", "trainer_explain_combat_9",[]],
  [anyone,"trainer_explain_combat_9", [], "Yes, selecting the direction you swing your weapon is a crucial skill. " +
    "There are four main directions you may use: right swing, left swing, overhead swing and thrust. You must use each one wisely. " +
    "[To control your swing direction with default controls, move your mouse in the direction you want to swing from as you press the left mouse button].", "trainer_pretalk2",[]],
  
  [anyone,"trainer_practice_11", [(eq,"$training_system_explained", 0)],
    "If I may say so, I see great warrior in you. " +
    "^^Some sailors have been idle since we stopped. Let's see if one of them could help us.", "trainer_practice_11",
    [
      (assign, "$novicemaster_opponent_troop", "trp_regular_sailors"),
      (assign, "$training_system_explained", 1),
  ]],
  [anyone,"trainer_practice_11",
    [
      (str_store_troop_name, s9, "$novicemaster_opponent_troop"),
    ],
    "A sailor will fight you. Are you ready?", "novicemaster_are_you_ready1",
    []],
  [anyone|plyr,"novicemaster_are_you_ready1", [], "Yes I am.", "novicemaster_ready_to_fight1",[]],
  [anyone,"novicemaster_ready_to_fight1", [], "Here you go then. Good luck.", "close_window",
    [
      (assign, "$training_fight_won", 0),
      (assign, "$waiting_for_training_fight_result", 1),
      (modify_visitors_at_site,"scn_mainquest_1ship"),
      (reset_visitors),
      
      #(set_visitor, 40, "$novicemaster_opponent_troop"),
      #(set_visitor, 35, "$g_talk_troop"),
      
      (assign, reg0, 0),
      (assign, reg1, 1),
      # (assign, reg2, 2),
      # (assign, reg3, 3),
      (shuffle_range, 0, 2),
      (set_visitor, reg1, "trp_player"),
      (set_visitor, reg0, "$novicemaster_opponent_troop"),
      (set_visitor, 4, "$g_talk_troop"),
      
      ##             (try_for_range, ":visiterator", 10, 15),
      (set_visitor, 4, "trp_sailors",),
      (set_visitor, 4, "trp_sailors",),
      (set_visitor, 4, "trp_sailors",),
      (set_visitor, 4, "trp_sailors",),
      ##               (try_end),
      
      
      
      (set_visitor,4,"trp_mercenary_arqueros"),
      (set_visitor,4,"trp_mercenary_arqueros"),
      
      (set_visitor,4,"trp_bodo_falso"), #futuro companero viaja en el barco.
      (set_visitor,4,"trp_your_tutorialwife"),	#???????
      (set_visitor,4,"trp_frisianship_merchant"),
      
      (set_jump_mission, "mt_mainquest_trainer_training"),
      (jump_to_scene, "scn_mainquest_1ship"),
  ]],
  
  [anyone|plyr,"novicemaster_are_you_ready1", [], "Just a moment. I am not ready yet.", "novicemaster_not_ready1",[]],
  [anyone,"novicemaster_not_ready1", [], "Hey, you will never make it if you don't practice.", "close_window",[]],
  
  ###bodo primera conversacion sven lair
  [trp_peasant_woman,"start", [(check_quest_active,"qst_sven_lair"),],
    "Please, kind {reg59?madame:sir}, help us! I don't want to be a slave!", "close_window",[]],
  
  [trp_bodo_falso,"start", [(check_quest_active,"qst_sven_lair"),],
    "Hi {playername}. Glad to see you are alive. I thought you were killed when Sven Bull Neck's men attacked us. I was not so lucky, as you can see.", "bodo_prisoner_sl",[]],
  [anyone|plyr, "bodo_prisoner_sl", [],
    "Bodo! What? Where is my mother? And who are these women?", "bodo_prisoner_s2", []],
  [anyone|plyr, "bodo_prisoner_sl", [],
    "Let me get you out of here, my friend, and then we'll talk.", "close_window", []],
  [anyone,"bodo_prisoner_s2", [],
    "We can't talk here; there are too many ears listening. Get me out of here, and I will tell you everything.", "close_window",[]],
  [trp_peasant_woman,"start", [(check_quest_active,"qst_sven_lair"),],
    "Please, kind {reg59?madame:sir}, help us. I don't want to be a slave.", "close_window",[]],
  #quest inicial
  [trp_bodo_falso,"start", [(eq, "$hablo_bodo", 0),],
    "Good day, {playername}. It is good to see that you are well. You were giving us a fright, talking in your sleep. I'd hate to be the one troubled by such dreams...", "bodo_merchant_1",[]],
  
  [anyone|plyr, "bodo_merchant_1", [],
    "I'm fine, thank you. No one has need to worry.", "bodo_merchant_2", []],
  
  [anyone|plyr, "bodo_merchant_1", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@Oh... well... I do not know ... I'm probably fine. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@Even bad dreams speak to us. I like to listen. Perhaps learn something. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Yes, I had a nightmare, but now I'm awake. All that matters is what's ahead. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@All is well. Believe me, it was just a stupid nightmare! (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "bodo_merchant_22",[(str_clear, s10),]],
  
  [anyone|plyr, "bodo_merchant_1", [],
    "Well, I can't see how my affairs are anyone else's business!", "bodo_merchant_21", []],
  
  [anyone,"bodo_merchant_2", [],
    "Perhaps not. At any rate, it's good to see you up and about, friend.", "bodo_merchant_3",[]],
  
  [anyone,"bodo_merchant_22", [       (str_clear, s2),
    ],
    "{!}{s2}", "bodo_merchant_3",[
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s2, "@No need to get shy! At any rate, it's good to see you up and about, friend."),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s2, "@I prefer not to dream. They bring too many memories and longings. Well, it's good to see you up and about, friend."),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s2, "@Yes, we are finally near Friese. There, after all these days, we will part, for my journey continues on towards West Seaxe. For now, it's good to see you up and about, friend."),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s2, "@I agree completely. Fortunately, I usually do not remember my dreams when I wake. Well, it's good to see you up and about, friend."),
      (try_end),
  ]],
  
  
  [anyone,"bodo_merchant_21", [],
    "No need to get angry! I was just speaking as a friend. It's just good to see you up and about.", "bodo_merchant_3",[]],
  
  [anyone|plyr, "bodo_merchant_3", [],
    "Remind me who you are. To tell the truth, my mind is still a little foggy.", "bodo_merchant_4a", []],
  [anyone|plyr, "bodo_merchant_3", [],
    "Thanks! Now I'm going to help check out those ships. Farewell for now.", "close_window", [(assign, "$hablo_bodo", 1),]],
  
  [anyone, "bodo_merchant_4a", [],
    "Why, I am Bodo. I hail from Cantabria, in the Kingdom of Asturias, in the north of the land that the Romans called Hispania. We've become well acquainted on this voyage.", "bodo_merchant_5", []],	#MOTO original string too long and appeared in text too small to read # question, Moto, this is NPC text, it should have more space, it isnt player. Where is the problem?
  
  [anyone|plyr,"bodo_merchant_5", [], "Then I know you've told me your story, but I'd like to hear it again.", "bodo_merchant_6",[]],
  [anyone|plyr, "bodo_merchant_5", [],
    "Oh, that's right... Bodo. Well, I go now to help check out those ships. Farewell for now.", "close_window", [(assign, "$hablo_bodo", 1),]],
  
  [anyone, "bodo_merchant_6", [],
    "Perhaps some other time. I think right now I want to keep an eye on the horizon. I'm not as convinced as the captain that stopping here is a good idea.", "bodo_merchant_7", []],
  
  [trp_bodo_falso,"start", [     (eq, "$hablo_bodo", 1),],
    "I thought I saw something a minute ago, but the mist over these waters plays tricks on the eyes... Probably nothing. I hope it's nothing. This ship's fast enough, but can't outrun a warship.", "close_window",[]],
  
  [anyone|plyr,"bodo_merchant_7", [],
    "I'm worried as well. I'm glad you are watching, my friend.", "bodo_merchant_8",[]],
  
  [anyone|plyr,"bodo_merchant_7", [],
    "What could be the harm of it? But to speed things along, I will help check out those ships.", "close_window",[(assign, "$hablo_bodo", 1),]],
  
  [anyone,"bodo_merchant_8", [],
    "And I'm glad to do it for you. We've become such good friends on this trip, I'm sorry we will soon part. If we meet again in the future and you need my help, you have it, my friend.", "close_window",[(assign, "$hablo_bodo", 1),]],
  
  #esposa  marido
  [trp_your_tutorialwife,"start", [       (str_clear, s2),
    ],
    "{s2}^^My {reg59?daughter:son}, it is such a nice day! The sea is so bright! It is truly a pity to have all these shipwrecks spoil the scene!", "esposabarco_1",[
      (str_store_string, s2, "@--She has aged several years since her illness began. She's so frail that she looks like she would break if you touched her. This is not the woman you know; just a vague memory of her, but she's still your mother.--", color_good_news),
  ]],
  
  [anyone|plyr, "esposabarco_1", [],
    "Yes, Mother. I'm glad you are well today.", "esposabarco_12", []],
  
  [anyone|plyr, "esposabarco_1", [],
    "You remember me? That's wonderful!", "esposabarco_11", []],
  
  [anyone|plyr, "esposabarco_1", [],
    "I will see you later, Mother.", "close_window", []],
  
  [anyone,"esposabarco_12", [       (str_clear, s2),
    ],
    "{s2}^^Not only well but happy! I'm glad we made this trip, but we must remember to be home to make dinner! Your father will expect it.", "esposabarco_13",[
      (str_store_string, s2, "@--She smiles and looks at you with love--", color_good_news),
  ]],
  
  [anyone,"esposabarco_11", [       (str_clear, s2),
    ],
    "{s2}^^You are my baby. I am your mother. Why would I or Father forget you?", "esposabarco_13",[
      (str_store_string, s2, "@--She looks past you--", color_good_news),
  ]],
  
  [anyone|plyr, "esposabarco_13", [],
    "But... Father is dead.", "esposabarco_14", []],
  [anyone|plyr, "esposabarco_13", [],
    "Mother, we are going home right now. I love you.", "close_window", []],
  
  [anyone, "esposabarco_14", [       (str_clear, s2),
    ],
    "{s2}^^But... But... We aren't on a trip near home, are we? My head hurts so much, I don't remember where home is! I know who you are, but I don't remember your name. Am I crazy?", "esposabarco_15", [
      (str_store_string, s2, "@--She opens her eyes, looks at you. Her hands shake--", color_good_news),
  ]],
  
  [anyone|plyr,"esposabarco_15", [], "No, you've only forgotten a few things.", "esposabarco_16",[]],
  [anyone|plyr,"esposabarco_15", [], "No, you're just sick. But soon we will see someone that will make you better.", "esposabarco_17",[]],
  [anyone|plyr, "esposabarco_15", [], "Yes, but we're getting help for you. Farewell, then, for the moment.", "close_window", []],
  
  [anyone, "esposabarco_16", [       (str_clear, s2),
    ],
    "{s2}^^Oh dear. I think I need a moment alone. Please go.", "close_window", [
      (str_store_string, s2, "@--She shifts her gaze to the sea. She is crying.--", color_good_news),
  ]],
  
  [anyone, "esposabarco_17", [       (str_clear, s2),
    ],
    "{s2}^^I am not so sure that anybody can heal this, my {reg59?daughter:son}.", "esposabarco_18", [
      (str_store_string, s2, "@--She shifts her gaze to the sea. She is crying.--", color_good_news),
  ]],
  
  [anyone|plyr,"esposabarco_18", [],
    "We are almost there! Please don't give up now. We'll talk more later.", "close_window",[]],
  
  #sailors of Frisa beach
  [trp_regular_sailors,"start",
    [
      (store_current_scene, ":cur_scene"),
      (eq, ":cur_scene", "scn_frisa_beach"),
    ],
    "I'd like to chat, but I must complete my chores now.", "close_window",[]],
  
  #sailors
  [trp_sailors,"start", [],
    "Ic grete thee, {playername}. I'd like to chat, but I must complete my chores now. We will talk later.", "sailors_merchant_1",[]],
  
  [anyone|plyr, "sailors_merchant_1", [],
    "Very well. We will talk tonight at the anchorage.", "close_window", []],
  #arqueros
  #readingum
  [trp_mercenary_arqueros,"start", [(check_quest_active,"qst_svenbn_final"),],
    "[Enemy lookouts watch you closely from the walls of Readingum.]", "close_window",[]],
  #initial quest
  [trp_mercenary_arqueros,"start", [],
    "Talk to the boss, {playername}, that veteran in the prow of the boat over there. He's the one that can best train you in fighting.", "arquerosb_merchant_1",[]],
  
  [anyone|plyr, "arquerosb_merchant_1", [],
    "Thanks, I will do that.", "close_window", []],
  
  ###capitan del barco dialogos
  [trp_frisianship_merchant,"start", [(eq, "$first_encuentro", 0),],
    "West thu hal, {playername}. Are you well today? You were moving violently in your sleep and saying incomprehensible things. My sailors thought you were being tormented by a spirit.", "frisianship_merchant_1",[]],
  
  [anyone|plyr, "frisianship_merchant_1", [],
    "Where am I? What is this place?", "frisianship_merchant_2", []],
  
  [anyone,"frisianship_merchant_2", [],
    "Oh, this is bad. You don't remember anything? My name is Avo, leof. I am the captain of this ship, the Woden Ric. You embarked with us in Friese some weeks ago, paying well for us to take you on.", "frisianship_merchant_3",[]],
  
  [anyone|plyr, "frisianship_merchant_3", [],
    "Yes, yes, I remember now.", "frisianship_merchant_4a", []],
  [anyone|plyr, "frisianship_merchant_3", [],
    "Oh, it's coming back to me now, but perhaps you can remind me why am I here?", "frisianship_merchant_4b", []],
  
  [anyone, "frisianship_merchant_4a", [],
    "Well, don't worry. These things happen to everyone.", "frisianship_merchant_5", []],
  [anyone, "frisianship_merchant_4b", [],
    "Now I'm really starting to worry about you. I don't know the details, but do know that you worry for your mother. She is sick, and you were taking her to a priest of great healing ability in the Frisian port where we are going.", "frisianship_merchant_5", []],
  
  [anyone|plyr,"frisianship_merchant_5", [], "Thanks! But it's light out. Shouldn't we be under full sail? The boat is not moving! What is happening? Why have we stopped?", "frisianship_merchant_6",[]],
  
  [trp_frisianship_merchant,"start", [     (eq, "$first_encuentro", 1),],
    "May we talk later, {reg59?madame:sir}? I need to give some orders to my men.", "close_window",[]],
  
  [trp_frisianship_merchant,"start", [     (eq, "$first_encuentro", 2),],
    "Good day. We are ready to cast off. Are you ready?", "frisianship_merchant_talk",[]],
  
  [anyone|plyr,"frisianship_merchant_talk", [],
    "I am ready. Please, let us continue our voyage.", "frisianship_merchant_1x",[
  ]],
  
  [anyone|plyr,"frisianship_merchant_talk", [],
    "No, I need to do something before we leave.", "close_window",[]],
  
  [anyone,"frisianship_merchant_1x", [       (str_clear, s2),
    ], "{s2}^^We've been together on this voyage some time. Would you like to try the rudder? She steers very nimbly for a merchantman.", "frisianship_merchant_2x",
    [
      (str_store_string, s2, "@--He smiles and shows you the rudder.--", color_bad_news),
  ]],
  
  [anyone|plyr,"frisianship_merchant_2x", [],
    "Why, I've been wondering when you'd ask!", "close_window",[ (assign, "$mainquestbarco_5_state", 5),]],
  
  [anyone|plyr,"frisianship_merchant_2x", [],
    "No. Believe me, I think you'd want me to touch it only a last resort!", "close_window",[
      (assign, "$mainquestbarco_5_state", 5),]],
  
  [anyone,"frisianship_merchant_6", [],
    "We found a bit of wreckage, some half-sunken ships. Looks like there was a fight here recently. " +
    "I have my men checking out the situation and looking for survivors. Poor bastards wouldn't have had a chance against Viking long ships. We'll be on our way soon enough, though.", "frisianship_merchant_7",
    [
  ]],
  
  [anyone|plyr,"frisianship_merchant_7", [], "Oh. Could we hurry it along? Whoever sunk those ships might still be nearby.", "frisianship_merchant_8",[]],
  [anyone|plyr,"frisianship_merchant_7", [], "Well, finally a bit of excitement! I think I'll go and help them.", "close_window",[ (assign, "$first_encuentro", 1), ]],
  
  
  [anyone,"frisianship_merchant_8", [       (str_clear, s2),
    ], "{s2}^^Relax, {reg59?woman:man}. Your friend, Bodo, insisted on keeping watch. I doubt that fellow ever misses a thing!", "frisianship_merchant_9",
    [
      (str_store_string, s2, "@--He stares at you for a second, then lets out a chuckle.--", color_bad_news),
  ]],
  
  [anyone|plyr,"frisianship_merchant_9", [], "Bodo? Yes. Well, I'm still worried.", "frisianship_merchant_10",[]],
  [anyone|plyr,"frisianship_merchant_9", [], "I sure hope you know what you're doing.", "frisianship_merchant_11",[]],
  
  [anyone,"frisianship_merchant_10", [       (str_clear, s2),
      ], "{s2}^^If you had been on one of those ships instead of this one, you'd want us to stop, now wouldn't you? It's the law of the sea -- especially this sea.", "close_window",[
      (str_store_string, s2, "@--He nods.--", color_good_news),
      (assign, "$first_encuentro", 1),
  ]],
  
  [anyone,"frisianship_merchant_11", [], "Be assured, I do, {reg59?madame:sir}. Now let me tend to this matter, or we'll be delayed even longer.", "close_window",[
      (assign, "$first_encuentro", 1),
  ]],
  
  ###dialogo de lucha en barco
  #[trp_frisianship_merchant,"start", [(eq, "$first_encuentro", 5),],
  [trp_frisianship_merchant,"start", [(eq, "$first_encuentro", -5),],	#Phaiak: Sorry, I know it is a stupid solution
    "Oh, Woden, we're in trouble!", "frisianship_mer_1",[]],
  
  [trp_frisianship_merchant,"start", [],#VC-2913
    "May we talk later, {reg59?madame:sir}? I need to give some orders to my men.", "close_window",[]],
  
  [anyone|plyr, "frisianship_mer_1", [],
    "What's happened?", "frisianship_mer_2", []],
  
  [anyone,"frisianship_mer_2", [],
    "Shh! Keep quiet. Listen, we're in danger. As we were watching your fight, two long ships arrived. Now I can see the banner. It's Sven Bull-Neck. " +
    "Ah, dammit! You'd better pray to whatever gods you worship. Hell, you may as well pray to those you don't! Won't matter at all if he catches us.", "frisianship_mer_3",[]],
  
  [anyone|plyr, "frisianship_mer_3", [],
    "I knew this would happen! We should not have stopped.", "frisianship_mer_4c", []],
  [anyone|plyr, "frisianship_mer_3", [],
    "Calm down, man! Tell me: who's Sven?", "frisianship_mer_4b", []],
  [anyone|plyr, "frisianship_mer_3", [],
    "This is terrible news! What shall we do?", "frisianship_mer_4c", []],
  
  [anyone,"frisianship_mer_4b", [],
    "You've not heard of him? Sven's a Viking. Worse, a Viking's Viking. He burns villages and sinks ships and enslaves or kills everyone in them. Everyone! " +
    "But it's worst for the one he chooses for a hideous death as a sacrifice to his gods. Heard of Blodorn, the Blood Eagle? You don't want to know what that means. Now keep quiet.", "frisianship_mer_4c",
    []],
  
  [anyone,"frisianship_mer_4c", [       (str_clear, s2),
    ], "{s2}^^I think they're passing by. If we stay still right here, they may just think we're another bit of the wreckage. That's our only hope.", "frisianship_mer_5",
    [
      (str_store_string, s2, "@--You notice his hands shaking from nervousness.--", color_bad_news),
  ]],
  
  [anyone|plyr, "frisianship_mer_5", [],
    "What? We should have already been escaping into the mist. Row, men, for all it's worth!", "frisianship_mer_6", []],
  [anyone|plyr, "frisianship_mer_5", [],
    "Please, calm down, my friend. We mustn't make a wrong move here!", "frisianship_mer_6", []],
  
  [anyone,"frisianship_mer_6", [], "{s1}^^Sven's spotted us! They're turning this way! Nothing for it but to move. Cut the anchor and start rowing! Oh, Woden, it's no use. Help!", "close_window",
    [
      (str_store_string, s1, "@--Now he looks scared.--", color_bad_news),
  ]],
  
  ###############################Asturians leader in Douar-an-Enez
  [trp_petrus_didaz,"start", [(check_quest_active,"qst_douar_an_enez"),],
    "Greetings! My name is Petro Didaz of Oveto, and I am a duke in the service of King Aldefonso of Asturias. These men are Silo, who comes from Farum in Gallaecia, and Gundinsalvo, who comes from Amaia, in Cantabria. " +
    "We are surprised that you have submitted to us with so many ships and men. We want to know who you are.", "petro_leader_1",[]],
  
  [anyone|plyr, "petro_leader_1", [(eq, "$player_side", 2), ],#danish
    "My name is {playername}. I come on behalf of the sons of Ragnar to negotiate with you.", "petro_leader_3", []],
  [anyone|plyr, "petro_leader_1", [(eq, "$player_side", 1), ],#wessex
    "My name is {playername}. Aethelred, the king of West Seaxe, sends me to serve as your escort to his kingdom.", "petro_leaderwessex_4", []],
  
  ###opcion daneses###########
  [anyone,"petro_leader_3", [],
    "I do not think that's...", "petro_leader_31",[(talk_info_show, 0),]],
  
  [anyone|other(trp_silo_gallaecia),"petro_leader_31", [],
    "Ragnar's sons are powerful and well-known men. You should hear their proposal.", "petro_leader_32",[]],
  [anyone|other(trp_gundinsalvo_cantabrian),"petro_leader_32", [ (str_clear, s2),
    ],
    "{s2}^^Yes, listen to their messenger. After he sings his song, we can kill him.", "petro_leader_33",[
      (str_store_string, s2, "@--He scratches his back and then smiles.--", color_good_news),
  ]],
  
  [anyone|plyr, "petro_leader_33", [],
    "Rathbarth Ragnarsson wants you to join him and his brothers against West Seaxe.", "petro_leader_34", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  [anyone|plyr, "petro_leader_33", [],
    "Rathbarth Ragnarsson promises you half of West Seaxe if you join him.", "petro_leader_34", [
  ]],
  [anyone|plyr, "petro_leader_33", [],
    "Rathbarth Ragnarsson will fill your boat with riches if you join him.", "petro_leader_34", [
      (call_script, "script_change_player_relation_with_troop", "trp_silo_gallaecia", 10),
  ]],
  
  [anyone|other(trp_npc6),"petro_leader_34", [],
    "And if they do not join, what will he do? Kill them? Did he send you here with a fleet to make friends?", "petro_leader_35",[]],
  
  [anyone|plyr, "petro_leader_35", [],
    "Bodo?", "petro_leader_36", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
      (call_script, "script_change_player_relation_with_troop", "trp_silo_gallaecia", -10),
      (call_script, "script_change_player_relation_with_troop", "trp_gundinsalvo_cantabrian", -10),
  ]],
  [anyone|plyr, "petro_leader_35", [],
    "Exactly. It is your choice.", "petro_leader_36_1", [
  ]],
  
  [anyone|plyr, "petro_leader_35", [],
    "If I wanted you dead, I would have attacked. I am offering an alliance with fellow winners.", "petro_leader_36_2", [
  ]],
  
  [anyone|other(trp_gundinsalvo_cantabrian),"petro_leader_36_1", [ (str_clear, s2),],
    "{s2}^^I like things simple and clear. I like this guy.", "petro_leader_36",[ #puntos con el cantabro
      (str_store_string, s2, "@--He touches the hilt of his sword.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_gundinsalvo_cantabrian", 10),
  ]],
  
  [anyone|other(trp_silo_gallaecia),"petro_leader_36_2", [],
    "Now you're talking.", "petro_leader_36",[
      (call_script, "script_change_player_relation_with_troop", "trp_silo_gallaecia", 10),
  ]],
  
  [anyone|other(trp_npc6),"petro_leader_36", [],
    "This {reg59?woman:man} is a liar. I traveled with {reg59?her:him} for a long time. I offered {reg59?her:him} my friendship. I fought beside {reg59?her:him} and served {reg59?her:him} faithfully. But when the time came, {reg59?she:he} betrayed me and delivered the letter to the Vikings. " +
    "That's why {reg59?she:he} is here today with that fleet: to destroy you and the alliance between West Seaxe, Frankia and Asturias.", "petro_leader_37",[]],
  
  [anyone|plyr, "petro_leader_37", [],
    "The Danish rule the North. It will take an alliance to keep Asturias safe.", "petro_leader_37_1", []],
  [anyone|plyr, "petro_leader_37", [],
    "West Seaxe is weak and ripe for conquest. Don't you want to enjoy the glory and loot?", "petro_leader_38_1", []], #points with Silo
  [anyone|plyr, "petro_leader_37", [],
    "I didn't come this far to listen to this nonsense. What is your decision?", "petro_leader_41", [
  ]],
  ##
  [anyone|other(trp_silo_gallaecia),"petro_leader_37_1", [],
    "That has been my position for some time now. Better Danmark than West Seaxe. The Danish control practically all the north while West Seaxe barely controls its own kingdom. " +
    "An alliance with the Danish would mean that the Vikings would stay away from Asturias. Maybe we could even use them against Al-Andalus.", "petro_leader_37_2",[
      (call_script, "script_change_player_relation_with_troop", "trp_silo_gallaecia", 20),
  ]],
  [anyone|other(trp_gundinsalvo_cantabrian),"petro_leader_37_2", [],
    "What? Then all the fun would end. I like killing Vikings and keeping their boats.", "petro_leader_37_3",[ #puntos con el cantabro
      (call_script, "script_change_player_relation_with_troop", "trp_gundinsalvo_cantabrian", -10),
  ]],
  [anyone|other(trp_npc6),"petro_leader_37_3", [],
    "Someone who truly knows the north would not say that. The king of the Danish does not have the power to control the Vikings. " +
    "The Vikings are free men who have embraced the sea to get wealth and fame, and if their king tried to stop them, they would find another king.", "petro_leader_40",[
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  ###
  [anyone|other(trp_gundinsalvo_cantabrian),"petro_leader_38_1", [],
    "West Seaxe can still fight, and I think it would be quite good at it. You sing well, messenger. It would be nice to switch our looting to places other than the lands of the Moors.", "petro_leader_38_2",[ #puntos con el cantabro
      (call_script, "script_change_player_relation_with_troop", "trp_gundinsalvo_cantabrian", 20),
  ]],
  [anyone|other(trp_silo_gallaecia),"petro_leader_38_2", [],
    "Well, this sounds good to me.", "petro_leader_38_3",[
      (call_script, "script_change_player_relation_with_troop", "trp_silo_gallaecia", 10),
  ]],
  [anyone,"petro_leader_38_3", [],
    "You're forgetting that our king has an alliance with the king of West Seaxe. Is it your intention to disobey your king?", "petro_leader_38_4",[ #puntos con el cantabro
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -10),
  ]],
  [anyone|other(trp_npc6),"petro_leader_38_4", [],
    "Do not be deceived by {reg59?her:his} flattering words. Anyone who pays attention to {reg59?her:him} ends badly.", "petro_leader_40",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -10),
  ]],
  ##
  [anyone|other(trp_npc6),"petro_leader_41", [],
    "Are you listening to {reg59?her:him}? Makes demands like a king, and if they are not accepted, threatens with the sword.", "petro_leader_40",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -10),
  ]],
  
  [anyone|plyr, "petro_leader_40", [],
    "Bodo is a good man, but he will lead you to destruction if you listen to him.", "petro_leader_40_1", []], #points with Silo
  [anyone|plyr, "petro_leader_40", [],
    "It's time for you to make a decision.", "petro_leader_50", [
  ]],
  [anyone|other(trp_npc6),"petro_leader_40_1", [],
    "There was a time that I loved and admired you. You tricked me, and I will never forgive you. The day will come when you will die by my hands.", "petro_leader_50",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -10),
  ]],
  
  [anyone|other(trp_silo_gallaecia),"petro_leader_50", [],
    "I have already expressed my opinion. My men will join the sons of Ragnar and make an alliance with the Danish in favor of Asturias. King Aldefonso will be satisfied.", "petro_leader_50_1",[
      (call_script, "script_change_player_relation_with_troop", "trp_silo_gallaecia", 10),
  ]],
  
  [anyone|other(trp_gundinsalvo_cantabrian),"petro_leader_50_1", [
      (call_script, "script_troop_get_player_relation",  "trp_gundinsalvo_cantabrian"),
      (assign, ":relation", reg0),
      #   (troop_get_slot, ":relation", "trp_gundinsalvo_cantabrian", slot_troop_player_relation),
      (ge, ":relation", 20),
    ],
    "I did not bleed for a kingdom destined to perish. I'm with Silo. Join the Danish and ransack West Seaxe.", "petro_leader_50_2",[ #puntos con el cantabro
      (call_script, "script_change_player_relation_with_troop", "trp_gundinsalvo_cantabrian", 20),
  ]],
  [anyone|other(trp_gundinsalvo_cantabrian),"petro_leader_50_1", [
    ],
    "I would prefer killing Danes rather than Saxons... Yes, that's my decision.", "petro_leader_50_2",[ #puntos con el cantabro
      (call_script, "script_change_player_relation_with_troop", "trp_gundinsalvo_cantabrian", -20),
  ]],
  
  [anyone,"petro_leader_50_2", [],
    "King Aldefonso named me, his duke, lord of this army, to complete our mission of helping West Seaxe. Barring orders to the contrary, that is our goal, and anything else is treason.", "petro_leader_51",[
  ]],
  
  [anyone|other(trp_npc6),"petro_leader_51", [],
    "Your people cannot be trusted, Duke Petro. I am Bodo Vimaraniz from Malacoria. You know me, I am a man of the royal court, and here is my seal. I did not want to resort to this...^^I am the word of the king here. " +
    "I have given an order to have the West Seaxe fleet attack {playername}'s fleet. Look over there and enjoy the show!", "petro_leader_52",[
      (str_store_string, s2, "@After traveling for several days, you came to Douar-an-Enez and met with the Asturians. " +
      "But while you were trying to convince them to join Ragnar's sons, Bodo took command and ordered an attack on your fleet. You must return to your fleet and fight!"),
      (add_quest_note_from_sreg, "qst_douar_an_enez", 7, s2, 0),
      (quest_set_slot,"qst_douar_an_enez",slot_quest_current_state, 13),
  ]],
  
  [anyone|other(trp_npc6),"petro_leader_52", [],
    "Silo is a traitor and will be executed. Gundinsalvo will gather and embark his Cantabrians now and prepare for battle. You, Petro, will leave some men here to protect our food supply and send the rest with Gundinsalvo. " +
    "{playername} shall return to {reg59?her:his} ship to die with {reg59?her:his} men. We will advance from here with our ships in a pincer attack and end this matter. Then we will travel in aid of West Seaxe as agreed.", "petro_leader_52_2",[
  ]],
  
  [anyone|other(trp_gundinsalvo_cantabrian),"petro_leader_52_2", [
    ],
    "You are not the king, and you have ordered an attack without our consent. This breaks all the rules. I'm going with {playername}, but I will not fight.", "petro_leader_52_3",[ #puntos con el cantabro
      (call_script, "script_change_player_relation_with_troop", "trp_gundinsalvo_cantabrian", -20),
  ]],
  
  [anyone|plyr, "petro_leader_52_3", [],
    "Bodo, you're stupidly crazy! You're sending these men to their death.", "petro_leader_53", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -10),
  ]], #points with Silo
  [anyone|plyr, "petro_leader_52_3", [],
    "See you soon.", "petro_leader_53", [
  ]],
  
  [anyone|other(trp_npc6),"petro_leader_53", [],
    "Away with {playername}! Everyone must prepare for battle. Gundinsalvo, go with your men, but if you happen to betray us, you will pay dearly!", "close_window",[
      (add_xp_as_reward,1000),
      (mission_cam_animate_to_screen_color, 0xFF000000, 3000),
      (finish_mission,4),
  ]], #salto a menu y batalla naval. Primero descripcion como le llevan al barco
  
  ######West Seaxe part #################################################################################
  [anyone,"petro_leaderwessex_4", [],
    "Welcome {playername}, we expected you days ago.", "petro_leaderwessex_31",[(talk_info_show, 0),]],
  [anyone|other(trp_silo_gallaecia),"petro_leaderwessex_31", [],
    "The king of West Seaxe sent a nobody. That is an insult!", "petro_leaderwessex_32",[]],
  [anyone|other(trp_gundinsalvo_cantabrian),"petro_leaderwessex_32", [ (str_clear, s2),],
    "{s2}^^You get offended too easily, Silo.", "petro_leaderwessex_33",[
      (str_store_string, s2, "@--He scratches his back and then smiles.--", color_good_news),
  ]],
  
  [anyone|plyr, "petro_leaderwessex_33", [],
    "This man next to me, Bodo, is from Asturias.", "petro_leaderwessex_34", [
  ]],
  [anyone|plyr, "petro_leaderwessex_33", [],
    "How many men and boats do you have?", "petro_leaderwessex_34_2", [
  ]],
  
  [anyone|other(trp_gundinsalvo_cantabrian),"petro_leaderwessex_34_2", [ (str_clear, s2),],
    "{s2}^^Hah! I like someone who gets straight to the point.", "petro_leaderwessex_34_1",[ #puntos con el cantabro
      (str_store_string, s2, "@--He touches the hilt of his sword.--", color_good_news),
      (call_script, "script_change_player_relation_with_troop", "trp_gundinsalvo_cantabrian", 10),
  ]],
  
  [anyone|other(trp_npc6),"petro_leaderwessex_34", [],
    "Thank you, {playername}, but Petro knows who I am. He has seen me in the royal court. I am one of the king's men, as my seal shows.", "petro_leaderwessex_35",[]],
  [anyone|other(trp_npc6),"petro_leaderwessex_34_1", [],
    "They have more than 500 men and more than 20 boats, many of them obtained from the defeated Danish, {playername}. " +
    "Petro knows me. He has seen me in the royal court. I am one of the king's men, as my seal shows.", "petro_leaderwessex_34_8",[]],
  
  [anyone,"petro_leaderwessex_34_8", [],
    "Yes, I'm glad to see you, Bodo. It has been many years.", "petro_leaderwessex_34_9",[]],
  
  [anyone|other(trp_npc6),"petro_leaderwessex_34_9", [],
    "True, but now you know where I have been. This alliance between West Seaxe, Asturias and Frankia is my work.", "petro_leaderwessex_35",[]],
  
  [anyone|plyr, "petro_leaderwessex_35", [],
    "Glad to see this meeting of old friends.", "petro_leaderwessex_36_1", [
  ]],
  [anyone|plyr, "petro_leaderwessex_35", [],
    "Well, before we leave, we have to talk about that man, Silo.", "petro_leaderwessex_36_2", [
  ]],
  
  [anyone|other(trp_npc6),"petro_leaderwessex_36_1", [],
    "Very diplomatic, but we have to tackle a thorny issue. Silo has been providing information to the Danish.", "petro_leaderwessex_36_2",[
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", 10),
  ]],
  
  [anyone|other(trp_silo_gallaecia),"petro_leaderwessex_36_2", [],
    "What! What are you talking about?", "petro_leaderwessex_37",[
      (call_script, "script_change_player_relation_with_troop", "trp_silo_gallaecia", -20),
  ]],
  
  [anyone|other(trp_npc6), "petro_leaderwessex_37", [],
    "Sigurd Ragnarsson mentioned his name when he spoke to {playername} about a traitor in Asturias who's been sending them information regularly. " +
    "So Sigurd knew about the letter and my movements. He also knows about this fleet now.", "petro_leaderwessex_37_1", []],
  
  [anyone|plyr, "petro_leaderwessex_37_1", [],
    "Everything he says is true.", "petro_leaderwessex_38_1", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", 10),
  ]],
  [anyone|plyr, "petro_leaderwessex_37_1", [],
    "Silo should die now.", "petro_leaderwessex_38_2", []],
  [anyone|plyr, "petro_leaderwessex_37_1", [],
    "(Say nothing)", "petro_leaderwessex_38_1", []],
  ##
  
  
  [anyone|other(trp_silo_gallaecia),"petro_leaderwessex_38_1", [],
    "What? You judge and condemn me merely based on the word of this stranger, mere riffraff? By God! I have a noble rank!", "petro_leaderwessex_39",[
      (call_script, "script_change_player_relation_with_troop", "trp_silo_gallaecia", -20),
  ]],
  
  [anyone|other(trp_gundinsalvo_cantabrian),"petro_leaderwessex_38_2", [],
    "Kill him? This is a bit hasty, don't you think?", "petro_leaderwessex_38_1",[ #puntos con el cantabro
      (call_script, "script_change_player_relation_with_troop", "trp_gundinsalvo_cantabrian", -10),
  ]],
  
  [anyone|other(trp_npc6),"petro_leaderwessex_39", [],
    "You should fear what I have to say more than anything else.", "petro_leaderwessex_40",[
  ]],
  
  [anyone,"petro_leaderwessex_40", [],
    "Bodo's word means considerably more to me than any other proof or witness. However, we are not in the position to judge or condemn, for that is the king's prerogative. Silo, if you are a traitor, pray God to protect you, for the king won't have mercy. " +
    "For now, you will be imprisoned and sent back to Asturias with the witness, {playername}, while we will continue on to West Seaxe.", "petro_leaderwessex_41",[]],
  
  [anyone|plyr, "petro_leaderwessex_41", [],
    "Very well, I will go to Asturias to testify against this man, Silo.", "petro_leaderwessex_42", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", 10),
      (call_script, "script_change_player_relation_with_troop", "trp_silo_gallaecia", -20),
      (call_script, "script_change_player_relation_with_troop", "trp_gundinsalvo_cantabrian", 5),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
  ]],
  [anyone|plyr, "petro_leaderwessex_41", [],
    "Sorry, I can't go to Asturias. I have an unfinished business back in Englaland.", "petro_leaderwessex_42", [
      (call_script, "script_change_player_relation_with_troop", "trp_npc6", -5),
      (call_script, "script_change_player_relation_with_troop", "trp_silo_gallaecia", 10),
      (call_script, "script_change_player_relation_with_troop", "trp_gundinsalvo_cantabrian", -5),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -5),
  ]],
  
  [anyone|other(trp_silo_gallaecia),"petro_leaderwessex_42", [],
    "I think no one is going anywhere. If I'm not mistaken, that smoke you see on the horizon comes from our guest's ships. It seems that the Danish have arrived. Maybe now you would understand my strategy.", "petro_leaderwessex_43",[
  ]],
  
  [anyone|other(trp_gundinsalvo_cantabrian),"petro_leaderwessex_43", [
    ],
    "By the gods! Sorry, I mean my God! Both fleets are maneuvering for battle. The smoke comes from fire arrows.", "petro_leaderwessex_44",[ #
  ]],
  
  [anyone,"petro_leaderwessex_44", [],
    "You must have the eyes of an eagle, Cantabro. We must help our allies before the Danes destroy them. Silo, we need your men on our side, they are the best sailors in our fleet.", "petro_leaderwessex_45",[
  ]],
  
  [anyone|other(trp_silo_gallaecia),"petro_leaderwessex_45", [],
    "You should've thought of that before making grave accusations. My men will fight with me... Well, the Danish brought more boats, and I always ally with the winner.", "petro_leaderwessex_46",[
  ]],
  
  [anyone|other(trp_npc6),"petro_leaderwessex_46", [],
    "You traitorous scum! I am taking the overall command. {playername}, return to your ships and try to contain the Danish. Gundinsalvo will be in charge of our fleet and will join you. " +
    "I'll stay here in a safe place to coordinate a defense on the ground, so that you have a place to withdraw to if things go bad.^^" +
    "Go!", "petro_leaderwessex_48",[
      (str_store_string, s2, "@After traveling for several days, you came to Douar-an-Enez and met with the Asturians. You unmasked the traitor, Silo, but it was too late! The Danish are attacking your fleet. " +
      "You must hurry and save your men!"),
      (add_quest_note_from_sreg, "qst_douar_an_enez", 7, s2, 0),
      (quest_set_slot,"qst_douar_an_enez",slot_quest_current_state, 13),
      (troop_set_slot, "trp_npc6", slot_troop_occupation, 0), #bye bye bodo
      (troop_set_slot, "trp_npc6", slot_troop_playerparty_history, pp_history_dismissed),
      (remove_member_from_party, "trp_npc6"),
  ]],
  
  [anyone|other(trp_silo_gallaecia),"petro_leaderwessex_48", [],
    "You're insane! You should surrender. To me, my men! For Gallaecia!", "close_window",[
      (add_xp_as_reward,1000),
      (mission_cam_animate_to_screen_color, 0xFF000000, 3000),
      (finish_mission,4),
  ]], #salto a menu y batalla naval. Primero descripcion como le llevan al barco
  
  ########################################
  #######################################
  
  ###main quest trainer en barco chief acaba
  
  #Trainers
  [anyone,"start", [(is_between, "$g_talk_troop", training_gound_trainers_begin, training_gound_trainers_end),
      (eq, "$g_talk_troop_met", 0)],
    "Good day to you {reg59?lass:lad}. You look like another adventurer who has come to try {reg59?her:his} chance in these lands. " +
    "Well, trust my word. You won't be able to survive long here unless you know how to fight yourself out of a tight spot.", "trainer_intro_1",[]],
  
  [anyone|plyr, "trainer_intro_1", [],
    "Thank you for your advice. This place looks like a training field. Can I learn about fighting here?", "trainer_intro_2", []],
  
  [anyone,"trainer_intro_2", [],
    "Indeed, you can. I am a veteran soldier... fought a good deal in the wars in my time. But these days, I train young novices in this area. " +
    "I can find you some opponents to practice with if you like. Or if you have any questions about theory of combat, feel free to ask.", "trainer_intro_3",[]],
  
  [anyone|plyr, "trainer_intro_3", [],
    "Yes, I do have a few questions.", "trainer_intro_4a", []],
  [anyone|plyr, "trainer_intro_3", [ #(neq, "$g_talk_troop", "trp_trainer_2"),
    ],
    "Actually, I can move on to practice.", "trainer_intro_4b", []],
  
  [anyone, "trainer_intro_4a", [],
    "Well, ask anything you like.", "trainer_talk_combat", []],
  [anyone, "trainer_intro_4b", [],
    "Good. It's good to find someone eager for practice. Let's see what you will do.", "trainer_practice_1", []],
  
  [anyone,"start", [(is_between, "$g_talk_troop", training_gound_trainers_begin, training_gound_trainers_end),
      (neq,"$waiting_for_training_fight_result", 0),
      (neq,"$training_fight_won", 0)],
    "That was a good fight. ", "trainer_practice_1",
    [(val_sub, "$num_opponents_to_beat_in_a_row", 1),
      (assign,"$waiting_for_training_fight_result",0),
  ]],
  [anyone,"start", [(is_between, "$g_talk_troop", training_gound_trainers_begin, training_gound_trainers_end),
      (neq, "$waiting_for_training_fight_result", 0)],
    "Ha! Looks like you've developed a bit of a limp there. Don't worry. Even losses have their value, provided you learn from them. Shake the stars out of your eyes and get back in there. There's no other way to win.", "trainer_practice_1",
    [(assign,"$num_opponents_to_beat_in_a_row",3),(assign,"$waiting_for_training_fight_result",0)]],
  
  
  
  [anyone,"start", [(is_between, "$g_talk_troop", training_gound_trainers_begin, training_gound_trainers_end)],
    "Good day. Ready for some training today?", "trainer_talk",[]],
  
  [anyone,"trainer_pretalk", [(is_between, "$g_talk_troop", training_gound_trainers_begin, training_gound_trainers_end)],
    "Ah, are you ready for some training?", "trainer_talk",[]],
  
  [anyone,"trainer_pretalk", [(eq, "$g_talk_troop", "trp_trainer_2")],
    "Anything else, {playername}?", "trainer_talk",[]],
  
  [anyone|plyr,"trainer_talk", [(is_between, "$g_talk_troop", training_gound_trainers_begin, training_gound_trainers_end),],
    "I am ready for some practice.", "trainer_practice_1",[]],
  
  [anyone|plyr,"trainer_talk", [(is_between, "$g_talk_troop", training_gound_trainers_begin, training_gound_trainers_end),],
    "First, tell me something about combat...", "trainer_combat_begin",[]],
  
  ##    [anyone|plyr,"trainer_talk", [],
  ##   "I have some novice soldiers with me. Can you train them?", "trainer_train_novices_1",[]],
  
  #player lair
  [trp_trainer_2,"start", [#(eq, "$g_encountered_party", "p_yourlair"),
    ],
    "Good day, {playername}. How may I help you?", "trainer_talk",[]],
  
  [trp_trainer_2|plyr,"trainer_talk", [#(eq, "$g_encountered_party", "p_yourlair"),
    ],
    "I'd like to discuss training options.", "trainer_training_lair0_tr",[]],
  
  [anyone, "trainer_training_lair0_tr",
    [],
    "I can take your recruits and turn them into warriors.", "trainer_training_lair0",
    []],
  
  [anyone|plyr,"trainer_training_lair0", [(eq, "$g_trainerlair_training_center", -1),],
    "I need some men to be trained.", "trainer_training_lair2",[]],
  
  [anyone|plyr, "trainer_training_lair0",
    [   (eq, "$g_trainerlair_training_center", "$g_encountered_party"),],
    "Please, stop training my men here.", "trainer_training_lair4_stop",
    []],
  
  [anyone|plyr, "trainer_training_lair0",
    [],
    "Never mind.", "trainer_pretalk",
    []
  ],
  
  ##  [anyone, "trainer_training_lair",
  ##  [
  ##  ],
  ##  "Do you want me to use promotion, if there is one available?", "trainer_training_lair2",
  ##  []
  ##  ],
  ##
  [anyone, "trainer_training_lair2",
    [],
    "Do you want me to use an alternative promotion when available?", "trainer_training_lair3a",
    []
  ],
  ##
  [anyone|plyr, "trainer_training_lair3a",
    [],
    "Yes.", "trainer_training_lair3",
    [(assign, "$g_trainerlair_training_type", 1),]],
  [anyone|plyr, "trainer_training_lair3a",
    [],
    "No.", "trainer_training_lair3",
    [(assign, "$g_trainerlair_training_type", 0),]],
  
  [anyone, "trainer_training_lair3",
    [
      (str_store_party_name, s11, "$g_encountered_party"),
      ##    (try_begin),
      ##      (eq, "$g_trainerlair_training_type", 0),
      ##      (str_store_string, s12, "@You don't want me to promote the men."),
      ##    (else_try),
      ##      (str_store_string, s12, "@You want me to promote the men."),
      ##    (try_end),
    ],
    #"Alright, I will train the recruits in {s11}. {s12} And place the troops you want to be trained at the bottom of the garrison list.", "trainer_talk",
    "Alright, I will train the recruits in {s11}. Place the troops you want me to train at the bottom of the garrison list.", "trainer_talk",
    [(assign, "$g_trainerlair_training_center", "$g_encountered_party"),
    ]
  ],
  
  ##  [anyone|plyr, "trainer_training_lair2",
  ##  [],
  ##  "I changed my mind. Don't train them.", "trainer_pretalk",
  ##  []
  ##  ],
  
  [anyone, "trainer_training_lair4_stop",
    [
    ],
    "As you wish, my {reg59?lady:lord}.", "trainer_pretalk",
    [(assign, "$g_trainerlair_training_center", -1),
      (assign, "$g_trainerlair_training_type", 0),
    ]
  ],
  
  #player lair acaba chief
  
  [anyone|plyr,"trainer_talk", [],
    "I need to leave now. Farewell.", "close_window",[]],
  
  [anyone,"trainer_combat_begin", [],
    "What do you want to know?", "trainer_talk_combat",[]],
  [anyone,"trainer_combat_pretalk", [],
    "What else do you want to know?", "trainer_talk_combat",[]],
  
  [anyone|plyr,"trainer_talk_combat", [], "Tell me about defending myself.", "trainer_explain_defense",[]],
  [anyone|plyr,"trainer_talk_combat", [], "Tell me about attacking with weapons.", "trainer_explain_attack",[]],
  [anyone|plyr,"trainer_talk_combat", [], "Tell me about fighting on horseback.", "trainer_explain_horseback",[]],
  #    [anyone|plyr,"trainer_talk_combat", [], "Tell me about using ranged weapons.", "trainer_explain_ranged",[]],
  #    [anyone|plyr,"trainer_talk_combat", [], "Tell me about weapon types.", "trainer_explain_weapon_types",[]],
  [anyone|plyr,"trainer_talk_combat", [], "I guess I know all theory I need. Let's talk about something else.", "trainer_pretalk",[]],
  
  [anyone,"trainer_explain_defense", [], "Good question. The first thing you should know as a fighter is how to defend yourself. " +
    "Keeping yourself out of harm's way is the first rule of combat, and it is much more important than giving harm to others. " +
    "Everybody can swing a sword around and hope to cut some flesh, but only those fighters that are experts at defense live to tell of it.",
    "trainer_explain_defense_2",[]],
  [anyone,"trainer_explain_defense_2", [], "Now. Defending yourself is easiest if you are equipped with a shield. " +
    "Just block with your shield. [Hold down the right mouse button to defend yourself with the shield.] In this state, you will be able to deflect all attacks that come from your front. However, you will still be open to strikes from your sides or your back.", "trainer_explain_defense_3",[]],
  [anyone|plyr,"trainer_explain_defense_3", [], "What if I don't have a shield?", "trainer_explain_defense_4",[]],
  [anyone,"trainer_explain_defense_4", [], "Then you will have to use your weapon to block your opponent. " +
    "This is a bit more difficult than defending with a shield. " +
    "Defending with a weapon, you can block against only ONE attack direction. " +
    "That is, you block against either overhead swings, side swings or thrusts. " +
    "Therefore, you must watch your opponent carefully and start to block AFTER he starts his attack. " +
    "In this way, you will be able to block against the direction of his current attack. " +
    "If you start to block BEFORE he makes his move, he may just attack in another direction than the one you are blocking against and score a hit.", "trainer_combat_pretalk",[]],
  [anyone,"trainer_explain_attack", [], "Good question. Attacking is the best defence, they say. " +
    "A tactic many fighters find useful is taking an offensive stance and readying your weapon for attack, waiting for the right moment for swinging it. " +
    "[You can ready your weapon for attack by pressing and holding down the left mouse button.]", "trainer_explain_attack_2",[]],
  [anyone|plyr,"trainer_explain_attack_2", [], "That sounds useful.", "trainer_explain_attack_3",[]],
  [anyone,"trainer_explain_attack_3", [], "It is a good tactic, but remember that, your opponent may see that and take a defensive stance against the direction you are swinging your weapon. " +
    "If that happens, you must break your attack and quickly attack from another direction " +
    "[You may cancel your current attack by quickly tapping the right mouse button].", "trainer_explain_attack_4",[]],
  [anyone|plyr,"trainer_explain_attack_4", [], "If my opponent is defending against the direction I am attacking from, I will break and use another direction.", "trainer_explain_attack_5",[]],
  [anyone,"trainer_explain_attack_5", [], "Yes, selecting the direction you swing your weapon is a crucial skill. " +
    "There are four main directions you may use: right swing, left swing, overhead swing and thrust. You must use each one wisely. " +
    "[To control your swing direction with default controls, move your mouse in the direction you want to swing from as you press the left mouse button].", "trainer_combat_pretalk",[]],
  [anyone,"trainer_explain_horseback", [], "Very good question. A horse may be a warrior's most powerful weapon in combat. " +
    "It gives you speed, height, power and initiative. A lot of deadly weapons will become even deadlier on horseback. " +
    "However, you must pay particular attention to horse-mounted enemies couching their lances, as they may take down any opponent in one hit. " +
    "[To use the couched lance yourself, wield a lance or similar weapon, and speed up your horse without pressing attack or defense buttons. " +
      "after you reach a speed, you'll lower your lance. Then try to target your enemies by maneuvering your horse.]", "trainer_combat_pretalk",[]],
  
  [anyone,"trainer_practice_1", [(eq,"$training_system_explained", 0)],
    "I train novices in four stages, each tougher than the one before. " +
    "To finish a stage and advance to the next one, you have to win three fights in a row.", "trainer_practice_1",
    [
      (assign, "$num_opponents_to_beat_in_a_row", 3),
      (assign, "$novicemaster_opponent_troop", "trp_novice_fighter"),
      (assign, "$training_system_explained", 1),
  ]],
  [anyone,"trainer_practice_1",
    [(ge,"$novice_training_difficulty",4)],
    "You have passed all stages of training, but if you want, you can still practice. Are you ready?", "novicemaster_are_you_ready",
    [(assign,"$num_opponents_to_beat_in_a_row",99999)]],
  [anyone,"trainer_practice_1",
    [(eq,"$num_opponents_to_beat_in_a_row",0),(eq,"$novice_training_difficulty",0)],
    "Way to go {reg59?lass:lad}. With this victory, you have advanced to the next training level. From now on, your opponents will be regular fighters, not the riff-raff off the street, so be on your toes.",
    "trainer_practice_1",
    [[assign,"$num_opponents_to_beat_in_a_row",3],
      [val_add,"$novice_training_difficulty",1],
      [add_xp_to_troop,100],
      [assign,"$novicemaster_opponent_troop","trp_regular_fighter"]]],
  [anyone,"trainer_practice_1",
    [[eq,"$num_opponents_to_beat_in_a_row",0],[eq,"$novice_training_difficulty",1]],
    "Way to go {reg59?lass:lad}. Welcome to the third training level. From now on, your opponents will be veteran fighters -- soldiers and arena regulars and the like. These guys know some dirty tricks, so keep your defense up.",
    "trainer_practice_1",
    [[assign,"$num_opponents_to_beat_in_a_row",3],
      [val_add,"$novice_training_difficulty",1],
      [add_xp_to_troop,100],
      [assign,"$novicemaster_opponent_troop","trp_veteran_fighter"]]],
  [anyone,"trainer_practice_1",
    [[eq,"$num_opponents_to_beat_in_a_row",0],[eq,"$novice_training_difficulty",2]],
    "You've got the heart of a champion, {reg59?lass:lad}, and the sword arm to match. From now on, your opponents will be champion fighters. " +
    "These are the cream of the crop, the finest warriors I have trained. If you can best three of them in a row, you will join their ranks.",
    "trainer_practice_1",
    [[assign,"$num_opponents_to_beat_in_a_row",3],
      [val_add,"$novice_training_difficulty",1],
      [add_xp_to_troop,100],
      [assign,"$novicemaster_opponent_troop","trp_champion_fighter"]]],
  [anyone,"trainer_practice_1",
    [[eq,"$num_opponents_to_beat_in_a_row",0],[eq,"$novice_training_difficulty",3]],
    "It does my heart good to see such a promising talent. You have passed all tiers of training. You can now tell everyone that you have been trained by the master of the training field.",
    "novicemaster_finish_training",
    [[assign,"$num_opponents_to_beat_in_a_row",3],
      [val_add,"$novice_training_difficulty",1],
      [add_xp_to_troop,300]]],
  [anyone|plyr,"novicemaster_finish_training", [], "Thank you master.", "novicemaster_finish_training_2",[]],
  [anyone,"novicemaster_finish_training_2", [], "I wish you good luck in the tournaments. And, don't forget, " +
    "if you want to practice your sword work anytime, just come and say the word.", "close_window",[]],
  [anyone,"trainer_practice_1",
    [
      (assign, reg8, "$num_opponents_to_beat_in_a_row"),
      (str_store_troop_name, s9, "$novicemaster_opponent_troop"),
    ],
    "Your next opponent will be a {s9}. You need to win {reg8} more " +
    "fights in a row to advance to the next stage. Are you ready?", "novicemaster_are_you_ready",
    []],
  [anyone|plyr,"novicemaster_are_you_ready", [], "Yes I am.", "novicemaster_ready_to_fight",[]],
  [anyone,"novicemaster_ready_to_fight", [], "Here you go then. Good luck.", "close_window",
    [
      (assign, "$training_fight_won", 0),
      (assign, "$waiting_for_training_fight_result", 1),
      (modify_visitors_at_site, "$g_training_ground_melee_training_scene"),
      (reset_visitors),
      (assign, reg0, 0),
      (assign, reg1, 1),
      (assign, reg2, 2),
      (assign, reg3, 3),
      (shuffle_range, 0, 4),
      (set_visitor, reg0, "trp_player"),
      (set_visitor, reg1, "$novicemaster_opponent_troop"),
      (set_visitor, 4, "$g_talk_troop"),
      (set_jump_mission, "mt_training_ground_trainer_training"),
      (jump_to_scene, "$g_training_ground_melee_training_scene"),
  ]],
  
  [anyone|plyr,"novicemaster_are_you_ready", [], "Just a moment. I am not ready yet.", "novicemaster_not_ready",[]],
  [anyone,"novicemaster_not_ready", [], "Hey, you will never make it if you don't practice.", "close_window",[]],
  
  
  #Crooks
  
  ##  [anyone ,"start", [(is_between,"$g_talk_troop",crooks_begin,crooks_end),(eq,"$g_talk_troop_met",0),(eq,"$sneaked_into_town",0),(store_random_in_range, reg2, 2)],
  ##   "You {reg2?looking for:want} something?:", "crook_intro_1",[]],
  ##  [anyone|plyr,"crook_intro_1",[],"I am trying to learn my way around the town.", "crook_intro_2",[]],
  ##
  ##  [anyone,"crook_intro_2",[(eq,"$crook_talk_order",0),(val_add,"$crook_talk_order",1),(str_store_troop_name,s1,"$g_talk_troop")],
  ##"Then you came to the right guy. My name is {s1}, and I know everyone and everything that goes around in this town.\
  ## Anyone you want to meet, I can arrange it. Anything you need to know, I can find out. For the right price, of course. Do you have gold?", "crook_intro_2a",[]],
  ##  [anyone|plyr,"crook_intro_2a",[],"I have gold. Plenty of it.", "crook_intro_2a_1a",[]],
  ##  [anyone|plyr,"crook_intro_2a",[],"Not really.", "crook_intro_2a_1b",[]],
  ##  [anyone,"crook_intro_2a_1a",[],"Good. That means you and I will be great friends.", "crook_talk",[]],
  ##  [anyone,"crook_intro_2a_1b",[],"Then you should look into earning some. Listen to me now, for I'll give you some free advice.\
  ## The easiest way to make money is to fight in the tournaments and bet on yourself. If you are good, you'll quickly get yourself enough money to get going.", "crook_talk",[]],
  ##
  ##  [anyone,"crook_intro_2",[(eq,"$crook_talk_order",1),(val_add,"$crook_talk_order",1),(str_store_troop_name,s1,"$g_talk_troop")],
  ##"Then you need to go no further. I am {s1}, and I can provide you anything... For the right price.", "crook_intro_2b",[]],
  ##  [anyone|plyr,"crook_intro_2b",[],"Are you a dealer?", "crook_intro_2b_1",[]],
  ##  [anyone,"crook_intro_2b_1",[],"A dealer? Yes. I deal in knowledge... connections.. lies... secrets... Those are what I deal in. Interested?", "crook_talk",[]],
  ##
  ##  [anyone,"crook_intro_2",[(eq,"$crook_talk_order",2),(val_add,"$crook_talk_order",1),(str_store_troop_name,s1,"$g_talk_troop")],
  ##"Then this is your lucky day. Because you are talking to {s1}, and I know every piss-stained brick of this wicked town.\
  ##I know every person, every dirty little secret. And all that knowledge can be yours. For a price.", "crook_talk",[]],
  ##
  ##  [anyone,"crook_intro_2",[(val_add,"$crook_talk_order",1),(str_store_troop_name,s1,"$g_talk_troop")],
  ## "Then {s1} is at your service {reg59?madam:sir}. If you want to know what's really going on in this town, or arrange a meeting in secret, then come to me. I can help you.", "crook_talk",[]],
  ##
  ##  [anyone ,"start", [(is_between,"$g_talk_troop",crooks_begin,crooks_end),(eq,"$g_talk_troop_met",0),(eq,"$sneaked_into_town",1),(eq,"$crook_sneak_intro_order",0),(val_add,"$crook_sneak_intro_order",1)],
  ##   "Good day. {playername} right?", "crook_intro_sneak_1",[]],
  ##  [anyone|plyr,"crook_intro_sneak_1", [], "You must be mistaken. I'm just a poor pilgrim. I don't answer to that name.", "crook_intro_sneak_2",[]],
  ##  [anyone,"crook_intro_sneak_2", [(str_store_troop_name,s1,"$g_talk_troop")], "Of course you do. And if the town guards knew you were here, they'd be upon you this moment.\
  ## But don't worry. Noone knows it is {playername} under that hood. Except me of course. But I am {s1}. It is my business to know things.", "crook_intro_sneak_3",[]],
  ##  [anyone|plyr,"crook_intro_sneak_3", [], "You won't tip off the guards about my presence?", "crook_intro_sneak_4",[]],
  ##  [anyone,"crook_intro_sneak_4", [], "What? Of course not! Well, maybe I would, but the new captain of the guards is a dung-eating cheat.\
  ## I led him to this fugitive, and the man was worth his weight in silver as prize money. But I swear, I didn't see a penny of it.\
  ## The bastard took it all to himself. So your secret is safe with me.", "crook_intro_sneak_5",[]],
  ##  [anyone,"crook_intro_sneak_5", [], "Besides, I heard you have a talent for surviving any kind of ordeal.\
  ## I wouldn't want you to survive this one as well and then come after me with a sword. Ha-hah.", "crook_talk",[]],
  ##
  ##
  ##  [anyone ,"start", [(is_between,"$g_talk_troop",crooks_begin,crooks_end),(eq,"$g_talk_troop_met",0),(eq,"$sneaked_into_town",1),(str_store_troop_name,s1,"$g_talk_troop")],
  ##   "{s1} is at your service {reg59?madam:sir}. If you want to know what's really going on in this town, or arrange a meeting in secret, then come to me. I can help you.", "crook_talk",[]],
  ##
  ##  [anyone ,"start", [(is_between,"$g_talk_troop",crooks_begin,crooks_end),(store_character_level, ":cur_level", "trp_player"),(lt,":cur_level",8)],
  ##   "{You again?/Delighted to see you again my pretty.}", "crook_talk",[]],
  ##  [anyone ,"start", [(is_between,"$g_talk_troop",crooks_begin,crooks_end)],
  ##   "I see that you need my services {reg59?madam:sir}...", "crook_talk",[]],
  ##  [anyone ,"crook_pretalk", [],
  ##   "Is that all?", "crook_talk",[]],
  
  
  
  ##  [anyone|plyr,"crook_talk", [], "I'm looking for a person...", "crook_search_person",[]],
  ##  [anyone|plyr,"crook_talk", [], "I want you to arrange me a meeting with someone...", "crook_request_meeting",[]],
  ##  [anyone|plyr,"crook_talk", [], "[Leave]", "close_window",[]],
  
  
  
  #  [anyone,"crook_enter_dungeon", [],
  #   "Alright but this will cost you 50 peningas.", "crook_enter_dungeon_2", []],
  
  #  [anyone|plyr, "crook_enter_dungeon_2", [(store_troop_gold, ":cur_gold", "trp_player"),
  #                                            (ge, ":cur_gold", 50)],
  #   "TODO: Here it is. 50 peningas.", "crook_enter_dungeon_3_1",[(troop_remove_gold, "trp_player", 50)]],
  
  #  [anyone|plyr, "crook_enter_dungeon_2", [(store_troop_gold, ":cur_gold", "trp_player"),
  #                                            (ge, ":cur_gold", 50)],
  #   "Never mind then.", "crook_pretalk",[]],
  
  #  [anyone|plyr, "crook_enter_dungeon_2", [(store_troop_gold, ":cur_gold", "trp_player"),
  #                                            (lt, ":cur_gold", 50)],
  #   "TODO: I don't have that much money.", "crook_enter_dungeon_3_2",[]],
  
  #  [anyone,"crook_enter_dungeon_3_1", [],
  #   "TODO: There you go.", "close_window", [(call_script, "script_enter_dungeon", "$current_town", "mt_visit_town_castle")]],
  
  #  [anyone,"crook_enter_dungeon_3_2", [],
  #   "TODO: Come back later then.", "crook_pretalk",[]],
  
  
  ##  [anyone, "crook_request_meeting", [],
  ##   "Who do you want to meet with?", "crook_request_meeting_2",[]],
  ##  [anyone|plyr|repeat_for_troops,"crook_request_meeting_2", [(store_encountered_party, ":center_no"),
  ##                                                             (store_repeat_object, ":troop_no"),
  ##                                                             (is_between, ":troop_no", heroes_begin, heroes_end),
  ##                                                             (troop_get_slot, ":cur_center", ":troop_no", slot_troop_cur_center),
  ##                                                             (call_script, "script_get_troop_attached_party", ":troop_no"),
  ##                                                             (assign, ":cur_center_2", reg0),
  ##                                                             (this_or_next|eq, ":cur_center", ":center_no"),
  ##                                                             (eq, ":cur_center_2", ":center_no"),
  ##                                                             (neg|party_slot_eq, ":center_no", slot_town_lord, ":troop_no"),#Neglect the ruler of the center
  ##                                                             (str_store_troop_name, s1, ":troop_no")],
  ##   "{!}{s1}", "crook_request_meeting_3", [(store_repeat_object, "$selected_troop")]],
  ##
  ##  [anyone|plyr,"crook_request_meeting_2", [], "Never mind.", "crook_pretalk", []],
  ##
  ##  [anyone,"crook_request_meeting_3", [],
  ##   "Alright but this will cost you 50 peningas.", "crook_request_meeting_4", []],
  ##
  ##  [anyone|plyr, "crook_request_meeting_4", [(store_troop_gold, ":cur_gold", "trp_player"),
  ##                                            (ge, ":cur_gold", 50)],
  ##   "TODO: Here it is. 50 peningas.", "crook_search_person_5_1",[(troop_remove_gold, "trp_player", 50)]],
  ##
  ##  [anyone|plyr, "crook_request_meeting_4", [(store_troop_gold, ":cur_gold", "trp_player"),
  ##                                            (ge, ":cur_gold", 50)],
  ##   "Never mind then.", "crook_pretalk",[]],
  ##
  ##  [anyone|plyr, "crook_request_meeting_4", [(store_troop_gold, ":cur_gold", "trp_player"),
  ##                                            (lt, ":cur_gold", 50)],
  ##   "TODO: I don't have that much money.", "crook_search_person_5_2",[]],
  ##
  ##  [anyone, "crook_search_person_5_1", [],
  ##   "TODO: Ok.", "close_window",[(party_get_slot, ":town_alley", "$g_encountered_party", slot_town_alley),
  ##                                (modify_visitors_at_site,":town_alley"),(reset_visitors),
  ##                                (set_visitor,0,"trp_player"),
  ##                                (set_visitor,17,"$selected_troop"),
  ##                                (set_jump_mission,"mt_conversation_encounter"),
  ##                                (jump_to_scene,":town_alley"),
  ##                                (assign, "$talk_context", tc_back_alley),
  ##                                (change_screen_map_conversation, "$selected_troop")]],
  ##
  ##  [anyone, "crook_search_person_5_2", [],
  ##   "TODO: Come back later then.", "crook_pretalk",[]],
  ##
  ##  [anyone, "crook_search_person", [],
  ##   "TODO: Who are you searching for?", "crook_search_person_2",[]],
  ##  [anyone|plyr|repeat_for_factions,"crook_search_person_2", [(store_repeat_object, ":faction_no"),
  ##                                                             (is_between, ":faction_no", kingdoms_begin, kingdoms_end),
  ##                                                             (str_store_faction_name, s1, ":faction_no")],
  ##   "TODO: I'm looking for a {s1}.", "crook_search_person_3", [(store_repeat_object, "$selected_faction")]],
  ##
  ##  [anyone|plyr,"crook_search_person_2", [], "Never mind.", "crook_pretalk", []],
  ##
  ##
  ##  [anyone, "crook_search_person_3", [],
  ##   "TODO: Who?", "crook_search_person_4",[]],
  ##
  ##  [anyone|plyr|repeat_for_troops,"crook_search_person_4", [(store_repeat_object, ":troop_no"),
  ##                                                           (is_between, ":troop_no", heroes_begin, heroes_end),
  ##                                                           (store_troop_faction, ":faction_no", ":troop_no"),
  ##                                                           (eq, ":faction_no", "$selected_faction"),
  ##                                                           (str_store_troop_name, s1, ":troop_no")],
  ##   "{!}{s1}", "crook_search_person_5", [(store_repeat_object, "$selected_troop")]],
  ##
  ##  [anyone|plyr,"crook_search_person_4", [], "Never mind.", "crook_pretalk", []],
  ##
  ##  [anyone, "crook_search_person_5", [(call_script, "script_get_information_about_troops_position", "$selected_troop", 0),
  ##                                     (eq, reg0, 1),
  ##                                     (str_store_troop_name, s1, "$selected_troop")],
  ##   "TODO: I know where {s1} is at the moment, but hearing it will cost you 50 peningas.", "crook_search_person_6",[]],
  ##
  ##  [anyone, "crook_search_person_5", [],
  ##   "TODO: Sorry I don't know anything.", "crook_pretalk",[]],
  ##
  ##  [anyone|plyr, "crook_search_person_6", [(store_troop_gold, ":cur_gold", "trp_player"),
  ##                                          (ge, ":cur_gold", 50)],
  ##   "TODO: Here it is. 50 peningas.", "crook_search_person_7_1",[(troop_remove_gold, "trp_player", 50)]],
  ##
  ##  [anyone|plyr, "crook_search_person_6", [(store_troop_gold, ":cur_gold", "trp_player"),
  ##                                          (ge, ":cur_gold", 50)],
  ##   "Never mind then.", "crook_pretalk",[]],
  ##
  ##  [anyone|plyr, "crook_search_person_6", [(store_troop_gold, ":cur_gold", "trp_player"),
  ##                                          (lt, ":cur_gold", 50)],
  ##   "TODO: I don't have that much money.", "crook_search_person_7_2",[]],
  ##
  ##  [anyone, "crook_search_person_7_1", [(call_script, "script_get_information_about_troops_position", "$selected_troop", 0)],
  ##   "{!}{s1}", "crook_pretalk",[]],
  ##
  ##  [anyone, "crook_search_person_7_2", [],
  ##   "TODO: Come back later then.", "crook_pretalk",[]],
  ##
  
  [anyone|auto_proceed,"start", [
      (is_between,"$g_talk_troop","trp_town_1_master_craftsman", "trp_zendar_chest"),
      (party_get_slot, ":days_until_complete", "$g_encountered_party", slot_center_player_enterprise_days_until_complete),
      (ge, ":days_until_complete", 2),
      (assign, reg4, ":days_until_complete"),
    ],
    "{!}.", "start_craftsman_soon",[]],
  
  [anyone,"start_craftsman_soon", [
    ],
    "Good day, my {reg59?lady:lord}. We hope to begin production in about {reg4} days", "close_window",[]],
  
  [anyone,"start", [
      (is_between,"$g_talk_troop","trp_town_1_master_craftsman", "trp_zendar_chest"),
    ],
    "Good day, my {reg59?lady:lord}. We are honored that you have chosen to visit us. What do you require?", "master_craftsman_talk",[]],
  
  [anyone,"master_craftsman_pretalk", [],
    "Very good, my {reg59?lady:lord}. Do you require anything else?", "master_craftsman_talk",[]],
  
  [anyone|plyr,"master_craftsman_talk", [],
    "Let's go over the accounts.", "master_craftsman_accounts",[]],
  
  [anyone|plyr,"master_craftsman_talk", [],
    "Let's check the inventories.", "master_craftsman_pretalk",[
      (change_screen_loot, "$g_talk_troop"),
  ]],
  
  [anyone|plyr,"master_craftsman_talk", [
      (party_slot_eq, "$g_encountered_party", slot_center_player_enterprise_production_order, 1),
    ],
    "I'd like you to sell goods as they are produced.", "master_craftsman_pretalk",[
      (party_set_slot, "$g_encountered_party", slot_center_player_enterprise_production_order, 0),
  ]],
  
  [anyone|plyr,"master_craftsman_talk", [
      (party_slot_eq, "$g_encountered_party", slot_center_player_enterprise_production_order, 0),
    ],
    "I'd like you to keep all goods in the warehouse until I arrive.", "master_craftsman_pretalk",[
      (party_set_slot, "$g_encountered_party", slot_center_player_enterprise_production_order, 1),
  ]],
  
  [anyone,"master_craftsman_accounts", [
    ], "We currently produce {s3} worth {reg1} peningas each week, while the quantity of {s4} needed to manufacture it costs {reg2}, and labor and upkeep are {reg3}.{s9} This means that we theoretically make a {s12} of {reg0} peningas a week, assuming that we have no raw materials in the inventories, and that we sell directly to the market.", "master_craftsman_pretalk",
    [
      (party_get_slot, ":item_produced", "$g_encountered_party", slot_center_player_enterprise),
      (call_script, "script_process_player_enterprise", ":item_produced", "$g_encountered_party"),
      
      (try_begin),
        (ge, reg0, 0),
        (str_store_string, s12, "str_profit"),
      (else_try),
        (str_store_string, s12, "str_loss"),
      (try_end),
      
      (str_store_item_name, s3, ":item_produced"),
      (item_get_slot, ":primary_raw_material", ":item_produced", slot_item_primary_raw_material),
      (str_store_item_name, s4, ":primary_raw_material"),
      
      (item_get_slot, ":secondary_raw_material", ":item_produced", slot_item_secondary_raw_material),
      (str_clear, s9),
      (try_begin),
        (gt, ":secondary_raw_material", 0),
        (str_store_item_name, s11, ":secondary_raw_material"),
        (str_store_string, s9, "str_describe_secondary_input"),
      (try_end),
  ]],
  
  
  
  [anyone|plyr,"master_craftsman_talk", [
      ], "Could you explain my options related to production?", "master_craftsman_production_options",[]],
  
  [anyone,"master_craftsman_production_options", [
      (str_store_party_name, s5, "$g_encountered_party"),
      ], "Certainly, my {reg59?lady:lord}. Most of the time, the most profitable thing for you to do would be to let us buy raw materials and sell the finished goods directly to the market. Because of our longstanding relations with the local merchants, we can usually get a very good price.", "master_craftsman_production_options_2",[]],
  
  [anyone,"master_craftsman_production_options_2", [
      (str_store_party_name, s5, "$g_encountered_party"),
      ], "However, if you find that you can acquire raw materials cheaper outside {s5}, you may place them in the inventories, and we will use them instead of buying from the market. Likewise, if you feel that you can get a better price for the finished goods elsewhere, then you may ask us to deposit what we produce in our warehouses for you to take.", "master_craftsman_pretalk",[]],
  
  [anyone|plyr,"master_craftsman_talk", [
      ], "It will no longer be possible for me to continue operating this enterprise.", "master_craftsman_auction_price",[]],
  
  [anyone,"master_craftsman_auction_price", [
      (party_get_slot, ":item_produced", "$g_encountered_party", slot_center_player_enterprise),
      (item_get_slot, ":base_price",":item_produced", slot_item_base_price),
      (item_get_slot, ":number_runs", ":item_produced", slot_item_output_per_run),
      (store_mul, "$liquidation_price", ":base_price", ":number_runs"),
      (val_mul, "$liquidation_price", 4),
      
      (troop_get_inventory_capacity, ":total_capacity", "$g_talk_troop"),
      (try_for_range, ":capacity_iterator", 0, ":total_capacity"),
        (troop_get_inventory_slot, ":item_in_slot", "$g_talk_troop", ":capacity_iterator"),
        (gt, ":item_in_slot", 0),
        (item_get_slot, ":price_for_inventory_item", ":item_in_slot", slot_item_base_price),
        #		(troop_inventory_slot_get_item_amount, ":item_ammo", "$g_talk_troop", ":capacity_iterator"),
        #		(troop_inventory_slot_get_item_max_amount, ":item_max_ammo", "$g_talk_troop", ":capacity_iterator"),
        #		(try_begin),
        #			(lt, ":item_ammo", ":item_max_ammo"),
        #			(val_mul, ":price_for_inventory_item", ":item_ammo"),
        #			(val_div, ":price_for_inventory_item", ":item_max_ammo"),
        #		(try_end),
        
        (store_sub, ":item_slot_no", ":item_in_slot", trade_goods_begin),
        (val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
        (party_get_slot, ":index", "$g_encountered_party", ":item_slot_no"),
        (val_mul, ":price_for_inventory_item", ":index"),
        (val_div, ":price_for_inventory_item", 1200),
        #modify by site
        #divide by 1200 not 1000
        (val_add, "$liquidation_price", ":price_for_inventory_item"),
      (try_end),
      
      (assign, reg4, "$liquidation_price"),
      
      ], "A pity, my {reg59?lady:lord}. If we sell the land and the equipment, and liquidate the inventories, I estimate that we can get {reg4} peningas.", "master_craftsman_auction_decide",[]],
  
  [anyone|plyr,"master_craftsman_auction_decide", [
      ], "That sounds reasonable. Please proceed with the sale.", "master_craftsman_liquidation",[
      (troop_add_gold, "trp_player", "$liquidation_price"),
      (troop_clear_inventory, "$g_talk_troop"),
      (party_set_slot, "$g_encountered_party", slot_center_player_enterprise, 0),
      (party_set_slot, "$g_encountered_party", slot_center_player_enterprise_production_order, 0),
      
  ]],
  
  [anyone|plyr,"master_craftsman_auction_decide", [
      ], "Hmm. Let's hold off on that.", "master_craftsman_pretalk",[]],
  
  [anyone,"master_craftsman_liquidation", [
      ], "As you wish. It was an honor to have been in your employ.", "close_window",[
      (finish_mission),
  ]],
  
  
  [anyone|plyr,"master_craftsman_talk", [],
    "That is all for now.", "close_window",[]],
  
  
  ######################chief dialogos amplios y quest#############################
  ######################chief dialogos amplios y quest#############################
  #chief bardos dialogo empieza
  [anyone, "start", [(is_between, "$g_talk_troop", bardo_begin, bardo_end),
    ],
    "Ave, {reg59?my lady:my lord}. I am the kingdom's bard. I can recite you a poem or I can craft songs and poems about your honor and valour.", "bardo_talk", []],
  [anyone, "bardo_pretalk", [],
    "My art and skill will not disappoint you, my lord. What else do you need?", "bardo_talk", []],
  [anyone|plyr,"bardo_talk", [(troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0)],
    "I want you to sing about me. I need to be known and famous.", "bardo_sing",[]],
  [anyone|plyr,"bardo_talk", [(troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0)],
    "I want you to write a poem for a lady.", "bardo_sing_lady",[]],
  [anyone, "bardo_sing_lady",[],"It will cost you 500 peningas. What is the name of the lady?","bardo_sing_lady2", []],
  
  [anyone|plyr|repeat_for_troops,"bardo_sing_lady2", [
      (store_repeat_object, ":lady"),
      (is_between, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
      (troop_slot_eq, ":lady", slot_troop_cur_center, "$g_encountered_party"),
      (str_store_troop_name, s33, ":lady"),
      ], "{!}{s33}","bardo_sing_lady3",[(store_repeat_object, "$temp"),]],
  [anyone|plyr, "bardo_sing_lady2", [],"Never mind.","bardo_pretalk",[]],
  [anyone, "bardo_sing_lady3", [(str_store_troop_name, s34, "$temp"),], "Very well, I will write a poem, and will recite it to {s34}, it will take me one week to do it.", "bardo_pretalk",[
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",499),
        (troop_remove_gold,"trp_player",500),
        (troop_set_slot,"$g_talk_troop",slot_troop_days_on_mission,7),#7 days cooldown
        (troop_set_slot, "$g_talk_troop", slot_troop_current_mission, npc_mission_improve_relations),
        (troop_set_slot, "$g_talk_troop", slot_troop_mission_object , "$temp"),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),]],
  
  [anyone,"bardo_sing", [],
    "My lord, I will write a poem so epic that the whole Northlands will know about the greatness of {playername} - he jumps with joy. -Finally, he stops and takes a deep breath-. In return, I am asking for a small sum to cover the cost of inks and... keep my creativity going. I will need 500 coins.", "bardo_sing2", []],
  [anyone|plyr,"bardo_sing2", [],
    "Take the money. It is nothing to a mighty hero like me.", "bardo_pretalk",
    [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",499),
        (troop_remove_gold,"trp_player",500),
        (troop_set_slot,"$g_talk_troop",slot_troop_days_on_mission,7),#7 days cooldown
        (troop_set_slot, "$g_talk_troop", slot_troop_current_mission, npc_mission_seek_recognition),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  [anyone|plyr, "bardo_sing2", [],
    "You ask for the same price as a happy widow, and undoubtedly I'd like her performance better.", "close_window", []],
  
  [anyone|plyr, "bardo_talk", [],
    "Can you sing for me and my men?", "bardo_cancion", []],
  [anyone|plyr, "bardo_talk", [],
    "A bard? Songs? Why don't you go out and earn your bread like the rest of us?", "close_window", []],
  
  [anyone, "bardo_cancion", [],
    "It will cost you 100 coins, I can sing...", "bardo_cancion2", []],
  [anyone|plyr, "bardo_cancion2", [],
    "Your best song.", "close_window", [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",99),
        (troop_remove_gold, "trp_player", 100),
        (play_track, "track_c2", 1),
        (call_script, "script_change_player_party_morale", 1),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  ##  [anyone|plyr, "bardo_cancion2", [],
  ##   "Cantiga 9", "close_window", [
  ##(store_troop_gold,":money","trp_player"),
  ##      (try_begin),
  ##        (gt,":money",99),
  ##       (troop_remove_gold, "trp_player", 100),
  ##       (play_track, "track_c9", 1),
  ##             (call_script, "script_change_player_party_morale", 1),
  ##      (else_try),
  ##        (display_message,"str_no_money"),
  ##      (try_end),
  ##       ]],
  ##  [anyone|plyr, "bardo_cancion2", [],
  ##   "Cantiga 105", "close_window", [
  ##(store_troop_gold,":money","trp_player"),
  ##      (try_begin),
  ##        (gt,":money",99),
  ##       (troop_remove_gold, "trp_player", 100),
  ##       (play_track, "track_c105", 1),
  ##             (call_script, "script_change_player_party_morale", 1),
  ##      (else_try),
  ##        (display_message,"str_no_money"),
  ##      (try_end),
  ##       ]],
  [anyone|plyr, "bardo_cancion2", [],
    "Never mind. I want to ask you something else.", "bardo_pretalk", []],
  
  #chief Owain
  [trp_bardo_5|plyr,"bardo_talk", [],
    "I would like to know about the 'Treasures of Britannia.'", "bardo_bt",[]],
  
  [anyone,"bardo_bt", [],
    "Well, if you really want to know... then hear me! There are thirteen Treasures of Brittania:^" +
    "One: Dyrnwyn, White Hilt, the sword of Rhydderch Hael. If a well-born man draw it, it bursts into flame from its hilt to its tip. Moreover, anyone who asks for it receives it. Because of this peculiarity, anyone Rhydderch would offer it to would reject it. Therefore, he was called Rhydderch the Generous.^^" +
    "Two: The Hamper of Gwyddno Garanhir. Food for one man would be put in it, but when it was opened again, food for a hundred men would be found in it.", "bardo_bt2",[]],
  [anyone,"bardo_bt2", [],"Three: The Horn of Bran Galed from the north. Whatever drink might be wished for would be found in it.^" +
    "Four: The Chariot of Morgan Mwynfawr. Wherever the driver might wish to be, there it would travel, and quickly.^" +
    "Five: The Halter of Clydno Eiddyn. This was fixed by a staple to the foot of his bed. Whatever horse he might wish for, he would find in the halter.^" +
    "Six: The Knife of Llawfrodedd Farchog. This would allow twenty and four men to eat at table.^" +
    "Seven: The Cauldron of Dyrnwch the Giant. If meat for a brave man were put in it, it would instantly be cooked.", "bardo_bt3",[]],
  [anyone,"bardo_bt3", [],"Eight: The Whetstone of Tudwal Tudglyd. Any sword sharpened on this whetstone would not fail to kill any man from whom it drew blood.^" +
    "Nine: The Coat of Padarn Beisrudd. If a well-born man put it on, it would be the right size for him.^" +
    "Ten and Eleven: The Crock and the Dish of Rhygenydd the Cleric. Whatever food might be wished for, it would be found in them.^" +
    "Twelve: The Chessboard of Gwenddoleu ap Ceidio. If the pieces were set, they would play by themselves. The board was of gold, and the men of silver.^" +
    "Thirteen: The Mantle of Arthur of Cornwall. Whoever is under it cannot be seen, yet he himself can see everyone.", "bardo_bt4",[]],
  [anyone|plyr,"bardo_bt4", [],
    "I would like to find these treasures.", "bardo_bt5",[]],
  [anyone|plyr,"bardo_bt4", [],
    "Interesting song. Thank you.", "close_window",[]],
  [anyone,"bardo_bt5", [],
    "Sorry, friend. That is a difficult quest. Most of the treasures were destroyed in Myrdyn's times, and the rest was lost. I doubt they'll ever be found.", "bardo_bt6",[]],
  [anyone|plyr,"bardo_bt6", [],
    "Sorry to hear that.", "bardo_bt7",[]],
  [anyone|plyr,"bardo_bt6", [],
    "I think you're lying to me. I want the treasure now, or you will die.", "bardo_bt8",[]],
  [anyone|plyr,"bardo_bt6", [],
    "I'm tired of this, Farewell.", "close_window",[]],
  [anyone,"bardo_bt7", [],
    "An ancestor of mine, Owain map Modred, told me about another man deceived by my ancestor's enemy, Conchobor, centuries ago. He tried to find the treasures in the days of kings Penda and Cadwallon, but was unsuccessful. The treasures are lost, and it's better this way.", "close_window",[]],
  [anyone,"bardo_bt8", [],
    "Do you think if I had these treasures, I would be here serving a king? No, I would be reviving the old knowledge of the Druids and trying to regain the Britannia that was lost with the death of my father. Farewell.", "close_window",[]],
  #chief bardos acaba
  [anyone|plyr, "bardo_talk", [],
    "I have no need for a bard at this time.", "close_window", []],
  
  #chief sacerdotes
  ##    [anyone, "start", [(is_between, "$g_talk_troop", sacerdote_begin, sacerdote_end),
  ##                     (eq, "$sacerdote_mosqueado", 1),#le ha echado, no quiere saber nada
  ##                     ],
  ##   "Leave me alone.", "close_window", []],
  [anyone, "start", [(is_between, "$g_talk_troop", sacerdote_begin, sacerdote_end),
    ],
    "In nomine Patris, {reg59?my lady:my lord}. I am a priest. I see in your eyes that you are a pious soul.", "sacerdote_talk", []],
  [anyone, "sacerdote_pretalk", [],
    "God guard you, {playername}. What can this humble servant do for you?", "sacerdote_talk", []],
  [anyone|plyr,"sacerdote_talk", [(eq, "$g_player_faith", 2),(neg|main_party_has_troop, "$g_talk_troop")],
    "I am not a Christian, you crow! I spit on you, for Christians are like weak sheep... I worship the ancient gods, and I love war, blood and chaos!", "sacerdote_angry",[]],
  [anyone,"sacerdote_angry", [],
    "You... You... You are Satan, {playername} - his eyes burn like fire lit by the very flames of Hell - begone from my sight. This land shall neither feed you nor give you rest, for your place is among heathen lands soon to be burnt by God's wrath.", "close_window", [
      # (call_script, "script_change_player_relation_with_faction_ex", "$g_talk_troop_faction", -9),
  ]],
  [anyone|plyr, "sacerdote_talk", [(eq, "$g_player_faith", 1),],
    "I am a Christian, my father -you bow your head in respect-, and I must atone for my past sins.", "sacerdote_ayuda", []],
  [anyone|plyr, "sacerdote_talk", [(neq, "$g_player_faith", 1),],
    "I am not a Christian, but I wish to be converted (conversion to Christianity).", "sacerdote_ayuda", [
      (assign, "$g_player_faith", 1),
      (troop_set_slot, "trp_player", slot_troop_religion, 1), # christian
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_religion, cb3_christian),
      (display_message, "@You are now a Christian."),
      (try_begin),
        (lt, "$g_player_conversions", 3),
        (store_relation,":rel","fac_christians","fac_player_faction"),
        (try_begin),
          (lt,":rel",-5),
          (call_script, "script_set_player_relation_with_faction", "fac_christians", 1),
        (else_try),
          (call_script, "script_change_player_relation_with_faction", "fac_christians", 5), #la q designemos
        (try_end),
      (else_try),
        (call_script, "script_change_player_relation_with_faction", "fac_christians", 5), #la q designemos
      (try_end),
      (call_script, "script_change_player_relation_with_faction", "fac_pagans", -10), #la q designemos
      (troop_get_slot, ":controversy", "trp_player", slot_troop_controversy),
      (val_add, ":controversy", 5),
      (troop_set_slot, "trp_player", slot_troop_controversy, ":controversy"),
      (val_add, "$g_player_conversions", 1),
  ]],
  ##  [anyone|plyr, "sacerdote_talk", [(party_slot_eq, "$current_town", slot_town_lord, "trp_player"),], # le echa
  ##   "This is my kingdom, and I don't want to see you here.", "sacerdote_expulsar", []],
  
  [anyone|plyr, "sacerdote_talk", [],
    "I have no need for a man of God at this time.", "close_window", []],
  
  [anyone, "sacerdote_ayuda", [],
    "Come, my child! - He smiles, pleased. - Our God is one of forgiveness and acceptance, not of revenge and hate like the Pagan devils the barbarians are so keen to worship. I am here to help you, {playername}, " +
    "but you must also help the Church in return. I will pray for your soul, so that you may spend your eternal afterlife in Heaven, but you must donate 300 peningas. - He places his hand confidentially on your shoulder. - I can also preach in your name, {playername}, " +
    "and let all the land know of your Christian purity and holiness, but you must fund my travels through the land. This will cost you 1000 peningas.", "sacerdote_ayuda2", []],
  
  ##  [anyone, "sacerdote_expulsar", [], #le echa
  ##   "Odin will hate you, but I will not here next time you are back.", "close_window", [
  ##                            (assign, "$sacerdote_mosqueado", 1),#le ha echado, no quiere saber nada
  ##       (remove_troop_from_site,"$g_talk_troop","$current_town")]],
  
  [anyone|plyr,"sacerdote_ayuda2",
    [(store_troop_gold,":money","trp_player"),(gt,":money",299),], "Praise God, that he may cleanse us of our sins. I will donate 300 coins.", "sacerdote_sins",
    [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",299),
        (troop_remove_gold, "trp_player", 300),
        (try_begin),
          (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0),
          (call_script, "script_change_player_party_morale", 4),
          (call_script, "script_change_player_honor", 1),
          (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 1),
        (else_try),
          (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,1),
          (call_script, "script_change_player_party_morale", 2),
          (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 1),
        (else_try),
          (troop_slot_ge,"$g_talk_troop",slot_troop_days_on_mission,2),
          (display_message, "@Your men are getting tired of listening to the same old sermons. Perhaps it's time to let it go for a while.", color_bad_news),
        (else_try),
          (display_message,"str_no_money"),
        (try_end),
        (troop_set_slot,"$g_talk_troop",slot_troop_days_on_mission,3),
      (try_end),
  ]],
  
  [anyone, "sacerdote_sins", [],
    "Ego absolvo te a peccatis tuis, in nomine Patris et Filii et Spiritus Sanctii. Amen.", "sacerdote_pretalk", []],
  
  [anyone|plyr,"sacerdote_ayuda2",
    [(store_troop_gold,":money","trp_player"),(gt,":money",999),], "Thank you father, I want this land to love me. I will give you 1000 coins.", "sacerdote_pretalk",
    [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",999),
        (troop_remove_gold, "trp_player", 1000),
        (try_begin),
          (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0),
          (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 5),
        (else_try),
          (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,1),
          (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 4),
        (else_try),
          (this_or_next|troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,2),
          (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,3),
          (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 2),
        (else_try),
          (troop_slot_ge,"$g_talk_troop",slot_troop_days_on_mission,4),
          (display_message, "@The priest is happy about donations, but clearly is annoyed that you are trying to buy him off. Perhaps it's time to let it go, for a while.",color_bad_news),
        (else_try),
          (display_message,"str_no_money"),
        (try_end),
        (troop_set_slot,"$g_talk_troop",slot_troop_days_on_mission,5),
      (try_end),
  ]],
  
  [anyone|plyr,"sacerdote_ayuda2", [], "Are you selling your Faith? You are a pig! May my god feast upon your guts!", "sacerdote_angry",[]],
  
  [anyone|plyr,"sacerdote_ayuda2", [], "Actually, cancel that order.", "sacerdote_pretalk",[]],
  
  #sacerdote chief religion dialogo acaba
  #chief clerigo pagano
  ##  [anyone, "start", [(is_between, "$g_talk_troop", pagano_begin, pagano_end),
  ##                     (eq, "$sacerdote_mosqueado", 1),#le ha echado, no quiere saber nada
  ##                     ],
  ##   "Leave me alone.", "close_window", []],
  
  [anyone, "start", [(is_between, "$g_talk_troop", pagano_begin, pagano_end),
    ],
    "West thu hal, {reg59?my lady:my lord}. I am a priest of Odin, the almighty carrier-off the dead, which, if brave enough, forever rest by his side at the great halls of Walhalla. He is also the trickster god, the one-eyed one, and the leader of the Wild Hunt.", "pagano_talk", []],
  [anyone, "pagano_pretalk", [],
    "West thu hal, {playername}. What do you need?", "pagano_talk", []],
  [anyone|plyr,"pagano_talk", [(eq, "$g_player_faith", 1),(neg|main_party_has_troop, "$g_talk_troop")],
    "I am not a pagan, but follow Christ! You should do the same.", "pagano_angry",[]],
  [anyone,"pagano_angry", [],
    "Oooooodiiiiin! Only because we are in this place will I not immediately offer your life to the gods. - The priest's eyes burn with hot fire. - Begone from my sight! Let this land neither feed you nor give you rest, but speed you away to a cursed grave.", "close_window", [
      #   (call_script, "script_change_player_relation_with_faction_ex", "$g_talk_troop_faction", -9),
  ]],
  [anyone|plyr, "pagano_talk", [(eq, "$g_player_faith", 2),],
    "I am still true to the pagan ways, praying to Woden and waging war. - You bow your head. -", "pagano_ayuda", []],
  [anyone|plyr, "pagano_talk", [(neq, "$g_player_faith", 2),],
    "I wish to be taught about the old gods so that I might honor them (conversion to paganism).", "pagano_ayuda", [
      (assign, "$g_player_faith", 2),
      (troop_set_slot, "trp_player", slot_troop_religion, 2), # pagan
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_religion, cb3_pagan),
      (display_message, "@You are now a pagan, a follower of Odin and other Norse gods."),
      (call_script, "script_change_player_relation_with_faction", "fac_christians", -10), #la q designemos
      (try_begin),
        (lt, "$g_player_conversions", 3),
        (store_relation,":rel","fac_pagans","fac_player_faction"),
        (try_begin),
          (lt,":rel",-5),
          (call_script, "script_set_player_relation_with_faction", "fac_pagans", 1),
        (else_try),
          (call_script, "script_change_player_relation_with_faction", "fac_pagans", 5), #la q designemos
        (try_end),
      (else_try),
        (call_script, "script_change_player_relation_with_faction", "fac_pagans", 5), #la q designemos
      (try_end),
      
      (troop_get_slot, ":controversy", "trp_player", slot_troop_controversy),
      (val_add, ":controversy", 5),
      (troop_set_slot, "trp_player", slot_troop_controversy, ":controversy"),
      (val_add, "$g_player_conversions", 1),
  ]],
  
  ##  [anyone|plyr, "pagano_talk", [(party_slot_eq, "$current_town", slot_town_lord, "trp_player"),], # le echa
  ##   "This is my kingdom and I don't want to see you here.", "pagano_expulsar", []],
  
  [anyone|plyr, "pagano_talk", [],
    "I have no need for a man of any god at this time.", "close_window", []],
  
  [anyone, "pagano_ayuda", [],
    "Come, brave warrior! - He smiles, pleased. - Odin is more than pleased to smile upon great warriors like yourself, and he knows your feats of arms. I am here to bring you back to honour the old gods of our ancestors, {playername}, " +
    "but you must also help us. Christianity spreads like a plague and displaces the old gods from their rightful seats. We need money to recruit warriors to kill their cowardly clerics. - He places his hands on your shoulders. - We ask for just 300 peningas. I can even tell everyone how {playername} is truly favoured by Odin, Thor, and Freiya, " +
    "letting all the kingdom know of your respect for our gods, but you must fund my travels. My travel expenses would amount to 1000 peningas for that.", "pagano_ayuda2", []],
  
  [anyone|plyr,"pagano_ayuda2",
    [(store_troop_gold,":money","trp_player"),(gt,":money",299),], "Kill them all. I will donate 300 coins.", "pagano_sins",
    [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",299),
        (troop_remove_gold, "trp_player", 300),
        (try_begin),
          (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0),
          (call_script, "script_change_player_party_morale", 4),
          (call_script, "script_change_player_honor", -1),
          (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 1),
        (else_try),
          (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,1),
          (call_script, "script_change_player_party_morale", 2),
          (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 1),
        (else_try),
          (troop_slot_ge,"$g_talk_troop",slot_troop_days_on_mission,2),
          (display_message, "@Your men are getting tired of listening to the same old stories about the gods. Perhaps it's time to let it go for a while.", color_bad_news),
        (else_try),
          (display_message,"str_no_money"),
        (try_end),
        (troop_set_slot,"$g_talk_troop",slot_troop_days_on_mission,3),
      (try_end),
  ]],
  
  [anyone, "pagano_sins", [],
    "Thank you, warrior of Woden. I will talk to your men about Woden and his sons Wecta, Baeldaeg, Casere and Wihtlaeg. That will encourage them to fight proudly by your side, to earn their seats at Waelcyrge.", "pagano_pretalk", []],
  
  ##  [anyone, "pagano_expulsar", [], #le echa
  ##   "Odin will hate you, but I will not be here next time you come back.", "close_window", [
  ##                            (assign, "$sacerdote_mosqueado", 1),#le ha echado, no quiere saber nada
  ##       (remove_troop_from_site,"$g_talk_troop","$current_town")]],
  
  [anyone|plyr,"pagano_ayuda2",
    [(store_troop_gold,":money","trp_player"),(gt,":money",999),], "Thank you. I want this realm to love and respect me. I will give you 1000 coins.", "pagano_pretalk",
    [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",999),
        (troop_remove_gold, "trp_player", 1000),
        (try_begin),
          (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,0),
          (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 5),
        (else_try),
          (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,1),
          (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 4),
        (else_try),
          (this_or_next|troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,2),
          (troop_slot_eq,"$g_talk_troop",slot_troop_days_on_mission,3),
          (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 2),
        (else_try),
          (troop_slot_ge,"$g_talk_troop",slot_troop_days_on_mission,4),
          (display_message, "@The priest is happy about being paid to talk, but clearly is annoyed that you are trying to buy him off. Perhaps it's time to let it go for a while.",color_bad_news),
        (else_try),
          (display_message,"str_no_money"),
        (try_end),
        (troop_set_slot,"$g_talk_troop",slot_troop_days_on_mission,5),
      (try_end),
  ]],
  
  [anyone|plyr,"pagano_ayuda2", [], "Are you selling to Woden? What a pig you are!", "pagano_angry",[]],
  
  [anyone|plyr,"pagano_ayuda2", [], "Actually, cancel that order.", "pagano_pretalk",[]],
  #clerigo pagano chief dialogo acaba
  
  
  #monasterio religion dialogos
  #abad
  [trp_abad, "start", [ #mainquest chief
      (check_quest_active, "qst_kennemer_mission_1"),
      (quest_slot_eq,"qst_kennemer_mission_1",slot_quest_current_state,2),
      
      (eq, "$g_encountered_party", "p_monasterio2"),
    ],
    "Well, have you talked to them?^" +
    "For us, these lands are very important, and the jarl's happiness, you must know, depends on ours.^^" +
    "Are you ready for a verdict?", "problema_juicio8", []],
  
  
  [trp_abad, "start", [ #mainquest chief
      (check_quest_active, "qst_kennemer_mission_1"),
      (quest_slot_eq,"qst_kennemer_mission_1",slot_quest_current_state,1),
      
      (eq, "$g_encountered_party", "p_monasterio2"),
    ],
    "Are you ready for my judgment?", "problema_juicio7", []],
  
  [trp_abad, "start", [],
    "What may I do for you?", "abad_talk", []],
  [trp_abad, "abad_pretalk", [],
    "Yes?", "abad_talk", []],
  ###mainquest kennemer mission 1, abad monasterio cercano
  
  [trp_abad|plyr, "abad_talk", [
      (check_quest_active, "qst_kennemer_mission_1"),
      (quest_slot_eq,"qst_kennemer_mission_1",slot_quest_current_state,0),
      
      (eq, "$g_encountered_party", "p_monasterio2"),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (str_store_troop_name,s4,":town_lord"),
    ],
    "I am here for your petition to {s4}. Please explain what has happened.", "problema_juicio1", [
      (str_clear, s4),
  ]],
  
  [anyone ,"problema_juicio1", [
      (str_clear, s2),
    ],
    "{s2}^^I expected... some other person. The jarl, or one of his close associates. May I ask who you are, {reg59?madame:sir}?", "problema_juicio2",
    [
      (str_store_string, s2, "@--The abbot looks you up and down, unconvinced.--", color_good_news),
  ]],
  
  [trp_abad|plyr, "problema_juicio2", [
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (str_store_troop_name,s4,":town_lord"),
    ],
    "My name is {playername}. {s4} is busy, so I am your {reg59?judge:man}.", "problema_juicio3", [
      (str_clear, s4),
  ]],
  
  [trp_abad|plyr, "problema_juicio2", [
      (eq, "$g_player_faith", 1),      ],
    "I am {playername}, a devout fellow Christian. I am here for your help, Father.", "problema_juicio3", []],
  
  [trp_abad|plyr, "problema_juicio2", [
      (eq, "$g_player_faith", 2),      ],
    "{playername}. Remember my name, priest, or my gods will burn your shabby robe. Now, what is it?", "problema_juicio3", []],
  
  [anyone ,"problema_juicio3", [
      (str_clear, s2),
    ],
    "{!}{s2}", "problema_juicio4",
    [
      (try_begin),
        (eq, "$g_player_faith", 1),
        (str_store_string, s2, "@Welcome, then. Listen to me: we need your support."),
      (else_try),
        (eq, "$g_player_faith", 2),
        (str_store_string, s2, "@In nomine pater, the jarl insults us by sending a pagan. Okay, if that's how he wants to play this... Now, listen."),
      (else_try),
        (str_store_string, s2, "@Then welcome {playername}. I'll explain what's going on."),
      (try_end),
  ]],
  
  [anyone ,"problema_juicio4", [
      (str_clear, s2),
    ],
    "{s2}^^Some weeks ago, a monk found this document in our archives. It is a letter where a previous lord three generations back donated land next to the monastery to us. You can read it.", "problema_juicio5",
    [
      (str_store_string, s2, "@--The abbot, after rummaging through his books, draws out a letter to show you.--", color_good_news),
  ]],
  
  [trp_abad|plyr, "problema_juicio5", [(eq, "$sabe_leer", 1),],
    "Let me read it.", "problema_juicio6", []],
  
  [trp_abad|plyr, "problema_juicio5", [(eq, "$sabe_leer", 0)],
    "(You don't know how to read, but feign to the abbot that you are reading the document.)", "problema_juicio6", [(assign, "$temp", 0)]],
  
  [trp_abad|plyr, "problema_juicio5", [(eq, "$sabe_leer", 0)],
    "I don't know how to read. Just tell me what it is about.", "problema_juicio6", [(assign, "$temp", 1)]],
  
  
  [anyone ,"problema_juicio6", [
      (str_clear, s2),
    ],
    "{s2}Well, the document is right and proper, with witnesses and donor name. The problem is that currently a family resides on this piece of land. They say the land has been theirs for generations, but the monastery owns these plots, and we want them to leave. ", "problema_juicio7",
    [
      (try_begin),
        (eq, "$sabe_leer", 1), #sabe leer chief?
        (str_store_string, s2, "@--The document seems quite believable, with good penmanship, where a man named Frethwi gives the monastery several parcels of land. It is signed by several witnesses.--^^"),
      (else_try),
        (eq, "$temp", 0),
        (str_store_string, s2, "@--You look at the text. It is all very nice, with the letters nicely aligned, but, without accompanying illustrations, you do not understand anything.--^^"),
      (try_end),
  ]],
  
  [trp_abad|plyr, "problema_juicio7", [],
    "Well, call the head of family and the monk who found the document. I want to question them.", "close_window", [
      (set_fixed_point_multiplier, 100),
      (get_player_agent_no, ":player_agent"),
      (agent_get_position, pos1, ":player_agent"),
      (position_rotate_z, pos1, -70),
      (agent_set_position, ":player_agent", pos1),
      (start_presentation, "prsnt_abbot_justice_1"),
  ]],
  
  [trp_abad|plyr, "problema_juicio7", [],
    "I don't have the time now. I will be back later.", "close_window", [
      (quest_set_slot,"qst_kennemer_mission_1",slot_quest_current_state, 1),
  ]],
  
  
  [trp_abad|plyr, "problema_juicio8", [],
    "Yes. My verdict is that the land belongs to the monastery.", "problema_juicio9", [
      (call_script, "script_change_player_honor", -5),
  ]],
  
  [trp_abad|plyr, "problema_juicio8", [],
    "Yes. My verdict is that the land belongs to the farmer.", "problema_juicio10", [
      (call_script, "script_change_player_honor", 5),
  ]],
  
  [trp_abad|plyr, "problema_juicio8", [],
    "Yes. My verdict is that the land belongs to the jarl.", "problema_juicio10", [
      (call_script, "script_change_player_honor", -2),
  ]],
  
  [trp_abad|plyr, "problema_juicio8", [],
    "Yes. My verdict is that the land belongs to nobody.", "problema_juicio10", []],
  
  [trp_abad|plyr, "problema_juicio8", [],
    "No, I need more time to talk with them.", "close_window", [
      (quest_set_slot,"qst_kennemer_mission_1",slot_quest_current_state, 2),
      (store_current_scene,":current_scene"),
      (modify_visitors_at_site,":current_scene"),
      (reset_visitors),
      (set_visitor, 41, "trp_farmer"),
      (set_visitor, 42, "trp_monjes"),
      (set_visitor, 43, "trp_abad"),
      (set_jump_entry, 0),
      
      (set_jump_mission, "mt_monasterio_interior_juicio"),
      (jump_to_scene,":current_scene"),
      (change_screen_mission),
  ]],
  
  
  [anyone ,"problema_juicio9", [
      (str_clear, s2),
    ],
    "I am sure you have made the right decision. Go back to the jarl and advise him that we are very happy with the outcome. We will tell the people that he is just and devout. Oh, and we have a little gift for you.", "close_window",
    [
      (call_script, "script_troop_add_gold", "trp_player", 150),
      # (str_store_string, s2, "@Back to the jarl of Kennemer."), not needed with script_succeed_quest
      # (add_quest_note_from_sreg, "qst_kennemer_mission_1", 5, s2, 0),
      
      (str_store_string, s2, "@Info:"),
      (call_script, "script_start_quest", "qst_notes_frisa", "trp_player"),
      
      (str_clear, s3),
      (str_store_party_name_link, s3, "p_castle_63"),
      (str_store_string, s2, "@Note 1: You chose to give the land to the monastery near {s3}."),
      (add_quest_note_from_sreg, "qst_notes_frisa", 4, s2, 0),
      
      (call_script, "script_set_player_relation_with_faction", "fac_kingdom_4", 5), #VC-3091
      (quest_set_slot,"qst_kennemer_mission_1",slot_quest_current_state, 3),
      (call_script, "script_succeed_quest", "qst_kennemer_mission_1"),
  ]],
  
  [anyone ,"problema_juicio10", [
      (str_clear, s3),      ],
    "What? That land is ours! Well, if the jarl wants problems, he shall have them. Leave. Now.", "close_window",
    [
      (str_store_string, s2, "@Info:"),
      (call_script, "script_start_quest", "qst_notes_frisa", "trp_player"),
      # (str_store_string, s2, "@Back to the jarl of Kennemer."), not needed with script_fail_quest
      # (add_quest_note_from_sreg, "qst_kennemer_mission_1", 5, s2, 0),
      
      (str_clear, s3),
      (str_store_party_name_link, s3, "p_castle_63"),
      (str_store_string, s2, "@Note 1: You chose not to give the land to the monastery near {s3}."),
      (add_quest_note_from_sreg, "qst_notes_frisa", 4, s2, 0),
      (str_store_string, s1, "@--The abbot opens his eyes wide.--", color_good_news),
      (call_script, "script_set_player_relation_with_faction", "fac_kingdom_4", 5), #VC-3091
      (quest_set_slot,"qst_kennemer_mission_1",slot_quest_current_state, 4),
      (call_script, "script_fail_quest", "qst_kennemer_mission_1"),
      # (assign, "$g_leave_encounter",1),
  ]],
  
  ######
  #### catach quest chief
  [trp_abad|plyr, "abad_talk", [(eq, "$g_encountered_party", "p_monasterio29"),
      (check_quest_active,"qst_cathach_colum"),(quest_slot_eq,"qst_cathach_colum",slot_quest_current_state, 1),],
    "I have come to get a book called: 'The Cathach of Colum Cille.'", "abad_catach1", []],
  [trp_abad|plyr, "abad_talk", [(eq, "$g_encountered_party", "p_monasterio29"),
      (check_quest_active,"qst_cathach_colum"),(quest_slot_eq,"qst_cathach_colum",slot_quest_current_state, 2),],
    "About the book, 'The Cathach of Colum Cille'...", "abad_catach2", []],
  [trp_abad|plyr, "abad_talk", [(eq, "$g_encountered_party", "p_monasterio29"),
      (player_has_item,"itm_relic"),],
    "I have come to return 'The Cathach of Colum Cille' to you.", "abad_catachbackbook", []],
  
  [trp_abad, "abad_catach1", [],
    "But... but... that's not possible {reg59?lady:lord}. 'The Cathach of Colum Cille' is a relic, it is a copy made at night by a miraculous light of Colum Cille - Saint Columba! " +
    "Moreover, the book doesn't even belong to us. We are just the guardians. It really belongs to Clan o Domhnaill from Ui Neill. It serves as a rallying cry and protector in battle. " +
    "It protects them in battle and guarantees victory in war. Do you want to become an enemy of the Ui Neill?", "abad_catach2",[
  ]],
  
  [trp_abad|plyr, "abad_catach2", [],
    "I say, I will take the book, regardless, and I will kill anyone who stands in my way.", "abad_catach3", []],
  [trp_abad|plyr, "abad_catach2", [(eq, "$g_player_faith", 1),],
    "Pater, I am a Christian, and this book is very important to me. I will make a donation.", "abad_catach4", []],
  
  [trp_abad|plyr, "abad_catach2", [
      #(store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      #(gt, ":persuasion", 3),
    ],
    "I need this book to rescue prisoners. Isn't that the work of God? To save lives? (Persuasion)", "abad_catachpers", []],
  
  [trp_abad|plyr, "abad_catach2", [
    ],
    "If you do not give me the book, I will kill everyone here. (Power Strike)", "abad_dalibro_ps", []],
  
  
  [trp_abad, "abad_catach3", [],
    "Then you have to kill us all and take the book from our dead hands. God will make us martyrs and condemn you.", "close_window",[
      (mission_disable_talk),
      (quest_set_slot,"qst_cathach_colum",slot_quest_current_state, 3),
  ]],
  [trp_abad, "abad_catach4", [],
    "Sorry, but it's not a question of money. This is a relic, and it is too sacred to sell.", "abad_catach2c",[
  ]],
  [trp_abad|plyr, "abad_catach2c", [],
    "Pater, it is too important for me. I need to find the hideout where a Viking holds prisoners. They are in danger. You must help me, pater. This book is my only hope to save them.", "abad_catach3c", []],
  [trp_abad, "abad_catach3c", [        (gt, "$player_honor", 10),],
    "I understand that you want to save innocent people, but the book belongs to the Ui Neill of Aileach and Mide. " +
    "Well, I could give it to you, for your cause is honorable. I could tell the Ui Neill that you are a Viking who stole it from us by the sword, but they will hate you and become your enemies. Are you sure?", "abad_catach4c",[
  ]],
  [trp_abad, "abad_catach3c", [],
    "I'm not moved by your words.", "abad_pretalk",[
  ]],
  #devuelve libro
  [trp_abad, "abad_catachbackbook", [],
    "Thank you. May God bless you.", "abad_pretalk",[
      (str_store_string, s2, "@Note: You returned 'The Cathach of Colum Cille' to Gleann Da Loch."),
      (add_quest_note_from_sreg, "qst_notes_global", 6, s2, 0),
      (troop_remove_item, "trp_player", "itm_relic"),
      (call_script, "script_change_troop_renown", "trp_player", 6),
      (call_script, "script_change_player_honor", 10),
      (call_script, "script_change_player_relation_with_faction", "fac_christians", 5),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_18", 25),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_19", 25),
  ]],
  
  #persuasion
  [trp_abad, "abad_catachpers", [       (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (gt, ":persuasion", 4),
    ],
    "I understand that you want to save innocent people, but the book belongs to the Ui Neill of Aileach and Mide. " +
    "Well, I could give it to you. Your cause is honorable, and I could tell the Ui Neill that a Viking stole it from us by the sword, and not mention your name.", "abad_catachpre4c",[
  ]],
  [trp_abad, "abad_catachpers", [],
    "I'm not moved by your words. Sorry.", "close_window",[
      ##    (mission_disable_talk),
      ##    (quest_set_slot,"qst_cathach_colum",slot_quest_current_state, 2),
  ]],
  [trp_abad|plyr, "abad_catachpre4c", [],
    "Thank you, pater. God will be pleased.", "abad_dalibro", [
  ]],
  ###
  
  [trp_abad|plyr, "abad_catach4c", [],
    "Yes, pater. I do not mind the enmity of Ui Neill. I only desire to save people dearest to me.", "abad_dalibro", [
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_18", -50),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_19", -50),
  ]],
  [trp_abad|plyr, "abad_catach4c", [],
    "You are right. Let me think about this.", "abad_pretalk", [
      #(quest_set_slot,"qst_cathach_colum",slot_quest_current_state, 2),
  ]],
  
  
  [trp_abad, "abad_dalibro", [],
    "Well, here's the book. Take care of it. It is a valuable relic. If one day you are able, bring it back.", "abad_pretalk",[
      (troop_add_item, "trp_player","itm_relic",0),
      (call_script, "script_succeed_quest", "qst_cathach_colum"),
      (quest_set_slot,"qst_cathach_colum",slot_quest_current_state, 4),
  ]],
  
  
  [trp_abad, "abad_dalibro_ps", [(store_skill_level, ":pwst", "skl_power_strike", "trp_player"),
      (lt, ":pwst", 5),],
    "Then you have to kill us all and take the book from our dead hands. God will make us martyrs and condemn you.", "close_window",[
      (mission_disable_talk),
      (quest_set_slot,"qst_cathach_colum",slot_quest_current_state, 3),
  ]],
  [trp_abad, "abad_dalibro_ps", [],
    "Take the book. I will not allow you to kill all those people, but a divine curse will fall on you. Now, go away, demon.", "close_window",[
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_18", -50),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_19", -50),
      (call_script, "script_change_player_relation_with_faction", "fac_christians", -50),
      (call_script, "script_change_player_honor", -10),
      (troop_add_item, "trp_player","itm_relic",0),
      (mission_disable_talk),
      (call_script, "script_succeed_quest", "qst_cathach_colum"),
      (quest_set_slot,"qst_cathach_colum",slot_quest_current_state, 4),
  ]],
  ###
  ######Add-ons story
  [trp_abad|plyr, "abad_talk", [
      (check_quest_active, "qst_blank_quest_23"),
      (quest_slot_eq,"qst_blank_quest_23",slot_quest_current_state,0),
      
      (eq, "$g_encountered_party", "p_monasterio25"),
    ],
    "I received your message. Why have you sent for me?", "addonstoryabad1", [
  ]],
  [trp_abad|plyr, "abad_talk", [
      (check_quest_active, "qst_blank_quest_23"),
      (quest_slot_eq,"qst_blank_quest_23",slot_quest_current_state,25), #no interested, now yes
      
      (eq, "$g_encountered_party", "p_monasterio25"),
    ],
    "I could be interested in your offer.", "addonstoryabad1_re", [
  ]],
  ###
  [trp_abad|plyr, "abad_talk", [
      (check_quest_active, "qst_blank_quest_24"),
      (check_quest_succeeded, "qst_blank_quest_24"),
      (quest_slot_eq,"qst_blank_quest_24",slot_quest_current_state,1),
      
      (eq, "$g_encountered_party", "p_monasterio25"),
    ],
    "'The Snake' is dead.", "addonsthesnakedead", [
  ]],
  
  ### back from morrigan quest
  [trp_abad|plyr, "abad_talk", [
      (check_quest_active, "qst_blank_quest_23"),
      (check_quest_succeeded, "qst_blank_quest_23"),
      (eq, "$g_encountered_party", "p_monasterio25"),
    ],
    "Morrigan won't be a problem any more.", "abadmorrigan_end1", [
  ]],
  ###
  ### looking for Mael Bresail
  [trp_abad|plyr, "abad_talk", [
      (check_quest_active, "qst_blank_quest_26"),
      (quest_slot_eq,"qst_blank_quest_26",slot_quest_current_state,5),
      (eq, "$g_encountered_party", "p_monasterio25"),
    ],
    "We have to talk about Mael Bresail.", "abadmaelbresail_1", [
  ]],
  ###
  [trp_abad|plyr, "abad_talk", [
      (neg|check_quest_succeeded, "qst_blank_quest_25"),
      (check_quest_active, "qst_blank_quest_25"),
      (quest_get_slot, ":quest_current_state", "qst_blank_quest_25", slot_quest_current_state),
      (ge, ":quest_current_state", 2),
      
      (eq, "$g_encountered_party", "p_monasterio25"),
    ],
    "I know where Flaithbertach's grandchildren are.", "addonsflaithbertach1", [
  ]],
  [anyone, "addonsflaithbertach1", [], "That's good news. You're lucky, for my patron wants to hear it directly from you. " +
    "He is a powerful man who doesn't like long florid stories. When he asks you something, just give him a simple answer. I assure you that if you make a good impression, you will have a bright future. My patron's name is Mael Bresail. You can find him at the court of Aileach.","addonsflaithbertach2",[
      (str_store_party_name_link, s3, "p_town_25"),
      (str_store_string, s2, "@The abbot of Finian told you that Mael Bresail, his patron, is in {s3} awaiting your news about Flaithbertach's grandchildren."),
      (add_quest_note_from_sreg, "qst_blank_quest_25", 7, s2, 0),
  ]],
  [anyone|plyr,"addonsflaithbertach2", [
      ], "Very well, I will see you soon.", "close_window", [
  ]],
  
  ###
  [trp_abad|plyr, "abad_talk", [
      (check_quest_active, "qst_blank_quest_25"),
      (check_quest_succeeded, "qst_blank_quest_25"),
      (eq, "$g_encountered_party", "p_monasterio25"),
    ],
    "I talked to Mael Bresail.", "addonsmaelflaithbertach1", [
  ]],
  [anyone, "addonsmaelflaithbertach1", [], "Yes, I know. You surely noticed that he is generous toward those who serve him well.","addonsmaelflaithbertach2",[
  ]],
  [anyone|plyr,"addonsmaelflaithbertach2", [
      ], "Yes, the man is rich and takes care of his own.", "addonsmaelflaithbertach3", [
  ]],
  [anyone|plyr,"addonsmaelflaithbertach2", [
      ], "He didn't impress me at all.", "addonsmaelflaithbertach3_2", [
  ]],
  [anyone|plyr,"addonsmaelflaithbertach2", [
      ], "I believe you owe me a reward.", "addonsmaelflaithbertach3_3", [
  ]],
  [anyone, "addonsmaelflaithbertach3", [], "I'm glad to hear that, but back to our business. Here is your reward for finding out where Flaithbertach's grandchildren were hiding.","addonsmaelflaithbertach4",[
      (call_script, "script_troop_add_gold", "trp_player", 5000),
      (call_script, "script_end_quest", "qst_blank_quest_25"),
      (add_xp_as_reward, 1000),
  ]],
  [anyone, "addonsmaelflaithbertach3_2", [], "I guess you didn't have enough time to get to know him better, but back to our business. Here is your reward for finding out where Flaithbertach's grandchildren were hiding.","addonsmaelflaithbertach4",[
      (call_script, "script_troop_add_gold", "trp_player", 5000),
      (call_script, "script_end_quest", "qst_blank_quest_25"),
      (add_xp_as_reward, 1000),
  ]],
  [anyone, "addonsmaelflaithbertach3_3", [], "Well, well, back quickly to what's important to you. Here is your reward for finding out where Flaithbertach's grandchildren were hiding.","addonsmaelflaithbertach4",[
      (call_script, "script_troop_add_gold", "trp_player", 5000),
      (call_script, "script_end_quest", "qst_blank_quest_25"),
      (add_xp_as_reward, 1000),
  ]],
  [anyone|plyr,"addonsmaelflaithbertach4", [
      ], "Thank you, but he mentioned another task...", "addonstoryabad6_1m", [
  ]],
  [anyone|plyr,"addonsmaelflaithbertach4", [
      ], "He told me that I would get more peningas. (persuasion)", "addonsmaelflaithbertach5", [
  ]],
  
  [anyone, "addonsmaelflaithbertach5", [		(store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (gt, ":persuasion", 5),
      ], "Did he say that? Then let me open my purse again. I'll give you 2,000 peningas more. Now, it's time to talk about out next task.","addonsmaelflaithbertach6",[
      (call_script, "script_troop_add_gold", "trp_player", 2000),
  ]],
  [anyone, "addonsmaelflaithbertach5", [], "I like jokes, but we have more important things to deal with. Please, let's be serious. Time to talk about out next task.","addonsmaelflaithbertach6",[
  ]],
  [anyone|plyr,"addonsmaelflaithbertach6", [
      ], "Very well, I am listening.", "addonstoryabad6_1m", [
  ]],
  ###
  [anyone,"addonstoryabad1", [
      (str_clear, s4),
    ],
    "{!}{s4}", "addonstoryabad2",[
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (try_begin),
        (lt, "$player_honor", -10),
        (str_store_string, s4, "@So you're {playername}. I've heard about you. Personally, I dislike the reports of your sinfulness, but I wasn't the one making the decision. " +
        "Here is one thousand peningas. Now listen..."),
      (else_try),
        (ge, "$player_honor", 25),
        (str_store_string, s4, "@So you're {playername}. I've heard about you. You're someone who loves the people and treats others with kindness. You deserve this one thousand peningas. Now listen, for my patron has a mission for you..."),
      (else_try),
        (ge, ":player_renown", 300),
        (str_store_string, s4, "@So you're {playername}. I cannot deny that your reputation precedes you. I have heard of you from many travelers. For better or worse, you seem destined to leave your mark on the world. " +
        "Here is one thousand peningas. Now listen, for my patron has a mission for you..."),
      (else_try),
        (str_store_string, s4, "@So you're {playername}. I do not know much about you, and I'm not particularly interested to learn. However, my patron gave me a list, and it included your name. " +
        "Here is one thousand peningas. Now listen, for my patron has a mission for you..."),
      (try_end),
  ]],
  [anyone|plyr,"addonstoryabad2", [
      ], "Thank you for the money. Who is your patron?", "addonstoryabad3", [
      (call_script, "script_troop_add_gold", "trp_player", 1000),
  ]],
  [anyone|plyr,"addonstoryabad2", [
      ], "Thank you for the money. I am listening.", "addonstoryabad4", [
      (call_script, "script_troop_add_gold", "trp_player", 1000),
  ]],
  [anyone|plyr,"addonstoryabad2", [
      ], "Give this money to the orphans. Who is your patron?", "addonstoryabad5", [
  ]],
  [anyone|plyr,"addonstoryabad2", [
      ], "Pater, give this money to the orphans and widows.", "addonstoryabad4", [
      (call_script, "script_change_player_honor", 1),
  ]],
  
  [anyone, "addonstoryabad3", [], "You will learn that in time. For now, I will only say that he is someone important, a man who can make or break kings.","addonstoryabad4",[]],
  [anyone, "addonstoryabad5", [], "I appreciate your interest in our orphans, but I cannot answer your question. My patron wants to remain anonymous for now. " +
    "I will tell you that he is someone important, so important that he sits at the table with kings, and they listen.","addonstoryabad4",[]],
  [anyone, "addonstoryabad4", [], "You will be surprised to know that my patron is a mighty man, and yet he has chosen you. He watches you, for his spies and informers are everywhere. " +
    "He has entrusted you with an important mission, for which you will be generously rewarded.","addonstoryabad6",[]],
  [anyone|plyr,"addonstoryabad6", [
      ], "Speaking of reward is music to my ears.", "addonstoryabad6_1", [
  ]],
  [anyone|plyr,"addonstoryabad6", [
      ], "I am listening.", "addonstoryabad6_1", [
  ]],
  
  [anyone, "addonstoryabad1_re", [ #second try
    ],
    "Well...", "addonstoryabad6_1", [
  ]],
  
  [anyone, "addonstoryabad6_1", [], "--The abbot clears his throat and fixes his eyes on yours--^^" +
    "A dangerous man, a robber and a murderer, the enemy of my patron, has taken refuge in the old land of the Picts and is recruiting an army of outlaws. He plans to return to Eriu and attack the good people that live here. " +
    "My patron's spies have found out that this man is recruiting warriors from the mead hall of Scuin. This man must be stopped. " +
    "You will be paid 5,000 peningas to put an end to his life.","addonstoryabad7descendiente1",[]],
  [anyone|plyr,"addonstoryabad7descendiente1", [
      ], "Tell me about this man and why he must die.", "addonstoryabad8descendiente1", [
  ]],
  [anyone|plyr,"addonstoryabad7descendiente1", [
      ], "Five thousand peningas? Sounds good, but I want another 1,000 in advance for expenses.", "addonstoryabad9_1descendiente1", [
  ]],
  [anyone|plyr,"addonstoryabad7descendiente1", [
      ], "Without a doubt, I am your {reg59?woman:man}.", "addonstoryabad10descendiente1", [
  ]],
  [anyone|plyr,"addonstoryabad7descendiente1", [
      ], "No, I'm not interested. Sorry.", "addonstoryabad9_2descendiente1", [
      (quest_set_slot,"qst_blank_quest_23",slot_quest_current_state, 25), #status 25, non usable until he accepts
  ]],
  
  [anyone, "addonstoryabad8descendiente1", [], "He is called 'the Snake.' He is an exile and descendant of a cursed family who tried to impose their power in Eriu. " +
    "It took a lot of effort and lives to defeat him, but The 'Snake' escaped.","addonstoryabad9descendiente1",[]],
  
  [anyone|plyr,"addonstoryabad9descendiente1", [
      ], "Five thousand peningas? Sounds good, but I want another 1,000 for expenses now.", "addonstoryabad9_1descendiente1", [
  ]],
  [anyone|plyr,"addonstoryabad9descendiente1", [
      ], "Without a doubt, I am your {reg59?woman:man}.", "addonstoryabad10descendiente1", [
  ]],
  [anyone|plyr,"addonstoryabad9descendiente1", [
      ], "No, I'm not interested. Sorry.", "addonstoryabad9_2descendiente1", [
      (quest_set_slot,"qst_blank_quest_23",slot_quest_current_state, 25), #status 25, non usable until he accepts
  ]],
  
  [anyone, "addonstoryabad9_1descendiente1", [], "Money is not a problem. Take 1,000 peningas. Now, we have a deal.","addonstoryabad10descendiente1",[
      (call_script, "script_troop_add_gold", "trp_player", 1000),]],
  
  [anyone, "addonstoryabad9_2descendiente1", [], "Very well, I guess you need time to think about it. Come back if you change your mind.","close_window",[]],
  
  [anyone, "addonstoryabad10descendiente1", [], "Very well. I recommend that you travel with all haste to Scuin. " +
    "Look for a man there called The 'Snake' in the mead hall. Return quickly once the problem is solved. Godspeed.","addonstoryabad11descendiente1",[
      (str_store_party_name_link, s3, "p_town_15"),
      (str_store_string, s2, "@The abbot of Finian has asked you travel to {s3} and kill a man called 'The Snake.' Go to the mead hall and meet him."),
      (call_script, "script_start_quest", "qst_blank_quest_24", "trp_abad"),
      (quest_set_slot,"qst_blank_quest_24",slot_quest_current_state, 0), #status 0
      (str_store_string, s2, "@You are working for the anonymous patron of the abbot of Finian."),
      (add_quest_note_from_sreg, "qst_blank_quest_23", 4, s2, 0),
      (quest_set_slot,"qst_blank_quest_23",slot_quest_current_state, 23), #status 23, non usable until right moment
      (str_store_string, s2, "@Info:"),
      (call_script, "script_start_quest", "qst_blank_quest_27", "trp_player"),
  ]],
  [anyone|plyr,"addonstoryabad11descendiente1", [
      ], "You keep those 5,000 peningas handy, for I will return soon.", "close_window", [
  ]],
  [anyone|plyr,"addonstoryabad11descendiente1", [
      ], "I shall certainly do so, pater.", "close_window", [
  ]],
  ###Snake dead
  [anyone, "addonsthesnakedead", [], "I know. Our spy sent a messenger with the news. Here is your reward. As you see, my patron is very generous.^^" +
    "That being said, I have a suggestion. Our spy told us that you had bantered away with The 'Snake' too much. This was a mistake. He could have dissuaded you, and also the less you know about my patron's business, the better it is, for your own sake.","addonsthesnakedead2",[
      (call_script, "script_troop_add_gold", "trp_player", 5000),]],
  [anyone|plyr,"addonsthesnakedead2", [
      ], "Is that a threat?", "addonsthesnakedead2_1", [
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -3),
  ]],
  [anyone|plyr,"addonsthesnakedead2", [
      ], "I understand.", "addonsthesnakedead3", [
  ]],
  [anyone|plyr,"addonsthesnakedead2", [
      ], "That's what I do.", "addonsthesnakedead2_2", [
  ]],
  [anyone, "addonsthesnakedead2_1", [], "Hardly. I am an abbot, not a killer. It was a suggestion. Do what you want.^^" +
    "But enough about that. I have another task for you that pays even better.","addonsthesnakedead3",[
  ]],
  [anyone, "addonsthesnakedead2_2", [], "It was just a suggestion. You are being paid well for this work, so it would be foolish to annoy your patron.^^" +
    "But enough about that. I have another task for you that pays even better.","addonsthesnakedead3",[
  ]],
  
  [anyone, "addonsthesnakedead3", [], "There is another danger that threatens Eriu...","addonsthesnakedead4",[
  ]],
  [anyone|plyr,"addonsthesnakedead4", [
      ], "I hope that it is not another murder. I am not an assassin.", "addonsthesnakedead4_1", [
  ]],
  [anyone|plyr,"addonsthesnakedead4", [
      ], "[Say Nothing]", "addonsthesnakedead5", [
  ]],
  [anyone, "addonsthesnakedead4_1", [], "No, thank God. In this case, it is only information. Listen.","addonsthesnakedead5",[
  ]],
  [anyone, "addonsthesnakedead5", [], "Across the sea, Caer Meguaidd has become a refuge for the enemies of Eriu. It is a place that breeds intrigues. " +
    "Two people in particular pose dangers to us - they are Flaithbertach's grandchildren. Your mission is simple: go and find out where they are hiding. As nobody connects you with my patron, you can simply ask the mayor, a man called Donngal, for this information. " +
    "For this easy task, you will get another 5,000 peningas.","addonsthesnakedead6",[
  ]],
  [anyone|plyr,"addonsthesnakedead6", [
      ], "We have a deal.", "addonsthesnakedead7", [
  ]],
  [anyone|plyr,"addonsthesnakedead6", [
      ], "No, I'm not interested. Sorry.", "addonsthesnakedead8", [
  ]],
  
  [anyone, "addonsthesnakedead8", [], "You're working for my boss; I'm just a messenger. I give you information; you do what you want.","addonsthesnakedead7",[]],
  
  [anyone, "addonsthesnakedead7", [], "Donngal has a weakness for gold. I'm sure you'll be able to convince him. Come back as soon as possible with news about the location of Flaithbertach's grandchildren. Good luck.","addonsthesnakedead9",[
      (quest_set_slot,"qst_blank_quest_24",slot_quest_current_state, 2), #status 0
      (call_script, "script_end_quest", "qst_blank_quest_24"),
      (add_xp_as_reward, 1000),
      
      (str_store_party_name_link, s3, "p_town_22"),
      (str_store_string, s2, "@The abbot of Finian has asked you travel to {s3} and learn the whereabouts of Flaithbertach's grandchildren from the mayor called Donngal."),
      (call_script, "script_start_quest", "qst_blank_quest_25", "trp_abad"),
      (quest_set_slot,"qst_blank_quest_25",slot_quest_current_state, 0), #status 0
  ]],
  [anyone|plyr,"addonsthesnakedead9", [
      ], "You keep those 5,000 peningas handy, for I will return soon.", "close_window", [
  ]],
  [anyone|plyr,"addonsthesnakedead9", [
      ], "Farewell, pater.", "close_window", [
  ]],
  
  ###morrigan begin
  [anyone, "addonstoryabad6_1m", [], "--The abbot clears his throat and fixes his eyes on yours--^^" +
    "At the west end of Eriu there is a village with, err... problems. It is a remote place, near harsh, sea-beaten cliffs and populated by fishermen. " +
    "Its residents have asked for help because a great evil has befallen them. It shatters men beyond recognition and kidnaps their wives and children.","addonstoryabad7",[]],
  [anyone, "addonstoryabad7", [], "My patron wants you to travel to this village, Bal Luighne, and talk to its leader. " +
    "He will tell you all the details. Then put an end to the evil in the area and come back here. Nothing particularly complicated, but you will be paid handsomely for fulfilling your mission. " +
    "To be precise, you will be paid 10,000 peningas for this favor.","addonstoryabad8",[]],
  
  [anyone|plyr,"addonstoryabad8", [
      ], "Are there not lords of Eriu that can deal with this problem?", "addonstoryabad9_1", [
  ]],
  [anyone|plyr,"addonstoryabad8", [
      ], "Can you tell me more about the evil that attacks them?", "addonstoryabad9_2", [
  ]],
  [anyone|plyr,"addonstoryabad8", [
      ], "Ten thousand peningas? Sounds good, but I want 2,000 extra for expenses now.", "addonstoryabad9_3", [
  ]],
  [anyone|plyr,"addonstoryabad8", [
      ], "If these people need help, I will go. Without a doubt, I am your hero.", "addonstoryabad9_4", [
  ]],
  [anyone|plyr,"addonstoryabad8", [
      ], "No, I'm not interested. Sorry.", "addonstoryabad9_5", [
  ]],
  [anyone, "addonstoryabad9_1", [], "The lords in Eriu are too busy making war on each other, and the area near Bal Luighne is remote and unimportant. I hope my patron didn't make a mistake in selecting you...","addonstoryabad10_2",[]],
  [anyone, "addonstoryabad9_2", [], "I have nothing else to add. The news lacks details, and the fishermen are terrified. I think the area leader of Bal Luighne would be the best person to get details from.","addonstoryabad10_1",[]],
  [anyone, "addonstoryabad9_3", [], "As you know, money is not a problem, and I apologize for underestimating your needs. Take 2,000 more peningas. Now, we have a deal.","addonstoryabad11",[
      (call_script, "script_troop_add_gold", "trp_player", 2000),]],
  [anyone, "addonstoryabad9_4", [], "That's what I expected to hear. My patron certainly was not wrong about you.","addonstoryabad11",[]],
  [anyone, "addonstoryabad9_5", [], "I understand, but this is a unique opportunity for you. If you do not accept, another warlord will take the job. " +
    "Are you sure you're not interested?","addonstoryabad10_2",[]],
  [anyone|plyr,"addonstoryabad10_2", [
      ], "Can you tell me more about the evil that attacks them?", "addonstoryabad9_2", [
  ]],
  [anyone|plyr,"addonstoryabad10_2", [
      ], "Forget what I said. I will go. Without a doubt, I am your hero.", "addonstoryabad9_4", [
  ]],
  [anyone|plyr,"addonstoryabad10_2", [
      ], "Yes, I am sure. I'm not interested. Farewell.", "addonstoryabad10_3", [
      (fail_quest, "qst_blank_quest_23"),
      (call_script, "script_end_quest", "qst_blank_quest_23"),
  ]],
  [anyone, "addonstoryabad10_3", [], "Well, I'm sorry about your answer, but I respect your decision. We will not be bothering you anymore.","close_window",[]],
  [anyone|plyr,"addonstoryabad10_1", [
      ], "Ten thousand peningas? Sounds good, but I want 2,000 extra for expenses now.", "addonstoryabad9_3", [
  ]],
  [anyone|plyr,"addonstoryabad10_1", [
      ], "Are there not lords of Eriu that can deal with this problem?", "addonstoryabad9_1", [
  ]],
  [anyone|plyr,"addonstoryabad10_1", [
      ], "If these people need help, I will go. Without a doubt, I am your hero.", "addonstoryabad9_4", [
  ]],
  [anyone|plyr,"addonstoryabad10_1", [
      ], "No, I'm not interested. Sorry.", "addonstoryabad9_5", [
  ]],
  
  [anyone, "addonstoryabad11", [], "I recommend that you take your best weapons and travel with all haste to Bal Luighne. Look for a man there called Caliacas. Return quickly once the problem is solved. Godspeed.","addonstoryabad12",[
      (str_store_party_name_link, s3, "p_village_78"),
      (str_store_string, s2, "@The abbot of Finian has asked you travel to {s3} and investigate what kind of evil is attacking fishermen. Enter the village and look for a man there called Caliacas."),
      (add_quest_note_from_sreg, "qst_blank_quest_23", 4, s2, 0),
      (quest_set_slot,"qst_blank_quest_23",slot_quest_current_state, 1), #status 0
  ]],
  [anyone|plyr,"addonstoryabad12", [
      ], "You keep those 10,000 peningas handy, for I will return soon.", "close_window", [
  ]],
  [anyone|plyr,"addonstoryabad12", [
      ], "I shall certainly do so, pater.", "close_window", [
  ]],
  
  ####
  ###morrigan end
  [anyone, "abadmorrigan_end1", [], "I did not expect anything less from you. Caliacas sent a messenger confirming that the attacks have ceased and the farmers have burned the devil's lair where Morrigan was hiding. " +
    "Now, thanks to you, this world is safer. Here is your reward: 10,000 peningas.","abadmorrigan_end2",[
  ]],
  [anyone|plyr,"abadmorrigan_end2", [
      ], "Thank you, abbot.", "abadmorrigan_end3", [
      (call_script, "script_troop_add_gold", "trp_player", 10000),
  ]],
  [anyone|plyr,"abadmorrigan_end2", [
      ], "Give that money to my men. They deserve all this silver.", "abadmorrigan_end3", [
      (call_script, "script_change_player_party_morale", 40),
  ]],
  
  [anyone, "abadmorrigan_end3", [(quest_slot_eq, "qst_blank_quest_25",slot_quest_current_state, 3),], "I have bad news. The men sent to kill Flaithbertach's grandchildren had succeeded, " +
    "but when the Ard Ruire, Aed mac Niall, saw the bodies, he said that they were not the right children. Angry, he ordered the men executed. The king knows you were involved, so I would stay far away from his reach.","abadmorrigan_end4",[
      (call_script, "script_change_player_relation_with_troop", "trp_kingdom_18_lord", -30),
  ]],
  [anyone, "abadmorrigan_end3", [(quest_slot_eq, "qst_blank_quest_25",slot_quest_current_state, 4),], "I have bad news. When men sent to kill Flaithbertach's grandchildren came to the farm, they found nobody. " +
    "I don't know what happened, but the Ard Ruire, Aed mac Niall, has promised to punish you if you cross his path. I would stay far away from his reach.","abadmorrigan_end4",[
      (call_script, "script_change_player_relation_with_troop", "trp_kingdom_18_lord", -80),
  ]],
  
  [anyone, "abadmorrigan_end3", [], "For my part, I have finished my task. Now you must go and see Mael Bresail. From now on, you will deal directly with him. Just a tip: he is a powerful, easy to anger man, and I wouldn't want him as my enemy. " +
    "Never lie to him and stay loyal, and everything will be fine... Otherwise, you may not live too long. Good luck, {playername}.","abad_pretalk",[
      (call_script, "script_end_quest", "qst_blank_quest_23"),
      (add_xp_as_reward, 1000),
      (str_store_party_name_link, s3, "p_town_25"),
      (str_store_string, s2, "@You have finished the missions given to you by the abbot of Finian. It's time to talk with Mael Bresail, his patron, who is awaiting you in {s3}."),
      (call_script, "script_start_quest", "qst_blank_quest_26", "trp_abad"),
      (quest_set_slot,"qst_blank_quest_26",slot_quest_current_state, 0), #status 0
  ]],
  [anyone, "abadmorrigan_end4", [], "For my part, I have finished my task. Now you must go and see Mael Bresail. From now on, you will deal directly with him. Just a tip: he is a powerful, easy to anger man, and I wouldn't want him as my enemy " +
    "Never lie to him and stay loyal, and everything will be fine... Otherwise, you may not live too long. Good luck, {playername}.","abad_pretalk",[
      (call_script, "script_end_quest", "qst_blank_quest_23"),
      (add_xp_as_reward, 1000),
      (str_store_party_name_link, s3, "p_town_25"),
      (str_store_string, s2, "@You have finished the missions given to you by the abbot of Finian. It's time to talk with Mael Bresail, his patron, who is awaiting you in {s3}."),
      (call_script, "script_start_quest", "qst_blank_quest_26", "trp_abad"),
      (quest_set_slot,"qst_blank_quest_26",slot_quest_current_state, 0), #status 0
  ]],
  ###
  ###mael bresail find out
  [anyone, "abadmaelbresail_1", [], "You look tense. Did everything go well with our patron?","abadmaelbresail_2",[
  ]],
  [anyone|plyr,"abadmaelbresail_2", [
      ], "Your patron tried to kill me. Where can I find him now?", "abadmaelbresail_3", [
  ]],
  [anyone|plyr,"abadmaelbresail_2", [
      ], "I will be back later.", "close_window", [
  ]],
  
  [anyone, "abadmaelbresail_3", [], "Did he try to kill you? Sorry, I knew nothing. I warned you that you need to serve him faithfully and unequivocally. " +
    "Our patron is a man who rewards good work but punishes disloyalty or neglect severely.","abadmaelbresail_4",[
  ]],
  
  [anyone|plyr,"abadmaelbresail_4", [
      ], "I do not have time to chat. Where is he? Hurry!", "abadmaelbresail_5", [
  ]],
  [anyone|plyr,"abadmaelbresail_4", [					 (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"), #persuasion
      (gt, ":persuasion", 3),
      ], "Your master organized a feast and tried to burn me inside the hall. (Persuasion)", "abadmaelbresail_5_2", [
  ]],
  [anyone|plyr,"abadmaelbresail_4", [					 (store_skill_level, ":power_strike", "skl_power_strike", "trp_player"),
      (gt, ":power_strike", 3),
      ], "Do not waste my time. Reply now, or I'll kill you and burn your monastery. (Power Strike)", "abadmaelbresail_5_3", [
  ]],
  [anyone|plyr,"abadmaelbresail_4", [
      ], "I will be back later.", "close_window", [
  ]],
  
  [anyone, "abadmaelbresail_5", [], "I cannot tell you what I do not know. You can torture me or kill me, but you will not get any further response from my lips.","abadmaelbresail_8",[
  ]],
  
  [anyone|plyr,"abadmaelbresail_8", [	    (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 4000),
      ], "This monastery needs silver to continue to prosper. Give me this information and I will donate 4,000 peningas, abbot.", "abadmaelbresail_8_1", [
      (troop_remove_gold, "trp_player", 4000),
  ]],
  [anyone|plyr,"abadmaelbresail_8", [					 (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"), #persuasion
      (gt, ":persuasion", 3),
      ], "Your master organized a feast and tried to burn me inside the hall. (Persuasion)", "abadmaelbresail_5_2", [
  ]],
  [anyone|plyr,"abadmaelbresail_8", [					 (store_skill_level, ":power_strike", "skl_power_strike", "trp_player"),
      (gt, ":power_strike", 3),
      ], "Do not waste my time. Reply now, or I'll kill you and burn your monastery. (Power Strike)", "abadmaelbresail_5_3", [
  ]],
  [anyone|plyr,"abadmaelbresail_8", [
      ], "I will back later.", "close_window", [
      (str_store_string, s2, "@You need to learn the location of Mael Bresail, but the abbot of Finian refuses to give it to you. Maybe you should come back with more silver or increase your powers of persuasion or intimidation."),
      (add_quest_note_from_sreg, "qst_blank_quest_26", 8, s2, 0),
  ]],
  #money ok
  [anyone,"abadmaelbresail_8_1", [
    ], "This monastery has been hard pressed by the attacks of the Vikings, so we need the money. I cannot refuse your donation and believe that this information will not cause harm to anyone. " +
    "However, if somebody asks me, I will deny talking to you. Mael Bresail is very dangerous.", "abadmaelbresail_6", [
  ]],
  #persuasion ok
  [anyone|plyr,"abadmaelbresail_5_2", [
    ], "If Mael Bresail tried to kill me, it's likely he wants to eliminate all witnesses that may link him to the murder of Flaithbertach's grandchildren. " +
    "Besides me, you are the only one who knows all the details. You are also at risk. If I find your boss soon, your life and mine will last longer. You know I am right.", "abadmaelbresail_5_5", [
  ]],
  [anyone, "abadmaelbresail_5_5", [], "But I am only a messenger, an intermediary between his desires and those who execute them! " +
    "Oh, my God! He wants to kill me, too. Please help me!","abadmaelbresail_6",[
  ]],
  #power strike ok
  [anyone,"abadmaelbresail_5_3", [
      ], "I know you're capable of such a deed, for I've followed your steps for a while now. Well, I'll tell you where he is, but I am only a messenger, an intermediary between Mael Bresail's desires and those who execute them. Please do not hurt anyone in this monastery.", "abadmaelbresail_6", [
  ]],
  #success
  [anyone, "abadmaelbresail_6", [], "There is a place where Mael Bresail feels safe, but ironically it is where he is the weakest, as only a few men travel with him there. " +
    "Mael Bresail's mother is not Goidelic, but a Briton from Cornubia. She was kidnapped by a war party of the Ui Neill many years ago and was made a wife by one of its leaders, the father of Mael Bresail.","abadmaelbresail_6_11",[
  ]],
  [anyone, "abadmaelbresail_6_11", [], "When his father died, Mael Bresail went back to her homeland and built a house for his mother and a fort for himself, near Bosvenegh. He goes there when he needs to visit or to rest. After what happened recently, he will go there to seek comfort and advice from his old mother. " +
    "Few know this. I only know because once I had to accompany him to cure his mother. If you find him, remember that Mael Bresail is a reasonable man. Accept what he proposes. Revenge is useless.","abadmaelbresail_7",[
      (enable_party, "p_bresail_fort"),
      (str_store_party_name_link, s3, "p_village_122"),
      (str_store_string, s2, "@The abbot of Finian told you that Mael Bresail hides in Cornubia, on a site built for his mother near {s3}."),
      (add_quest_note_from_sreg, "qst_blank_quest_26", 8, s2, 0),
      (quest_set_slot,"qst_blank_quest_26",slot_quest_current_state, 6), # go to cornubia
  ]],
  
  [anyone|plyr,"abadmaelbresail_7", [
      ], "He tried to kill me. Only his death will stop me. Farewell.", "close_window", [
  ]],
  [anyone|plyr,"abadmaelbresail_7", [
      ], "I always listen if the proposal is interesting. Farewell.", "close_window", [
  ]],
  [anyone|plyr,"abadmaelbresail_7", [
      ], "That's all I need. Farewell.", "close_window", [
  ]],
  
  ####################################
  
  ### monastery quest
  [trp_abad|plyr,"abad_talk", [(neg|check_quest_active, "qst_blank_quest_12"),
      (store_relation,":rel","fac_christians","fac_player_faction"),
      (lt, ":rel", 30),
      (store_random_in_range, ":rand", 0, 100),
      (lt, ":rand", 15),
      ], "Pater, is there anything I can do to help your monastery? ", "abad_quest", []],
  
  [trp_abad, "abad_quest", [(gt, "$player_honor", -10),
      (store_random_in_range, ":rand", 2, 6),
      (assign, reg33, ":rand"),
      (assign, "$temp", reg33),],"Perhaps. We are building more houses for our new brothers, and we definitely need more timber. Would you be able to bring us {reg33} pallets?", "abad_quest1",[
      (str_store_party_name_link,s3,"$g_encountered_party"),
      (setup_quest_text,"qst_blank_quest_12"),
      (str_store_string, s2, "@The abbot of {s3} asked you to bring them {reg33} pallets of timber."),
  ]],
  
  [trp_abad, "abad_quest", [], "No, my son, we don't need your help at the moment","abad_pretalk",[]],
  
  [trp_abad|plyr,"abad_quest1", [], "Pater, you can count on me", "abad_pretalk", [
      (quest_set_slot, "qst_blank_quest_12", slot_quest_target_amount, "$temp"),
      (quest_set_slot, "qst_blank_quest_12", slot_quest_expiration_days, 30),
      (quest_set_slot, "qst_blank_quest_12", slot_quest_xp_reward, 400),
      (quest_set_slot, "qst_blank_quest_12", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_set_slot, "qst_blank_quest_12", slot_quest_target_center, "$g_encountered_party"),
      (quest_set_slot, "qst_blank_quest_12", slot_quest_dont_give_again_period, 60),
      (call_script, "script_start_quest", "qst_blank_quest_12", "$g_talk_troop"),]],
  
  [trp_abad|plyr,"abad_talk", [(check_quest_active, "qst_blank_quest_12"),
      (quest_get_slot, ":quest_target_center",  "qst_blank_quest_12",slot_quest_target_center),
      (quest_get_slot, ":quest_target_amount",  "qst_blank_quest_12",slot_quest_target_amount),
      (eq, ":quest_target_center", "$g_encountered_party"),
      (assign,":timber",0),
      (troop_get_inventory_capacity,":capacity","trp_player"),
      (try_for_range,":slot",0,":capacity"),
        (troop_get_inventory_slot,":cur_item","trp_player",":slot"),
        (eq,":cur_item","itm_timber"),
        (val_add,":timber",1),
      (try_end),
      (ge,":timber",":quest_target_amount"),
      (assign, reg33, ":quest_target_amount"),
      ], "Pater, I brought you {reg33} pallets of timber, as you requested.", "abad_thankyou", []],
  
  [trp_abad, "abad_thankyou", [(str_store_party_name, s3, "$g_encountered_party"),],"Thank you, {playername}. The brothers of {s3} will be praying nightly for your soul. Amen.","abad_pretalk",[
      (quest_get_slot, ":quest_target_amount", "qst_blank_quest_12", slot_quest_target_amount),
      (quest_get_slot, ":quest_xp", "qst_blank_quest_12", slot_quest_xp_reward),
      (troop_remove_items, "trp_player", "itm_timber", ":quest_target_amount"),
      (add_xp_as_reward, ":quest_xp"),
      (call_script, "script_change_player_relation_with_faction", "fac_christians", ":quest_target_amount"),
      (call_script, "script_end_quest", "qst_blank_quest_12"),
  ]],
  
  [trp_abad|plyr,"abad_quest1", [], "Pater, I don't believe I have time for this.", "abad_pretalk", [
      (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 7),]],
  ####
  
  [trp_abad|plyr,"abad_talk", [
      (eq, "$g_player_faith", 1),
      (store_troop_gold,":money","trp_player"),
      (gt,":money",499),
      ], "Pater, we need God to cleanse us of our sins. Here are 500 peningas for widows and orphans.", "abad_action", [
      (troop_remove_gold, "trp_player", 500),
  ]],
  
  
  [trp_abad, "abad_action", [],
    "Ego absolvo te a peccatis tuis, in nomine Patris et Filii et Spiritus Sanctii. Amen. Your men will feel better now.", "close_window",[
      (call_script, "script_change_player_party_morale", 2),
  ]],
  
  [trp_abad|plyr,"abad_talk", [
      (eq, "$g_player_faith", 1),
      ],"Pater, I would like to know more about converting people to the one true faith!", "abad_talk_conv", []],
  
  [anyone, "abad_talk_conv", [],
    "Sure, my son. I will be more than happy to talk to you about the matters of Christianity, but I don't have a lot of free time. Would you consider a donation to our monastery? " +
    "I think 500 peningas will help my brothers make this place even more beautiful.", "abad_talk_conv1",[]],
  
  [anyone|plyr,"abad_talk_conv1", [
      (store_troop_gold,":money","trp_player"),
      (gt,":money",499),], "Of course, here is my donation.", "abad_talk_conv2", [(troop_remove_gold, "trp_player", 500),]],
  [anyone|plyr,"abad_talk_conv1", [
      (store_troop_gold,":money","trp_player"),
      (le,":money",499),], "Sorry, I don't have this kind of money at the moment.", "abad_pretalk", []],
  [anyone|plyr,"abad_talk_conv1", [], "I really don't see why I should pay you. Good day!", "close_window", []],
  
  [anyone, "abad_talk_conv2", [],
    "Thank you, my {reg59?daughter:son}. Our Lord, Jesus Christ will be pleased. Now, about conversion. You see, each settlement has some mix of true Christians, pagans, heretics and, God forbid, " +
    "atheists. Every day, events affect people's beliefs. Some turn to Christianity, and others abandon it. That effect is fairly insignificant, on balance, unless there is some kind of " +
    "force that compels people to choose one way over the others. Certain lords and minor adventurers come with a sword and try to force people to change their beliefs. " +
    "That, of course, is not God's way.", "abad_talk_conv2a",[]],
  
  [anyone, "abad_talk_conv2a", [],
    "Our Lord, Jesus Christ, teaches us that any influence we exert on people should come through convincing, preaching and other non-violent means. However, force " +
    "of threat produces results that are more spectacular, albeit short-lived. This can be improved by compelling people to build a house of worship and hiring a good priest to " +
    "teach them. Initially, many people may not like that they are being forced to follow our God, but eventually, through God's Word, they change.", "abad_talk_conv2b",[]],
  
  [anyone, "abad_talk_conv2b", [],
    "With persistence and patience, more and more people will turn to the only true faith, just as they have done elsewhere in Europe. The more people are converted, the easier it will be to convert the " +
    "rest. But please be prepared for setbacks! Initially, it will be a difficult process. If too many people living in that particular place become too angry, they may even riot and burn down the house of " +
    "worship. Even then, don't despair. Rebuild it and continue with your mission. Also, it helps if your settlement is near a monastery. " +
    "God bless you, my {reg59?daughter:son}. I pray that your way will be blessed if you decide to follow this path. Amen.", "abad_talk_conv3",[]],
  
  [anyone|plyr,"abad_talk_conv3", [], "Thank you, father. That was very informative.", "abad_pretalk", []],
  
  [anyone|plyr,"abad_talk_conv3", [], "You mentioned forced conversion...", "abad_talk_conv4", []],
  
  [anyone, "abad_talk_conv4", [],
    "Yes, my {reg59?daughter:son}. Some of our more overzealous brothers, especially the ones who consider themselves to be great soldiers, think that chopping off a few heads will force people to abandon their " +
    "beliefs in favor of Christianity. While it may work to some degree in the very short term, inevitably these people will reconvert to their old gods the moment the sword is back in its sheath. " +
    "If this is the path that you wish to take, I advise that you have a dozen or so clergymen with you to facilitate the process.", "abad_talk_conv4a",[]],
  
  [anyone, "abad_talk_conv4a", [],
    "Being formidable is important, but it is also essential to be able to speak intelligently and persuasively. Your personality will also play a role. Being bold and courageous should help your case, " +
    "as opposed to being shy and compassionate. Lastly, I highly recommend that you build up relations with the people first. It is well known that people are more receptive if they trust and like you. " +
    "May God help you, my {reg59?daughter:son}. Amen.", "abad_pretalk",[]],
  
  
  [trp_abad|plyr,"abad_talk", [
      ],"Pater, I have heard great things about the wine of this monastery. Can I buy some of it?", "abad_talk_wine", []],
  
  [anyone,"abad_talk_wine", [
      (party_slot_eq, "$g_encountered_party", slot_center_inventory, 0),
      (str_clear, s4),], "{!}{s4}", "abad_talk_wine2",[
      (troop_clear_inventory, "trp_abad"),
      (store_random_in_range, ":material", 0, 100),
      (try_begin),
        (ge, ":material", 60),
        (str_store_string, s4, "@Of course, my {reg59?daughter:son}. We have a big batch of our wine."),
        (troop_add_item,"trp_abad","itm_wine"),
        (troop_add_item,"trp_abad","itm_wine"),
        (troop_add_item,"trp_abad","itm_wine"),
        (troop_add_item,"trp_abad","itm_wine"),
      (else_try),
        (str_store_string, s4, "@We have some wine still available."),
        (troop_add_item,"trp_abad","itm_wine"),
        (troop_add_item,"trp_abad","itm_wine"),
      (try_end),
      (troop_set_auto_equip,"$g_talk_troop", 0),
  ]],
  
  [anyone,"abad_talk_wine", [], "Sorry, my {reg59?daughter:son}. We have just sold it to someone else.", "abad_pretalk",[]],
  
  [anyone|plyr,"abad_talk_wine2",
    [], "Very well. I want to buy some.", "abad_pretalk",
    [
      (party_set_slot, "$g_encountered_party", slot_center_inventory, 1),
      [change_screen_trade]
  ]],
  
  [anyone|plyr,"abad_talk_wine2", [], "Actually, I prefer to talk about other things.", "abad_pretalk",[]],
  
  [trp_abad|plyr, "abad_talk", [
      (try_begin),
        (eq, "$g_player_faith", 1),
        (assign, reg0, 1),
      (else_try),
        (assign, reg0, 0),
      (try_end),
      ], "Nothing{reg0?, Pater:}. I must take my leave now.", "close_window", []],
  
  #religion monasterios acaba
  #troll bridge
  [trp_troll_bridge, "start", [(eq,"$troll_bridge",0),
      (str_clear, s2),
    ],
    "{s2}^^Ho, Ho, Ho! Who's that tripping over my bridge? This troll wants some gold because you are on his bridge!", "troll_treasure1", [
      (str_store_string, s2, "@--A huge creature is looking down on you, seemingly unintimidated by your presence or your equipment.--", color_good_news),
  ]],
  
  [trp_troll_bridge, "start", [
    ],
    "Ho, Ho, Ho! This troll wants some gold because you are on his bridge!", "close_window", [
  ]],
  
  [anyone|plyr,"troll_treasure1", [],
    "You're just a big, ugly fool, not a troll.", "troll_treasure2",[]],
  [anyone|plyr,"troll_treasure1", [
      (store_troop_gold,":money","trp_player"),
      (gt,":money",99),
    ],
    "I will pay you 100 peningas.", "troll_treasure3",[]],
  
  [anyone|plyr,"troll_treasure1", [],
    "Business on the other side of this bridge is not as pressing as I thought.", "close_window",[
      (finish_mission,0),
      (leave_encounter),
      (change_screen_return),
  ]],
  
  [anyone, "troll_treasure3", [],
    "This troll is happy with his toll! Now you can continue on your way.", "close_window", [
      (troop_remove_gold, "trp_player", 100),
      (finish_mission,0),
      (leave_encounter),
      (change_screen_return),
  ]],
  
  [anyone, "troll_treasure2", [],
    "Ho, Ho, Ho! When I was little, my mother said to me, 'Grendel, my son, if someone calls you big, ugly or a fool, ignore him. But if someone calls you all three together, hit him.", "close_window", [
      (assign,"$troll_bridge",1),(mission_disable_talk),]],
  ##########
  ###the elf
  [trp_elf_riddles, "start", [
      (str_clear, s2),
    ],
    "{s2}^^I don't know who you are or what your name is. I don't care about your origin or your intentions. I just want to have some fun.", "elf_treasure1", [
      (str_store_string, s2, "@--You see a short, thin man with a strange face in front of you.--", color_good_news),
  ]],
  
  [anyone|plyr,"elf_treasure1", [],
    "I like the sound of that! I'd like to have some fun! But what are you?", "elf_treasure2",[]],
  [anyone|plyr,"elf_treasure1", [],
    "You appear to be deeply disturbed, go your own way. Farewell.", "close_window",[]],
  
  [anyone, "elf_treasure2", [          (store_troop_gold,":money","trp_player"),
      (lt,":money",20000),
    ],
    "Oh no, you want to have fun, but you don't have enough money! Come back when you have twenty times a thousand silver coins, then we'll have some fun. Silver, gold, coins, jewels - I love them all...", "close_window", [
      (finish_mission,1),
      (leave_encounter),
      (change_screen_return),
  ]],
  [anyone, "elf_treasure2", [                     (store_free_inventory_capacity, ":inv_cap_a", "trp_player"),
      (lt, ":inv_cap_a", 5), #player need space free in inventory
      
    ],
    "Oh no, you want to have fun, but you don't have enough room for my awards?  Go sell something and come back when you have more space, and we'll have some fun.", "close_window", [
      (finish_mission,1),
      (leave_encounter),
      (change_screen_return),
  ]],
  
  [anyone, "elf_treasure2", [],
    "Alright! Let the fun begin! The game has started. There shall be... a question for a riddle and a riddle for a question. If you fail, I take your silver, but if you succeed, you get a reward! Maybe.", "elf_treasure3", []],
  
  [anyone, "elf_treasure3", [],
    "My answer to your question: I'm from a nearby village. People hated me because I was thought to be the son of an elf, who bring bad luck. I had to flee, leaving my mother behind, and take refuge in here.^^" +
    "Now it is my turn. Listen carefully to my riddle. If your answer is wrong, I'll take away some of your money, but if you answer correctly, I'll give you a reward. I want your money, I want your gold, I love silver and gold.", "elf_treasure4", []],
  
  [anyone, "elf_treasure4", [],
    "Who is that shrill one,^" +
    "Who rides a hard road,^" +
    "Despite going that way before?^" +
    "He keeps old wood^" +
    "Between his two cheeks^" +
    "But pushes away good gold.", "elf_treasure5", []],
  
  [anyone|plyr,"elf_treasure5", [],
    "A cart.", "elf_treasure6",[]],
  [anyone|plyr,"elf_treasure5", [],
    "A squirrel.", "elf_treasure6",[]],
  [anyone|plyr,"elf_treasure5", [],
    "A hammer.", "elf_treasure7",[]],
  [anyone|plyr,"elf_treasure5", [],
    "Me.", "elf_treasure6",[]],
  [anyone|plyr,"elf_treasure5", [],
    "A bad singer.", "elf_treasure6",[]],
  
  [anyone, "elf_treasure6", [],
    "That's not the correct answer. Your silver is mine. Let's have more fun!", "elf_treasure8", [
      (troop_remove_gold, "trp_player", 5000),
  ]],
  [anyone, "elf_treasure7", [],
    "Yes, the hammer is used for working gold. I love gold! A hammer shouts out loud when it hits the hard anvil, and that is its road. Take your prize, and let's continue.", "elf_treasure8", [
      (troop_add_item, player,"itm_elf_seax",0),
  ]],
  
  [anyone, "elf_treasure8", [],
    "What is that wonder^" +
    "I saw in my ruins,^" +
    "Eight feet it has^" +
    "And four eyes^" +
    "And knees above its belly.", "elf_treasure9", []],
  
  [anyone|plyr,"elf_treasure9", [],
    "An eight-foot stone pillar.", "elf_treasure10",[]], #mosca
  [anyone|plyr,"elf_treasure9", [],
    "A spider.", "elf_treasure11",[]],
  [anyone|plyr,"elf_treasure9", [],
    "A monster.", "elf_treasure10",[]],
  [anyone|plyr,"elf_treasure9", [],
    "A flowering vine.", "elf_treasure10",[]],
  
  [anyone, "elf_treasure10", [],
    "That's not the correct answer. Your silver is mine. Let's have more fun!", "elf_treasure12", [
      (troop_remove_gold, "trp_player", 5000),
  ]],
  [anyone, "elf_treasure11", [(this_or_next|troop_has_item_equipped,"$g_player_troop","itm_elf_seax"),(player_has_item, "itm_elf_seax"),
    ],
    "Yes, a spider is the correct answer, but that was an easy one. Way too easy, indeed, so you don't deserve a prize! I will take your gold this time, agreed? Yes, your gold is mine. " +
    "The next riddle will be more difficult, I promise! And you will get your prize. Trust me!", "elf_treasure11_1", [
      (troop_remove_gold, "trp_player", 5000),
  ]],
  
  [anyone, "elf_treasure11", [],
    "Yes, right answer! Maybe this was too easy. Take your prize and let's continue.", "elf_treasure12", [
      (troop_add_item, player,"itm_elf_seax",0),
  ]],
  
  [anyone|plyr,"elf_treasure11_1", [],
    "You're a sneaky rat!", "elf_treasure11_2",[]],
  [anyone|plyr,"elf_treasure11_1", [],
    "Well, let's continue.", "elf_treasure12",[]],
  
  [anyone, "elf_treasure11_2", [],
    "No, no, I am not a rat! I am a good elf, but I love your silver so much, I can't help it. I will not cheat again, I promise! Listen to my next riddle.", "elf_treasure12", [
  ]],
  
  [anyone, "elf_treasure12", [],
    "Four hang.^" +
    "Four sprang.^" +
    "Two find the way.^" +
    "Two ward off dogs.^" +
    "One dangles after,^" +
    "Always rather dirty.", "elf_treasure13", []],
  
  [anyone|plyr,"elf_treasure13", [],
    "A cow.", "elf_treasure15",[]], #mosca
  [anyone|plyr,"elf_treasure13", [],
    "Swords.", "elf_treasure14",[]],
  [anyone|plyr,"elf_treasure13", [],
    "A squad of swordsmen.", "elf_treasure14",[]],
  [anyone|plyr,"elf_treasure13", [],
    "Spiders.", "elf_treasure14",[]],
  
  [anyone, "elf_treasure14", [],
    "You are incorrect. Your silver is mine. One more riddle to go!", "elf_treasure16", [
      (troop_remove_gold, "trp_player", 5000),
  ]],
  [anyone, "elf_treasure15", [],
    "Yes, that has four feet and four udders, two horns and two eyes, and the tail dangles after. Take your prize, and let's continue on to the last riddle.", "elf_treasure16", [
      (troop_add_item, player,"itm_elf_shield",0),
  ]],
  
  [anyone, "elf_treasure16", [],
    "What creature is it that carries men?^" +
    "It has a bloody back,^" +
    "Yet shelters the strong^" +
    "From shaft and point^" +
    "And all manner of attack.^" +
    "It gives life to some,^" +
    "But itself lies down^" +
    "Inside a soldier's grasp?", "elf_treasure17", []],
  
  [anyone|plyr,"elf_treasure17", [],
    "A ship.", "elf_treasure18",[]], #mosca
  [anyone|plyr,"elf_treasure17", [],
    "A horse.", "elf_treasure18",[]],
  [anyone|plyr,"elf_treasure17", [],
    "A shield.", "elf_treasure19",[]],
  [anyone|plyr,"elf_treasure17", [],
    "A wall.", "elf_treasure18",[]],
  [anyone|plyr,"elf_treasure17", [],
    "A noose for hanging elves!", "elf_treasure18",[]],
  
  [anyone, "elf_treasure18", [],
    "Incorrect! Your silver is mine!", "elf_treasure20", [
      (troop_remove_gold, "trp_player", 5000),
  ]],
  [anyone, "elf_treasure19", [],
    "Yes, a shield is often bloody from battle, defends well those men who know how to use it, but carries off the men that don't. Take your prize!^^" +
    "This is the best of my prizes, an ancient helmet I found in the tomb of a king. This helmet is very valuable, so take care of it.", "elf_treasure20", [
      (troop_add_item, player,"itm_elf_helmet",0),
  ]],
  
  [anyone, "elf_treasure20", [],
    "That was fun! I always played riddles with my mother before I had to flee my village. But this is my home now, and it's late and time for me to go back to my hidey-hole. Good luck! Farewell.", "close_window", [
      (assign,"$roman_fort_riddles",1),
      (finish_mission,1),
      (leave_encounter),
      (change_screen_return),
  ]],
  ####################
  #### battle stones svian Vikingr
  [trp_hired_blade, "start", [(eq, "$g_encountered_party", "p_battle_stones"),
      (str_clear, s2),
    ],
    "Talk to the captain, he is in charge here.", "close_window", [
  ]],
  [trp_taiga_bandit, "start", [(eq, "$g_encountered_party", "p_battle_stones"),
    ],
    "Talk to the captain, he is in charge here.", "close_window", [
  ]],
  [trp_peasant_woman, "start", [(eq, "$g_encountered_party", "p_battle_stones"),
    ],
    "--She does not look you in the eye as she speaks to you.--", "close_window", [
  ]],
  [trp_farmerdruid, "start", [(eq, "$g_encountered_party", "p_battle_stones"),
    ],
    "--He does not look you in the eye as he speaks to you.--", "close_window", [
  ]],
  [trp_sea_raider_leader2, "start", [(eq, "$g_encountered_party", "p_battle_stones"),
      (str_clear, s2),
    ],
    "{s2}^^This is a trading post. Here we buy captured slaves and offer a better price than other sites. If you brought slaves to sell, talk. If not, leave.", "battlestones_treasure1", [
      (str_store_string, s2, "@--The Swedish Viking looks you up and down, studying you.--", color_good_news),
  ]],
  
  [anyone|plyr,"battlestones_treasure1", [],
    "I have slaves to sell.", "battlestones_treasure3",[]],
  [anyone|plyr,"battlestones_treasure1", [],
    "You're enslaving innocent people. I came to kill you.", "battlestones_treasure2",[]],
  [anyone|plyr,"battlestones_treasure1", [],
    "Sorry for disturbing you. Farewell.", "close_window",[]],
  
  [anyone, "battlestones_treasure2", [],
    "Well, well, you're a funny {reg59?lady:man}. Now I am going to kill you.", "close_window", [
      (assign,"$battle_stones",1),]],
  
  [anyone,"battlestones_treasure3", [(store_num_regular_prisoners,reg0),(ge,reg0,1)], "I will pay you according to the quality of the prisoner as do other slave traders and I will add 1 pening on top regardless of their status. " +
    "That means you will earn one extra pening per slave more than you will anywhere else.", "battlestones_treasure4",[]],
  [anyone,"battlestones_treasure3", [], "You don't appear to have any slaves to sell. Why are you wasting my time?", "close_window",[]],
  
  [anyone|plyr,"battlestones_treasure4", [],
    "My slaves are yours. Pay me.", "battlestones_treasure5", [
      (assign, ":total_income", 0),
      (party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
      (try_for_range_backwards, ":i_stack", 0, ":num_stacks"),
        (party_prisoner_stack_get_troop_id, ":troop_no", "p_main_party", ":i_stack"),
        (neg|troop_is_hero, ":troop_no"),
        (party_prisoner_stack_get_size, ":stack_size", "p_main_party", ":i_stack"),
        (call_script, "script_game_get_prisoner_price", ":troop_no"),
        (assign, ":sell_price", reg0),
        (val_add, ":sell_price", 1),
        (store_mul, ":stack_total_price", ":sell_price", ":stack_size"),
        (val_add, ":total_income", ":stack_total_price"),
        (party_remove_prisoners, "p_main_party", ":troop_no", ":stack_size"),
      (try_end),
      (troop_add_gold, "trp_player", ":total_income"),
    ]
  ],
  [anyone|plyr,"battlestones_treasure4", [],
    "I don't want to sell. Farewell.", "close_window",[]],
  [anyone, "battlestones_treasure5", [], "Nice doing business with you. Come back when you have more slaves for me.", "close_window",[]],
  
  #########################
  #####mountain_bandit_leader mystic circle chief
  [trp_mountain_bandit_leader, "start", [
      (str_clear, s2),
    ],
    "{s2}^^Hey, hey, who are you and what are you doing in my hole?", "bandit_treasure1", [
      (str_store_string, s2, "@--The man, flattening the floor with his feet, suddenly turns towards you when you approach him. At first, he seems surprised, but quickly flashes a smile.--", color_good_news),
  ]],
  
  [anyone|plyr,"bandit_treasure1", [],
    "I am {playername}, what are you hiding here?", "bandit_treasure2",[]],
  [anyone|plyr,"bandit_treasure1", [],
    "Sorry for disturbing you. Farewell.", "close_window",[]],
  
  [anyone, "bandit_treasure2", [],
    "Well, well, you're a funny {reg59?lady:man} to poke your nose into other people's affairs. You know, I met a man like you once, a real goose... As an old god once said, I will answer all your questions if you solve but a single riddle of mine.", "bandit_treasure3", []],
  
  [anyone|plyr,"bandit_treasure3", [],
    "And what happened to that man?", "bandit_treasure4",[]],
  [anyone|plyr,"bandit_treasure3", [],
    "I do not have time for this. Farewell.", "close_window",[]],
  
  [anyone, "bandit_treasure4", [],
    "That man had only one question to answer... can you imagine, a single question! but he failed and died before the divine. Now you must play this game. I'll ask you a riddle, and if you solve it, I'll answer all your questions, but if you fail, I'll take your soul.", "bandit_treasure5", []],
  
  [anyone|plyr,"bandit_treasure5", [
      (str_clear, s10),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@I was just leaving. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@I think we are both too old for games like this. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Heh, I've played games with worse odds. Proceed. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Very well, but if I solve your riddle but do not like your answers, I'll take your soul. (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "bandit_treasure6",[
  ]],
  
  [anyone|plyr,"bandit_treasure5", [],
    "I like riddles. Let's go.", "bandit_treasure6",[]],
  
  [anyone|plyr,"bandit_treasure5", [],
    "I do not have time for this. Farewell.", "bandit_treasure6",[]],
  
  [anyone, "bandit_treasure6", [],
    "Actually, I didn't say you have a choice. There is only one option, so let's play. Listen carefully, for your life is at stake, he-he. And the riddle is:^^" +
    "I cannot be seen. I cannot be felt.^" +
    "I cannot be heard. I cannot be smelt.^" +
    "I lie behind stars and under the hills,^" +
    "And holes, no matter how deep, I can always fill.^" +
    "I always come first and always follow after.^" +
    "I end all life. I kill all laughter.", "bandit_treasure7", []],
  
  [anyone|plyr,"bandit_treasure7", [],
    "Air.", "bandit_treasure8",[]],
  [anyone|plyr,"bandit_treasure7", [],
    "Clouds.", "bandit_treasure8",[]],
  [anyone|plyr,"bandit_treasure7", [],
    "Death.", "bandit_treasure8",[]],
  [anyone|plyr,"bandit_treasure7", [],
    "Darkness.", "bandit_treasure9",[]],
  [anyone|plyr,"bandit_treasure7", [],
    "Water.", "bandit_treasure8",[]],
  [anyone|plyr,"bandit_treasure7", [],
    "Nothing.", "bandit_treasure8",[]],
  [anyone|plyr,"bandit_treasure7", [],
    "I don't want to play.", "bandit_treasure8",[]],
  
  [anyone, "bandit_treasure8", [],
    "That's not correct. Now you have a different problem that my friend and I will help to solve.", "close_window", [
      (assign,"$circle_mystic",1),
  ]],
  [anyone, "bandit_treasure9", [],
    "You're smarter than you look. Yes, it's darkness. Now, I will answer your questions. My pals and I are hiding treasure. Why? Because we are bandits and we stole it from a rich man. " +
    "As you might have already guessed, this information is too valuable for you to live with, so your life will end now anyway.", "close_window", [
      (assign,"$circle_mystic",1),
  ]],
  
  
  #hablar chief stone circle
  [anyone,"start", [(store_current_scene,":current_scene"),(eq,":current_scene","scn_hadrian_wall1"),(is_between, "$g_talk_troop", stone_refugee_begin, stone_refugee_end),],
    "Greetings to you, {reg59?madam:sir}. Welcome to our refuge. We are homeless and live under the protection of the old wall. You should talk to our leader.", "druid_refugee",[]],
  
  [anyone,"start", [(store_current_scene,":current_scene"),(eq,":current_scene","scn_celidon_forest"),(is_between, "$g_talk_troop", stone_refugee_begin, stone_refugee_end),],
    "Greetings to you, {reg59?madam:sir}. Welcome to our refuge. We are homeless and live under the protection of the old druid. You should talk to him.", "druid_refugee",[]],
  
  [anyone|plyr,"druid_refugee",[], "Thank you. Farewell.", "close_window",[]],
  
  [trp_prisionerdruid,"start", [],
    "(He looks at you with eyes of hate.) Do you like sacrifices? Would you like to see these bastards kill a Saxon? Bah! Get lost!", "druid_refugee2",[]],
  
  [anyone|plyr,"druid_refugee2",[], "Err... Farewell, then.", "close_window",[]],
  #########
  ########### hadrian wall and stone circle, celidon forest
  #chief druida viejos dioses
  [trp_last_druid, "start", [],
    "Welcome, {reg59?my lady:my lord}. I am a priest of the old gods. Do you know them? Certainly not. Men are forgetting them. Now they worship Christ. " +
    "There were other gods in the land before the arrival of the Christians. I've read and heard the stories of our elders. I have restored their worship here.", "druid_talk", []],
  [anyone, "druid_pretalk", [],
    "Welcome, {playername}. I am the last druid.", "druid_talk", []],
  
  [anyone|plyr,"druid_talk", [],
    "I see. It is just an excuse to create your own sect.", "druid_angry",[]],
  [anyone,"druid_angry", [],
    "What? I do not hurt anyone. People who want to come here are free to join us or leave. Why punish me with your presence?", "close_window", []],
  [anyone|plyr, "druid_talk", [],
    "Tell me about your gods.", "druid_ayuda", []],
  
  [anyone|plyr,"druid_talk", [],
    "You are mad! I see only evil here! This is a haven for murderers! Farewell.", "close_window",[#(assign, "$druid_on", 2), #battle!
  ]],
  
  [anyone|plyr, "druid_talk", [],
    "I have no need for a man of any god at this time.", "close_window", []],
  
  [anyone, "druid_ayuda", [],
    "Our gods came largely from two families: the Children of Don and the Children of Llyr. Don was a goddess of the sky, and Llyr was a god of the sea. Don is known as the big mother. Among her children were the god Gwydion and the goddess Arianrod. " +
    "Gwydion was a god druid, a 'master of illusion and fantasy.' He was a friend and helper of mankind, and a constant fighter against the powers of the underworld, the realm of Annwn.", "druid_ayu", []],
  
  [anyone, "druid_ayu", [],
    "Arianrod, called the 'Silver Circle,' bore two sons, Dylan and Lleu. Dylan had a great affinity for the sea, and swam as well as the best fish in the ocean. It is said that the waves of Britannia wept for Dylan at his death. Arianrod had poor bonds with her other son Lleu, and his care was left largely to Gwydion. Math, the brother of the goddess Don, was a master of magic and Gwydion's teacher of spells. " +
    "Do you want to make a sacrifice to the old gods? I warn you that they are fickle.", "druid_ayuda2", []],
  
  [anyone|plyr,"druid_ayuda2",
    [], "I will donate 300 peningas for this temple and your refugees.", "druid_sins",
    [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",299),
        (troop_remove_gold, "trp_player", 300),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  
  [anyone, "druid_sins", [],
    "Thank you, your help is welcome. Our gods and goddesses are dying, and there is only one druid, me, who remembers them. More money is always welcome... and beautiful virgins too.", "druid_pretalk", []],
  
  [anyone|plyr,"druid_ayuda2",
    [], "Take these 100 peningas and tell me more about them.", "druid_info2",
    [
      (store_troop_gold,":money","trp_player"),
      (try_begin),
        (gt,":money",99),
        (troop_remove_gold, "trp_player", 100),
      (else_try),
        (display_message,"str_no_money"),
      (try_end),
  ]],
  [anyone, "druid_info2", [],
    "I really do not know anything else, the gods have sent me messages in dreams, and they say I must sacrifice slaves. They like blood, just like me!", "druid_pretalk", []],
  
  [anyone|plyr,"druid_ayuda2", #once possible only
    [(store_troop_gold,":money","trp_player"),(gt,":money",4000),(eq, "$druid_on", 0),], "I want to make a sacrifice. I will give you 4000 coins for the expenses of the ceremony.", "druid_sacrifice_1",
    [
  ]],
  
  [anyone,"druid_sacrifice_1",
    [], "Yes, yes, bring the money! Well, let me think... So far, I haven't had to do anything serious. I used to slay these wretched beggars and enjoy their screams.^^" +
    "-The Druid summons his followers, and they surround you. They begin to chant in a language you don't understand. The Druid swings from side to side with a cruel smile and a huge knife in his hands.", "druid_sacrifice_2",
    [       (troop_remove_gold, "trp_player", 4000),(assign, "$druid_on", 1),
  ]],
  
  [anyone,"druid_sacrifice_2", #
    [], "-The Druid pronounces your name and opens the throat of a prisoner tied to the post with the ritual knife.^^You close your eyes...-", "close_window",
    [
      (call_script, "script_change_player_honor", -5),
      (store_random_in_range, ":rand", 0, 6),
      (try_begin),
        (eq, ":rand", 0),
        (dialog_box,"@When you open your eyes again, you receive the blessing of the gods and goddesses. Maybe this is just your imagination but you feel more skillful with weapons."),
        (troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,15),
      (else_try),
        (eq, ":rand", 1),
        (dialog_box,"@When you open your eyes again, you receive the blessing of the gods and goddesses. Maybe this is just your imagination but you feel more attractive."),
        (troop_raise_attribute,"trp_player",ca_charisma, 1),
      (else_try),
        (eq, ":rand", 2),
        (dialog_box,"@When you open your eyes again, you receive the blessing of the gods and goddesses. Maybe this is just your imagination but you feel stronger."),
        (troop_raise_attribute, "trp_player",ca_strength,1),
      (else_try),
        (eq, ":rand", 3),
        (dialog_box,"@When you open your eyes again, you receive the blessing of the gods and goddesses. Maybe this is just your imagination but you feel smarter."),
        (troop_raise_attribute, "trp_player",ca_intelligence,1),
      (else_try),
        (eq, ":rand", 4),
        (dialog_box,"@When you open your eyes again, you receive the blessing of the gods and goddesses. Maybe this is just your imagination, but you feel more agile."),
        (troop_raise_attribute, "trp_player",ca_agility,1),
      (else_try),
        (dialog_box,"@You open your eyes again, but nothing happens. The gods do not accept this sacrifice."),
      (try_end),
  ]],
  
  [anyone|plyr,"druid_ayuda2", [(store_num_regular_prisoners,reg0),(ge,reg0,1)], "I want to sell you all prisoners I brought.", "druid_venta",[]],
  
  [anyone,"druid_venta", [],
    "Do you have any pretty virgins? Anyways, I will pay you silver according to prisoner quality.", "druid_venta2", []],
  [anyone|plyr,"druid_venta2", [],
    "Your gods and goddesses will be pleased with such sacrifice material as I bring.", "druid_venta3", [
      (assign, ":total_income", 0),
      (party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
      (try_for_range_backwards, ":i_stack", 0, ":num_stacks"),
        (party_prisoner_stack_get_troop_id, ":troop_no", "p_main_party", ":i_stack"),
        (neg|troop_is_hero, ":troop_no"),
        (party_prisoner_stack_get_size, ":stack_size", "p_main_party", ":i_stack"),
        (call_script, "script_game_get_prisoner_price", ":troop_no"),
        (assign, ":sell_price", reg0),
        (store_mul, ":stack_total_price", ":sell_price", ":stack_size"),
        (val_add, ":total_income", ":stack_total_price"),
        (party_remove_prisoners, "p_main_party", ":troop_no", ":stack_size"),
      (try_end),
      (troop_add_gold, "trp_player", ":total_income"),
    ]
  ],
  [anyone|plyr,"druid_venta2", [],
    "Let me think about it again.", "druid_pretalk",[]],
  [anyone, "druid_venta3", [], "I'll tell you one thing: we are not here by chance. We are near the ancient Kingdom of Dyfed, a territory connected with Annwn, the Underworld. " +
    "Here, we are close to all the gods and goddesses, because this is the time of their fall. The gods of Annwn are now the most powerful. I am a follower of Bran, god of the Underworld, whose eminence is most often associated with his 'Wonderful Head.' " +
    "Bran is also the patron of bards, minstrels, and musicians. You should pray to him.", "close_window",[]],
  
  [anyone|plyr,"druid_ayuda2", [], "Human sacrifices? You're a fool!", "druid_angry",[]],
  
  [anyone|plyr,"druid_ayuda2", [], "Actually, forget this.", "druid_pretalk",[]],
  
  ##
  #####old roman chief dialogo
  [trp_old_roman, "start", [(eq, "$g_talk_troop_met", 0)],
    "Who are you and what do you want? We are not used to visitors here.", "old_talk", []],
  ##  [anyone, "old_pretalk", [],
  ##   "Tell me.", "old_talk", []],
  [anyone|plyr,"old_talk", [],
    "I am {playername}, sir. Who are you?", "old_angry",[]],
  [anyone|plyr, "old_talk", [],
    "I am {playername}, but I haven't got time for you.", "close_window", []],
  
  [trp_old_roman, "start", [   (check_quest_active,"qst_old_roman"),
      (call_script, "script_get_troop_item_amount", "trp_player", "itm_grain"),
      (assign, ":cur_amount", reg0),
      (ge, ":cur_amount", 8),
    ],
    "I see that you came loaded with wheat for my people. Thank you!", "old_grainok", []],
  
  [trp_old_roman, "start", [   (check_quest_failed, "qst_old_roman"),],
    "You... You stole our money and left us without food. I don't want to see you ever again.", "close_window", []],
  [trp_old_roman, "start", [(check_quest_active,"qst_old_roman")],
    "{playername}, please return with food.", "close_window", []],
  
  [anyone|plyr,"old_grainok", [],
    "I like to be of help.", "old_grainok2",[
      (troop_remove_item, "trp_player", "itm_grain"),
      (troop_remove_item, "trp_player", "itm_grain"),
      (troop_remove_item, "trp_player", "itm_grain"),
      (troop_remove_item, "trp_player", "itm_grain"),
      (troop_remove_item, "trp_player", "itm_grain"),
      (troop_remove_item, "trp_player", "itm_grain"),
      (troop_remove_item, "trp_player", "itm_grain"),
      (troop_remove_item, "trp_player", "itm_grain"),
  ]],
  
  [anyone,"old_grainok2", [],
    "Thank you! We are poor and cannot offer more than our friendship, but whenever you come here, you will be welcome. Moreover, I'll give you one of my sons to serve you as a soldier. He is a strong and brave boy.", "old_grainok3", []],
  [anyone,"old_grainok3", [],
    "I told him to go to pack up and join you when you leave this place. Thank you so much, {playername}. You saved our lives! Now we will return to our caves and hide for a while longer in this terrible world.", "close_window", [
      (add_xp_as_reward,200),
      (call_script, "script_end_quest", "qst_old_roman"),
      (assign, "$g_hadrianwall_visited", 1),
  ]], # se une hijo
  
  
  [trp_old_roman, "start", [],
    "Welcome, {playername}! What can I do for you?", "old_talk2", []],
  
  [anyone|plyr,"old_talk2", [(neq, "$g_hadrianwall_visited", 1),],
    "Remind me who you are.", "old_angry",[]],
  [anyone|plyr, "old_talk2", [],
    "I haven't got time for you.", "close_window", []],
  
  [anyone,"old_angry", [],
    "-He smiles.-^^I live here with my family, which has been here for several generations. An ancestor of mine, who took up a residence here, was said to be a Roman, or perhaps he was of Roman lineage.", "old_ayuda", []],
  
  [anyone, "old_ayuda", [],
    "The place where you have set your foot is Vallum Aelium, Hadrian's Wall. It became the frontier of civilization here, in the far north, after the Romans abandoned the Antonine Wall. Farther north, there are only Caledonians and Picts, impoverished and wild people not worth conquering.^^" +
    "Vallum Aelium was garrisoned by auxiliari, non-legionary troops. My ancestor was one of those auxiliari, who became a citizen after fulfilling his military service for Rome. " +
    "I was told another story about a hero in the days of King Penda who helped my family in difficult times.", "old_sins2", []],
  
  [anyone|plyr,"old_sins2",
    [(eq, "$sabe_leer", 1)], "Roma Victrix, old man.", "old_continue", [
      (eq, "$g_talk_troop_met", 0),
      (add_xp_as_reward,100),
    ]],
    
  [anyone|plyr,"old_sins2",
    [(eq, "$sabe_leer", 0)], "Rome was great, old man.", "old_continue",
    []],
  
  [anyone|plyr,"old_sins2", [], "The thought of Rome disgusts me, old man.", "old_continue2",[]],
  
  [anyone,"old_continue", [],
    "Oh, it is good you know about the Romans or have at least heard of them. You seem like a person that I can trust. I have a favor to ask... We need your help.", "old_ayuda_2", []],
  [anyone,"old_continue2", [],
    "I understand. For me Rome means nothing. It is part of my past, but only part was Roman. In fact, I am more Briton and Angle than Roman. At any rate, you seem like a person that I can trust. I have a favor to ask... We need your help.", "old_ayuda_2", []],
  [anyone,"old_ayuda_2", [],
    "Recent invasions have complicated things a lot here in the north. We live well hidden in the caves to the east, but come to this place when we need food, for merchants often stop here on their way to trading towns. At present, we've been waiting for weeks and no merchant has come... " +
    "We had a bad harvest and desperately need food. Could you bring us eight sacks of wheat? I will give you money in advance.", "old_ayuda_3", []],
  
  [anyone|plyr,"old_ayuda_3",
    [], "I will be happy to help you.", "old_ayuda_4",
    []],
  [anyone|plyr, "old_ayuda_3", [],
    "I haven't got time for this.", "close_window", []],
  
  [anyone,"old_ayuda_4", [],
    "Thank you. Take this money and return as soon as possible. We have hungry children crying.", "close_window", [
      (call_script, "script_troop_add_gold", "trp_player", 300),
      (call_script, "script_change_player_relation_with_troop","$g_talk_troop",5),
      (str_clear, s3),
      (str_store_party_name_link, s3, "p_hadrian_wall1"),
      (str_store_string, s2, "@An old Roman at {s3} asked you bring him eight sacks of wheat."),
      (call_script, "script_start_quest", "qst_old_roman", "$g_talk_troop"),
  ]],
  
  ###old roman acaba
  
  ###quarry chief
  ##para quarry chief
  [trp_quarry_trabajador,"start", [],
    "I am busy. Talk to the foreman.", "quarry_refugee2",[]],
  
  [anyone|plyr,"quarry_refugee2",[], "Very well, my good man. Farewell.", "close_window",[]],
  
  #capataz chief QUARRY
  [trp_quarry_capataz, "start", [(neq, "$player_is_working", 1),],
    "What do you want? Can't you see that I am busy?", "capataz_talk", []],
  [anyone, "capataz_pretalk", [],
    "What else?", "capataz_talk", []],
  [anyone|plyr,"capataz_talk", [],
    "Watch how you speak to me, man, or I shall give you a painful reply.", "capataz_angry",[]],
  [anyone,"capataz_angry", [],
    "Bah! I haven't insulted you, and the laws protect us. I have better things to do.", "close_window", []],
  [anyone|plyr, "capataz_talk", [],
    "I want my slaves to work here.", "capataz_ayuda", []],
  
  # VC-1877 begins
  [trp_quarry_capataz, "start", [],
    "You haven't finished your work yet. As I said, the stone down here must be broken out of the earth.", "close_window", []],
  [anyone|plyr,"capataz_talk", [],
    "I would like to work here.", "quarry_work_0",[]],
  [anyone,"quarry_work_0", [(assign, reg1, vc_work_payment_3)],
    "We have use for a day laborer. We pay {reg1} peningas per day.", "quarry_work_1", []],
  [anyone|plyr,"quarry_work_1", [],
    "Very well, I want to work one day here.", "quarry_work_2",[]],
  [anyone|plyr,"quarry_work_1", [],
    "I'm not interested.", "capataz_pretalk",[]],
  [anyone,"quarry_work_2", [],
    "The stone down here must be broken out of the earth. Here is a pickaxe.", "close_window",
    [
      (assign, "$player_is_working", 1),
      (store_random_in_range, "$vc_work_payment", 0, 8),
      (try_begin),
        (ge, "$cheat_mode", 1),
        (assign, reg7, "$vc_work_payment"),
        (display_message, "@{!}payment type will be: {reg7}"),
      (end_try),
      (get_player_agent_no, ":player_agent"),
      (try_for_range, ":item_slot", 0, ek_body),	#all weapons + helmet
        (agent_get_item_slot,  ":item", ":player_agent", ":item_slot"),
        (gt, ":item", -1),
        (agent_unequip_item, ":player_agent", ":item"),
      (try_end),
      (agent_equip_item, ":player_agent", "itm_work_pickaxe"),
      (agent_set_wielded_item, ":player_agent", "itm_work_pickaxe"),
      (call_script, "script_advanced_agent_set_speed_modifier",":player_agent", 70),	#player slower while working
  ]],
  # VC-1877 ends
  
  [anyone, "capataz_ayuda", [],
    "Sorry, my {reg59?lady:lord}, but this place is our place. This place belonged to our fathers and before them, our grandparents. Only my men and my slaves work here.", "close_window", []],
  
  [anyone|plyr, "capataz_talk", [],
    "I'd like to buy some of whatever you're mining here.", "capataz_sins",
    []],
  
  [anyone,"capataz_sins", [
      (party_slot_eq, "$g_encountered_party", slot_center_inventory, 0),
      #	  (eq, "$capataz_sell", 0), #only consultable each 90 hours
      (str_clear, s4),
    ],
    "{!}{s4}", "capataz_sins2",[
      (troop_clear_inventory, "trp_quarry_capataz"),
      (store_random_in_range, ":material", 0, 100),
      (try_begin),
        (ge, ":material", 85), #only mineral
        (str_store_string, s4, "@I have a good load of mineral available."),
        (troop_add_item,"trp_quarry_capataz","itm_iron"),
        (troop_add_item,"trp_quarry_capataz","itm_iron"),
        (troop_add_item,"trp_quarry_capataz","itm_iron"),
        (troop_add_item,"trp_quarry_capataz","itm_iron"),
        (troop_add_item,"trp_quarry_capataz","itm_iron"),
        (troop_add_item,"trp_quarry_capataz","itm_iron"),
      (else_try),
        (ge, ":material", 60), #only stone
        (str_store_string, s4, "@I have loads of both mineral and stone available."),
        (troop_add_item,"trp_quarry_capataz","itm_iron"),
        (troop_add_item,"trp_quarry_capataz","itm_iron"),
        (troop_add_item,"trp_quarry_capataz","itm_iron"),
        (troop_add_item,"trp_quarry_capataz","itm_stone"),
        (troop_add_item,"trp_quarry_capataz","itm_stone"),
        (troop_add_item,"trp_quarry_capataz","itm_stone"),
      (else_try),
        (this_or_next|ge, ":material", 20), #only stone
        (neq, "$g_encountered_party", "p_quarry3"),
        (str_store_string, s4, "@I have a good load of stone available."),
        (troop_add_item,"trp_quarry_capataz","itm_stone"),
        (troop_add_item,"trp_quarry_capataz","itm_stone"),
        (troop_add_item,"trp_quarry_capataz","itm_stone"),
        (troop_add_item,"trp_quarry_capataz","itm_stone"),
      (else_try),
        (eq, "$g_encountered_party", "p_quarry3"),
        (str_store_string, s4, "@I have some soapstone available."),
        (troop_add_item,"trp_quarry_capataz","itm_soapstone"),
        (troop_add_item,"trp_quarry_capataz","itm_soapstone"),
      (try_end),
  ]],
  
  [anyone,"capataz_sins", [], "Sorry, I have just promised the rest to someone else.", "capataz_pretalk",[]],
  
  [anyone|plyr,"capataz_sins2",
    [], "Very well. I want to buy some.", "capataz_sins_end",
    [
      (party_set_slot, "$g_encountered_party", slot_center_inventory, 1),
      #(assign, "$capataz_sell", 1),
      [change_screen_trade]
  ]],
  
  [anyone, "capataz_sins_end", [],
    "Pleasure doing business with you.", "close_window", []],
    
  [anyone|plyr,"capataz_sins2", [], "Actually, I prefer to talk about other things.", "capataz_pretalk",[]],
  
  #
  [anyone|plyr,"capataz_talk", [(store_num_regular_prisoners,reg0),(ge,reg0,1)], "I want to sell all my prisoners to you.", "capataz_venta",[]],
  
  [anyone,"capataz_venta", [],
    "Well, I will pay you a flat 15 peningas for each prisoner, as I don't care about their quality or their past. If such things matter to you, I guarantee that they will never escape from here. Do we have a deal?", "capataz_venta2", []],
  [anyone|plyr,"capataz_venta2", [],
    "Yes, this is acceptable.", "capataz_venta3", [
      (assign, ":total_income", 0),
      (party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
      (try_for_range_backwards, ":i_stack", 0, ":num_stacks"),
        (party_prisoner_stack_get_troop_id, ":troop_no", "p_main_party", ":i_stack"),
        (neg|troop_is_hero, ":troop_no"),
        (party_prisoner_stack_get_size, ":stack_size", "p_main_party", ":i_stack"),
        (assign, ":sell_price", 15),
        (store_mul, ":stack_total_price", ":sell_price", ":stack_size"),
        (val_add, ":total_income", ":stack_total_price"),
        (party_remove_prisoners, "p_main_party", ":troop_no", ":stack_size"),
      (try_end),
      (troop_add_gold, "trp_player", ":total_income"),
    ]
  ],
  [anyone|plyr,"capataz_venta2", [],
    "Let me think about it.", "capataz_pretalk",[]],
  
  [anyone, "capataz_venta3", [], "Thank you. I could use new hands.", "close_window",[]],
  
  [anyone|plyr, "capataz_talk", [],
    "I take my leave now.", "close_window", []],
  
  ###Foreman Salt Mine
  [trp_saltmine_capataz, "start", [(neq, "$player_is_working", 1),],
    "Welcome, stranger, to our salt mine.", "capataz_talk2", []],
  [anyone, "capataz_pretalk2", [],
    "Anything else I can do for you?", "capataz_talk2", []],
  [anyone|plyr,"capataz_talk2", [],
    "What is happening here?", "capataz_angry2",[]],
  [anyone,"capataz_angry2", [],
    "Salt. Work. More salt. As you can see. Now I have things to do.", "close_window", []],
  
  # VC-1877 begins
  [trp_saltmine_capataz, "start", [],
    "You haven't finished your work yet. As I said, in the tunnel next to me, the salt must be struck out of the mountain.", "close_window", []],
  [anyone|plyr,"capataz_talk2", [],
    "I would like to work here.", "salt_work_0",[]],
  [anyone,"salt_work_0", [(assign, reg1, vc_work_payment_3)],
    "We have use for a day laborer. We pay {reg1} peningas per day.", "salt_work_1", []],
  [anyone|plyr,"salt_work_1", [],
    "Very well, I want to work one day here.", "salt_work_2",[]],
  [anyone|plyr,"salt_work_1", [],
    "I'm not interested.", "capataz_pretalk2",[]],
  [anyone,"salt_work_2", [],
    "In the tunnel next to me, the salt must be struck out of the mountain. Here is a pickaxe.", "close_window",
    [
      (assign, "$player_is_working", 1),
      (store_random_in_range, "$vc_work_payment", 0, 8),
      (try_begin),
        (ge, "$cheat_mode", 1),
        (assign, reg7, "$vc_work_payment"),
        (display_message, "@{!}payment type will be: {reg7}"),
      (end_try),
      (get_player_agent_no, ":player_agent"),
      (try_for_range, ":item_slot", 0, ek_body),	#all weapons + helmet
        (agent_get_item_slot,  ":item", ":player_agent", ":item_slot"),
        (gt, ":item", -1),
        (agent_unequip_item, ":player_agent", ":item"),
      (try_end),
      (agent_equip_item, ":player_agent", "itm_work_pickaxe"),
      (agent_set_wielded_item, ":player_agent", "itm_work_pickaxe"),
      (agent_equip_item, ":player_agent", "itm_work_basket"),
      (call_script, "script_advanced_agent_set_speed_modifier",":player_agent", 70),	#player slower while working
  ]],
  # VC-1877 ends
  
  [anyone|plyr, "capataz_talk2", [],
    "I want to buy some salt.", "capataz_sins2_2",
    []],
  
  [anyone,"capataz_sins2_2", [
      (party_slot_eq, "$g_encountered_party", slot_center_inventory, 0),
      #(eq, "$capataz_sell", 0), #only consultable each 90 hours
      (str_clear, s4),
    ],
    "Well, you've come the right place. {s4}", "capataz_sins22",[
      (troop_clear_inventory, "trp_saltmine_capataz"),
      (store_random_in_range, ":material", 0, 100),
      (try_begin),
        (ge, ":material", 85), #only mineral
        (str_store_string, s4, "@I have loads of salt today."),
        (troop_add_item,"trp_saltmine_capataz","itm_salt"),
        (troop_add_item,"trp_saltmine_capataz","itm_salt"),
        (troop_add_item,"trp_saltmine_capataz","itm_salt"),
        (troop_add_item,"trp_saltmine_capataz","itm_salt"),
        (troop_add_item,"trp_saltmine_capataz","itm_salt"),
        (troop_add_item,"trp_saltmine_capataz","itm_salt"),
      (else_try),
        (ge, ":material", 60), #only stone
        (str_store_string, s4, "@Come with me. I'll show you what we've got."),
        (troop_add_item,"trp_saltmine_capataz","itm_salt"),
        (troop_add_item,"trp_saltmine_capataz","itm_salt"),
        (troop_add_item,"trp_saltmine_capataz","itm_salt"),
        (troop_add_item,"trp_saltmine_capataz","itm_salt"),
      (else_try),
        (str_store_string, s4, "@I have some salt."),
        (troop_add_item,"trp_saltmine_capataz","itm_salt"),
        (troop_add_item,"trp_saltmine_capataz","itm_salt"),
      (try_end),
  ]],
  
  [anyone,"capataz_sins2_2", [], "Sorry, I just sold the last sack of salt to someone else.", "capataz_pretalk2",[]],
  
  [anyone|plyr,"capataz_sins22",
    [], "Very well. I want to buy some.", "capataz_sins_end",
    [
      (party_set_slot, "$g_encountered_party", slot_center_inventory, 1),
      #(assign, "$capataz_sell", 1),
      [change_screen_trade]
  ]],
  
  [anyone, "capataz_sins_end", [],
    "Pleasure doing business with you.", "close_window", []],
    
  [anyone|plyr,"capataz_sins22", [], "Actually, I prefer to talk about other things.", "capataz_pretalk2",[]],
  
  #
  [anyone|plyr,"capataz_talk2", [(store_num_regular_prisoners,reg0),(ge,reg0,1)], "I want to sell all my prisoners to you.", "capataz_venta2",[]],
  
  [anyone,"capataz_venta2", [],
    "Well, I will pay you a flat 30 peningas for each prisoner, as I don't care about their quality or their past. If such things matter to you, I guarantee that they will never escape from here. Do we have a deal?", "capataz_venta22", []],
  [anyone|plyr,"capataz_venta22", [],
    "Yes, this is acceptable.", "capataz_venta32", [
      (assign, ":total_income", 0),
      (party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
      (try_for_range_backwards, ":i_stack", 0, ":num_stacks"),
        (party_prisoner_stack_get_troop_id, ":troop_no", "p_main_party", ":i_stack"),
        (neg|troop_is_hero, ":troop_no"),
        (party_prisoner_stack_get_size, ":stack_size", "p_main_party", ":i_stack"),
        (assign, ":sell_price", 30),
        (store_mul, ":stack_total_price", ":sell_price", ":stack_size"),
        (val_add, ":total_income", ":stack_total_price"),
        (party_remove_prisoners, "p_main_party", ":troop_no", ":stack_size"),
      (try_end),
      (troop_add_gold, "trp_player", ":total_income"),
    ]
  ],
  [anyone|plyr,"capataz_venta22", [],
    "Let me think about it.", "capataz_pretalk2",[]],
  
  [anyone, "capataz_venta32", [], "Thank you. I could use a few new hands.", "close_window",[]],
  
  [anyone|plyr, "capataz_talk2", [],
    "I take my leave now.", "close_window", []],
  
  #Foreman Lumber Camp
  #capataz chief
  [trp_lumbercamp_capataz, "start", [
      (party_slot_eq, "$g_encountered_party", slot_center_fee_paid, 1),
    ],
    "You're not getting any money from me!", "close_window", []],
  [trp_lumbercamp_capataz, "start", [(le, "$player_is_working", 0),],
    "Aye, this is a work camp.", "capataz_talk3", []],
  [anyone, "capataz_pretalk3", [],
    "How else may I help?", "capataz_talk3", []],
  # VC-1877 begins
  [trp_lumbercamp_capataz, "start", [],
    "You haven't finished your work yet. As I said, the wood next to me needs to be cut into smaller pieces, and the trees behind this house have to be felled.", "close_window", []],
  [anyone|plyr,"capataz_talk3", [],
    "I would like to work here.", "lumber_work_0",[]],
  [anyone,"lumber_work_0", [(assign, reg1, vc_work_payment_1)],
    "We have use for a day laborer. We pay {reg1} peningas per day.", "lumber_work_1", []],
  [anyone|plyr,"lumber_work_1", [],
    "Very well, I want to work one day here.", "lumber_work_2",[]],
  [anyone|plyr,"lumber_work_1", [],
    "I'm not interested.", "capataz_pretalk3",[]],
  [anyone,"lumber_work_2", [],
    "The wood next to me needs to be cut into smaller pieces, and the trees behind this house have to be felled. Here is your axe.", "close_window",
    [
      (assign, "$player_is_working", 1),
      (store_random_in_range, "$vc_work_payment", 0, 8),
      (try_begin),
        (ge, "$cheat_mode", 1),
        (assign, reg7, "$vc_work_payment"),
        (display_message, "@{!}payment type will be: {reg7}"),
      (end_try),
      (get_player_agent_no, ":player_agent"),
      (try_for_range, ":item_slot", 0, ek_body),	#all weapons + helmet
        (agent_get_item_slot,  ":item", ":player_agent", ":item_slot"),
        (gt, ":item", -1),
        (agent_unequip_item, ":player_agent", ":item"),
      (try_end),
      (agent_equip_item, ":player_agent", "itm_work_axe"),
      (agent_set_wielded_item, ":player_agent", "itm_work_axe"),
      (call_script, "script_advanced_agent_set_speed_modifier",":player_agent", 70),	#player slower while working
  ]],
  # VC-1877 ends
  # [anyone,"capataz_angry3", [],
  # "Sorry, but we are not hiring workers or buying slaves. Our family runs this camp on our own.", "close_window", []],
  
  ###extortion
  [anyone|plyr,"capataz_talk3", [
      (party_slot_eq, "$g_encountered_party", slot_center_fee_paid, 0),
    ],
    "Such nice trees, but they burn easily. I could ensure that they don't -- for a small fee.", "lumbercamp_angry",[]],
  [anyone,"lumbercamp_angry", [        (le, "$player_honor", -15),
    ],
    "Oh? Well, it's true that I do not like fires. I will pay your... fee.", "lumbercamp_extortion", [
      ###less honor + money
      (try_begin),
        (le, "$player_honor", -80),
        (store_random_in_range, ":random", 1000, 2000),
      (else_try),
        (le, "$player_honor", -40),
        (store_random_in_range, ":random", 500, 1000),
      (else_try),
        (store_random_in_range, ":random", 200, 500),
      (try_end),
      (troop_add_gold, "trp_player", ":random"),
      (call_script, "script_change_player_honor", -5),
  ]],
  
  [anyone|plyr, "lumbercamp_extortion", [],
    "You have done well, my man. We'll make sure nothing happens to you or your camp.", "close_window", [
      (party_set_slot, "$g_encountered_party", slot_center_fee_paid, 1),
  ]],
  
  [anyone,"lumbercamp_angry", [
    ],
    "Is this some sort of a bad joke? I have no time for your nonsense.", "close_window", [
      (party_set_slot, "$g_encountered_party", slot_center_fee_paid, 1),
  ]],
  
  ###
  
  
  [anyone|plyr, "capataz_talk3", [],
    "I want to buy some timber.", "capataz_sins3",
    []],
  
  [anyone|plyr, "capataz_talk3", [],
    "I must take my leave.", "close_window", []],
  
  [anyone,"capataz_sins3", [
      (party_slot_eq, "$g_encountered_party", slot_center_inventory, 0),
      #	  (eq, "$capataz_sell", 0), #only consultable each 90 hours
      (str_clear, s4),
    ],
    "Of course! {s4}", "capataz_sins23",[
      (troop_clear_inventory, "trp_lumbercamp_capataz"),
      (store_random_in_range, ":material", 0, 100),
      (try_begin),
        (ge, ":material", 85), #only mineral
        (str_store_string, s4, "@I have plenty of timber available."),
        (troop_add_item,"trp_lumbercamp_capataz","itm_timber"),
        (troop_add_item,"trp_lumbercamp_capataz","itm_timber"),
        (troop_add_item,"trp_lumbercamp_capataz","itm_timber"),
        (troop_add_item,"trp_lumbercamp_capataz","itm_timber"),
        (troop_add_item,"trp_lumbercamp_capataz","itm_timber"),
        (troop_add_item,"trp_lumbercamp_capataz","itm_timber"),
      (else_try),
        (ge, ":material", 60), #only stone
        (str_store_string, s4, "@Come with me. I'll show you what we've got."),
        (troop_add_item,"trp_lumbercamp_capataz","itm_timber"),
        (troop_add_item,"trp_lumbercamp_capataz","itm_timber"),
        (troop_add_item,"trp_lumbercamp_capataz","itm_timber"),
        (troop_add_item,"trp_lumbercamp_capataz","itm_timber"),
      (else_try),
        (str_store_string, s4, "@I have some timber available."),
        (troop_add_item,"trp_lumbercamp_capataz","itm_timber"),
        (troop_add_item,"trp_lumbercamp_capataz","itm_timber"),
      (try_end),
  ]],
  
  [anyone,"capataz_sins3", [], "Sorry, one of the lords in the area just requisitioned whatever we had.", "capataz_pretalk3",[]],
  
  [anyone|plyr,"capataz_sins23",
    [], "Very well. I would like to buy some.", "capataz_sins_end",
    [
      (party_set_slot, "$g_encountered_party", slot_center_inventory, 1),
      #(assign, "$capataz_sell", 1),
      [change_screen_trade]
  ]],
  
  [anyone, "capataz_sins_end", [],
    "Pleasure doing business with you.", "close_window", []],
    
  [anyone|plyr,"capataz_sins23", [], "Actually, I prefer to talk about other things.", "capataz_pretalk3",[]],
  
  #capataz acaba
  #farmstead special##########
  [trp_farmstead_boss, "start", [
      (party_slot_eq, "$g_encountered_party", slot_center_fee_paid, 1),
    ],
    "You are not going to see a pening from us!", "close_window", []],
  [trp_farmstead_boss, "start", [(neq, "$player_is_working", 1),],
    "Welcome to our farm. Please help yourself to some bread and ale. How may I help you?", "farmstead_boss_talk", []],
  [anyone, "farmstead_boss_pretalk", [],
    "How else may I help you?", "farmstead_boss_talk", []],
  
  ###extortion
  [anyone|plyr,"farmstead_boss_talk", [
      (party_slot_eq, "$g_encountered_party", slot_center_fee_paid, 0),
    ],
    "There is trouble in the area, and your farm is so nice. I can protect it -- for a fee.", "farmstead_boss_angry",[]],
  [anyone,"farmstead_boss_angry", [        (le, "$player_honor", -15),
    ],
    "Trouble? There's no trouble... Oh, I see. Yes, we want no trouble. We will pay you.", "farmstead_boss_extortion", [
      ###less honor + money
      (try_begin),
        (le, "$player_honor", -80),
        (store_random_in_range, ":random", 1000, 2000),
      (else_try),
        (le, "$player_honor", -40),
        (store_random_in_range, ":random", 500, 1000),
      (else_try),
        (store_random_in_range, ":random", 200, 500),
      (try_end),
      (troop_add_gold, "trp_player", ":random"),
      (call_script, "script_change_player_honor", -5),
  ]],
  
  [anyone|plyr, "farmstead_boss_extortion", [],
    "Well done, my man. I assure you, trouble will stay far from you.", "farmstead_boss_pretalk", [
      (party_set_slot, "$g_encountered_party", slot_center_fee_paid, 1),
  ]],
  
  [anyone,"farmstead_boss_angry", [
    ],
    "Trouble? Bother me again, and I'll show you trouble!", "close_window", [
      (party_set_slot, "$g_encountered_party", slot_center_fee_paid, 1),
  ]],
  
  # VC-1877 begins
  [trp_farmstead_boss, "start", [],
    "You haven't finished your work yet. As I said, the hay in the two wheat fields near the courtyard must be piled up.", "close_window", []],
  [anyone|plyr,"farmstead_boss_talk", [],
    "I would like to work here.", "farmstead_work_0",[]],
  [anyone,"farmstead_work_0", [(assign, reg1, vc_work_payment_2)],
    "We have a use for a day laborer. We pay {reg1} peningas per day.", "farmstead_work_1", []],
  [anyone|plyr,"farmstead_work_1", [],
    "Very well, I want to work one day here.", "farmstead_work_2",[]],
  [anyone|plyr,"farmstead_work_1", [],
    "I'm not interested.", "farmstead_boss_pretalk",[]],
  [anyone,"farmstead_work_2", [],
    "The hay in the two wheat fields near the courtyard must be piled up. Here is a pitchfork.", "close_window",
    [
      (assign, "$player_is_working", 1),
      (store_random_in_range, "$vc_work_payment", 0, 8),
      (try_begin),
        (ge, "$cheat_mode", 1),
        (assign, reg7, "$vc_work_payment"),
        (display_message, "@{!}payment type will be: {reg7}"),
      (end_try),
      (get_player_agent_no, ":player_agent"),
      (try_for_range, ":item_slot", 0, ek_body),	#all weapons + helmet
        (agent_get_item_slot,  ":item", ":player_agent", ":item_slot"),
        (gt, ":item", -1),
        (agent_unequip_item, ":player_agent", ":item"),
      (try_end),
      (agent_equip_item, ":player_agent", "itm_work_pitchfork"),
      (agent_set_wielded_item, ":player_agent", "itm_work_pitchfork"),
      (agent_equip_item, ":player_agent", "itm_work_basket"),
      (call_script, "script_advanced_agent_set_speed_modifier",":player_agent", 70),	#player slower while working
  ]],
  # VC-1877 ends
  
  ###
  [anyone|plyr, "farmstead_boss_talk", [#(eq, "$reclutar_puede_refuges", 0),
      (party_slot_eq, "$g_encountered_party", slot_center_fee_paid, 0),
      (party_slot_eq,"$g_encountered_party",slot_center_volunteer_troop_type,0),#can recruit
      (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
      (ge, ":free_capacity", 8),
    ],
    "I see some of your men are loitering around. Can I hire some of them?", "farmstead_boss_ayuda", []],
  
  
  [anyone, "farmstead_boss_ayuda", [],
    "To tell the truth, my {reg59?lady:lord}, my servants and slaves breed like rabbits and eat too much of the produce. " +
    "It would please me to sell the excess, and I'll give you a good price. One hundred peningas for the lot.", "farmstead_boss_ayuda2", [
  ]],
  
  [anyone|plyr, "farmstead_boss_ayuda2", [
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 100),
    ],
    "Sounds good. Here is the money, how many men can you give me?", "farmstead_boss_ayuda3",
    [
      (troop_remove_gold, "trp_player", 100),
  ]],
  [anyone|plyr, "farmstead_boss_ayuda2", [
    ],
    "Oh, I'm afraid I disagree. That's a little excessive.", "farmstead_boss_pretalk",
    [
  ]],
  
  
  [anyone, "farmstead_boss_ayuda3", [
    ],
    "{reg0} lads in all.", "farmstead_boss_pretalk", [
      (store_random_in_range, reg0, 2, 8),
      (party_add_members,"p_main_party","trp_farmer",reg0),
      #(assign, "$reclutar_puede_refuges", 1),
      (party_set_slot,"$g_encountered_party",slot_center_volunteer_troop_type,5),#5 days cooldown
  ]],
  
  ###
  [anyone|plyr, "farmstead_boss_talk", [],
    "What do you have for sale?", "farmstead_boss_sins",
    []],
  
  [anyone|plyr, "farmstead_boss_talk", [],
    "I must take my leave.", "close_window", []],
  
  [anyone,"farmstead_boss_sins", [
      (party_slot_eq, "$g_encountered_party", slot_center_inventory, 0),
      #	  (eq, "$farmstead_boss_sell", 0), #only consultable each 90 hours
      (str_clear, s4),
    ],
    "{!}{s4}", "farmstead_boss_sins2",[
      (troop_clear_inventory, "trp_farmstead_boss"),
      (party_get_slot, ":cattle", "$g_encountered_party", slot_center_head_cattle),
      (val_sub, ":cattle", 100),
      (store_random_in_range, ":material", 0, 100),
      (try_begin),
        (gt, ":cattle", 0),
        (ge, ":material", 85), #only cows
        (str_store_string, s4, "@I have nice cows, huge and fat, ready to sell in the town. I'd be happy to sell them right now."),
        (troop_add_item,"trp_farmstead_boss","itm_cow1"),
        (troop_add_item,"trp_farmstead_boss","itm_cow1"),
        (troop_add_item,"trp_farmstead_boss","itm_cow1"),
        (troop_add_item,"trp_farmstead_boss","itm_cow2"),
        (troop_add_item,"trp_farmstead_boss","itm_cow2"),
        (troop_add_item,"trp_farmstead_boss","itm_cow2"),
      (else_try),
        (ge, ":material", 60), #only expensive products
        (str_store_string, s4, "@I have raw materials and produce."),
        (troop_add_item,"trp_farmstead_boss","itm_vc_honey"),
        (troop_add_item,"trp_farmstead_boss","itm_wool"),
        (troop_add_item,"trp_farmstead_boss","itm_ale"),
        (troop_add_item,"trp_farmstead_boss","itm_vc_honey"),
        (troop_add_item,"trp_farmstead_boss","itm_raw_flax"),
        (troop_add_item,"trp_farmstead_boss","itm_wool"),
        (troop_add_item,"trp_farmstead_boss","itm_ale"),
        (troop_add_item,"trp_farmstead_boss","itm_vc_honey"),
        (troop_add_item,"trp_farmstead_boss","itm_raw_flax"),
        (troop_add_item,"trp_farmstead_boss","itm_wool"),
        (troop_add_item,"trp_farmstead_boss","itm_ale"),
      (else_try),
        (str_store_string, s4, "@I have a few food items for sale."),
        (troop_add_item,"trp_farmstead_boss","itm_dried_meat"),
        (troop_add_item,"trp_farmstead_boss","itm_bread"),
        (troop_add_item,"trp_farmstead_boss","itm_chicken"),
        (troop_add_item,"trp_farmstead_boss","itm_cattle_meat"),
        (troop_add_item,"trp_farmstead_boss","itm_dried_meat"),
        (troop_add_item,"trp_farmstead_boss","itm_grain"),
        (troop_add_item,"trp_farmstead_boss","itm_bread"),
        (troop_add_item,"trp_farmstead_boss","itm_pork"),
        (troop_add_item,"trp_farmstead_boss","itm_chicken"),
        (troop_add_item,"trp_farmstead_boss","itm_cattle_meat"),
      (try_end),
  ]],
  
  [anyone,"farmstead_boss_sins", [], "My lord has just sent a word that he needs the rest of what I have for a feast.", "farmstead_boss_pretalk",[]],
  
  [anyone|plyr,"farmstead_boss_sins2",
    [], "I'm interested. Let me see.", "capataz_sins_end",
    [
      #(assign, "$farmstead_boss_sell", 1),
      (party_set_slot, "$g_encountered_party", slot_center_inventory, 1),
      [change_screen_trade]
  ]],
  
  [anyone, "capataz_sins_end", [],
    "Pleasure doing business with you.", "close_window", []],
    
  [anyone|plyr,"farmstead_boss_sins2", [], "No, I'm looking for something else.", "farmstead_boss_pretalk",[]],
  
  [anyone|plyr, "farmstead_boss_talk", [#(eq, "$reclutar_puede_refuges", 0),
      (party_slot_eq, "$g_encountered_party", slot_center_fee_paid, 0),
      (assign, reg25, 0),
      (try_for_parties, ":party_no"),
        (party_slot_eq, ":party_no", slot_party_type, spt_cattle_herd),
        (party_slot_eq, ":party_no", slot_cattle_driven_by_player, 1),
        (store_distance_to_party_from_party, ":distance", ":party_no", "p_main_party"),
        (lt, ":distance", 3),
        (party_count_members_of_type, ":num", ":party_no", "trp_cattle"),
        (val_add, reg25, ":num"),
      (try_end),
      (gt, reg25, 0),
    ],
    "I have {reg25} cattle with me. May I have them kept here?", "farmstead_boss_cattle", []],
  [anyone,"farmstead_boss_cattle", [
      (party_get_slot, ":cattle", "$g_encountered_party", slot_center_head_cattle),
      (party_get_slot, ":p_cattle", "$g_encountered_party", slot_center_player_cattle),
      (store_add, ":total", ":cattle", ":p_cattle"),
      (val_add, ":total", "$temp"),
      (lt, ":total", 500),],
    "We can do that, {playername}.","farmstead_boss_cattle1", [
      (call_script, "script_remove_cattles_if_herd_is_close_to_party", "$g_encountered_party", reg25),
      (party_get_slot, ":p_cat", "$g_encountered_party", slot_center_player_cattle),
      (val_add, ":p_cat", reg25),
      (party_set_slot,  "$g_encountered_party",slot_center_player_cattle, ":p_cat"),
  ]],
  
  [anyone,"farmstead_boss_cattle", [
      (party_get_slot, ":cattle", "$g_encountered_party", slot_center_head_cattle),
      (party_get_slot, ":p_cattle", "$g_encountered_party", slot_center_player_cattle),
      (store_add, ":total", ":cattle", ":p_cattle"),
      (val_add, ":total", "$temp"),
      (ge, ":total", 500),],
    "Unfortunately, {playername}, we have too many cattle as it is.","farmstead_boss_pretalk", []],
  
  [anyone|plyr,"farmstead_boss_cattle1",[], "Thank you.", "farmstead_boss_pretalk",[]],
  
  
  
  
  #
  ##############
  # Castle Reeve
  [anyone ,"start", [(is_between,"$g_talk_troop","trp_castle_1_seneschal","trp_town_1_arena_master"),(eq,"$g_talk_troop_met",0),
      (this_or_next|eq, "$players_kingdom", "$g_encountered_party_faction"),
      (eq, "$g_encountered_party_faction", "fac_player_supporters_faction"),],
    "Good day, {reg59?my lady:my lord}.", "reeve_begin",[]],
  [anyone ,"start", [(is_between,"$g_talk_troop","trp_castle_1_seneschal","trp_town_1_arena_master"),(eq,"$g_talk_troop_met",0),
      (str_store_party_name, s9, "$current_town")],
    "Hello, stranger. You seem to be new to {s9}. I am the reeve of this fort.", "reeve_talk",[]],
  [anyone ,"start", [(is_between,"$g_talk_troop","trp_castle_1_seneschal","trp_town_1_arena_master")],
    "Good day, {playername}.", "reeve_begin",[]],
  [anyone,"reeve_begin", [(check_quest_active, "qst_blank_quest_10"),
      (check_quest_succeeded, "qst_blank_quest_10"),
      (quest_slot_eq, "qst_blank_quest_10", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_target_item", "qst_blank_quest_10", slot_quest_target_item),
      (player_has_item, ":quest_target_item"),
      (str_store_item_name, s13, ":quest_target_item"),
    ],
    "I have heard that you found the perpetrator and recovered my valuable {s13}. " +
    "You are really as good as they say. " +
    "Here is your reward: {reg5} peningas.",
    "reeve_friendly_pretalk", [(quest_get_slot, ":quest_gold_reward", "qst_blank_quest_10", slot_quest_gold_reward),
      (call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
      (quest_get_slot, ":quest_target_item", "qst_blank_quest_10", slot_quest_target_item),
      (troop_remove_item, "trp_player", ":quest_target_item"),
      (assign, ":xp_reward", ":quest_gold_reward"),
      (val_mul, ":xp_reward", 2),
      (add_xp_as_reward, ":xp_reward"),
      (call_script, "script_change_player_relation_with_center", "$current_town", 10),
      (call_script, "script_change_troop_renown", "trp_player", 2),
      (call_script, "script_end_quest", "qst_blank_quest_10"),
      (assign, reg5, ":quest_gold_reward"),
  ]],
  [anyone,"reeve_begin", [(check_quest_active, "qst_blank_quest_10"),
      (quest_slot_eq, "qst_blank_quest_10", slot_quest_giver_troop, "$g_talk_troop"),
      (check_quest_failed, "qst_blank_quest_10"),
      (quest_get_slot, ":quest_target_item", "qst_blank_quest_10", slot_quest_target_item),
      (str_store_item_name, s9, ":quest_target_item"),
    ],
    "I heard that you lost a fight against the runaway guard and my valuable {s9} is gone forever. " +
    "I am very disappointed, {playername}, as I've heard so many good things about your reliability. ", "close_window",
    [ (call_script, "script_end_quest", "qst_blank_quest_10"),
      (call_script, "script_change_player_relation_with_center", "$current_town", -5),]],
  
  [anyone,"reeve_begin", [(check_quest_active, "qst_troublesome_bandits"),
      (check_quest_succeeded, "qst_troublesome_bandits"),
      (quest_slot_eq, "qst_troublesome_bandits", slot_quest_giver_troop, "$g_talk_troop"),
    ],
    "I have heard about your deeds. You have given those bandits the punishment they deserved. " +
    "You are really as good as they say. " +
    "Here is your reward: {reg5} peningas. " +
    "I would like to give more but those bandits almost brought me to bankruptcy.",
    "reeve_friendly_pretalk", [(quest_get_slot, ":quest_gold_reward", "qst_troublesome_bandits", slot_quest_gold_reward),
      (quest_get_slot, ":xp_reward", "qst_troublesome_bandits", slot_quest_xp_reward),
      (call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
      (add_xp_as_reward, ":xp_reward"),
      (call_script, "script_change_player_relation_with_center", "$current_town", 7),
      (call_script, "script_change_troop_renown", "trp_player", 3),
      (call_script, "script_end_quest", "qst_troublesome_bandits"),
      (assign, reg5, ":quest_gold_reward"),
  ]],
  
  
  
  [anyone,"reeve_begin", [], "What can I do for you?", "reeve_talk", []],
  [anyone,"reeve_friendly_pretalk", [], "Now... What else may I do for you?", "reeve_talk",[]],
  [anyone,"reeve_pretalk", [], "Yes?", "reeve_talk",[]],
  
  [anyone|plyr,"reeve_talk", [], "Can you tell me about what you do?", "reeve_info_begin",[]],
  
  
  [anyone, "reeve_info_begin", [(str_store_party_name, s9, "$current_town"),
      (try_begin),
        (party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
        (str_store_string, s11, "@I am the reeve of the fort of {s9}. " +
        "I manage the affairs of the fort in your name, my {reg59?lady:lord}"),
      (else_try),
        (str_store_string, s11, "@I am the reeve of the fort of {s9}. " +
        "I manage the affairs of the castle in my lord's name."),
      (try_end),
    ],
    "{!}{s11}", "reeve_info_talk",[(assign, "$mayor_info_lord_told",0)]],
  
  [anyone|plyr,"reeve_info_talk",[(eq, "$mayor_info_lord_told",0)], "Who rules this castle?", "reeve_info_lord",[]],
  
  [anyone, "reeve_info_lord", #moto fix
    [
      (party_get_slot, ":town_lord","$current_town",slot_town_lord),
      (try_begin),
        (eq, ":town_lord", "trp_player"),
        (party_get_slot,":tax", "$current_town", slot_center_tax_rate),
        (str_store_string, s10, "@Your highness"),
        (try_begin),
          (eq, ":tax", 0),
          (str_store_string, s33, "@May I remind you that the populace is paying normal taxes to you?"),
        (else_try),
          (eq, ":tax", 1),
          (str_store_string, s33, "@May I remind you that the populace is paying low taxes to you? They are exceptionally grateful to you."),
        (else_try),
          (eq, ":tax", 2),
          (str_store_string, s33, "@May I remind you that the populace is paying high taxes to you? Your name is being cursed on every corner and at every market stall."),
        (try_end),
      (else_try),
        (is_between, ":town_lord", active_npcs_begin, active_npcs_end),
        (str_store_troop_name, s10, ":town_lord"),
        (str_clear, s33),
      (else_try),
        (faction_get_slot, ":faction_leader", "$g_encountered_party_faction", slot_faction_leader),
        (str_store_troop_name, s10, ":faction_leader"),
        (str_clear, s33),
      (try_end),
    ],
    "This fort's lord and protector is {s10}. {s10} resides here and collects taxes from the local populace. " +
    "However, when my lord is not around, I manage matters and execute the law in my lord's stead. " +
    "As the castle's reeve, I have the authority to decide those things.{s33}", "reeve_info_talk",[(assign, "$mayor_info_lord_told",1)]],
  
  [anyone|plyr,"reeve_info_talk",[], "That's all I need to know. Thanks.", "reeve_pretalk",[]],
  
  ## Send message to lords of your faction JuJu70
  [anyone|plyr,"reeve_talk", [
      (party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
      ], "I need to send a message to one of the lords.", "reeve_sendmessage0",[]],
  
  [anyone, "reeve_sendmessage0", [],"I can do that, {reg59?my lady:my lord}. To whom would you like to send the message?", "reeve_sendmessage",[]],
  
  [anyone|plyr|repeat_for_troops, "reeve_sendmessage", [
      (store_repeat_object, ":troop_no"),
      (store_faction_of_troop, ":faction", ":troop_no"),
      (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (is_between, ":troop_no", active_npcs_begin, active_npcs_end),
      (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
      (party_is_active, ":party_no"),
      (party_get_battle_opponent, ":opponent",":party_no"),
      (lt, ":opponent", 0), #party is not itself involved in a battle
      (get_party_ai_behavior, ":behavior", ":party_no"),
      (party_get_attached_to, ":attached_to",":party_no"),
      (assign, ":cont", 0),
      (try_begin),
        (neq, ":behavior", 8),#party is not in a town/castle
        (lt, ":attached_to", 0),
      (else_try),
        (eq, ":behavior", 8),
        (is_between, ":attached_to",centers_begin, centers_end),
        (try_begin),
          (party_slot_eq, ":attached_to", slot_center_is_besieged_by, -1),
        (else_try),
          (assign, ":cont", 1),
        (try_end),
      (try_end),
      (eq, ":cont", 0),
      (store_distance_to_party_from_party, ":cur_distance", ":party_no", "p_main_party"),
      (lt, ":cur_distance", 100),  #party is within distance
      (eq, ":faction", "$players_kingdom"),
      (troop_slot_eq, ":troop_no", slot_troop_message_sent, 0),
      (str_store_troop_name, s1, ":troop_no"),],"{!}{s1}.", "reeve_sendmessage1",[(store_repeat_object, "$temp"),]],
  
  [anyone|plyr, "reeve_sendmessage",[],"No, none of those. Later perhaps.", "reeve_friendly_pretalk",[]],
  
  [anyone, "reeve_sendmessage1", [(str_store_troop_name, s4, "$temp"),],
    "Very well, you'd like to send a message to {s4}. What is the message about?", "reeve_sendmessage2",[]],
  
  [anyone|plyr, "reeve_sendmessage2",[], "Actually, I changed my mind", "reeve_friendly_pretalk",[]],
  
  [anyone|plyr, "reeve_sendmessage2",[
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      (call_script, "script_troop_get_player_relation", "$temp"),
      (gt, reg0, 10),
      ], "I would like to ask him to come to my help here.", "reeve_sendmessage3a",[]],
  
  [anyone|plyr, "reeve_sendmessage2",[
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      ], "I would like to ask him to meet me somewhere.", "reeve_sendmessage3b",[]],
  
  [anyone|plyr, "reeve_sendmessage2",[
      ], "I would like to send him a gift.", "reeve_sendmessage3c",[]],
  
  [anyone, "reeve_sendmessage3a", [], "Very well. Consider it done, your highness.","reeve_friendly_pretalk", [
      (troop_set_slot, "$temp", slot_troop_message_sent, 1),
      (troop_set_slot, "$temp", slot_troop_days_on_mission, 1),
      (troop_set_slot, "$temp", slot_troop_current_mission, npc_mission_improve_relations),
      (troop_set_slot, "$temp", slot_troop_mission_object, "p_main_party"),
      (troop_set_slot, "$temp", slot_troop_mission_target, "$current_town"),
  ]],
  
  [anyone, "reeve_sendmessage3c", [], "Very well. What kind of gift do you want to send?","reeve_sendmessage3cc", [(assign, "$temp2", 0)]],
  
  [anyone|plyr, "reeve_sendmessage3cc",[(store_troop_gold,":money","trp_player"),(ge,":money",1000),], "I would like to send him bracelets and rings worth 1000 peningas.", "reeve_sendmessage3ccc",[(assign, "$temp2", 1000)]],
  
  [anyone|plyr, "reeve_sendmessage3cc",[(store_troop_gold,":money","trp_player"),(ge,":money",3000),], "I would like to send him bracelets and rings worth 3000 peningas.", "reeve_sendmessage3ccc",[(assign, "$temp2", 3000)]],
  
  [anyone|plyr, "reeve_sendmessage3cc",[(store_troop_gold,":money","trp_player"),(ge,":money",5000),], "I would like to send him bracelets and rings worth 5000 peningas.", "reeve_sendmessage3ccc",[(assign, "$temp2", 5000)]],
  
  [anyone|plyr, "reeve_sendmessage3cc",[], "Actually, I changed my mind", "reeve_friendly_pretalk",[]],
  
  [anyone, "reeve_sendmessage3ccc", [], "Very well. Consider it done, your highness.","reeve_friendly_pretalk", [
      (troop_remove_gold, "trp_player", "$temp2"),
      (troop_set_slot, "$temp", slot_troop_message_sent, 1),
      (troop_set_slot, "$temp", slot_troop_days_on_mission, 2),
      (troop_set_slot, "$temp", slot_troop_current_mission, npc_mission_improve_relations),
      (troop_set_slot, "$temp", slot_troop_mission_amount, "$temp2"),
      (troop_set_slot, "$temp", slot_troop_mission_object, -1),  ]],
  
  [anyone, "reeve_sendmessage3b", [], "Very well. Where would you want him to travel?","reeve_sendmessage3bb", []],
  
  [anyone|plyr|repeat_for_parties, "reeve_sendmessage3bb", [
      (store_repeat_object, ":party_no"),
      (store_faction_of_party, ":faction", ":party_no"),
      (is_between, ":party_no", walled_centers_begin, walled_centers_end),
      (eq, ":faction", "$players_kingdom"),
      (str_store_party_name, s1, ":party_no"),],"{!}{s1}.", "reeve_sendmessage3bbb",[(store_repeat_object, "$temp2"),]],
  
  [anyone|plyr, "reeve_sendmessage3bb",[],"No, none of those. Later perhaps.", "reeve_friendly_pretalk",[]],
  
  [anyone, "reeve_sendmessage3bbb", [(str_store_party_name, s4, "$temp2"),(str_store_troop_name, s32, "$temp"),],
    "Very well, I'll send a messenger to {s32} and ask him to meet you in {s4}.", "reeve_friendly_pretalk",[
      (troop_set_slot, "$temp", slot_troop_message_sent, 1),
      (troop_set_slot, "$temp", slot_troop_days_on_mission, 1),
      (troop_set_slot, "$temp", slot_troop_current_mission, npc_mission_improve_relations),
      (troop_set_slot, "$temp", slot_troop_mission_object, "$temp2"),
  ]],
  
  ## Castle reeve messages end
  
  [anyone|plyr,"reeve_talk", [(store_partner_quest, ":partner_quest"),
      (lt, ":partner_quest", 0),
      (this_or_next|gt, "$cheat_mode", 0),
      (neq, "$merchant_quest_last_offerer", "$g_talk_troop")],
    "Do you happen to have a job for me?", "merchant_quest_requested",[
      (assign,"$merchant_quest_last_offerer", "$g_talk_troop"),
      (call_script, "script_get_quest", "$g_talk_troop"),
      (assign, "$random_merchant_quest_no", reg0),
      (assign,"$merchant_offered_quest","$random_merchant_quest_no"),
  ]],
  
  [anyone|plyr,"reeve_talk", [(store_partner_quest, ":partner_quest"),
      (lt, ":partner_quest", 0),
      (eq, "$cheat_mode", 0),
      (eq,"$merchant_quest_last_offerer", "$g_talk_troop"),
      (gt,"$merchant_offered_quest", 0),
      (neq,"$merchant_offered_quest", "qst_blank_quest_10"),
      (neq, "$merchant_offered_quest", "qst_blank_quest_11"),
    ],
    "About that job you offered me...", "merchant_quest_last_offered_job",[]],
  
  [anyone|plyr,"reeve_talk", [(store_partner_quest, ":partner_quest"),
      (lt, ":partner_quest", 0),
      (eq, "$cheat_mode", 0),
      (eq,"$merchant_quest_last_offerer", "$g_talk_troop"),
      (gt,"$merchant_offered_quest", 0),
      (this_or_next|eq,"$merchant_offered_quest", "qst_blank_quest_10"),
      (eq, "$merchant_offered_quest", "qst_blank_quest_11"),
    ],
    "About that job you offered me...", "merchant_quest_requested",[]],
  
  
  
  [anyone|plyr,"reeve_talk", [(store_partner_quest,reg(2)),(ge,reg(2),0)],
    "About the job you gave me...", "merchant_quest_about_job",[]],
  
  
  # [anyone,"reeve_begin", [(check_quest_active, "qst_deal_with_night_bandits"),
  # (quest_slot_eq, "qst_deal_with_night_bandits", slot_quest_giver_troop, "$g_talk_troop"),
  # (check_quest_succeeded, "qst_deal_with_night_bandits"),
  # ],
  # "Very nice work, {playername}, you made short work of those lawless curs.\
  # Thank you kindly for all your help, and please accept this bounty of 150 peningas.", "lord_deal_with_night_bandits_completed",
  # [
  # (add_xp_as_reward,200),
  # (call_script, "script_troop_add_gold", "trp_player", 250),
  # (call_script, "script_change_player_relation_with_center", "$current_town", 1),
  # (call_script, "script_end_quest", "qst_deal_with_night_bandits"),
  # ]],
  
  
  
  
  
  
  
  
  #Mayor talk (town elder)
  
  [anyone ,"start", [(is_between,"$g_talk_troop",mayors_begin,mayors_end),(eq,"$g_talk_troop_met",0),
      (this_or_next|eq, "$players_kingdom", "$g_encountered_party_faction"),
      (             eq, "$g_encountered_party_faction", "fac_player_supporters_faction"),],
    "Good day, {reg59?my lady:my lord}.", "mayor_begin",[]],
  
  [anyone ,"start", [(is_between,"$g_talk_troop",mayors_begin,mayors_end),(eq,"$g_talk_troop_met",0),
      (str_store_party_name, s9, "$current_town")],
    "Hello stranger, you seem to be new to {s9}. I am the mayor of the town.", "mayor_talk",[]],
  
  [anyone ,"start", [(is_between,"$g_talk_troop",mayors_begin,mayors_end)],
    "Good day, {playername}.", "mayor_begin",
    [
      #Delete last offered quest if peace is formed.
      (try_begin),
        (eq, "$merchant_offered_quest", "qst_persuade_lords_to_make_peace"),
        (party_get_slot, ":target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
        (party_get_slot, ":object_faction", "qst_persuade_lords_to_make_peace", slot_quest_object_faction),
        (store_relation, ":reln", ":target_faction", ":object_faction"),
        (ge, ":reln", 0),
        (assign, "$merchant_quest_last_offerer", -1),
        (assign, "$merchant_offered_quest", -1),
      (try_end),
  ]],
  
  
  [anyone,"mayor_begin", [(check_quest_active, "qst_persuade_lords_to_make_peace"),
      (quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_giver_troop, "$g_talk_troop"),
      (check_quest_succeeded, "qst_persuade_lords_to_make_peace"),
      (quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
      (quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
      (val_mul, ":quest_target_troop", -1),
      (val_mul, ":quest_object_troop", -1),
      (quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
      (quest_get_slot, ":quest_object_faction", "qst_persuade_lords_to_make_peace", slot_quest_object_faction),
      (str_store_troop_name, s12, ":quest_target_troop"),
      (str_store_troop_name, s13, ":quest_object_troop"),
      (str_store_faction_name, s14, ":quest_target_faction"),
      (str_store_faction_name, s15, ":quest_object_faction"),
      (str_store_party_name, s19, "$current_town"),
    ],
    "{playername}, it was an incredible feat to get the {s14} and the {s15} to make peace, and you made it happen. " +
    "Your involvement has not only saved our town from disaster, but it has also saved thousands of lives, and put an end to all the grief this bitter war has caused. " +
    "As the townspeople of {s19}, know that we'll be good on our word, and we are ready to pay the {reg12} peningas we promised.", "lord_persuade_lords_to_make_peace_completed",
    [(quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
      (quest_get_slot, ":quest_object_faction", "qst_persuade_lords_to_make_peace", slot_quest_object_faction),
      #Forcing 2 factions to make peace within 72 hours.
      (assign, "$g_force_peace_faction_1", ":quest_target_faction"),
      (assign, "$g_force_peace_faction_2", ":quest_object_faction"),
      (quest_get_slot, ":quest_reward", "qst_persuade_lords_to_make_peace", slot_quest_gold_reward),
      (assign, reg12, ":quest_reward"),
      #TODO: Change these values
      (add_xp_as_reward, 4000),
  ]],
  
  
  [anyone|plyr,"lord_persuade_lords_to_make_peace_completed", [],
    "Thank you. Let me have the money.", "lord_persuade_lords_to_make_peace_pay",[]],
  [anyone|plyr,"lord_persuade_lords_to_make_peace_completed", [],
    "No need for a payment. I only did what was right.", "lord_persuade_lords_to_make_peace_no_pay",[]],
  
  [anyone ,"lord_persuade_lords_to_make_peace_pay", [],
    "Oh, yes, of course. We had already got the money for you. " +
    "Here, please accept these {reg12} peningas together with our most sincere thanks. " +
    "Me and the people of our town will not forget your help.", "close_window",
    [(quest_get_slot, ":quest_reward", "qst_persuade_lords_to_make_peace", slot_quest_gold_reward),
      (call_script, "script_troop_add_gold", "trp_player", ":quest_reward"),
      (call_script, "script_change_player_relation_with_center", "$current_town", 5),
      (call_script, "script_end_quest", "qst_persuade_lords_to_make_peace"),
      (quest_get_slot, ":quest_reward", "qst_persuade_lords_to_make_peace", slot_quest_gold_reward),
      (assign, reg12, ":quest_reward")
  ]],
  
  [anyone ,"lord_persuade_lords_to_make_peace_no_pay", [],
    "You are indeed an extraordinary person, {reg59?madame:sir}, and it is an honour for me to have known you. " +
    "You not only did what was impossible and put an end to this terrible war, but you won't even accept a reward for it. " +
    "Very well, I will not insist on the matter, but please know that you will have our eternal respect and gratitude.", "close_window",
    [
      (call_script, "script_change_player_honor", 3),
      (call_script, "script_change_player_relation_with_center", "$current_town", 8),
      (call_script, "script_end_quest", "qst_persuade_lords_to_make_peace"),
  ]],
  
  [anyone,"mayor_begin", [(check_quest_active, "qst_deal_with_night_bandits"),
      (quest_slot_eq, "qst_deal_with_night_bandits", slot_quest_giver_troop, "$g_talk_troop"),
      (check_quest_succeeded, "qst_deal_with_night_bandits"),
    ],
    "Very nice work, {playername}, you made short work of those lawless curs. " +
    "Thank you kindly for all your help, and please accept this bounty of 150 peningas.", "lord_deal_with_night_bandits_completed",
    [
      (add_xp_as_reward,200),
      (call_script, "script_troop_add_gold", "trp_player", 250),
      (call_script, "script_change_player_relation_with_center", "$current_town", 1),
      (call_script, "script_end_quest", "qst_deal_with_night_bandits"),
  ]],
  
  
  [anyone|plyr,"lord_deal_with_night_bandits_completed", [],
    "It was my pleasure, {s65}.", "close_window",[]],
  
  # Ryan BEGIN
  [anyone,"mayor_begin", [(check_quest_active, "qst_deal_with_looters"),
      (quest_slot_eq, "qst_deal_with_looters", slot_quest_giver_troop, "$g_talk_troop"),
    ],
    "Ah, {playername}. Do you have any progress to report?", "mayor_looters_quest_response",
    [
  ]],
  
  [anyone|plyr,"mayor_looters_quest_response",
    [
      (store_num_parties_destroyed_by_player, ":num_looters_destroyed", "pt_looters"),
      (party_template_get_slot,":previous_looters_destroyed","pt_looters",slot_party_template_num_killed),
      (val_sub,":num_looters_destroyed",":previous_looters_destroyed"),
      (quest_get_slot,":looters_paid_for","qst_deal_with_looters",slot_quest_current_state),
      (lt,":looters_paid_for",":num_looters_destroyed"),
    ],
    "I've killed some looters.", "mayor_looters_quest_destroyed",[]],
  # [anyone|plyr,"mayor_looters_quest_response", [(eq,1,0)
    # ],
    # "I've brought you some goods.", "mayor_looters_quest_goods",[]],
  [anyone|plyr,"mayor_looters_quest_response", [
    ],
    "Not yet, sir. Farewell.", "close_window",[]],
  
  [anyone,"mayor_looters_quest_destroyed", [],
    "Aye, my scouts saw the whole thing. That should make anyone else think twice before turning outlaw! " +
    "The bounty is 40 peningas for every band, so that makes {reg1} in total. Here is your money, as promised.",
    "mayor_looters_quest_destroyed_2",[
      (store_num_parties_destroyed_by_player, ":num_looters_destroyed", "pt_looters"),
      (party_template_get_slot,":previous_looters_destroyed","pt_looters",slot_party_template_num_killed),
      (val_sub,":num_looters_destroyed",":previous_looters_destroyed"),
      (quest_get_slot,":looters_paid_for","qst_deal_with_looters",slot_quest_current_state),
      (store_sub,":looter_bounty",":num_looters_destroyed",":looters_paid_for"),
      (val_mul,":looter_bounty",40),
      (assign,reg1,":looter_bounty"),
      (call_script, "script_troop_add_gold", "trp_player", ":looter_bounty"),
      (assign,":looters_paid_for",":num_looters_destroyed"),
      (quest_set_slot,"qst_deal_with_looters",slot_quest_current_state,":looters_paid_for"),
  ]],
  [anyone,"mayor_looters_quest_destroyed_2", [
      (quest_get_slot,":total_looters","qst_deal_with_looters",slot_quest_target_amount),
      (quest_slot_ge,"qst_deal_with_looters",slot_quest_current_state,":total_looters"), # looters paid for >= total looters
      (quest_get_slot,":xp_reward","qst_deal_with_looters",slot_quest_xp_reward),
      (quest_get_slot,":gold_reward","qst_deal_with_looters",slot_quest_gold_reward),
      (add_xp_as_reward, ":xp_reward"),
      (call_script, "script_troop_add_gold", "trp_player", ":gold_reward"),
      (call_script, "script_change_troop_renown", "trp_player", 1),
      (call_script, "script_change_player_relation_with_center", "$current_town", 5),
      (call_script, "script_end_quest", "qst_deal_with_looters"),
      (try_for_parties, ":cur_party_no"),
        (party_get_template_id, ":cur_party_template", ":cur_party_no"),
        (eq, ":cur_party_template", "pt_looters"),
        (party_set_flags, ":cur_party_no", pf_quest_party, 0),
      (try_end),
    ],
    "And that's not the only good news! Thanks to you, the looters have ceased to be a threat. We've not had a single attack reported for some time now. " +
    "If there are any of them left, they've either run off or gone deep into hiding. That's good for business, " +
    "and what's good for business is good for the town! " +
    "I think that concludes our arrangement, {playername}. Please accept this silver as a token of my gratitude. Thank you, and farewell.",
    "close_window",[
  ]],
  [anyone,"mayor_looters_quest_destroyed_2", [],
    "Anything else you need?",
    "mayor_looters_quest_response",[
  ]],
  
  # [anyone,"mayor_looters_quest_goods", [
      # (quest_get_slot,reg1,"qst_deal_with_looters",slot_quest_target_item),
    # ],
    # "Hah, I knew I could count on you! Just tell me which item to take from your baggage, and I'll send some men to collect it. " +
    # "I still need {reg1} peningas' worth of goods.",
    # "mayor_looters_quest_goods_response",[
  # ]],
  # [anyone|plyr|repeat_for_100,"mayor_looters_quest_goods_response", [
      # (store_repeat_object,":goods"),
      # (val_add,":goods",trade_goods_begin),
      # (is_between,":goods",trade_goods_begin,trade_goods_end),
      # (player_has_item,":goods"),
      # (str_store_item_name,s5,":goods"),
    # ],
    # "{s5}.", "mayor_looters_quest_goods_2",[
      # (store_repeat_object,":goods"),
      # (val_add,":goods",trade_goods_begin),
      # (troop_remove_items,"trp_player",":goods",1),
      # (assign,":value",reg0),
      # (call_script, "script_troop_add_gold", "trp_player", ":value"),
      # (quest_get_slot,":gold_num","qst_deal_with_looters",slot_quest_target_item),
      # (val_sub,":gold_num",":value"),
      # (quest_set_slot,"qst_deal_with_looters",slot_quest_target_item,":gold_num"),
      # (str_store_item_name,s6,":goods"),
  # ]],
  # [anyone|plyr,"mayor_looters_quest_goods_response", [
    # ],
    # "Nothing at the moment, sir.", "mayor_looters_quest_goods_3",[]],
  
  # [anyone,"mayor_looters_quest_goods_3", [
    # ],
    # "Anything else you need?",
    # "mayor_looters_quest_response",[
  # ]],
  
  # [anyone,"mayor_looters_quest_goods_2", [
      # (quest_slot_ge,"qst_deal_with_looters",slot_quest_target_item,1),
      # (quest_get_slot,reg1,"qst_deal_with_looters",slot_quest_target_item),
    # ],
    # "Excellent, here is the money for your {s6}. Do you have any more goods to give me? I still need {reg1} peningas' worth of goods.",
    # "mayor_looters_quest_goods_response",[
  # ]],
  # [anyone,"mayor_looters_quest_goods_2", [
      # (neg|quest_slot_ge,"qst_deal_with_looters",slot_quest_target_item,1),
      # (quest_get_slot,":xp_reward","qst_deal_with_looters",slot_quest_xp_reward),
      # (quest_get_slot,":gold_reward","qst_deal_with_looters",slot_quest_gold_reward),
      # (add_xp_as_reward, ":xp_reward"),
      # (call_script, "script_troop_add_gold", "trp_player", ":gold_reward"),
      # #      (call_script, "script_change_troop_renown", "trp_player", 1),
      # (call_script, "script_change_player_relation_with_center", "$current_town", 3),
      # (call_script, "script_end_quest", "qst_deal_with_looters"),
      # (try_for_parties, ":cur_party_no"),
        # (party_get_template_id, ":cur_party_template", ":cur_party_no"),
        # (eq, ":cur_party_template", "pt_looters"),
        # (party_set_flags, ":cur_party_no", pf_quest_party, 0),
      # (try_end),
    # ],
    # "Well done, {playername}! That's the last of the goods I need. Here is the money for your {s6} and a small bonus for helping me out. " +
    # "I'm afraid I won't be paying for any more goods or offering bounties on looters, but you're welcome to keep hunting the bastards if any remain. " +
    # "Thank you for your help. I won't forget it.",
    # "close_window",[
  # ]],
  # Ryan END
  
  
  
  [anyone,"mayor_begin", [(check_quest_active, "qst_move_cattle_herd"),
      (quest_slot_eq, "qst_move_cattle_herd", slot_quest_giver_troop, "$g_talk_troop"),
      (check_quest_succeeded, "qst_move_cattle_herd"),
    ],
    "Good to see you again, {playername}. I have heard that you have delivered the cattle successfully. " +
    "I will tell the merchants how reliable you are. " +
    "And here is your pay, {reg8} peningas.", "close_window",
    [(quest_get_slot, ":quest_gold_reward", "qst_move_cattle_herd", slot_quest_gold_reward),
      (call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
      (store_div, ":xp_reward", ":quest_gold_reward", 3),
      (add_xp_as_reward, ":xp_reward"),
      (call_script, "script_change_troop_renown", "trp_player", 1),
      (call_script, "script_change_player_relation_with_center", "$current_town", 10),
      (call_script, "script_end_quest", "qst_move_cattle_herd"),
      (assign, reg8, ":quest_gold_reward"),
  ]],
  
  [anyone,"mayor_begin", [(check_quest_active, "qst_move_cattle_herd"),
      (quest_slot_eq, "qst_move_cattle_herd", slot_quest_giver_troop, "$g_talk_troop"),
      (check_quest_failed, "qst_move_cattle_herd"),
    ],
    "I heard that you have lost the cattle herd on your way to {s9}. " +
    "I had a very difficult time explaining your failure to the owner of that herd, {reg59?madam:sir}. " +
    "Do you have anything to say?", "move_cattle_herd_failed",
    []],
  
  [anyone,"mayor_begin", [(check_quest_active, "qst_blank_quest_10"),
      (quest_slot_eq, "qst_blank_quest_10", slot_quest_giver_troop, "$g_talk_troop"),
      (check_quest_failed, "qst_blank_quest_10"),
      (quest_get_slot, ":quest_target_item", "qst_blank_quest_10", slot_quest_target_item),
      (str_store_item_name, s9, ":quest_target_item"),
    ],
    "I heard that you lost a fight against the runaway guard and my valuable {s9} is gone forever. " +
    "I am very disappointed, {playername}, as I heard so many good things about your reliability. ", "close_window",
    [ (call_script, "script_abort_quest", "qst_blank_quest_10",1),]],
  
  [anyone|plyr ,"move_cattle_herd_failed", [],
    "I am sorry, but I was attacked on the way.", "move_cattle_herd_failed_2",[]],
  [anyone|plyr ,"move_cattle_herd_failed", [],
    "I am sorry. The stupid animals wandered off during the night.", "move_cattle_herd_failed_2",[]],
  
  [anyone,"move_cattle_herd_failed_2", [],
    "Well, it was your responsibility to deliver that herd safely, no matter what. " +
    "You should know that the owner of the herd demanded to be compensated for his loss. I had to pay him 1000 peningas, " +
    "so you now owe me that money.", "merchant_ask_for_debts",
    [(assign, "$debt_to_merchants_guild", 1000),
      (call_script, "script_end_quest", "qst_move_cattle_herd"),]],
  
  [anyone,"mayor_begin", [(check_quest_active, "qst_kidnapped_girl"),
      (quest_slot_eq, "qst_kidnapped_girl", slot_quest_current_state, 4),
      (quest_slot_eq, "qst_kidnapped_girl", slot_quest_giver_troop, "$g_talk_troop"),
    ],
    "{playername} -- I am in your debt for bringing back my friend's daughter. " +
    "Please take the {reg8} peningas that I promised you. " +
    "My friend wished he could give more but paying that ransom brought him to his knees.", "close_window",
    [(quest_get_slot, ":quest_gold_reward", "qst_kidnapped_girl", slot_quest_gold_reward),
      (call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
      (assign, reg8, ":quest_gold_reward"),
      (assign, ":xp_reward", ":quest_gold_reward"),
      (val_mul, ":xp_reward", 2),
      (val_add, ":xp_reward", 100),
      (add_xp_as_reward, ":xp_reward"),
      (call_script, "script_change_troop_renown", "trp_player", 3),
      (call_script, "script_change_player_relation_with_center", "$current_town", 10),
      (call_script, "script_end_quest", "qst_kidnapped_girl"),
  ]],
  
  [anyone,"mayor_begin", [(check_quest_active, "qst_track_down_bandits"),
      (check_quest_succeeded, "qst_track_down_bandits"),
      (quest_slot_eq, "qst_track_down_bandits", slot_quest_giver_troop, "$g_talk_troop"),
    ],
    "Well -- it sounds like you were able to track down the bandits, and show them what happens to those who would disrupt the flow of commerce. " +
    "Here is your reward: {reg5} peningas. " +
    "It is well earned, and we are most grateful.",
    "mayor_friendly_pretalk", [(quest_get_slot, ":quest_gold_reward", "qst_track_down_bandits", slot_quest_gold_reward),
      (call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
      (quest_get_slot, ":xp_reward", "qst_track_down_bandits", slot_quest_xp_reward),
      (add_xp_as_reward, ":xp_reward"),
      (call_script, "script_change_player_relation_with_center", "$current_town", 8),
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (val_add, ":player_renown", 3),
      (troop_set_slot, "trp_player", slot_troop_renown, ":player_renown"),
      (call_script, "script_end_quest", "qst_track_down_bandits"),
      (assign, reg5, ":quest_gold_reward"),
  ]],
  
  [anyone,"mayor_begin", [(check_quest_active, "qst_troublesome_bandits"),
      (check_quest_succeeded, "qst_troublesome_bandits"),
      (quest_slot_eq, "qst_troublesome_bandits", slot_quest_giver_troop, "$g_talk_troop"),
    ],
    "I have heard about your deeds. You have given those bandits the punishment they deserved. " +
    "You are really as good as they say. " +
    "Here is your reward: {reg5} peningas. " +
    "I would like to give more but those bandits almost brought me to bankruptcy.",
    "mayor_friendly_pretalk", [(quest_get_slot, ":quest_gold_reward", "qst_troublesome_bandits", slot_quest_gold_reward),
      (quest_get_slot, ":xp_reward", "qst_troublesome_bandits", slot_quest_xp_reward),
      (call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
      (add_xp_as_reward, ":xp_reward"),
      (call_script, "script_change_player_relation_with_center", "$current_town", 8),
      (call_script, "script_change_troop_renown", "trp_player", 3),
      (call_script, "script_end_quest", "qst_troublesome_bandits"),
      (assign, reg5, ":quest_gold_reward"),
  ]],
  
  [anyone,"mayor_begin", [(check_quest_active, "qst_blank_quest_10"),
      (check_quest_succeeded, "qst_blank_quest_10"),
      (quest_slot_eq, "qst_blank_quest_10", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_get_slot, ":quest_target_item", "qst_blank_quest_10", slot_quest_target_item),
      (player_has_item, ":quest_target_item"),
      (str_store_item_name, s13, ":quest_target_item"),
    ],
    "I have heard that you found the perpetrator and recovered my valuable {s13}. " +
    "You are really as good as they say. " +
    "Here is your reward: {reg5} peningas.",
    "mayor_friendly_pretalk", [(quest_get_slot, ":quest_gold_reward", "qst_blank_quest_10", slot_quest_gold_reward),
      (call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
      (quest_get_slot, ":quest_target_item", "qst_blank_quest_10", slot_quest_target_item),
      (troop_remove_item, "trp_player", ":quest_target_item"),
      (assign, ":xp_reward", ":quest_gold_reward"),
      (val_mul, ":xp_reward", 2),
      (add_xp_as_reward, ":xp_reward"),
      (call_script, "script_change_player_relation_with_center", "$current_town", 10),
      (call_script, "script_change_troop_renown", "trp_player", 3),
      (call_script, "script_end_quest", "qst_blank_quest_10"),
      (assign, reg5, ":quest_gold_reward"),
  ]],
  
  
  #destroy lair quest end dialogs taken from here
  
  [anyone,"mayor_begin", [(ge, "$debt_to_merchants_guild", 50)],
    "According to my accounts, you owe the merchants guild {reg1} peningas. " +
    "Would you like to pay this off now?", "merchant_ask_for_debts",[(assign,reg(1),"$debt_to_merchants_guild")]],
  [anyone|plyr,"merchant_ask_for_debts", [[store_troop_gold,reg(5),"trp_player"],[ge,reg(5),"$debt_to_merchants_guild"]],
    "Alright. I'll pay my debt to you.", "merchant_debts_paid",[[troop_remove_gold, "trp_player","$debt_to_merchants_guild"],
      [assign,"$debt_to_merchants_guild",0]]],
  [anyone, "merchant_debts_paid", [], "Excellent. I'll let my fellow merchants know that you are clear of any debts.", "mayor_pretalk",[]],
  
  [anyone|plyr, "merchant_ask_for_debts", [], "I'm afraid I can't pay this sum now.", "merchant_debts_not_paid",[]],
  [anyone, "merchant_debts_not_paid", [(assign,reg(1),"$debt_to_merchants_guild")], "In that case, I am afraid, I can't deal with you. Guild rules... " +
    "Come back when you can pay the {reg1} peningas. " +
    "We'll be charging interest on your debt, " +
    "so the sooner you pay it, the better.", "close_window",[]],
  
  
  [anyone,"mayor_begin", [], "What can I do for you?", "mayor_talk", []],
  [anyone,"mayor_friendly_pretalk", [], "Now... What else may I do for you?", "mayor_talk",[]],
  [anyone,"mayor_pretalk", [], "Yes?", "mayor_talk",[]],
  
  [anyone|plyr,"mayor_talk", [], "Can you tell me about what you do?", "mayor_info_begin",[]],
  
  #chief anade explicaciones historicas de ciudades
  ###add-ons quest mayor Donngal
  [anyone|plyr,"mayor_talk", [	(check_quest_active, "qst_blank_quest_25"),
      (quest_slot_eq,"qst_blank_quest_25",slot_quest_current_state,0),
      
      (eq, "$g_encountered_party", "p_town_22"),
      ], "I've heard that the grandchildren of Flaithbertach are here. Did you know that?", "mayor_dongall_quest1",[]],
  [anyone|plyr,"mayor_talk", [	(check_quest_active, "qst_blank_quest_25"),
      (quest_slot_eq,"qst_blank_quest_25",slot_quest_current_state,1),
      
      (eq, "$g_encountered_party", "p_town_22"),
      ], "About Flaithbertach's grandchildren...", "mayor_dongall_quest6",[]],
  
  [anyone,"mayor_dongall_quest1", [], "Yes, everyone has heard of them. The children of the son of Flaithbertach mac Niall, the brother of Aed mac Niall, ri h-Erenn uile, called 'Findliath,' or 'Fair Warrior.' " +
    "Flaithbertach's untimely death gave Aed access to the throne of Aileach. Flaithbertach's family had a bad end too, but two of his children escaped with the two grandchildren. I heard that one of the two who escaped died recently. " +
    "I feel sorry for him. So very tragic.", "mayor_dongall_quest2", []],
  
  [anyone|plyr,"mayor_dongall_quest2", [
      ], "Could you tell me where to find them?", "mayor_dongall_quest3",[]],
  [anyone|plyr,"mayor_dongall_quest2", [	(store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 1000)
      ], "I have some silver that I want to give to this town (1000 peningas)", "mayor_dongall_quest4",[
      (troop_remove_gold, "trp_player", 1000),
      (call_script, "script_change_player_relation_with_center", "$current_town", 2),
  ]],
  [anyone|plyr,"mayor_dongall_quest2", [(store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 3000)
      ], "I have some silver that I want to give to this town (3000 peningas)", "mayor_dongall_quest4",[
      (troop_remove_gold, "trp_player", 3000),
      (call_script, "script_change_player_relation_with_center", "$current_town", 4),
  ]],
  [anyone|plyr,"mayor_dongall_quest2", [(store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 5000)
      ], "I have some silver that I want to give to this town (5000 peningas)", "mayor_dongall_quest4",[
      (troop_remove_gold, "trp_player", 5000),
      (call_script, "script_change_player_relation_with_center", "$current_town", 6),
  ]],
  
  [anyone,"mayor_dongall_quest3", [], "Hiding somewhere where they cannot be found. They have many enemies.", "mayor_dongall_quest5", []],
  [anyone,"mayor_dongall_quest4", [], "Your gift is welcome in these difficult times. I'll let the people of this town know of your interest in their welfare.", "mayor_dongall_quest5", []],
  
  [anyone|plyr,"mayor_dongall_quest5", [
      ], "I am very interested to know where Flaithbertach's grandchildren are.", "mayor_dongall_quest6",[]],
  [anyone|plyr,"mayor_dongall_quest5", [	(store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 1000)
      ], "I must find them. This silver could help (1000 peningas)", "mayor_dongall_quest6",[
      (troop_remove_gold, "trp_player", 1000),
      (call_script, "script_change_player_relation_with_center", "$current_town", 2),
  ]],
  [anyone|plyr,"mayor_dongall_quest5", [(store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 3000)
      ], "I must find them. This silver could help (3000 peningas)", "mayor_dongall_quest6",[
      (troop_remove_gold, "trp_player", 3000),
      (call_script, "script_change_player_relation_with_center", "$current_town", 4),
  ]],
  [anyone|plyr,"mayor_dongall_quest5", [(store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 5000)
      ], "I must find them. This silver could help (5000 peningas)", "mayor_dongall_quest6",[
      (troop_remove_gold, "trp_player", 5000),
      (call_script, "script_change_player_relation_with_center", "$current_town", 6),
  ]],
  #second part
  [anyone,"mayor_dongall_quest6", [                  (party_get_slot, ":player_relation", "$current_town", slot_center_player_relation),
      (lt, ":player_relation",10), #relation
      ], "You look like a trustworthy sort, and I do not owe anything to Flaithbertach's grandchildren, but I would like in return service to my community. Make their life better so that they love you in this town, and then we'll talk again.", "mayor_pretalk", [
      (str_store_party_name_link, s3, "p_town_22"),
      (str_store_string, s2, "@Donngal, mayor of {s3}, wants you to improve relations with his town before giving you information about Flaithbertach's grandchildren. You need to raise relations above 10 points."),
      (add_quest_note_from_sreg, "qst_blank_quest_25", 4, s2, 0),
      (quest_set_slot,"qst_blank_quest_25",slot_quest_current_state, 1), #status 0
  ]],
  
  [anyone,"mayor_dongall_quest6", [
    ], "You have done a lot for this town, and people appreciate you. I give you now what you seek: Flaithbertach's grandchildren are in a farm near Dinas Bran. " +
    "I don't know why you are so interested in them. They are only two children eight years old. They are alone in life after the death of their father. " +
    "I understand that Aed Findliath wants to get rid of any pretender to his throne, but these children have no one to support them. They are hardly a danger to him.", "mayor_dongall_quest7", [
      (str_store_party_name_link, s3, "p_castle_42"),
      (str_store_string, s2, "@Donngal told you that Flaithbertach's grandchildren are at a farm near {s3}. It's time to return with the news to the abbot and collect your reward."),
      (add_quest_note_from_sreg, "qst_blank_quest_25", 5, s2, 0),
      (quest_set_slot,"qst_blank_quest_25",slot_quest_current_state, 2), #evil player
  ]],
  [anyone|plyr,"mayor_dongall_quest7", [
      ], "Children grow, Donngal. Anyway, this is none of our concern. Farewell.", "close_window",[    (call_script, "script_change_player_honor", -3),
      (str_store_string, s2, "@Note 1: You chose to kill Flaithbertach's grandchildren."),
      (add_quest_note_from_sreg, "qst_blank_quest_27", 4, s2, 0),
  ]],
  [anyone|plyr,"mayor_dongall_quest7", [
      ], "I will save these poor children.", "mayor_dongall_quest8",[]],
  [anyone,"mayor_dongall_quest8", [
    ], "Glad to hear that! I interpreted by your words that the murderers of Flaithbertach sent you find his grandchildren. If you go back to them and tell them that you have not found anything, they will continue looking for them. " +
    "If you really want to keep these children safe, you need to lie. " +
    "You must go back to Aed Findliath and tell him where the children are. Meanwhile, I could have Flaithbertach's grandchildren moved to another farm and put two young slaves in their place.", "mayor_dongall_quest9", [
  ]],
  [anyone|plyr,"mayor_dongall_quest9", [
      ], "That will work. Do it.", "mayor_dongall_quest10_1",[(call_script, "script_change_player_honor", -5),
      (str_store_string, s2, "@The children who will be at the farm will be slaves. Dongall will hide Flaithbertach's grandchildren elsewhere."),
      (add_quest_note_from_sreg, "qst_blank_quest_25", 6, s2, 0),
      (quest_set_slot,"qst_blank_quest_25",slot_quest_current_state, 3), #false children
      (str_store_string, s2, "@Note 1: You chose to save Flaithbertach's grandchildren. You instead sacrificed the lives of other, slave children."),
      (add_quest_note_from_sreg, "qst_blank_quest_27", 4, s2, 0),
  ]],
  [anyone|plyr,"mayor_dongall_quest9", [
      ], "No, other children aren't the solution.", "mayor_dongall_quest10",[]],
  [anyone,"mayor_dongall_quest10", [
    ], "They're just slaves, but it's your decision. " +
    "I can find safety for Flaithbertach's grandchildren. I guess you can go back to your lord and tell him where the farm is. " +
    "They will find the farm empty, but you will have a few weeks before they do. Then you must leave Eriu, where Ard Ruire Aed mac Niall will become your worst enemy.", "mayor_dongall_quest11", [
  ]],
  [anyone,"mayor_dongall_quest10_1", [
      ], "Very well, I'll take care of everything. Thankfully, the wergild for little slaves is not much. Good luck.", "close_window", [
  ]],
  
  [anyone|plyr,"mayor_dongall_quest11", [
      ], "Forget what I said. We will follow your idea about using little slaves.", "mayor_dongall_quest10_1",[(call_script, "script_change_player_honor", -5),
      (str_store_string, s2, "@The children who will be at the farm will be slaves. Dongall will hide Flaithbertach's grandchildren elsewhere."),
      (add_quest_note_from_sreg, "qst_blank_quest_25", 6, s2, 0),
      (quest_set_slot,"qst_blank_quest_25",slot_quest_current_state, 3), #false children
      (str_store_string, s2, "@Note 1: You chose to save Flaithbertach's grandchildren. You instead sacrificed the lives of other, slave children."),
      (add_quest_note_from_sreg, "qst_blank_quest_27", 4, s2, 0),
  ]],
  [anyone|plyr,"mayor_dongall_quest11", [
      ], "I can carry the hatred of a king better than the weight of the death of two children.", "mayor_dongall_quest12",[(call_script, "script_change_player_honor", 3),
      (str_store_string, s2, "@Dongall will remove Flaithbertach's grandchildren from the farm near Dinas Bran, so when the murderers come, they will not find anyone. " +
      "It is possible that this will put you at odds with the highest power in Eriu, but you are willing to take that risk."),
      (add_quest_note_from_sreg, "qst_blank_quest_25", 6, s2, 0),
      (quest_set_slot,"qst_blank_quest_25",slot_quest_current_state, 4), #no children
      (str_store_string, s2, "@Note 1: You chose to save Flaithbertach's grandchildren."),
      (add_quest_note_from_sreg, "qst_blank_quest_27", 4, s2, 0),   ]],
  
  [anyone,"mayor_dongall_quest12", [
      ], "Very well, I'll take care of everything. Good luck; Ard Ruire Aed is a terrible enemy.", "close_window", [
  ]],
  #lundenwic
  [trp_town_12_mayor|plyr,"mayor_talk", [], "My good man, can you tell me about this place?", "mayor_historia",[]],
  [anyone,"mayor_historia", [], "I certainly can. You definitely posed your question to the right man. I grew up here in Lundenwic and have seen the town grow bigger every year. " +
    "It must be the busiest town in all of Mierce. One can't see the harbour from here, but it's bustling with activity, ships coming in all day long. One can make a nice profit setting up an enterprise here.", "mayor_historia2", []],
  [anyone,"mayor_historia2", [], "If one walks further east, down the river, one can see the ruins of the Roman town that once was there, but I wouldn't bother. There's hardly anything left there but rubble and silence now. " +
    "When the Romans left, they took all the trade and engineering skills with them, so the place slowly crumbled into dust. Fortunately, that's all in the past now.", "mayor_talk", []],
  
  #bebbanburg
  [trp_town_27_mayor|plyr,"mayor_talk", [], "Greetings. Could you perhaps tell me about this place?", "mayor_histori",[]],
  [anyone,"mayor_histori", [], "I surely can. Did getting up here bring sweat to your forehead? I bet it did! You're probably too proud to admit it, but everyone must catch their breath once they reach the town walls. " +
    "It's not just from being amazed by the majestic size of this place but also from ascending the steep path leading up here. You've come to the royal town of Bernaccia: Bebbanburh. This is where our kings resided centuries ago.", "mayor_histori2", []],
  [anyone,"mayor_histori2", [], "No doubt you understand why it was made the royal seat. With the sea on one side, cliffs on the other and just a narrow path leading up here, it's a well-protected town. Since it was guarded by wise and holy men, it was impossible to conquer. " +
    "Although I should just say 'wise.' King Aethelfrith, who named the town after his wife Bebba, was certainly not holy. He was the first Northumbrian king and such a ruthless and steely leader of his men, that the natives here, the Britons, called him 'The Destroyer.'", "mayor_histori3", []],
  [anyone,"mayor_histori3", [], "He has kept this kingdom together in troublesome times, and he and his son Oswald conquered vast areas of land to the west. " +
    "Two centuries ago, our kingdom became the most powerful of Britain. King Oswiu gained supremacy over Mercia, becoming Brytenwalda. Those golden days are unfortunately gone. Not too far away from here, there is the holy island of Lindisfarne, where the Danes attacked us for the first time. Ever since that day, we have suffered from their raids. Now our kingdom is under the thumbs of those accursed Norsemen, and our ruler Ecgberht is nothing more than just a puppet in Jorvik. But here in Bebbanburh his influence is minimal, and good people of this town still resist.", "mayor_talk", []],
  
  #Town tax rate
  [anyone|plyr,"mayor_talk",[(party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
      (eq, "$g_encountered_party_type", spt_town),], "I would like to set a new tax rate for this town.", "town_tax",[(assign, "$temp",0),]],
  
  [anyone, "town_tax", [],"Certainly. What taxes do you want us to pay to you?","town_tax2",[]],
  
  [anyone|plyr, "town_tax2", [(party_get_slot, ":tax", "$current_town", slot_center_tax_rate),
      (assign, "$tax_rate", ":tax"),
      (this_or_next|eq, "$tax_rate", 0),
      (eq, "$tax_rate", 2),],"I would like to set a low tax rate.", "town_tax3", [(assign, "$temp",1),]],
  
  [anyone|plyr, "town_tax2", [(party_get_slot, ":tax", "$current_town", slot_center_tax_rate),
      (assign, "$tax_rate", ":tax"),
      (this_or_next|eq, "$tax_rate", 0),
      (eq, "$tax_rate", 1),],"I would like to set a high tax rate.", "town_tax3", [(assign, "$temp",2),]],
  
  [anyone|plyr, "town_tax2", [(party_get_slot, ":tax", "$current_town", slot_center_tax_rate),
      (assign, "$tax_rate", ":tax"),
      (this_or_next|eq, "$tax_rate", 1),
      (eq, "$tax_rate", 2),],"I would like to set a normal tax rate.", "town_tax3", [(assign, "$temp",0),]],
  
  [anyone|plyr, "town_tax2",[],"Actually, I changed my mind.","mayor_pretalk",[]],
  
  [anyone, "town_tax3", [], "Most certainly! We shall abide by your most gracious order.", "mayor_pretalk", [(party_set_slot, "$current_town", slot_center_tax_rate, "$temp"),]],
  
  #explicaciones acaba chief
  [anyone|plyr,"mayor_talk", [(store_partner_quest, ":partner_quest"),
      (lt, ":partner_quest", 0),
      
      #VC-3763
      (try_begin),
        (eq,"$merchant_offered_quest", "qst_track_down_bandits"),
        (quest_get_slot, reg1, "qst_track_down_bandits", slot_quest_target_party),
        (neg|party_is_active, reg1),
        (assign, "$merchant_quest_last_offerer", -1), #this will affect the dialog alternatives as well
      (try_end),
      
      (this_or_next|gt, "$cheat_mode", 0),
      (neq, "$merchant_quest_last_offerer", "$g_talk_troop")],
    "Do you happen to have a job for me?", "merchant_quest_requested",[
      (assign,"$merchant_quest_last_offerer", "$g_talk_troop"),
      (call_script, "script_get_quest", "$g_talk_troop"),
      (assign, "$random_merchant_quest_no", reg0),
      (assign,"$merchant_offered_quest","$random_merchant_quest_no"),
  ]],
  
  [anyone|plyr,"mayor_talk", [(store_partner_quest, ":partner_quest"),
      (lt, ":partner_quest", 0),
      (eq, "$cheat_mode", 0),
      (eq,"$merchant_quest_last_offerer", "$g_talk_troop"),
      (gt,"$merchant_offered_quest", 0),
      (neq,"$merchant_offered_quest", "qst_blank_quest_10"),
      (neq, "$merchant_offered_quest", "qst_blank_quest_11"),
    ],
    "About that job you offered me...", "merchant_quest_last_offered_job",[]],
  
  [anyone|plyr,"mayor_talk", [(store_partner_quest, ":partner_quest"),
      (lt, ":partner_quest", 0),
      (eq, "$cheat_mode", 0),
      (eq,"$merchant_quest_last_offerer", "$g_talk_troop"),
      (gt,"$merchant_offered_quest", 0),
      (this_or_next|eq,"$merchant_offered_quest", "qst_blank_quest_10"),
      (eq, "$merchant_offered_quest", "qst_blank_quest_11"),
      ],   "About that job you offered me...", "merchant_quest_requested",[]],
  
  [anyone|plyr,"mayor_talk", [(store_partner_quest,reg(2)),(ge,reg(2),0)],
    "About the job you gave me...", "merchant_quest_about_job",[]],
  
  [anyone|plyr,"mayor_talk",[], "I have some questions of a political nature.", "mayor_political_talk",[]],
  
  [anyone|plyr,"mayor_talk",[], "How is trade around here?", "mayor_economy_report_1",[
      (call_script, "script_merchant_road_info_to_s42", "$g_encountered_party"), #also does items to s32
  ]],
  
  [anyone|plyr,"mayor_talk",[
      ], "How does the wealth of this region compare with the rest of the North?", "mayor_wealth_comparison_1",[
  ]],
  
  
  ####No enterprise in dark ages, minor home production, change to farmstead system
  [anyone|plyr,"mayor_talk",[  #(ge, "$cheat_mode", 3), #only in cheat mode
      # (item_slot_ge, "itm_silver", slot_item_secondary_raw_material, "itm_ivory"), #ie, the item information has been updated, to ensure savegame compatibility
      ], "I wish to buy a farmstead near this town and hire a foreman.", "mayor_investment_possible",[
  ]],
  
  ####
  [anyone|plyr, "mayor_talk", [
      (assign, ":quest_center", 0),
      (try_begin),
        (check_quest_active, "qst_move_cattle_herd"),
        (quest_slot_eq, "qst_deliver_cattle", slot_quest_giver_troop, "$g_talk_troop"),
        (assign, ":quest_center", 1),
      (try_end),
      (eq, ":quest_center", 0),
      (neg|check_quest_active, "qst_move_cattle_herd"),
      (assign, reg25, 0),
      (try_for_parties, ":party_no"),
        (party_slot_eq, ":party_no", slot_party_type, spt_cattle_herd),
        (party_slot_eq, ":party_no", slot_cattle_driven_by_player, 1),
        (store_distance_to_party_from_party, ":distance", ":party_no", "p_main_party"),
        (lt, ":distance", 3),
        (party_count_members_of_type, ":num", ":party_no", "trp_cattle"),
        (val_add, reg25, ":num"),
      (try_end),
      (gt, reg25, 0),
      (assign, "$temp", reg25),
    ],
    "I have {reg25} cattle with me. Would you be interested in buying any?", "mayor_talk_cattle", []],
  
  [anyone, "mayor_talk_cattle", [
      (lt, "$player_honor", -15),], "Hmm, I wonder how many are 'borrowed'...","mayor_talk_cattle1", []],
  
  [anyone, "mayor_talk_cattle", [], "Hmm, I wonder if we really need more cattle...","mayor_talk_cattle1", []],
  
  [anyone|plyr, "mayor_talk_cattle1", [
      (lt, "$player_honor", -15),
    ],
    "I don't think cattle care who their owner is...", "mayor_talk_cattle2", []],
  [anyone|plyr, "mayor_talk_cattle1", [
    ],
    "One can't eat silver, should one need to eat...", "mayor_talk_cattle2", []],
  
  [anyone, "mayor_talk_cattle2", [
      (lt, "$player_honor", -15),
      (store_skill_level, ":trade", "skl_trade", "trp_player"),
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (val_mul, ":trade", 3),
      (val_div, ":trade", 2),
      (val_add, ":trade", ":persuasion"),
      (store_div, ":honor_adj", "$player_honor", 100),
      (val_sub,":honor_adj", 1),
      (val_add, ":trade", ":honor_adj"),
      (val_mul, ":trade", 7),
      (try_begin),
        (gt, ":trade", 50),
        (assign, "$temp2", ":trade"),
      (else_try),
        (assign, "$temp2", 50),
      (try_end),
      (assign, reg26, "$temp2"),
      ], "Alright, I'll pay you {reg26} peningas per head. Do we have a deal?","mayor_talk_cattle3", []],
  
  [anyone, "mayor_talk_cattle2", [
      (store_skill_level, ":trade", "skl_trade", "trp_player"),
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (val_mul, ":trade", 3),
      (val_div, ":trade", 2),
      (val_add, ":trade", ":persuasion"),
      (val_mul, ":trade", 7),
      (try_begin),
        (gt, ":trade", 50),
        (assign, "$temp2", ":trade"),
      (else_try),
        (assign, "$temp2", 50),
      (try_end),
      (assign, reg26, "$temp2"),
      ], "Alright, I'll pay you {reg26} peningas per head. Do we have a deal?","mayor_talk_cattle3", []],
  
  [anyone|plyr, "mayor_talk_cattle3", [],
    "No, that's too little.", "mayor_pretalk", []],
  
  [anyone|plyr, "mayor_talk_cattle3", [],
    "Agreed. The cattle are nearby and just lack someone to fetch them.", "mayor_pretalk", [
      (assign, reg25, "$temp"),
      (call_script, "script_remove_cattles_if_herd_is_close_to_party", "$g_encountered_party", reg25),
      (store_mul, reg33, "$temp", "$temp2"),
      (troop_add_gold, "trp_player",reg33),
      (store_div, ":change", "$temp", 10),
      (val_min, ":change", 5),
      (call_script, "script_change_center_prosperity", "$current_town", ":change"),
  ]],
  
  [anyone,"mayor_investment_possible",[
      (party_slot_ge, "$g_encountered_party", slot_center_player_enterprise, 1),
      (party_get_slot, ":item_produced", "$g_encountered_party", slot_center_player_enterprise),
      (call_script, "script_get_enterprise_name", ":item_produced"),
      (str_store_string, s4, reg0),
      ], "You already operate a {s4} here, and no one around here is selling his farm.", "mayor_pretalk",[
  ]],
  
  [anyone,"mayor_investment_possible",[
      (ge, "$cheat_mode", 3)
      ], "{!}CHEAT: Yes, we're playtesting this feature, and you're in cheat mode. Go right ahead.", "mayor_investment_advice",[
  ]],
  
  [anyone,"mayor_investment_possible",[
      (lt,"$g_encountered_party_relation",0),
      (str_store_string, s9, "str_enterprise_enemy_realm"),
      ], "{!}{s9}", "mayor_pretalk",[
  ]],
  
  [anyone,"mayor_investment_possible",[
      (party_slot_eq, "$g_encountered_party", slot_town_lord, "trp_player"),
      ], "Of course, {reg59?my lady:sir}. You are the lord of this town, and no one is going to stop you.", "mayor_investment_advice",[
  ]],
  
  [anyone,"mayor_investment_possible",[
      (party_get_slot, ":town_liege", "$g_encountered_party", slot_town_lord),
      (is_between, ":town_liege", active_npcs_begin, active_npcs_end),
      (call_script, "script_troop_get_relation_with_troop", "trp_player", ":town_liege"),
      (assign, ":relation", reg0),
      (lt, ":relation", 0),
      (str_store_troop_name, s4, ":town_liege"),
      ], "Well... Given your relationship with our lord, {s4}, I think that you will not find many here who are brave enough to sell you a farm.", "mayor_investment",[
  ]],
  
  [anyone|auto_proceed,"mayor_investment",[], "{!}.", "mayor_pretalk",[]],
  
  
  [anyone,"mayor_investment_possible",[
      (neg|party_slot_ge, "$current_town", slot_center_player_relation, 0),
      ], "Well, to be honest, I think that we in the town would like to know you a little better. We can be very particular about outsiders coming here and buying a farm.", "mayor_pretalk",[
  ]],
  
  [anyone,"mayor_investment_possible",[
      ], "Very good, {reg59?my lady:sir}. We in the town know and trust you, and I think I could find someone to sell you the land you need.", "mayor_investment_advice",[]],
  
  
  [anyone,"mayor_investment_advice",[], "There are a couple of things to keep in mind. Skilled foremen are always at a premium, so I doubt that you will be able to buy more land here. " +
    "In order to make a profit for yourself, you should choose a commodity which is in relatively short supply, but for which the raw materials are cheap. " +
    "A farmstead can engage in many economic activities, especially in enhancing production of local products.", "investment_choose_enterprise",[
  ]],
  
  [anyone|plyr,"investment_choose_enterprise",[], "It must have a mill and bakery, to make bread from wheat", "investment_summary",[
      (assign, "$enterprise_production", "itm_bread"),
  ]],
  
  [anyone|plyr,"investment_choose_enterprise",[], "It must have a brewery, to make ale from wheat", "investment_summary",[
      (assign, "$enterprise_production", "itm_ale"),
  ]],
  
  ##  [anyone|plyr,"investment_choose_enterprise",[], "It must have a tannery, to make leather from hides", "investment_summary",[
  ##  (assign, "$enterprise_production", "itm_timber"),
  ##  ]],
  
  ##  [anyone|plyr,"investment_choose_enterprise",[], "A wine press, to make wine from grapes", "investment_summary",[
  ##  (assign, "$enterprise_production", "itm_wine"),
  ##  ]],
  
  ##  [anyone|plyr,"investment_choose_enterprise",[], "An oil press, to make oil from olives", "investment_summary",[
  ##  (assign, "$enterprise_production", "itm_tar"),
  ##  ]],
  
  [anyone|plyr,"investment_choose_enterprise",[], "It must have a foundry, to make tools from iron", "investment_summary",[
      (assign, "$enterprise_production", "itm_tools"),
  ]],
  
  ##  [anyone|plyr,"investment_choose_enterprise",[], "A weavery and dyeworks, to make velvet from silk and dye", "investment_summary",[
  ##  (assign, "$enterprise_production", "itm_silver"),
  ##  ]],
  
  [anyone|plyr,"investment_choose_enterprise",[], "It must have a weavery, to make wool cloth from wool", "investment_summary",[
      (assign, "$enterprise_production", "itm_vc_wool_cloth"),
  ]],
  
  [anyone|plyr,"investment_choose_enterprise",[], "It must have a weavery, to make linen from flax", "investment_summary",[
      (assign, "$enterprise_production", "itm_linen"),
  ]],
  
  [anyone|plyr,"investment_choose_enterprise",[], "Never mind", "mayor_pretalk",[
  ]],
  
  [anyone,"investment_summary",[], "Very good, {reg59?my lady:sir}. The farmstead and the materials out of which you can build your {s3} will cost you {reg7} peningas. Right now, your {s3} will produce {s4} worth {reg1} peningas each week, while the {s6} needed to manufacture that much will be {reg2}, and labor and upkeep will be {reg3}.{s9} I would guess that your profit will be {reg0} peningas a week. This assumes of course that prices remain constant, but, I can virtually guarantee you, they will not. Do you wish to proceed?", "mayor_investment_confirm",
    [
      #(item_get_slot, ":base_price", "$enterprise_production", slot_item_base_price),
      #(item_get_slot, ":number_runs", "$enterprise_production", slot_item_output_per_run),
      #(store_mul, "$enterprise_cost", ":base_price", ":number_runs"),
      #(val_mul, "$enterprise_cost", 5),
      (item_get_slot, "$enterprise_cost", "$enterprise_production", slot_item_enterprise_building_cost),
      
      (assign, reg7, "$enterprise_cost"),
      
      (str_store_item_name, s4, "$enterprise_production"),
      
      (call_script, "script_get_enterprise_name", "$enterprise_production"),
      (str_store_string, s3, reg0),
      
      (call_script, "script_process_player_enterprise", "$enterprise_production", "$g_encountered_party"),
      #reg0: Profit per cycle
      #reg1: Selling price of total goods
      #reg2: Selling price of total goods
      
      (item_get_slot, ":primary_raw_material", "$enterprise_production", slot_item_primary_raw_material),
      (str_store_item_name, s6, ":primary_raw_material"),
      
      (str_clear, s9),
      (assign, ":cost_of_secondary_input", reg10),
      (try_begin),
        (gt, ":cost_of_secondary_input", 0),
        (item_get_slot, ":secondary_raw_material", "$enterprise_production", slot_item_secondary_raw_material),
        (str_store_item_name, s11, ":secondary_raw_material"),
        (str_store_string, s9, "str_describe_secondary_input"),
      (try_end),
  ]],
  
  
  [anyone|plyr,"mayor_investment_confirm",[
      (store_troop_gold, ":player_gold", "trp_player"),
      (ge, ":player_gold","$enterprise_cost"),
      ], "Yes. Here is money for the farmstead.", "mayor_investment_purchase",[
      (party_set_slot, "$g_encountered_party", slot_center_player_enterprise, "$enterprise_production"),
      (party_set_slot, "$g_encountered_party", slot_center_player_enterprise_days_until_complete, 14), #native 7, VC 14.
      
      (troop_remove_gold, "trp_player", "$enterprise_cost"),
      (store_sub, ":current_town_order", "$current_town", towns_begin),
      (store_add, ":craftsman_troop", ":current_town_order", "trp_town_1_master_craftsman"),
      (try_begin),
        (eq, "$enterprise_production", "itm_bread"),
        (troop_set_name, ":craftsman_troop", "str_master_miller"),
      (else_try),
        (eq, "$enterprise_production", "itm_ale"),
        (troop_set_name, ":craftsman_troop", "str_master_brewer"),
      (else_try),
        (eq, "$enterprise_production", "itm_tar"),
        (troop_set_name, ":craftsman_troop", "str_master_presser"),
      (else_try),
        (eq, "$enterprise_production", "itm_tools"),
        (troop_set_name, ":craftsman_troop", "str_master_smith"),
      (else_try),
        (eq, "$enterprise_production", "itm_vc_wool_cloth"),
        (troop_set_name, ":craftsman_troop", "str_master_weaver"),
      (else_try),
        (eq, "$enterprise_production", "itm_linen"),
        (troop_set_name, ":craftsman_troop", "str_master_weaver"),
      (else_try),
        (eq, "$enterprise_production", "itm_timber"),
        (troop_set_name, ":craftsman_troop", "str_master_tanner"),
      (else_try),
        (eq, "$enterprise_production", "itm_silver"),
        (troop_set_name, ":craftsman_troop", "str_master_dyer"),
      (else_try),
        (eq, "$enterprise_production", "itm_wine"),
        (troop_set_name, ":craftsman_troop", "str_master_vinter"),
      (try_end),
  ]],
  
  [anyone|plyr,"mayor_investment_confirm",[], "No -- that's not economical for me at the moment.", "mayor_pretalk",[
  ]],
  
  [anyone,"mayor_investment_purchase",[], "Very good. Your farmstead should be up and running in about two weeks. Whenever you visit after that, you can speak to your {s4} about its operations.", "mayor_pretalk",[
      (store_sub, ":current_town_order", "$current_town", towns_begin),
      (store_add, ":craftsman_troop", ":current_town_order", "trp_town_1_master_craftsman"),
      (str_store_troop_name, s4, ":craftsman_troop"),
      
  ]],
  
  
  
  
  [anyone|plyr,"mayor_talk", [], "[Leave]", "close_window",[]],
  
  [anyone, "mayor_info_begin", [(str_store_party_name, s9, "$current_town")],
    "I am the mayor of {s9}. " +
    "I can help you find a job if you are looking for some honest work.", "mayor_info_talk",[(assign, "$mayor_info_lord_told",0)]],
  
  [anyone|plyr,"mayor_info_talk",[(eq, "$mayor_info_lord_told",0)], "Who rules this town?", "mayor_info_lord",[]],
  
  [anyone, "mayor_info_lord", #moto fix
    [
      (party_get_slot, ":town_lord","$current_town",slot_town_lord),
      (try_begin),
        (eq, ":town_lord", "trp_player"),
        (party_get_slot,":tax", "$current_town", slot_center_tax_rate),
        (str_store_string, s10, "@Your highness"),
        (try_begin),
          (eq, ":tax", 0),
          (str_store_string, s33, "@ May I remind you that the populace is paying normal taxes to you?"),
        (else_try),
          (eq, ":tax", 1),
          (str_store_string, s33, "@ May I remind you that the populace is paying low taxes to you? They are exceptionally grateful to you."),
        (else_try),
          (eq, ":tax", 2),
          (str_store_string, s33, "@ May I remind you that the populace is paying high taxes to you? Your name is being cursed on every corner and at every market stall."),
        (try_end),
      (else_try),
        (is_between, ":town_lord", active_npcs_begin, active_npcs_end),
        (str_store_troop_name, s10, ":town_lord"),
        (str_clear, s33),
      (else_try),
        (faction_get_slot, ":faction_leader", "$g_encountered_party_faction", slot_faction_leader),
        (str_store_troop_name, s10, ":faction_leader"),
        (str_clear, s33),
      (try_end),
    ],
    "Our town's lord and protector is {s10}. {s10} owns the castle and sometimes resides here and collects taxes from the town. " +
    "However, we regulate ourselves in most of the matters that concern ourselves. " +
    "As the town's mayor, I have the authority to decide those things.{s33}", "mayor_info_talk",[(assign, "$mayor_info_lord_told",1)]],
  #MOTO rewrite to handle lord not assigned end
  
  [anyone|plyr,"mayor_info_talk",[], "That's all I need to know. Thanks.", "mayor_pretalk",[]],
  
  
  [anyone, "mayor_political_talk", [(faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
      (str_store_troop_name, s10, ":faction_leader"),
      (party_get_slot, ":town_lord","$current_town",slot_town_lord),
      (try_begin),
        (eq, ":town_lord", "trp_player"),
        (str_store_string, s10, "str_your_excellency"),
      (else_try),
        (is_between, ":town_lord", active_npcs_begin, active_npcs_end),
        (neq, ":town_lord", ":faction_leader"),
        (str_store_troop_name, s11, ":town_lord"),
        (neq, ":town_lord", ":faction_leader"),
        (str_store_string, s10, "str_s10_and_s11"),
      (try_end),
    ],
    "Politics? Good heaven, the guild has nothing to do with politics. We are loyal servants of {s10}. We merely govern our own affairs, pass on the townspeople's concerns to our lords and masters, and maybe warn them from time to time against evil advice. Anyway, what did you wish to ask?", "mayor_political_questions",[]],
  
  [anyone,"mayor_prepolitics",[ (faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
      (try_begin),
        (eq, ":faction_leader", "trp_player"),
        (str_store_string, s9, "str_your_loyal_subjects"),
      (else_try),
        (str_store_troop_name, s10, ":faction_leader"),
        (str_store_string, s9, "str_loyal_subjects_of_s10"),
      (try_end),
      ], "Did I mention that we here are all {s9}? Because I can't stress that enough... Anyway... Is there anything else?", "mayor_political_questions",[]],
  
  [anyone|plyr,"mayor_political_questions",[], "What is the cause of all these wars in the Northlands?", "mayor_war_description_1",[
  ]],
  
  [anyone,"mayor_war_description_1",[ (faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
      (str_store_troop_name, s10, ":faction_leader"),
      (str_store_string, s22, "str_the"),
      (try_begin),
        (eq, "$g_encountered_party_faction", "fac_kingdom_5"),
        (str_store_string, s22, "str_we"),
      (try_end),
      (val_max, "$g_mayor_given_political_dialog", 1),
      
      ], "Well, to answer your question generally, each monarch claims to be the rightful heir to the title of Brytenwalda, ruler of Englaland. Some of these claims are based on forgotten dynastic marriages and others are based on obscure promises, while some others are forged through sheer strength of arms. So in theory, any one realm has the right to declare war on any other realm at any time.", "mayor_war_description_2",[]],
  
  [anyone,"mayor_war_description_2",[ (faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
      (str_store_troop_name, s10, ":faction_leader"),
      (troop_get_type, reg4, ":faction_leader"),
      (val_mod, reg4, 2),
      ], "In practice, to make war is exhausting work. It is easy enough to lay waste to the enemy's farmland, but crops will grow back, and it is a far different matter to capture an enemy stronghold and to hold it. So the monarchs of the Northlands will fight a little, sign a truce, fight a little more, and so on and so forth. Often, a monarch will go to war when another realm provokes them. At such times, some bad influences who look to enrich themselves with ransoms and pillage will clamor for retribution, and thus the damage caused by war to a monarch's treasury is less than the damage caused by doing nothing would be to his authority... I'm of course not talking about {s10}, as no one would ever question {reg4?her:his} authority", "mayor_war_description_3",[]],
  
  [anyone,"mayor_war_description_3",[
      (faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
      (troop_get_type, reg4, ":faction_leader"),
      (val_mod, reg4, 2),
      
      ], "I would stress again that us merchants have nothing to do with politics. But if {s10} were to ask for my advice on these matters, as a loyal subject, I would tell {reg4?her:him} that while {reg4?her:his} claim to all of the Northlands is truly just, even the most legitimate claim must be backed by armed men, and armed men want money, and money comes from trade, and war ruins trade, so sometimes the best way to push a claim is not to push it, if you know what I mean...", "mayor_war_description_4",[]],
  
  [anyone,"mayor_war_description_4",[
      (str_store_party_name, s4, "$g_encountered_party"),
      (faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
      (troop_get_type, reg4, ":faction_leader"),
      (val_mod, reg4, 2),
      
      ], "You may tell {s10} this if you see {reg4?her:him}. Don't mention my name specifically -- just say 'the people of {s4}' told you this. Our personal opinion, of course, as to what would be in {s10}'s best interests. None of us would ever dream of questioning a monarch's sovereign right to push {reg4?her:his} legitimate claims.", "mayor_prepolitics",[
  ]],
  
  [anyone|plyr,"mayor_political_questions",[
      (faction_get_slot, ":faction_leader","$g_encountered_party_faction",slot_faction_leader),
      (str_store_troop_name, s10, ":faction_leader"),
      (ge, "$g_mayor_given_political_dialog", 1),
      (assign, ":continue", 0),
      (try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end),
        (faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active),
        (neq, ":cur_faction", "$g_encountered_party_faction"),
        (assign, ":continue", 1), #at least 1 faction is active
      (try_end),
      (eq, ":continue", 1),
      ], "What is {s10}'s policy in regards to the other realms of the Northlands?", "mayor_politics_assess",[
  ]],
  
  [anyone,"mayor_politics_assess",[], "Which realm did you have in mind?", "mayor_politics_assess_realm",[
  ]],
  
  [anyone|plyr|repeat_for_factions,"mayor_politics_assess_realm",[
      (store_repeat_object, ":faction"),
      (is_between, ":faction", kingdoms_begin, kingdoms_end),
      (faction_slot_eq, ":faction", slot_faction_state, sfs_active),
      (neq, ":faction", "$g_encountered_party_faction"),
      (str_store_faction_name, s11, ":faction"),
      ], "{!}{s11}", "mayor_politics_give_realm_assessment",[
      (store_repeat_object, "$faction_selected"),
  ]],
  
  [anyone,"mayor_politics_give_realm_assessment",[], "{!}{s14}", "mayor_prepolitics",[
      (call_script, "script_npc_decision_checklist_peace_or_war", "$g_encountered_party_faction", "$faction_selected", -1),
  ]],
  
  [anyone|plyr,"mayor_political_questions",[], "What can you say about the internal politics of the realms?", "mayor_internal_politics",[
  ]],
  
  [anyone,"mayor_internal_politics",[
      (str_store_faction_name, s4, "$g_encountered_party_faction"),
      (faction_get_slot, ":leader", "$g_encountered_party_faction", slot_faction_leader),
      (str_store_troop_name, s5, ":leader"),
      ], "Well, here in the {s4}, we are all united by our love for {s5} and support for {reg59?her:his} legitimate claim to the rulership of all these lands, but I have heard some talk of internal bickering in other realms...", "mayor_internal_politics_2",[
  ]],
  
  [anyone,"mayor_internal_politics_2",[], "The lords of a realm often have very different ideas about honor, strategy, and the way a nobleman should behave. In addition, they compete with each other for the ruler's favor, and are constantly weighing up their position -- how they stand, how their friends and family stand, and how their enemies stand.", "mayor_internal_politics_3", []],
  
  [anyone,"mayor_internal_politics_3",[], "Underlying all the tensions is the possibility that a lord may abandon his liege, and pledge vassalhood to another. In theory, each lord has sworn an oath of vassalage, but in practice, a vassal can always find an excuse to absolve himself. The vassal may claim that the liege has failed to hold up his end of the bargain, to protect the vassal and treat him justly. Or, the vassal may claim that his liege is in fact a usurper, and another has a better claim to the kingship.", "mayor_internal_politics_4", []],
  
  [anyone,"mayor_internal_politics_4",[], "Lieges and vassals still watch each other carefully. If a king believes that his vassal is going to change sides or rebel, he may indict the vassal for treason and seize his properties. Likewise, if a vassal fears that he will be indicted, he may rebel. Usually, whoever makes the first move will be able to control the vassal's fortresses.", "mayor_internal_politics_5", []],
  
  [anyone,"mayor_internal_politics_5",[], "Now, men do not trust a vassal who turns coat easily, nor do they trust a king who lightly throws around charges of treason. Those two factors can keep a realm together, but if relations between a vassal and a liege deteriorate far enough, things can become very tense indeed... In other lands, of course. These things could never happen here in the {s4}.", "mayor_prepolitics", []],
  
  [anyone|plyr, "mayor_political_questions", [], "That is all. Thank you.", "mayor_pretalk", []],
  
  
  [anyone,"merchant_quest_about_job", [], "What about it?", "merchant_quest_about_job_2",[]],
  [anyone|plyr,"merchant_quest_about_job_2", [], "What if I can't finish it?", "merchant_quest_what_if_fail",[]],
  [anyone|plyr,"merchant_quest_about_job_2", [], "Well, I'm still working on it.", "merchant_quest_about_job_working",[]],
  [anyone,"merchant_quest_about_job_working", [(is_between, "$g_talk_troop", mayors_begin, mayors_end),], "Good. I'm sure you will handle it.", "mayor_pretalk",[]],
  [anyone,"merchant_quest_about_job_working", [], "Good. I'm sure you will handle it.", "reeve_pretalk",[]],
  [anyone|plyr,"merchant_quest_about_job_2", [(store_partner_quest,":partner_quest"),(eq,":partner_quest","qst_blank_quest_11"),
      (quest_get_slot, ":quest_target_amount", "qst_blank_quest_11", slot_quest_target_amount),
      (quest_get_slot, ":quest_target_item", "qst_blank_quest_11", slot_quest_target_item),
      (call_script, "script_get_troop_item_amount", "trp_player", ":quest_target_item"),
      (assign, ":cur_amount", reg0),
      (ge, ":cur_amount", ":quest_target_amount"),
      (assign, reg5, ":quest_target_amount"),
      (str_store_item_name, s33, ":quest_target_item"),
      (assign, "$temp", ":quest_target_item"),
      (assign, "$temp2", ":quest_target_amount"),], "Indeed. I brought you {reg5} loads of {s33}.", "merchant_quest_about_job_2a",[]],
  
  [anyone,"merchant_quest_about_job_2a", [(is_between, "$g_talk_troop", mayors_begin, mayors_end),
      (str_store_item_name, s33, "$temp"),],
    "Good news, {playername}. I will let the merchant know, so he can come and get his materials. For now, please take the {s33} you brought to the storage over there. And of course, here is your reward.", "mayor_pretalk",
    [(quest_get_slot, ":quest_target_amount", "qst_blank_quest_11", slot_quest_target_amount),
      (quest_get_slot, ":quest_target_item", "qst_blank_quest_11", slot_quest_target_item),
      (quest_get_slot, ":quest_gold_reward", "qst_blank_quest_11", slot_quest_gold_reward),
      (troop_add_gold, "trp_player", ":quest_gold_reward"),
      (troop_remove_items, "trp_player", ":quest_target_item", ":quest_target_amount"),
      (add_xp_as_reward, ":quest_gold_reward"),
      (call_script, "script_change_player_relation_with_center", "$current_town", 5),
      (call_script, "script_end_quest", "qst_blank_quest_11"),
  ]],
  
  [anyone,"merchant_quest_about_job_2a", [(is_between, "$g_talk_troop", "trp_castle_1_seneschal", "trp_town_1_arena_master"),
      (str_store_item_name, s33, "$temp"),],
    "Good news, {playername}. I will let the merchant know, so he can come and get his materials. For now, please take the {s33} you brought to the storage over there. And of course, here is your reward.", "reeve_pretalk",
    [(quest_get_slot, ":quest_target_amount", "qst_blank_quest_11", slot_quest_target_amount),
      (quest_get_slot, ":quest_target_item", "qst_blank_quest_11", slot_quest_target_item),
      (quest_get_slot, ":quest_gold_reward", "qst_blank_quest_11", slot_quest_gold_reward),
      (troop_add_gold, "trp_player", ":quest_gold_reward"),
      (troop_remove_items, "trp_player", ":quest_target_item", ":quest_target_amount"),
      (add_xp_as_reward, ":quest_gold_reward"),
      (call_script, "script_change_player_relation_with_center", "$current_town", 5),
      (call_script, "script_end_quest", "qst_blank_quest_11"),
  ]],
  [anyone,"merchant_quest_last_offered_job", [], "Eh, you want to reconsider that. Good...", "merchant_quest_brief",
    [[assign,"$random_merchant_quest_no","$merchant_offered_quest"]]],
  
  
  [anyone,"merchant_quest_what_if_fail", [(store_partner_quest,":partner_quest"),(eq,":partner_quest","qst_deliver_wine"),(is_between, "$g_talk_troop", mayors_begin, mayors_end)],
    "I hope you don't fail. In that case, I'll have to ask for the price of the cargo you were carrying.", "mayor_pretalk",[]],
  [anyone,"merchant_quest_what_if_fail", [(store_partner_quest,":partner_quest"),(eq,":partner_quest","qst_deliver_wine"),(is_between, "$g_talk_troop", "trp_castle_1_seneschal", "trp_town_1_arena_master"),],
    "I hope you don't fail. In that case, I'll have to ask for the price of the cargo you were carrying.", "reeve_pretalk",[]],
  [anyone,"merchant_quest_what_if_fail", [(is_between, "$g_talk_troop", mayors_begin, mayors_end)], "Well, just do your best to finish it.", "mayor_pretalk",[]],
  [anyone,"merchant_quest_what_if_fail", [(is_between, "$g_talk_troop", "trp_castle_1_seneschal", "trp_town_1_arena_master"),], "Well, just do your best to finish it.", "reeve_pretalk",[]],
  
  [anyone,"merchant_quest_taken", [(is_between, "$g_talk_troop", mayors_begin, mayors_end)], "Excellent. I am counting on you then. Good luck.", "mayor_pretalk",[]],
  [anyone,"merchant_quest_taken", [(is_between, "$g_talk_troop", "trp_castle_1_seneschal", "trp_town_1_arena_master"),], "Excellent. I am counting on you then. Good luck.", "reeve_pretalk",[]],
  [anyone,"merchant_quest_stall", [(is_between, "$g_talk_troop", mayors_begin, mayors_end)], "Well, the job will be available for a few more days I guess. Tell me if you decide to take it.", "mayor_pretalk",[]],
  [anyone,"merchant_quest_stall", [(is_between, "$g_talk_troop", "trp_castle_1_seneschal", "trp_town_1_arena_master"),], "Well, the job will be available for a few more days I guess. Tell me if you decide to take it.", "reeve_pretalk",[]],
  
  [anyone,"mayor_economy_report_1", [], "{!}{s32}", "mayor_economy_report_2",
    []],
  
  [anyone,"mayor_economy_report_2", [], "{!}{s42}", "mayor_economy_report_3",
    []],
  
  [anyone,"mayor_economy_report_3", [], "{!}{s47}", "mayor_pretalk",
    []],
  
  
  ###################################################################3
  # Random Merchant quests....
  ##############################
  
  # Ryan BEGIN
  # deal with looters
  
  [anyone,"merchant_quest_requested",
    [
      (eq,"$random_merchant_quest_no","qst_deal_with_looters"),
    ],
    "Well, you look able enough. I think I might have something you could do.", "merchant_quest_brief", []],
  
  [anyone,"merchant_quest_brief",
    [
      (eq,"$random_merchant_quest_no","qst_deal_with_looters"),
      (try_begin),
        (party_slot_eq,"$g_encountered_party",slot_party_type,spt_town),
        (str_store_string,s5,"@town"),
      (else_try),
        (party_slot_eq,"$g_encountered_party",slot_party_type,spt_village),
        (str_store_string,s5,"@village"),
      (try_end),
    ],
    "We've had some fighting near the {s5} lately, with all the chaos that comes with it, " +
    "and that's led some of our less upstanding locals to try and make their fortune out of looting the shops and farms during the confusion. " +
    "A lot of valuable goods were taken. I need somebody to teach those bastards a lesson. " +
    "Sound like your kind of work?", "merchant_quest_looters_choice", []],
  
  [anyone|plyr,"merchant_quest_looters_choice", [], "Aye, I'll do it.", "merchant_quest_looters_brief", []],
  
  [anyone|plyr,"merchant_quest_looters_choice", [], "I'm afraid I can't take the job at the moment.", "merchant_quest_stall",[]],
  
  [anyone,"merchant_quest_looters_brief", [
      (try_begin),
        (party_slot_eq,"$g_encountered_party",slot_party_type,spt_town),
        (str_store_string,s5,"@town"),
      (else_try),
        (party_slot_eq,"$g_encountered_party",slot_party_type,spt_village),
        (str_store_string,s5,"@village"),
      (try_end),
      
      #     (party_get_slot,":merchant","$current_town",slot_town_merchant),
      #     (troop_clear_inventory,":merchant"),
      (store_random_in_range,":random_num_looters",3,7),
      (quest_set_slot,"qst_deal_with_looters",slot_quest_target_amount,":random_num_looters"),
      # (store_div, reg0, "$spawn_party_max_size", 2),
      # (store_div, ":min", reg0, 5),
      # (set_party_creation_random_limits, ":min", reg0),
      (try_for_range,":unused",0,":random_num_looters"),
        (store_random_in_range,":random_radius",5,14),
        (set_spawn_radius,":random_radius"),
        (spawn_around_party,"$g_encountered_party","pt_looters"),
        (party_set_flags, reg0, pf_quest_party, 1),
        (party_set_ai_behavior, reg0, ai_bhvr_patrol_location),
        (party_set_ai_patrol_radius, reg0, 2),
        (party_get_position, pos0, reg0),
        (party_set_ai_target_position, reg0, pos0),
      (try_end),
      # (store_div, ":min", "$spawn_party_max_size", 5),
      # (set_party_creation_random_limits, ":min", "$spawn_party_max_size"),
      (str_store_troop_name_link, s9, "$g_talk_troop"),
      (str_store_party_name_link, s13, "$g_encountered_party"),
      (str_store_party_name, s4, "$g_encountered_party"),
      (setup_quest_text, "qst_deal_with_looters"),
      (str_store_string, s2, "@The mayor of {s13} has asked you to deal with looters in the surrounding countryside."),
      (call_script, "script_start_quest", "qst_deal_with_looters", "$g_talk_troop"),
      (assign, "$g_leave_encounter",1),
    ],
    "Excellent! You'll find the looters roaming around the countryside, probably trying to rob more good people. " +
    "Kill or capture the bastards, I don't care what you do with them. " +
    "I'll pay you a bounty of 40 peningas on every band of looters you destroy, " +
    "until all the looters are dealt with.", "close_window",
    []],
  # Ryan END
  
  #The following few quests are non-random -- they will be checked every time a player asks for a job. If circumstances allow it, then the player will
  [anyone,"merchant_quest_requested", [
      (eq,"$random_merchant_quest_no","qst_retaliate_for_border_incident"),
      
      (quest_get_slot, ":target_faction", "qst_retaliate_for_border_incident", slot_quest_target_faction),
      (call_script, "script_faction_get_adjective_to_s10", ":target_faction"),
      
      (faction_get_slot, ":leader", "$g_encountered_party_faction", slot_faction_leader),
      (str_store_troop_name, s5, ":leader"),
      
    ], "Well, there is a very great favor which you could do us... As you may have heard, some {s10}s have come across the border to attack our people. {s5} is under great pressure from some of the more bellicose of his vassals to respond with a declaration of war. Unfortunately, while the great lords of this land grow rich from bloodshed, we of the commons will be caught in the middle, and will suffer.",
    "merchant_quest_explain_2", []],
  
  [anyone,"merchant_quest_explain_2", [
      (eq,"$random_merchant_quest_no","qst_retaliate_for_border_incident"),
      (quest_get_slot, ":target_troop", "qst_retaliate_for_border_incident", slot_quest_target_troop),
      (str_store_troop_name, s7, ":target_troop"),
      
    ],
    "We are not saying that {s5} should overlook this aggression -- far from it! But if he charges one of his own lords to respond, then the cycle of provocation will necessarily lead to a full-fledged confrontation. Now, if an outsider were to step in and defeat a {s10} lord in battle, then honor would be done, and it would defuse the clamor for war. If the defeated lord were a known troublemaker -- {s7} -- then the {s10}s might be able to overlook it.",
    "merchant_quest_brief",[]],
  
  
  [anyone,"merchant_quest_brief", [
      (eq,"$random_merchant_quest_no","qst_retaliate_for_border_incident"),
      (quest_get_slot, ":target_troop", "qst_retaliate_for_border_incident", slot_quest_target_troop),
      (str_store_troop_name, s7, ":target_troop"),
    ],
    "We need you to attack and defeat {s7}. This will not be an easy task, and that outsider would damage {reg59?her:his} relationship with the {s10}s, but we would be very grateful. We could not acknowledge a connection with that outsider, but we could be sure that {reg59?she:he} would be handsomely rewarded... Could you do this?",
    "merchant_quest_retaliate_confirm",[]],
  
  [anyone|plyr,"merchant_quest_retaliate_confirm", [], "Aye, I can do it.", "merchant_quest_track_bandits_brief", [
      #    (quest_set_slot, "qst_retaliate_for_border_incident", slot_quest_target_troop, "$g_target_leader"),
      #    (quest_set_slot, "qst_retaliate_for_border_incident", slot_quest_target_faction, "$g_target_faction"),
      
      (str_store_faction_name, s11, "$g_encountered_party_faction"),
      (setup_quest_text, "qst_retaliate_for_border_incident"),
      (str_store_string, s2, "str_track_down_s7_and_defeat_him_defusing_calls_for_war_within_the_s11"),
      (call_script, "script_start_quest", "qst_retaliate_for_border_incident", "$g_talk_troop"),
  ]],
  
  [anyone|plyr,"merchant_quest_retaliate_confirm", [], "I would prefer not to get mixed up in such things.", "merchant_pretalk", [
      (quest_set_slot, "qst_retaliate_for_border_incident", slot_quest_dont_give_again_remaining_days, 5),
  ]],
  
  
  
  [anyone,"destroy_lair_quest_brief", [
      (eq,"$random_quest_no", "qst_destroy_bandit_lair"),
      (quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
      (party_get_template_id, ":bandit_type", ":bandit_lair"),
      (eq, ":bandit_type", "pt_sea_raider_lair"),
    ],
    "Bandits such as these usually establish their hideouts in the plain. The best way to discover its location would be to find a group of bandits who appear to be heading back to their base to resupply, and follow them.", "merchant_quest_track_bandit_lair_choice",
    []],
  #chief anadido
  [anyone,"destroy_lair_quest_brief", [
      (eq,"$random_quest_no", "qst_destroy_bandit_lair"),
      (quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
      (party_get_template_id, ":bandit_type", ":bandit_lair"),
      (eq, ":bandit_type", "pt_sea_raider_lair2"),
    ],
    "The Vikings are likely to have hidden their ships in a well-concealed cove, somewhere along the coastline, preferably next to a small stream where they have access to fresh water. The best way to discover its location would be to find a band of them who appear to be heading back to their base to resupply, and follow their tracks.", "merchant_quest_track_bandit_lair_choice",
    []],
  
  [anyone,"destroy_lair_quest_brief", [
      (eq,"$random_quest_no", "qst_destroy_bandit_lair"),
      (quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
      (party_get_template_id, ":bandit_type", ":bandit_lair"),
      (eq, ":bandit_type", "pt_desert_bandit_lair"),
    ],
    "Bandits such as these will usually establish a base in the highlands, often on a steep ledge where they have a view of the surrounding countryside. This makes them difficult to surprise. The best way to discover its location would be to find a group of mountain bandits who appear to be heading back to their base to resupply, and follow them.", "merchant_quest_track_bandit_lair_choice",
    []],
  
  [anyone,"destroy_lair_quest_brief", [
      (eq,"$random_quest_no", "qst_destroy_bandit_lair"),
      (quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
      (party_get_template_id, ":bandit_type", ":bandit_lair"),
      (eq, ":bandit_type", "pt_mountain_bandit_lair"),
    ],
    "Bandits such as these will usually establish a base in the highlands, often on a steep ledge where they have a view of the surrounding countryside. This makes them difficult to surprise. The best way to discover its location would be to find a group of mountain bandits who appear to be heading back to their base to resupply, and follow them.", "merchant_quest_track_bandit_lair_choice",
    []],
  
  [anyone,"destroy_lair_quest_brief", [
      (eq,"$random_quest_no", "qst_destroy_bandit_lair"),
      (quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
      (party_get_template_id, ":bandit_type", ":bandit_lair"),
      (eq, ":bandit_type", "pt_forest_bandit_lair"),
    ],
    "Bandits such as these will usually set up their encampments deep in the woods. The best way to discover its location would be to find a group of bandits who appear to be heading back to their base to resupply, and follow them.", "merchant_quest_track_bandit_lair_choice",
    []],
  
  [anyone,"destroy_lair_quest_brief", [
      (eq,"$random_quest_no", "qst_destroy_bandit_lair"),
      (quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
      (party_get_template_id, ":bandit_type", ":bandit_lair"),
      (eq, ":bandit_type", "pt_steppe_bandit_lair"),
    ],
    "The Norwegian Vikings are likely to have hidden their ships in a well-concealed cove, somewhere along the coastline, preferably next to a small stream where they have access to fresh water. The best way to discover its location would be to find a group of raiders who appear to be heading back to their base to resupply, and follow them.", "merchant_quest_track_bandit_lair_choice",
    []],
  
  [anyone,"destroy_lair_quest_brief", [
      (eq,"$random_quest_no", "qst_destroy_bandit_lair"),
      (quest_get_slot, ":bandit_lair", "qst_destroy_bandit_lair", slot_quest_target_party),
      (party_get_template_id, ":bandit_type", ":bandit_lair"),
      (eq, ":bandit_type", "pt_taiga_bandit_lair"),
    ],
    "The Vikings are likely to have hidden their ships in a well-concealed cove, somewhere along the coastline, preferably next to a small stream where they have access to fresh water. The best way to discover its location would be to find a band of them who appear to be heading back to their base to resupply, and follow their tracks.", "merchant_quest_track_bandit_lair_choice",
    []],
  
  
  [anyone|plyr,"merchant_quest_track_bandit_lair_choice", [], "Aye, I'll do it.", "merchant_quest_destroy_lair_brief", [
      
      (quest_get_slot, ":target_party", "qst_destroy_bandit_lair", slot_quest_target_party),
      (party_set_flags, ":target_party", pf_quest_party, 1),
      #    (quest_set_slot, "qst_track_down_bandits", slot_quest_target_party, "$g_bandit_party_for_bounty"), #WHY IS THIS COMMENTED OUT?
      (quest_set_slot, "qst_destroy_bandit_lair", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_set_slot, "qst_destroy_bandit_lair", slot_quest_giver_center, "$g_encountered_party"),
      
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_party_name, s9, ":target_party"),
      (setup_quest_text, "qst_destroy_bandit_lair"),
      (str_store_string, s2, "str_bandit_lair_quest_description"),
      (call_script, "script_start_quest", "qst_destroy_bandit_lair", "$g_talk_troop"),
  ]],
  
  [anyone|plyr,"merchant_quest_track_bandit_lair_choice", [], "I'm afraid I can't take the job at the moment.", "lord_pretalk",[
      (quest_set_slot, "qst_destroy_bandit_lair", slot_quest_dont_give_again_remaining_days, 1),
  ]],
  
  [anyone,"merchant_quest_destroy_lair_brief", [
    ], "Very good. We will await word of your success.", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
  ]],
  
  
  
  [anyone,"merchant_quest_requested", [
      (eq,"$random_merchant_quest_no", "qst_track_down_bandits"),
    ], "We have heard that {s4}, some travellers on the road {reg4?to:from} {s5} were attacked by {s7}.", "merchant_quest_brief",
    [
      (call_script,"script_merchant_road_info_to_s42", "$g_encountered_party"),
      (assign, "$g_bandit_party_for_bounty", reg0),
      (assign, ":origin", reg1),
      (assign, ":destination", reg2),
      (assign, ":hours_ago", reg3),
      (try_begin),
        (lt, ":hours_ago", 24),
        (str_store_string, s4, "str_a_short_while_ago"),
      (else_try),
        (lt, ":hours_ago", 48),
        (str_store_string, s4, "str_one_day_ago"),
      (else_try),
        (lt, ":hours_ago", 72),
        (str_store_string, s4, "str_two_days_day_ago"),
      (else_try),
        (lt, ":hours_ago", 144),
        (str_store_string, s4, "str_earlier_this_week"),
      (else_try),
        (str_store_string, s4, "str_about_a_week_ago"),
      (try_end),
      
      
      (try_begin),
        (eq, ":origin", "$g_encountered_party"),
        (str_store_party_name, s5, ":destination"),
        (assign, reg4, 0),
      (else_try),
        (eq, ":destination", "$g_encountered_party"),
        (str_store_party_name, s5, ":origin"),
        (assign, reg4, 1),
      (try_end),
      
      (str_store_party_name, s7, "$g_bandit_party_for_bounty"),
      ###
      (quest_set_slot, "qst_track_down_bandits", slot_quest_target_party, "$g_bandit_party_for_bounty"),
  ]],
  
  [anyone,"merchant_quest_brief", [
      (eq,"$random_merchant_quest_no", "qst_track_down_bandits"),
      (quest_get_slot, ":target_party", "qst_track_down_bandits", slot_quest_target_party),
      (str_store_party_name, s4, ":target_party"),
    ],
    "We would like you to track these {s4} down. The merchants of the town were able to get a description of their leader, and have put together a bounty. If you can hunt them down and destroy them, we'll make it worth your while...", "merchant_quest_track_bandits_choice",
    []],
  
  [anyone|plyr,"merchant_quest_track_bandits_choice", [], "Aye, I'll do it.", "merchant_quest_track_bandits_brief", [
      (assign, "$merchant_offered_quest", 0),
      (assign,"$merchant_quest_last_offerer", "$g_talk_troop"),
      
      (quest_get_slot, ":target_party", "qst_track_down_bandits", slot_quest_target_party),
      (party_set_flags, ":target_party", pf_quest_party, 1),
      #    (quest_set_slot, "qst_track_down_bandits", slot_quest_target_party, "$g_bandit_party_for_bounty"), #WHY IS THIS COMMENTED OUT?
      (quest_set_slot, "qst_track_down_bandits", slot_quest_giver_troop, "$g_talk_troop"),
      (quest_set_slot, "qst_track_down_bandits", slot_quest_giver_center, "$g_encountered_party"),
      #	(store_party_size_wo_prisoners, ":party_size", ":target_party"),
      (party_get_num_companion_stacks, ":num_stacks",":target_party"),
      (assign, ":total", 0),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop",":target_party",":i_stack"),
        (party_stack_get_size, ":stack_size",":target_party",":i_stack"),
        (store_character_level, ":troop_level", ":stack_troop"),
        (store_mul, ":troop_total",":troop_level", ":stack_size"),
        (val_add, ":total", ":troop_total"),
      (try_end),
      (val_div, ":total", 10),
      (val_mul, ":total", 10),
      
      #	(val_mul, ":total", 2),
      (quest_set_slot, "qst_track_down_bandits", slot_quest_gold_reward, ":total"),
      (val_mul, ":total", 3),
      (val_div, ":total", 2),
      (quest_set_slot, "qst_track_down_bandits", slot_quest_xp_reward, ":total"),
      (str_store_party_name_link, s8, "$g_encountered_party"),
      (str_store_party_name, s9, ":target_party"),
      (setup_quest_text, "qst_track_down_bandits"),
      (str_store_string, s2, "str_track_down_the_s9_who_attacked_travellers_near_s8_then_report_back_to_the_town"),
      (call_script, "script_start_quest", "qst_track_down_bandits", "$g_talk_troop"),
  ]],
  
  
  [anyone,"merchant_quest_track_bandits_brief", [
    ], "Very good. The band may not have lingered long in the area, but chances are that they will be spotted by other travellers on the road.", "close_window",
    [
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [anyone|plyr,"merchant_quest_track_bandits_choice", [], "I'm afraid I can't take the job at the moment.", "merchant_quest_stall",[
      (quest_set_slot, "qst_track_down_bandits", slot_quest_dont_give_again_remaining_days, 1),
  ]],
  
  
  
  #Random quests begin here. Deliver wine:
  [anyone,"merchant_quest_requested", [(eq,"$random_merchant_quest_no","qst_deliver_wine"),], "You're looking for a job? " +
    "Actually, I was looking for someone to deliver some {s4}. " +
    "Perhaps you can do that...", "merchant_quest_brief",
    [(quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
      (str_store_item_name, s4, ":quest_target_item"),
  ]],
  
  [anyone,"merchant_quest_brief", [(eq,"$random_merchant_quest_no","qst_deliver_wine")],
    "I have a cargo of {s6} that needs to be delivered to the mead hall in {s4}. " +
    "If you can take {reg5} units of {s6} to {s4} in 7 days, you may earn {reg8} peningas. " +
    "What do you say?", "merchant_quest_brief_deliver_wine",
    [(quest_get_slot, reg5, "qst_deliver_wine", slot_quest_target_amount),
      (quest_get_slot, reg8, "qst_deliver_wine", slot_quest_gold_reward),
      (quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
      (quest_get_slot, ":quest_target_center", "qst_deliver_wine", slot_quest_target_center),
      (str_store_troop_name, s9, "$g_talk_troop"),
      (str_store_party_name_link, s3, "$g_encountered_party"),
      (str_store_party_name_link, s4, ":quest_target_center"),
      (str_store_item_name, s6, ":quest_target_item"),
      (setup_quest_text,"qst_deliver_wine"),
      (str_store_string, s2, "@{s9} of {s3} asked you to deliver {reg5} units of {s6} to the mead hall in {s4} in 7 days."),
      #s2 should not be changed until the decision is made
  ]],
  
  [anyone|plyr,"merchant_quest_brief_deliver_wine", [(store_free_inventory_capacity,":capacity"),
      (quest_get_slot, ":quest_target_amount", "qst_deliver_wine", slot_quest_target_amount),
      (ge, ":capacity", ":quest_target_amount"),
    ],
    "Alright. I will make the delivery.", "merchant_quest_taken",
    [(quest_get_slot, ":quest_target_amount", "qst_deliver_wine", slot_quest_target_amount),
      (quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
      (troop_add_items, "trp_player", ":quest_target_item",":quest_target_amount"),
      (call_script, "script_start_quest", "qst_deliver_wine", "$g_talk_troop"),
  ]],
  
  [anyone|plyr,"merchant_quest_brief_deliver_wine", [], "I am afraid I can't carry all that cargo now.", "merchant_quest_stall",[]],
  
  #escort merchant caravan:
  [anyone,"merchant_quest_requested", [(eq,"$random_merchant_quest_no","qst_escort_merchant_caravan")], "You're looking for a job? " +
    "Actually, I was looking for someone to escort a caravan. " +
    "Perhaps you can do that...", "merchant_quest_brief",
    []],
  
  [anyone,"merchant_quest_brief", [(eq, "$random_merchant_quest_no", "qst_escort_merchant_caravan")],
    "I am going to send a caravan of goods to {s8}. " +
    "However, with all those bandits and deserters on the roads, I don't want to send them out without an escort. " +
    "If you can lead that caravan to {s8} in 15 days, you will earn {reg8} peningas. " +
    "Of course, your party needs to be at least {reg4} strong to offer them any protection. " +
    "Also, keep in mind that the caravan may need to travel over the sea to get to its destination. Also ferries and ships hired for transport in port towns will be unable to carry the cargo. So you may need to own a ship to be able to escort it.", "escort_merchant_caravan_quest_brief",
    [(quest_get_slot, reg8, "qst_escort_merchant_caravan", slot_quest_gold_reward),
      (quest_get_slot, reg4, "qst_escort_merchant_caravan", slot_quest_target_amount),
      (quest_get_slot, ":quest_target_center", "qst_escort_merchant_caravan", slot_quest_target_center),
      (str_store_party_name, s8, ":quest_target_center"),
  ]],
  
  [anyone|plyr,"escort_merchant_caravan_quest_brief", [(store_party_size_wo_prisoners, ":party_size", "p_main_party"),
      (quest_get_slot, ":quest_target_amount", "qst_escort_merchant_caravan", slot_quest_target_amount),
      (ge,":party_size",":quest_target_amount"),
    ],
    "Alright. I will escort the caravan.", "merchant_quest_taken",
    [(quest_get_slot, ":quest_target_center", "qst_escort_merchant_caravan", slot_quest_target_center),
      (set_spawn_radius, 1),
      (spawn_around_party,"$g_encountered_party","pt_merchant_caravan"),
      (assign, ":quest_target_party", reg0),
      ###fixed relation commoners problem
      (store_faction_of_party, ":caravan_faction", ":quest_target_party"),
      (try_begin),
        (eq, ":caravan_faction", "fac_commoners"),
        (store_relation, ":relation_with_player", ":caravan_faction", "fac_player_faction"),
        (lt, ":relation_with_player", 0),
        (set_relation, "fac_player_faction", ":caravan_faction", 0),
      (try_end),
      ###
      (party_set_ai_behavior, ":quest_target_party", ai_bhvr_track_party),
      (party_set_ai_object, ":quest_target_party", "p_main_party"),
      (party_set_flags, ":quest_target_party", pf_default_behavior, 0),
      (call_script, "script_update_party_icon", ":quest_target_party"),	#new
      (quest_set_slot, "qst_escort_merchant_caravan", slot_quest_target_party, ":quest_target_party"),
      (quest_set_slot, "qst_escort_merchant_caravan", slot_quest_current_state, 0),
      (str_store_party_name_link, s8, ":quest_target_center"),
      (setup_quest_text, "qst_escort_merchant_caravan"),
      (str_store_string, s2, "@Escort the merchant caravan to the town of {s8}."),
      (call_script, "script_start_quest", "qst_escort_merchant_caravan", "$g_talk_troop"),
  ]],
  
  [anyone|plyr,"escort_merchant_caravan_quest_brief", [(store_party_size_wo_prisoners, ":party_size", "p_main_party"),
      (quest_get_slot, ":quest_target_amount", "qst_escort_merchant_caravan", slot_quest_target_amount),
      (lt,":party_size",":quest_target_amount"),],
    "I am afraid I don't have that many soldiers with me.", "merchant_quest_stall",[]],
  [anyone|plyr,"escort_merchant_caravan_quest_brief", [(store_party_size_wo_prisoners, ":party_size", "p_main_party"),
      (quest_get_slot, ":quest_target_amount", "qst_escort_merchant_caravan", slot_quest_target_amount),
      (ge,":party_size",":quest_target_amount"),],
    "Sorry. I can't do that right now", "merchant_quest_stall",[]],
  
  [party_tpl|pt_merchant_caravan,"start", [(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
      (eq,"$g_encountered_party",":quest_target_party"),
      (quest_slot_eq,"qst_escort_merchant_caravan", slot_quest_current_state, 2),
    ],
    "We can cover the rest of the way ourselves. Thanks.", "close_window",[(assign, "$g_leave_encounter", 1)]],
  
  [party_tpl|pt_merchant_caravan,"start", [(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
      (eq,"$g_encountered_party",":quest_target_party"),
      (quest_get_slot, ":quest_target_center", "qst_escort_merchant_caravan", slot_quest_target_center),
      (store_distance_to_party_from_party, ":dist", ":quest_target_center",":quest_target_party"),
      (lt,":dist",4),
      (quest_slot_eq, "qst_escort_merchant_caravan", slot_quest_current_state, 1),
    ],
    "Well, we have almost reached {s21}. We can cover the rest of the way ourselves. " +
    "Here's your pay... {reg14} peningas. " +
    "Thanks for escorting us. Good luck.", "close_window",[(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
      (quest_get_slot, ":quest_target_center", "qst_escort_merchant_caravan", slot_quest_target_center),
      (quest_get_slot, ":quest_giver_center", "qst_escort_merchant_caravan", slot_quest_giver_center),
      (quest_get_slot, ":quest_gold_reward", "qst_escort_merchant_caravan", slot_quest_gold_reward),
      (party_set_ai_behavior, ":quest_target_party", ai_bhvr_travel_to_party),
      (party_set_ai_object, ":quest_target_party", ":quest_target_center"),
      (party_set_flags, ":quest_target_party", pf_default_behavior, 0),
      (str_store_party_name, s21, ":quest_target_center"),
      (call_script, "script_change_player_relation_with_center", ":quest_giver_center", 7),
      (call_script, "script_end_quest","qst_escort_merchant_caravan"),
      (quest_set_slot, "qst_escort_merchant_caravan", slot_quest_current_state, 2),
      (call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
      (assign, ":xp_reward", ":quest_gold_reward"),
      (val_mul, ":xp_reward", 5),
      (val_add, ":xp_reward", 100),
      (add_xp_as_reward, ":xp_reward"),
      (call_script, "script_change_troop_renown", "trp_player", 2),
      (assign, reg14, ":quest_gold_reward"),
      (assign, "$g_leave_encounter", 1),
  ]],
  
  [party_tpl|pt_merchant_caravan,"start", [(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
      (eq,"$g_encountered_party",":quest_target_party"),
      (quest_slot_eq, "qst_escort_merchant_caravan", slot_quest_current_state, 0),
    ],
    "Greetings. You must be our escort, right?", "merchant_caravan_intro_1",[(quest_set_slot, "qst_escort_merchant_caravan", slot_quest_current_state, 1),]],
  
  [anyone|plyr,"merchant_caravan_intro_1", [], "Yes. My name is {playername}. I will lead you to {s1}.",
    "merchant_caravan_intro_2",[(quest_get_slot, ":quest_target_center", "qst_escort_merchant_caravan", slot_quest_target_center),
      (str_store_party_name, s1, ":quest_target_center"),
  ]],
  
  [anyone,"merchant_caravan_intro_2", [], "Well, it is good to know we won't travel alone. What do you want us to do now?", "escort_merchant_caravan_talk",[]],
  
  [party_tpl|pt_merchant_caravan,"start", [(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
      (eq, "$g_encountered_party", ":quest_target_party"),
    ],
    "Eh. We've made it this far... What do you want us to do?", "escort_merchant_caravan_talk",[]],
  
  [anyone|plyr,"escort_merchant_caravan_talk", [], "You follow my lead. I'll take you through a safe route.", "merchant_caravan_follow_lead",[]],
  [anyone,"merchant_caravan_follow_lead", [], "Alright. We'll be right behind you.", "close_window",[(assign, "$escort_merchant_caravan_mode", 0),
      (assign, "$g_leave_encounter", 1)]],
  [anyone|plyr,"escort_merchant_caravan_talk", [], "You stay here for a while. I'll go ahead and check the road.", "merchant_caravan_stay_here",[]],
  [anyone,"merchant_caravan_stay_here", [], "Alright. We'll be waiting here for you.", "close_window",[(assign, "$escort_merchant_caravan_mode", 1),
      (assign, "$g_leave_encounter", 1)]],
  #  [anyone|plyr,"escort_merchant_caravan_talk", [], "You go ahead to {s1}. I'll catch up with you.", "merchant_caravan_go_to_destination",[]],
  #  [anyone,"merchant_caravan_go_to_destination", [], "Alright. But stay close.", "close_window",[[assign,"escort_merchant_caravan_mode",2]]],
  
  
  # Troublesome bandits:
  [anyone,"merchant_quest_requested", [(eq, "$random_merchant_quest_no", "qst_troublesome_bandits")],
    "Actually, I was looking for an able adventurer like you. " +
    "There's this group of particularly troublesome bandits. " +
    "They have infested the vicinity of our town and are preying on my caravans. " +
    "They have avoided all the soldiers and the militias up to now. " +
    "If someone doesn't stop them soon, I am going to be ruined...", "merchant_quest_brief",
    []],
  
  [anyone,"merchant_quest_brief", [(eq,"$random_merchant_quest_no", "qst_troublesome_bandits")],
    "I will reward you handsomely if you hunt down those troublesome bandits. " +
    "It's dangerous work. But I believe that you are the {reg59?one:man} for it. " +
    "What do you say?", "troublesome_bandits_quest_brief",[]],
  
  [anyone|plyr,"troublesome_bandits_quest_brief", [],
    "Very well. I will hunt down those bandits.", "merchant_quest_taken_bandits",
    [(set_spawn_radius,7),
      (quest_get_slot, ":quest_giver_center", "qst_troublesome_bandits", slot_quest_giver_center),
      
      #limit size of quest party
      (store_mul, ":min", "$spawn_party_max_size", 55),
      (val_div, ":min", 100),
      (store_mul, ":max", "$spawn_party_max_size", 45),
      (val_div, ":max", 100),
      (set_party_creation_random_limits, ":min", ":max"),
      
      (spawn_around_party,":quest_giver_center","pt_troublesome_bandits"),
      (quest_set_slot, "qst_troublesome_bandits", slot_quest_target_party, reg0),
      (store_num_parties_destroyed,"$qst_troublesome_bandits_eliminated","pt_troublesome_bandits"),
      (store_num_parties_destroyed_by_player, "$qst_troublesome_bandits_eliminated_by_player", "pt_troublesome_bandits"),
      (str_store_troop_name, s9, "$g_talk_troop"),
      (str_store_party_name_link, s4, "$g_encountered_party"),
      
      (store_div, ":min", "$spawn_party_max_size", 5),
      (set_party_creation_random_limits, ":min", "$spawn_party_max_size"),
      (party_get_num_companion_stacks, ":num_stacks",reg0),
      (assign, ":total", 0),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop",reg0,":i_stack"),
        (party_stack_get_size, ":stack_size",reg0,":i_stack"),
        (store_character_level, ":troop_level", ":stack_troop"),
        (store_mul, ":troop_total",":troop_level", ":stack_size"),
        (val_add, ":total", ":troop_total"),
      (try_end),
      (val_div, ":total", 10),
      (val_mul, ":total", 10),
      (quest_set_slot, "qst_troublesome_bandits", slot_quest_gold_reward, ":total"),
      (val_mul, ":total", 3),
      (val_div, ":total", 2),
      (quest_set_slot, "qst_troublesome_bandits", slot_quest_xp_reward, ":total"),
      (setup_quest_text,"qst_troublesome_bandits"),
      (str_store_string, s2, "@Merchant {s9} of {s4} asked you to hunt down the troublesome bandits in the vicinity of the town."),
      (call_script, "script_start_quest", "qst_troublesome_bandits", "$g_talk_troop"),
      
  ]],
  [anyone,"merchant_quest_taken_bandits", [], "You will? Splendid. Good luck to you.", "close_window",
    []],
  
  [anyone|plyr,"troublesome_bandits_quest_brief", [],
    "Sorry. I don't have time for this right now.", "merchant_quest_stall",[]],
  
  # Kidnapped girl:
  [anyone,"merchant_quest_requested", [(eq, "$random_merchant_quest_no", "qst_kidnapped_girl")],
    "Actually, I was looking for a reliable {reg59?helper:man} that can undertake an important mission. " +
    "A group of bandits has kidnapped the daughter of a friend of mine and is holding her for ransom. " +
    "My friend is ready to pay them, but we still need " +
    "someone to take the money to those rascals and bring the girl back to safety.", "merchant_quest_brief",
    []],
  
  [anyone,"merchant_quest_brief", [(eq, "$random_merchant_quest_no", "qst_kidnapped_girl")],
    "The amount the bandits ask as ransom is {reg12} peningas. " +
    "I will give you that money once you accept to take the quest. " +
    "You have 15 days to take the money to the bandits who will be waiting near the village of {s4}. " +
    "Those bastards said that they are going to kill the poor girl if they don't get the money by that time. " +
    "You will get your pay of {reg8} peningas when you bring the girl safely back here.",
    "kidnapped_girl_quest_brief",[(quest_get_slot, ":quest_target_center", "qst_kidnapped_girl", slot_quest_target_center),
      (str_store_party_name, s4, ":quest_target_center"),
      (quest_get_slot, reg8, "qst_kidnapped_girl", slot_quest_gold_reward),
      (quest_get_slot, reg12, "qst_kidnapped_girl", slot_quest_target_amount),
  ]],
  
  [anyone|plyr,"kidnapped_girl_quest_brief", [],
    "All right, I will take the ransom money to the bandits and bring back the girl.",
    "kidnapped_girl_quest_taken",[(set_spawn_radius, 4),
      (quest_get_slot, ":quest_target_center", "qst_kidnapped_girl", slot_quest_target_center),
      (quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
      
      #limit size of quest party
      (store_mul, ":min", "$spawn_party_max_size", 55),
      (val_div, ":min", 100),
      (store_mul, ":max", "$spawn_party_max_size", 45),
      (val_div, ":max", 100),
      (set_party_creation_random_limits, ":min", ":max"),
      
      (spawn_around_party,":quest_target_center","pt_bandits_awaiting_ransom"),
      (assign, ":quest_target_party", reg0),
      (quest_set_slot, "qst_kidnapped_girl", slot_quest_target_party, ":quest_target_party"),
      (party_set_ai_behavior, ":quest_target_party", ai_bhvr_hold),
      (party_set_ai_object, ":quest_target_party", "p_main_party"),
      (party_set_flags, ":quest_target_party", pf_default_behavior, 0),
      (call_script, "script_troop_add_gold", "trp_player", ":quest_target_amount"),
      (assign, reg12, ":quest_target_amount"),
      (str_store_troop_name, s1, "$g_talk_troop"),
      (str_store_party_name_link, s4, "$g_encountered_party"),
      (str_store_party_name_link, s3, ":quest_target_center"),
      (setup_quest_text, "qst_kidnapped_girl"),
      (str_store_string, s2, "@The mayor of {s4} gave you {reg12} peningas to pay the ransom of a girl kidnapped by bandits. " +
        "You are to meet the bandits near {s3} and pay them the ransom fee. " +
      "After that, you are to bring the girl back to {s4}."),
      (call_script, "script_start_quest", "qst_kidnapped_girl", "$g_talk_troop"),
      
      (store_div, ":min", "$spawn_party_max_size", 5),
      (set_party_creation_random_limits, ":min", "$spawn_party_max_size"),
  ]],
  
  [anyone,"kidnapped_girl_quest_taken", [], "Good. I knew we could trust you at this. " +
    "Here is the ransom money, {reg12} peningas. " +
    "Count it before taking it. " +
    "And please, don't attempt to do anything rash. " +
    "Keep in mind that the girl's well being is more important than anything else...", "close_window",
    []],
  
  [anyone|plyr,"kidnapped_girl_quest_brief", [],
    "Sorry. I don't have time for this right now.", "merchant_quest_stall",[]],
  
  
  [trp_kidnapped_girl,"start",
    [
      (eq, "$talk_context", tc_entering_center_quest_talk),
    ],
    "Thank you so much for bringing me back! " +
    "I can't wait to see my family. Farewell.",
    "close_window",
    [(remove_member_from_party, "trp_kidnapped_girl"),
      (quest_set_slot, "qst_kidnapped_girl", slot_quest_current_state, 4),
  ]],
  
  
  
  [trp_kidnapped_girl|plyr,"kidnapped_girl_liberated_map", [], "Yes. Come with me. We are going home.", "kidnapped_girl_liberated_map_2a",[]],
  [trp_kidnapped_girl,"kidnapped_girl_liberated_map_2a", [(neg|party_can_join)], "Unfortunately, you do not have room in your party for me.", "close_window",[(assign, "$g_leave_encounter",1)]],
  [trp_kidnapped_girl,"kidnapped_girl_liberated_map_2a", [], "Oh really? Thank you so much!",
    "close_window", [(party_join),
      (quest_set_slot, "qst_kidnapped_girl", slot_quest_current_state, 3),
      (assign, "$g_leave_encounter",1)]],
  [trp_kidnapped_girl|plyr,"kidnapped_girl_liberated_map", [], "Wait here a while longer. I'll come back for you.", "kidnapped_girl_liberated_map_2b",[]],
  [trp_kidnapped_girl,"kidnapped_girl_liberated_map_2b", [], "Oh, please {reg59?madam:sir}, do not leave me here all alone!", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  
  [trp_kidnapped_girl,"start", [],
    "Oh {reg59?madam:sir}. Thank you so much for rescuing me. Will you take me to my family now?", "kidnapped_girl_liberated_map",[]],
  
  [trp_kidnapped_girl|plyr,"kidnapped_girl_liberated_battle", [], "Yes. Come with me. We are going home.", "kidnapped_girl_liberated_battle_2a",[]],
  [trp_kidnapped_girl,"kidnapped_girl_liberated_battle_2a", [(neg|hero_can_join, "p_main_party")], "Unfortunately, you do not have room in your party for me.", "kidnapped_girl_liberated_battle_2b",[]],
  [trp_kidnapped_girl,"kidnapped_girl_liberated_battle_2a", [], "Oh really? Thank you so much!",
    "close_window",[(party_add_members, "p_main_party","trp_kidnapped_girl",1),
      (quest_set_slot, "qst_kidnapped_girl", slot_quest_current_state, 3),
  ]],
  [trp_kidnapped_girl|plyr,"kidnapped_girl_liberated_battle", [], "Wait here a while longer. I'll come back for you.", "kidnapped_girl_liberated_battle_2b",[]],
  [trp_kidnapped_girl,"kidnapped_girl_liberated_battle_2b", [], "Oh, please {reg59?madam:sir}, do not leave me here all alone!",
    "close_window", [(add_companion_party,"trp_kidnapped_girl"),
      (assign, "$g_leave_encounter",1)]],
  
  [trp_kidnapped_girl,"start", [], "Can I come with you now?", "kidnapped_girl_liberated_map",[]],
  
  
  [party_tpl|pt_bandits_awaiting_ransom,"start", [(quest_slot_eq, "qst_kidnapped_girl", slot_quest_current_state, 0),],
    "Are you the one that brought the ransom? " +
    "Quick, give us the money now.", "bandits_awaiting_ransom_intro_1",[(quest_set_slot, "qst_kidnapped_girl", slot_quest_current_state, 1),]],
  [party_tpl|pt_bandits_awaiting_ransom,"start", [(quest_slot_eq, "qst_kidnapped_girl", slot_quest_current_state, 1),],
    "You came back? " +
    "Quick, give us the money now.", "bandits_awaiting_ransom_intro_1",[]],
  [party_tpl|pt_bandits_awaiting_ransom|plyr, "bandits_awaiting_ransom_intro_1", [(store_troop_gold, ":cur_gold"),
      (quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
      (ge, ":cur_gold", ":quest_target_amount")
    ],
    "Here, take the money. Just set the girl free.", "bandits_awaiting_ransom_pay",[]],
  [party_tpl|pt_bandits_awaiting_ransom, "bandits_awaiting_ransom_pay", [],
    "Heh. You've brought the money all right. " +
    "You can take the girl now. " +
    "It was a pleasure doing business with you...", "close_window",
    [(quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
      (quest_get_slot, ":quest_target_party", "qst_kidnapped_girl", slot_quest_target_party),
      (quest_get_slot, ":quest_target_center", "qst_kidnapped_girl", slot_quest_target_center),
      (troop_remove_gold, "trp_player", ":quest_target_amount"),
      (remove_member_from_party, "trp_kidnapped_girl", ":quest_target_party"),
      (set_spawn_radius, 1),
      (spawn_around_party, ":quest_target_party", "pt_kidnapped_girl"),
      (assign, ":girl_party", reg0),
      (party_set_ai_behavior, ":girl_party", ai_bhvr_hold),
      (party_set_flags, ":girl_party", pf_default_behavior, 0),
      (quest_set_slot, "qst_kidnapped_girl", slot_quest_current_state, 2),
      (party_set_ai_behavior, ":quest_target_party", ai_bhvr_travel_to_party),
      (party_set_ai_object, ":quest_target_party", ":quest_target_center"),
      (party_set_flags, ":quest_target_party", pf_default_behavior, 0),
      (add_gold_to_party, ":quest_target_amount", ":quest_target_party"),
      (assign, "$g_leave_encounter",1),
  ]],
  
  [anyone|plyr, "bandits_awaiting_ransom_intro_1", [],
    "No way! You release the girl first.", "bandits_awaiting_ransom_b",[]],
  [anyone, "bandits_awaiting_ransom_b", [],
    "You fool! Stop playing games and give us the money! ", "bandits_awaiting_ransom_b2",[]],
  [anyone|plyr, "bandits_awaiting_ransom_b2", [(store_troop_gold, ":cur_gold"),
      (quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
      (ge, ":cur_gold", ":quest_target_amount")],
    "All right. Here's your money. Let the girl go now.", "bandits_awaiting_ransom_pay",[]],
  [anyone|plyr, "bandits_awaiting_ransom_b2", [],
    "I had left the money in a safe place. Let me go fetch it.", "bandits_awaiting_ransom_no_money",[]],
  [anyone, "bandits_awaiting_ransom_no_money", [],
    "Are you testing our patience or something?  Go and bring that money here quickly.", "close_window",[(assign, "$g_leave_encounter",1)]],
  [anyone|plyr, "bandits_awaiting_ransom_b2", [],
    "I have no intention to pay you anything. I demand that you release the girl now!", "bandits_awaiting_ransom_fight",[]],
  [anyone, "bandits_awaiting_ransom_fight", [],
    "You won't be demanding anything when you're dead.", "close_window",[(encounter_attack),]],
  
  [party_tpl|pt_bandits_awaiting_ransom,"start", [(quest_slot_ge, "qst_kidnapped_girl", slot_quest_current_state, 2),],
    "What's it? You have given us the money. We have no more business.", "bandits_awaiting_remeet",[]],
  [anyone|plyr,"bandits_awaiting_remeet", [],
    "Sorry to bother you. I'll be on my way now.", "close_window",[(assign, "$g_leave_encounter",1)]],
  [anyone|plyr,"bandits_awaiting_remeet", [],
    "We have one more business. You'll give the money back to me.", "bandits_awaiting_remeet_2",[]],
  [anyone,"bandits_awaiting_remeet_2", [],
    "Oh, that business! Of course. Let us get down to it.", "close_window",[(encounter_attack)]],
  
  [party_tpl|pt_kidnapped_girl,"start", [],
    "Oh {reg59?madam:sir}. Thank you so much for rescuing me. Will you take me to my family now?", "kidnapped_girl_encounter_1",[]],
  [anyone|plyr,"kidnapped_girl_encounter_1", [], "Yes. Come with me. I'll take you home.", "kidnapped_girl_join",[]],
  [anyone,"kidnapped_girl_join", [(neg|party_can_join)], "Unfortunately. You do not have room in your party for me.", "close_window",[(assign, "$g_leave_encounter",1)]],
  [anyone,"kidnapped_girl_join", [], "Oh, thank you so much!",
    "close_window",[(party_join),
      (quest_set_slot, "qst_kidnapped_girl", slot_quest_current_state, 3),
      (assign, "$g_leave_encounter",1)]],
  [anyone|plyr,"kidnapped_girl_encounter_1", [], "Wait here a while longer. I'll come back for you.", "kidnapped_girl_wait",[]],
  [anyone,"kidnapped_girl_wait", [], "Oh, please {reg59?madam:sir}, do not leave me here all alone!", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  [anyone|plyr,"merchant_quest_about_job_2", [(store_partner_quest, ":partner_quest"),
      (eq, ":partner_quest", "qst_kidnapped_girl"),
      (quest_slot_eq, "qst_kidnapped_girl", slot_quest_current_state, 3),
      (neg|main_party_has_troop, "trp_kidnapped_girl")],
    "Unfortunately, I lost the girl on the way here...", "lost_kidnapped_girl",[]],
  [anyone,"lost_kidnapped_girl", [],
    "Oh no! How am I going to tell this to my friend?", "lost_kidnapped_girl_2",[]],
  [anyone|plyr,"lost_kidnapped_girl_2", [],
    "I'm sorry. I could do nothing about it.", "lost_kidnapped_girl_3",[]],
  [anyone,"lost_kidnapped_girl_3", [],
    "You let me down {playername}. I had trusted you. " +
    "I will let people know of your incompetence at this task. " +
    "Also, I want back that {reg8} peningas I gave you as the ransom fee.", "lost_kidnapped_girl_4",
    [(quest_get_slot, reg8, "qst_kidnapped_girl", slot_quest_target_amount),
      (try_for_parties, ":cur_party"),
        (party_count_members_of_type, ":num_members", ":cur_party", "trp_kidnapped_girl"),
        (gt, ":num_members", 0),
        (party_remove_members, ":cur_party", "trp_kidnapped_girl", 1),
        (party_remove_prisoners, ":cur_party", "trp_kidnapped_girl", 1),
      (try_end),
      (call_script, "script_end_quest", "qst_kidnapped_girl"),
      (call_script, "script_change_troop_renown", "trp_player", -5),
  ]],
  [anyone|plyr, "lost_kidnapped_girl_4", [(store_troop_gold,":gold"),
      (quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
      (ge,":gold",":quest_target_amount"),
    ],
    "Of course. Here you are...", "merchant_quest_about_job_5a",[(quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
      (troop_remove_gold, "trp_player",":quest_target_amount"),
  ]],
  [anyone,"merchant_quest_about_job_5a", [],
    "At least you have the decency to return the money.", "close_window",[]],
  [anyone|plyr,"lost_kidnapped_girl_4", [],
    "Sorry. I don't have that amount with me.", "merchant_quest_about_job_5b",[]],
  [anyone,"merchant_quest_about_job_5b", [],
    "Do you expect me to believe that? You are going to pay that ransom fee back! Go and bring the money now!",
    "close_window",[(quest_get_slot, ":quest_target_amount", "qst_kidnapped_girl", slot_quest_target_amount),
      (val_add, "$debt_to_merchants_guild", ":quest_target_amount"),
  ]],
  
  
  #  Give us the money now. Quick.
  # Here, take the money. Just set the girl free.
  # Heh, It was a pleasure doing business with you.
  
  # You set the girl free first. You'll have the money afterwards.
  # Stop playing games.
  
  #persuade_lords_to_make_peace
  [anyone,"merchant_quest_requested", [(eq, "$random_merchant_quest_no", "qst_persuade_lords_to_make_peace"),
      (quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
      (quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
      (quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
      (str_store_troop_name_link, s12, ":quest_object_troop"),
      (str_store_troop_name_link, s13, ":quest_target_troop"),
      (str_store_faction_name_link, s14, ":quest_target_faction"),
      (str_store_faction_name_link, s15, "$g_encountered_party_faction"),],
    "This war between the {s15} and the {s14} has brought our town to the verge of ruin. " +
    "Our caravans get raided before they can reach their destination. " +
    "Our merchants are afraid to leave the safety of the town walls. " +
    "And as if those aren't enough, the taxes to maintain the war take away the last bits of our savings. " +
    "If peace does not come soon, we cannot hold on for much longer.", "merchant_quest_persuade_peace_1",
    []],
  
  [anyone|plyr,"merchant_quest_persuade_peace_1", [], "You are right, but who can stop this madness called war?", "merchant_quest_brief",[]],
  [anyone|plyr,"merchant_quest_persuade_peace_1", [], "It is your duty to help the nobles in their war effort. You shouldn't complain about it.", "merchant_quest_persuade_peace_reject",[]],
  
  [anyone,"merchant_quest_persuade_peace_reject", [], "Hah. The nobles fight their wars for their greed and their dreams of glory. " +
    "And it is poor honest folk like us who have to bear the real burden. " +
    "But you obviously don't want to hear about that.", "close_window",[]],
  
  [anyone,"merchant_quest_brief", [(eq,"$random_merchant_quest_no","qst_persuade_lords_to_make_peace")],
    "There have been attempts to reconcile the two sides and reach a settlement. " +
    "However, there are powerful lords on both sides whose interests lie in continuing the war. " +
    "These men urge all others not to heed to the word of sensible men, but to keep fighting. " +
    "While these leaders remain influential, no peace settlement can be reached.", "merchant_quest_persuade_peace_3",[]],
  
  [anyone|plyr,"merchant_quest_persuade_peace_3", [], "Who are these warmongers who block the way of peace?", "merchant_quest_persuade_peace_4",[]],
  [anyone|plyr,"merchant_quest_persuade_peace_3", [], "Who are these lords you speak of?", "merchant_quest_persuade_peace_4",[]],
  
  [anyone,"merchant_quest_persuade_peace_4", [], "They are {s12} from the {s15} and {s13} from the {s14}. Until they change their mind or lose their influence, " +
    "there will be no chance of having peace between the two sides.", "merchant_quest_persuade_peace_5",[
      (quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
      (quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
      (quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
      (str_store_troop_name_link, s12, ":quest_object_troop"),
      (str_store_troop_name_link, s13, ":quest_target_troop"),
      (str_store_faction_name_link, s14, ":quest_target_faction"),
      (str_store_faction_name_link, s15, "$g_encountered_party_faction"),
  ]],
  
  [anyone|plyr,"merchant_quest_persuade_peace_5", [], "What can be done about this?", "merchant_quest_persuade_peace_6",[]],
  [anyone|plyr,"merchant_quest_persuade_peace_5", [], "Alas, it seems nothing can be done about it.", "merchant_quest_persuade_peace_6",[]],
  
  [anyone,"merchant_quest_persuade_peace_6", [], "There is a way to resolve the issue. " +
    "A particularly determined person can perhaps persuade one or both of these lords to accept making peace. " +
    "And even if that fails, it can be possible to see that these lords are defeated by force and taken prisoner. " +
    "If they are captive, they will lose their influence and they can no longer oppose a settlement... What do you think? Can you do it?",
    "merchant_quest_persuade_peace_7",[]],
  
  [anyone|plyr,"merchant_quest_persuade_peace_7", [], "It seems difficult, but I will try.", "merchant_quest_persuade_peace_8",[]],
  [anyone|plyr,"merchant_quest_persuade_peace_7", [], "If the price is right, I may.", "merchant_quest_persuade_peace_8",[]],
  [anyone|plyr,"merchant_quest_persuade_peace_7", [], "Forget it. This is not my problem.", "merchant_quest_persuade_peace_8",[]],
  
  [anyone,"merchant_quest_persuade_peace_8", [], "Most of the merchants in the town will gladly open up their purses to support such a plan. " +
    "I think we can collect {reg12} peningas between ourselves. " +
    "We will be happy to reward you with that sum, if you can work this out. " +
    "Convince {s12} and {s13} to accept a peace settlement, " +
    "and if either of them proves too stubborn, make sure he falls captive and cannot be ransomed until a peace deal is settled.",
    "merchant_quest_persuade_peace_9",[
      (quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
      (quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
      (str_store_troop_name_link, s12, ":quest_object_troop"),
      (str_store_troop_name_link, s13, ":quest_target_troop"),
      (quest_get_slot, ":quest_reward", "qst_persuade_lords_to_make_peace", slot_quest_gold_reward),
      (assign, reg12, ":quest_reward")]],
  
  [anyone|plyr,"merchant_quest_persuade_peace_9", [], "All right, I will do my best.", "merchant_quest_persuade_peace_10",[]],
  [anyone|plyr,"merchant_quest_persuade_peace_9", [], "Sorry. I cannot do this.", "merchant_quest_persuade_peace_no",[]],
  
  [anyone,"merchant_quest_persuade_peace_10", [], "Excellent. You will have our blessings. " +
    "I hope you can deal with those two old goats. " +
    "We will be waiting and hoping for the good news.", "close_window",[
      (str_store_party_name_link, s4, "$g_encountered_party"),
      (quest_get_slot, ":quest_target_faction", "qst_persuade_lords_to_make_peace", slot_quest_target_faction),
      (quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
      (quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
      (quest_get_slot, ":quest_reward", "qst_persuade_lords_to_make_peace", slot_quest_gold_reward),
      (assign, reg12, ":quest_reward"),
      (str_store_troop_name_link, s12, ":quest_object_troop"),
      (str_store_troop_name_link, s13, ":quest_target_troop"),
      (str_store_faction_name_link, s14, ":quest_target_faction"),
      (str_store_faction_name_link, s15, "$g_encountered_party_faction"),
      (setup_quest_text,"qst_persuade_lords_to_make_peace"),
      (str_store_string, s2, "@The mayor of {s4} promised you {reg12} peningas if you can make sure that " +
        "{s12} and {s13} no longer pose a threat to a peace settlement between the {s15} and the {s14}. " +
      "In order to do that, you must either convince them or make sure they fall captive and remain so until a peace agreement is made."),
      (call_script, "script_start_quest", "qst_persuade_lords_to_make_peace", "$g_talk_troop"),
      (quest_get_slot, ":quest_object_troop", "qst_persuade_lords_to_make_peace", slot_quest_object_troop),
      (quest_get_slot, ":quest_target_troop", "qst_persuade_lords_to_make_peace", slot_quest_target_troop),
      (call_script, "script_report_quest_troop_positions", "qst_persuade_lords_to_make_peace", ":quest_object_troop", 3),
      (call_script, "script_report_quest_troop_positions", "qst_persuade_lords_to_make_peace", ":quest_target_troop", 4),
  ]],
  
  [anyone,"merchant_quest_persuade_peace_no", [], "Don't say no right away. Think about this for some time. " +
    "If there is a {reg59?lady:man} who can manage to do this, it is you.",
    "close_window",[]],
  
  
  #deal with night bandits
  [anyone,"merchant_quest_requested",
    [
      (eq, "$random_merchant_quest_no", "qst_deal_with_night_bandits"),
    ],
    "Do I indeed! There's a group of bandits infesting the town, and I'm at the end of my rope as to how to deal with them. " +
    "They've been ambushing and robbing townspeople under the cover of night. " +
    "Then they fade away, quick as lightning, when the guards finally show up. We've not been able to catch a one of them. " +
    "They only attack lone people, never daring to show themselves when there's a group about. " +
    "I need someone who can take on these bandits alone and win. That seems to be the only way of bringing them to justice. " +
    "Are you up to the task?", "merchant_quest_deal_with_night_bandits",
    []],
  
  [anyone,"merchant_quest_brief",
    [
      (eq,"$random_merchant_quest_no","qst_deal_with_night_bandits"),
    ],
    "There's a group of bandits infesting the town, and I'm at the end of my rope as to how to deal with them. " +
    "They've been ambushing and robbing townspeople under the cover of night. " +
    "Then they fade away, quick as lightning, when the guards finally show up. We've not been able to catch a one of them. " +
    "They only attack lone people, never daring to show themselves when there's a group about. " +
    "I need someone who can take on these bandits alone and win. That seems to be the only way of bringing them to justice. " +
    "Are you up to the task?", "merchant_quest_deal_with_night_bandits",
    []],
  
  [anyone|plyr,"merchant_quest_deal_with_night_bandits", [],
    "Killing bandits? Why, certainly!",
    "deal_with_night_bandits_quest_taken",
    [
      (str_store_party_name_link, s14, "$g_encountered_party"),
      (setup_quest_text, "qst_deal_with_night_bandits"),
      (str_store_string, s2, "@The mayor of {s14} has asked you to deal with a group of bandits terrorising the streets of {s14}. They only come out at night, and only attack lone travellers on the streets."),
      (call_script, "script_start_quest", "qst_deal_with_night_bandits", "$g_talk_troop"),
  ]],
  
  [anyone|plyr, "merchant_quest_deal_with_night_bandits", [],
    "My apologies, I'm not interested.", "merchant_quest_stall",[]],
  
  [anyone,"deal_with_night_bandits_quest_taken", [], "That takes a weight off my shoulders, {playername}. " +
    "You can expect a fine reward if you come back successful. Just don't get yourself killed, eh?", "mayor_pretalk",[]],
  
  
  #move cattle herd
  [anyone,"merchant_quest_requested", [(eq, "$random_merchant_quest_no", "qst_move_cattle_herd"),
      (quest_get_slot, ":target_center", "qst_move_cattle_herd", slot_quest_target_center),
      (str_store_party_name,s13,":target_center"),],
    "One of the merchants here is looking for herdsmen to take his cattle to the market in {s13}.", "merchant_quest_brief",
    []],
  
  [anyone,"merchant_quest_brief",
    [
      (eq,"$random_merchant_quest_no","qst_move_cattle_herd"),
      (quest_get_slot, reg8, "qst_move_cattle_herd", slot_quest_gold_reward),
      (quest_get_slot, ":target_center", "qst_move_cattle_herd", slot_quest_target_center),
      (str_store_party_name, s13, ":target_center"),
    ],
    "The cattle herd must be at {s13} within 30 days. Sooner is better, much better, " +
    "but it must be absolutely no later than 30 days. " +
    "If you can do that, I'd be willing to pay you {reg8} peningas for your trouble. Interested?", "move_cattle_herd_quest_brief",
    []],
  
  [anyone|plyr,"move_cattle_herd_quest_brief", [],  "Aye, I can take the herd to {s13}.",
    "move_cattle_herd_quest_taken",
    [
      (call_script, "script_create_cattle_herd", "$g_encountered_party", 0),
      (quest_set_slot, "qst_move_cattle_herd", slot_quest_target_party, reg0),
      (str_store_party_name_link, s10,"$g_encountered_party"),
      (quest_get_slot, ":target_center", "qst_move_cattle_herd", slot_quest_target_center),
      (str_store_party_name_link, s13, ":target_center"),
      (quest_get_slot, reg8, "qst_move_cattle_herd", slot_quest_gold_reward),
      (setup_quest_text, "qst_move_cattle_herd"),
      (str_store_string, s2, "@The mayor of {s10} asked you to move a cattle herd to {s13}. You will earn {reg8} peningas in return."),
      (call_script, "script_start_quest", "qst_move_cattle_herd", "$g_talk_troop"),
  ]],
  [anyone|plyr,"move_cattle_herd_quest_brief", [],
    "I am sorry, but no.", "merchant_quest_stall",[]],
  
  [anyone,"move_cattle_herd_quest_taken", [], "Splendid. You can find the herd right outside the town. " +
    "After you take the animals to {s13}, come back to me and you will get your pay.", "mayor_pretalk",[]],
  
  [anyone,"merchant_quest_requested", [(eq, "$random_merchant_quest_no", "qst_blank_quest_10"),
      (quest_get_slot, ":quest_target_item", "qst_blank_quest_10", slot_quest_target_item),
      #										(quest_get_slot, ":quest_target_center", "qst_blank_quest_10", slot_quest_target_center),
      (quest_get_slot, ":quest_gold_reward", "qst_blank_quest_10", slot_quest_gold_reward),
      (assign, reg33, ":quest_gold_reward"),
      (str_store_item_name,s13,":quest_target_item"),
      (store_random_in_range, ":name", "str_name_1", "str_surname_1"),
      (str_store_string, s50, ":name"),
      (str_store_string, s33, "@Yes, {playername}, I have a delicate task to ask of you. I was in the possession of a wonderful musical " +
        "instrument, a {s13}, which was made by one of the greatest artisans of yore, {s50} of... well, not really sure where he was from. Regardless, it looks like it was stolen " +
        "from me by a local guard. He went into hiding, and no one can find him. He's probably hiding in one of the local villages nearby. If you return {s13} to me, I will reward you with " +
      "{reg33} peningas."),
      (assign, "$temp", ":quest_target_item"),
      (assign, "$temp2", ":quest_gold_reward"),],
    "{!}{s33}", "merchant_quest10_brief",[]],
  [anyone|plyr,"merchant_quest10_brief", [
      (str_store_item_name, s13, "$temp"),],  "No problem. I will bring your {s13} back.",
    "merchant_quest10_taken",
    [ (str_store_party_name_link, s3,"$g_encountered_party"),
      (quest_set_slot, "qst_blank_quest_10", slot_quest_current_state, 0),
      (quest_get_slot, ":quest_giver_troop", "qst_blank_quest_10", slot_quest_giver_troop),
      (str_store_troop_name, s9, ":quest_giver_troop"),
      (setup_quest_text, "qst_blank_quest_10"),
      
      #villages to investigate
      
      (str_clear, s11),
      (str_clear, s10),
      (quest_get_slot, ":giver_center_no", "qst_blank_quest_10", slot_quest_giver_center),
      (assign, ":distance", 50), #before 50 km
      (try_for_range,":cur_village", villages_begin, villages_end),
        (store_distance_to_party_from_party, ":cur_distance", ":cur_village", ":giver_center_no"),
        (lt,  ":cur_distance", ":distance"),
        (str_store_party_name_link, s11, ":cur_village"),
        (str_store_string, s10, "@{s10}^{s11}"),
      (try_end),
      ####
      (str_store_string, s2, "@The {s9} of {s3} asked you to recover a {s13} stolen from him.^^Look Into:^{s10}"),
      (call_script, "script_start_quest", "qst_blank_quest_10", "$g_talk_troop"),
  ]],
  [anyone|plyr,"merchant_quest10_brief", [],
    "I am sorry, but no.", "merchant_quest_stall",[]],
  
  [anyone,"merchant_quest_requested", [(eq, "$random_merchant_quest_no", "qst_blank_quest_11"),
      (quest_get_slot, ":quest_target_item", "qst_blank_quest_11", slot_quest_target_item),
      (quest_get_slot, ":quest_target_amount", "qst_blank_quest_11", slot_quest_target_amount),
      (assign, reg33, ":quest_target_amount"),
      (str_store_item_name,s13,":quest_target_item"),
      (try_begin),
        (eq, ":quest_target_item", "itm_stone"),
        (str_store_string, s33, "@Yes, {playername}, one of the merchants here is looking to expand, and he needs some stone for that. Unfortunately, " +
          "with all the fighting around, bandits and all that, he was unable to procure the stone at the acceptable price. Perhaps, you can go to the nearest " +
        "stone quarry and get {reg33} loads of stone?"),
      (else_try),
        (eq, ":quest_target_item", "itm_salt"),
        (str_store_string, s33, "@Yes, {playername}, one of the merchants here had an unusually high demand for salt lately, and he is running low. Unfortunately, " +
          "with all the fighting around, bandits and all that, his last shipment never arrived, and he was unable to procure the salt at the acceptable price. Perhaps, you can go to the nearest " +
        "salt mine and get {reg33} loads of salt for him?"),
      (try_end),
      (assign, "$temp", ":quest_target_item"),
      (assign, "$temp2", ":quest_target_amount"),
    ],
    "{!}{s33}", "merchant_quest11_brief",[]],
  [anyone|plyr,"merchant_quest11_brief", [(assign, reg33, "$temp2"),
      (str_store_item_name, s33, "$temp"),],  "Aye, I will bring you {reg33} loads of {s33}.",
    "merchant_quest11_taken",
    [ (str_store_party_name_link, s3,"$g_encountered_party"),
      (setup_quest_text, "qst_blank_quest_11"),
      (str_store_troop_name, s9, "$g_talk_troop"),
      (str_store_string, s2, "@{s9} of {s3} asked you to bring {reg33} loads of {s33}."),
      (call_script, "script_start_quest", "qst_blank_quest_11", "$g_talk_troop"),
  ]],
  [anyone|plyr,"merchant_quest11_brief", [],
    "I am sorry, but no.", "merchant_quest_stall",[]],
  
  [anyone,"merchant_quest10_taken", [(is_between, "$g_talk_troop", mayors_begin, mayors_end),
      (str_store_item_name, s13, "$temp"),], "Splendid. Good luck on finding the rascal and bringing my {s13} back.", "mayor_pretalk",[]],
  [anyone,"merchant_quest10_taken", [(is_between, "$g_talk_troop", "trp_castle_1_seneschal", "trp_town_1_arena_master"),
      (str_store_item_name, s33, "$temp"),], "Splendid. Good luck on finding the rascal and bringing my {s13} back.", "reeve_pretalk",[]],
  [anyone,"merchant_quest11_taken", [(assign, reg33, "$temp2"),(is_between, "$g_talk_troop", mayors_begin, mayors_end),
      (str_store_item_name, s33, "$temp"),], "Splendid. Bring {reg33} loads of {s33} here, and I will reimburse you for your expenses.", "mayor_pretalk",[]],
  [anyone,"merchant_quest11_taken", [(assign, reg33, "$temp2"),(is_between, "$g_talk_troop", "trp_castle_1_seneschal", "trp_town_1_arena_master"),
      (str_store_item_name, s33, "$temp"),], "Splendid. Bring {reg33} loads of {s33} here, and I will reimburse you for your expenses.", "reeve_pretalk",[]],
  
  #################################################
  #################### Random merchant quests end
  
  [anyone,"merchant_quest_requested", [(is_between, "$g_talk_troop", mayors_begin, mayors_end),], "I am afraid I can't offer you a job right now.", "mayor_pretalk",[]],
  [anyone,"merchant_quest_requested", [(is_between, "$g_talk_troop", "trp_castle_1_seneschal", "trp_town_1_arena_master"),], "I am afraid I can't offer you a job right now.", "reeve_pretalk",[]],
  
  
  #Village elders
  
  [anyone,"start", [(is_between,"$g_talk_troop",village_elders_begin,village_elders_end),
      (store_partner_quest,":elder_quest"),
      (eq,":elder_quest","qst_deliver_cattle"),
      (check_quest_succeeded, ":elder_quest"),
      (quest_get_slot, reg5, "qst_deliver_cattle", slot_quest_target_amount)],
    "My good {reg59?madam:sir}. Our village is grateful for your help. Thanks to the {reg5} head of cattle you have brought, we can now raise our own herd.", "village_elder_deliver_cattle_thank",
    [(add_xp_as_reward, 400),
      #    (quest_get_slot, ":num_cattle", "qst_deliver_cattle", slot_quest_target_amount),
      #    (party_set_slot, "$current_town", slot_village_number_of_cattle, ":num_cattle"),
      (call_script, "script_change_center_prosperity", "$current_town", 4),
      (call_script, "script_change_player_relation_with_center", "$current_town", 12),
      (call_script, "script_end_quest", "qst_deliver_cattle"),
      #Troop commentaries begin
      (call_script, "script_add_log_entry", logent_helped_peasants, "trp_player",  "$current_town", -1, -1),
      #Troop commentaries end
  ]],
  
  ## VC-1883 begin
  [anyone,"start", [(is_between,"$g_talk_troop",village_elders_begin,village_elders_end),
      (store_partner_quest,":elder_quest"),
      (eq,":elder_quest","qst_blank_quest_7"),
      (quest_slot_eq, ":elder_quest", slot_quest_current_state, 3),
      
      (neg|check_quest_failed, "qst_blank_quest_7"),
      (call_script, "script_succeed_quest", ":elder_quest"),
      (call_script, "script_end_quest", ":elder_quest"),
      (add_xp_as_reward, 200),
      (call_script, "script_change_player_relation_with_center", "$current_town", 4),
    ],
    "My good {reg59?madam:sir}. Our village is grateful for your help. The slave will be punished now.", "village_elder_deliver_cattle_thank",
    [
      (store_conversation_agent,"$talk_agent"),
      (get_player_agent_no, ":player_agent"),
      (set_fixed_point_multiplier, 100),
      (agent_get_position, pos1, "$talk_agent"),
      (position_move_y, pos1, 400),
      
      (set_spawn_position, pos1),
      (spawn_agent, "trp_slave"),
      (assign, "$alpha_animal", reg0),
      (agent_set_no_death_knock_down_only, "$alpha_animal", 1),
      (agent_add_relation_with_agent, ":player_agent", "$alpha_animal", 0),
      (agent_get_position, pos1, "$talk_agent"),
      (position_move_y, pos1, 500),
      (position_move_x, pos1, -50),
      (set_spawn_position, pos1),
      (try_for_range, ":unused", 0, 2),
        (spawn_agent, "trp_farmer"),
        (assign, ":agent", reg0),
        (agent_add_relation_with_agent, ":agent", "$alpha_animal", -1),
        (agent_add_relation_with_agent, ":player_agent", ":agent", 0),
        (agent_set_is_alarmed, ":agent", 1),
        (agent_ai_set_always_attack_in_melee, ":agent", 1),
        (agent_ai_set_aggressiveness, ":agent", 1000),
        (try_for_range, ":item_slot", 0, 4),
          (agent_get_item_slot,  ":item", ":agent", ":item_slot"),
          (gt, ":item", -1),
          (agent_unequip_item, ":agent", ":item"),
        (try_end),
        (agent_equip_item, ":agent", "itm_club_hard"),
        (agent_set_wielded_item, ":agent", "itm_club_hard"),
        (position_move_x, pos1, 100),
        (set_spawn_position, pos1),
      (end_try),
      
      (mission_disable_talk),	#?
  ]],
  
  [anyone,"start", [(is_between,"$g_talk_troop",village_elders_begin,village_elders_end),
      (store_partner_quest,":elder_quest"),
      (eq,":elder_quest","qst_blank_quest_7"),
      (quest_slot_eq, ":elder_quest", slot_quest_current_state, 3),
      
      (check_quest_failed, "qst_blank_quest_7"),
      (call_script, "script_change_player_relation_with_center", "$current_town", -3),
      #(call_script, "script_abort_quest", "qst_blank_quest_7"),
      (call_script, "script_end_quest", ":elder_quest"),
    ],
    "My good {reg59?madam:sir}. You tried, but you returned without the slave. I guess you couldn't find him...", "village_elder_pretalk",
    []],
  
  
  ## VC-1883 end
  
  [anyone,"village_elder_deliver_cattle_thank", [],
    "My good {reg59?lady:lord}, please, is there anything I can do for you?", "village_elder_talk",[]],
  
  
  ##  [anyone,"start",
  ##   [
  ##     (is_between, "$g_talk_troop", village_elders_begin, village_elders_end),
  ##     (store_partner_quest, ":elder_quest"),
  ##     (eq, ":elder_quest", "qst_train_peasants_against_bandits"),
  ##     (check_quest_succeeded, ":elder_quest"),
  ##     (quest_get_slot, reg5, "qst_train_peasants_against_bandits", slot_quest_target_amount)],
  ##   "Oh, thank you so much for training our men. Now we may stand a chance against those accursed bandits if they come again.", "village_elder_train_peasants_against_bandits_thank",
  ##   [
  ##     (add_xp_as_reward, 400),
  ##     (call_script, "script_change_player_relation_with_center", "$current_town", 5),
  ##     (call_script, "script_end_quest", "qst_train_peasants_against_bandits"),
  ##     (call_script, "script_add_log_entry", logent_helped_peasants, "trp_player",  "$current_town", -1, -1),
  ##    ]],
  
  #  [anyone,"village_elder_train_peasants_against_bandits_thank", [],
  #   "Now, good {reg59?lady:sire}, is there anything I can do for you?", "village_elder_talk",[]],
  
  #chief mainquest VC(is_currently_night)
  [anyone,"start", [(eq,"$g_talk_troop", "trp_village_150_elder"),(check_quest_active,"qst_doccinga_interrogation"),(quest_slot_eq,"qst_doccinga_interrogation",slot_quest_current_state, 2), #chief village_elder_talk thonkrik from Doccinga
      (neq, "$g_encountered_party_type", spt_levy),],
    "I do not think we can get more information. It seems that your fate, your Wyrd, takes you to Danmark, my friend.", "doccinga_interrogation_1",[
  ]], #doccinga coastal assault dialog chief
  ##   [anyone,"start", [(eq,"$g_talk_troop", "trp_village_150_elder"),(check_quest_active,"qst_doccinga_interrogation"),(quest_slot_eq,"qst_doccinga_interrogation",slot_quest_current_state, 1), #chief village_elder_talk thonkrik from Doccinga
  ##                    ],
  ##   "It seems that you still have to get more information. Let me know when you're done and we leave this site.", "close_window",[
  ##       ]], #doccinga coastal assault dialog chief
  [anyone,"start", [(eq,"$g_talk_troop", "trp_village_150_elder"),(check_quest_active,"qst_doccinga_interrogation"), (neg|quest_slot_eq,"qst_doccinga_interrogation",slot_quest_current_state, 2),#chief village_elder_talk thonkrik from Doccinga
      (neq, "$g_encountered_party_type", spt_levy),],
    "{playername}, the prisoner is waiting to be interrogated. He may have some information.", "village_elder_talk_p",[
  ]], #doccinga coastal assault dialog chief
  
  [anyone,"start", [(eq,"$g_talk_troop", "trp_village_150_elder"),(check_quest_active,"qst_doccinga_assault"),(quest_slot_eq,"qst_doccinga_assault",slot_quest_current_state, 2), #chief village_elder_talk thonkrik from Doccinga
      (neq, "$g_encountered_party_type", spt_levy),],
    "Wyrd bith ful araed!", "close_window",[
  ]], #doccinga coastal assault dialog chief
  
  [anyone,"start", [(eq,"$g_talk_troop", "trp_village_150_elder"),(check_quest_active,"qst_doccinga_assault"),(quest_slot_eq,"qst_doccinga_assault",slot_quest_current_state, 1), #chief village_elder_talk thonkrik from Doccinga
      (neq, "$g_encountered_party_type", spt_levy),],
    "{playername}, you are here! Thank God! Viking ships are coming! It's Sven Bull Neck! He wants to destroy us.", "doccinga_thonkrikca",[
  ]], #doccinga coastal assault dialog chief
  
  
  [anyone,"start", [(eq,"$g_talk_troop", "trp_village_150_elder"),(is_currently_night), #chief village_elder_talk thonkrik from Doccinga
      (eq, "$g_encountered_party_type", spt_village),],
    "Sorry, {reg59?my lady:man}. It is late, and I have to be back at home. I will see you with the new day.", "close_window",[
  ]],
  
  [anyone,"start", [(eq,"$g_talk_troop", "trp_village_150_elder"),(check_quest_active,"qst_collect_men"), #chief village_elder_talk thonkrik from Doccinga
      (eq, "$g_encountered_party_type", spt_village),
      (str_store_party_name, s9, "$current_town")],
    "Welcome to {s9}... Oh, wait! You are the {reg59?lady:man} we found in the sea! Nice to see you, most assuredly! I didn't dare hope to see you alive again. That healer may yet prove worthy of the legacy of his father, God rest his soul!", "village_elder_thonkrik1",[
      (call_script, "script_end_quest", "qst_collect_men"),
  ]],
  
  [anyone|plyr,"village_elder_thonkrik1", [],
    "Are you Thonkrik? My name is {playername}, and I am in debt to Doccinga.", "village_elder_thonkrik2a",[]],
  
  [anyone|plyr,"village_elder_thonkrik1", [],
    "Thonkrik from Doccinga? I am {playername}. I have some questions.", "village_elder_thonkrik2b",[]],
  
  
  [anyone,"village_elder_thonkrik2a", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "That isn't necessary. No debt, my friend! Rescuing others from distress at sea is the duty of every fisherman! " +
    "^We found you unconscious, clinging to a plank and led by the tide. Fortunately, you were not far from the coast.", "village_elder_thonkrik3",[]],
  
  
  [anyone,"village_elder_thonkrik2b", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "Well, {playername}, go ahead.", "village_elder_thonkrik3",[]],
  
  [anyone|plyr,"village_elder_thonkrik3", [],
    "We were traveling on a ship, the Woden Ric, and were attacked by Vikings! That's the reason you found me in the sea.", "village_elder_thonkrik4",[]],
  
  [anyone,"village_elder_thonkrik4", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "I know the Woden Ric! It made landfall at Doccinga many times, because it had passengers seeking cures for the most terrible ills. " +
    "^The father of the healer who has healed you was a man well known for his skills in many parts, and thousands of people left everything to come here. Now that man has died, and unfortunately his son does not have his father's magic. " +
    "^I am sorry to hear that the Woden Ric was attacked by Vikings...", "village_elder_thonkrik5",[
  ]],
  
  [anyone|plyr,"village_elder_thonkrik5", [],
    "I was one of those people. My mother was sick, and now, maybe she... is dead.", "village_elder_thonkrik7",[
  ]],
  
  [anyone|plyr,"village_elder_thonkrik5", [],
    "My mother traveled with me. Did you find other people or... corpses where you found me?", "village_elder_thonkrik7",[
  ]],
  
  [anyone,"village_elder_thonkrik7", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "The sea brings swollen corpses and wrecks to our shores sometimes, but nobody lately. Usually, Vikings take prisoners to sell as slaves...", "village_elder_thonkrik8",[]],
  
  
  [anyone|plyr,"village_elder_thonkrik8", [],
    "Thonkrik, our ship was attacked by Sven Bull Neck. Have you heard of this name before?", "village_elder_thonkrik9",[]],
  
  [anyone,"village_elder_thonkrik9", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "{s1}^^Sven Bull Neck? Oh, my good God! It is a miracle then that you are alive. Sven is a murderer, and his men are demons. He takes no prisoners, kills the whole crew, and burns the ship with the corpses inside. " +
    "^He does not look for riches. Sven is more ambitious. Each year we pay a lot of money to him to leave us in peace.", "village_elder_thonkrik10",[
      (str_store_string, s1, "@--His eyes widen.--", color_bad_news),
  ]],
  
  
  [anyone|plyr,"village_elder_thonkrik10", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s1, "@He has killed many people, but he also killed my mother. I need to find him! (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s1, "@I know, but he must die! He is my mortal enemy now! Where is Sven, Thonkrik? (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s1, "@Sven had the audacity to attack my ship. He will pay dearly! Where is he? (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s1, "@Sven is my goal now. Anyone who gets in my way is my enemy! Where is Sven? (Sanguine)"),
      (try_end),
    ],
    "{!}{s1}", "village_elder_thonkrik11",[]],
  
  [anyone|plyr,"village_elder_thonkrik10", [],
    "He killed my mother, so now I'll kill him! Tell me, where I can find Sven?", "village_elder_thonkrik11",[]],
  
  [anyone|plyr,"village_elder_thonkrik10", [],
    "My mother may have been doomed regardless, but he'll pay for attacking ME! Where is Sven?", "village_elder_thonkrik11",[]],
  
  
  [anyone,"village_elder_thonkrik11", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "{s3}^^To seek Sven? Are you crazy? You are not listening to me! Look around? See those men training here? They are hardened warriors, sent by our jarl! They are here to defend us from Sven's attacks. And we are lucky! Other villages don't enjoy as much importance to the jarl. " +
    "^No, no, I know nothing about Sven!", "village_elder_thonkrik12",[
      (str_store_string, s3, "@--He looks frightened.--", color_bad_news),
      
      (str_store_string, s2, "@Info:"),
      (call_script, "script_start_quest", "qst_notes_global", "trp_player"),
      
      (str_store_string, s2, "@Note 1: Doccinga fishermen rescued you from the sea. Looks like you're the only survivor. Sven attacked your ship."),
      (add_quest_note_from_sreg, "qst_notes_global", 4, s2, 0),
      
  ]],
  
  [anyone|plyr,"village_elder_thonkrik12", [],
    "And so what? They are not looking for Sven. Where is Sven? I want an answer now!", "village_elder_thonkrik13",[]],
  
  [anyone|plyr,"village_elder_thonkrik12", [],
    "Thonkrik, I need your help. Don't you know I can help you kill Sven?", "village_elder_thonkrik15",[]],
  
  [anyone,"village_elder_thonkrik13", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "I don't have an answer for you. I am but a simple villager who yet, I may point out, retains his head. If you are so intent on your own destruction, you should ask the jarl of Kennemer. God has given you a second chance, saving your life, but now you intend to waste it. Good luck, but I cannot help more.", "village_elder_thonkrik14",[
      (str_store_troop_name, s9, "$g_talk_troop"),
      (str_store_troop_name_link, s3, "trp_knight_4_3"),
      (str_store_party_name_link, s1, "p_castle_63"),
      
      (str_store_string, s2, "@{s9} told me that {s3}, jarl of {s1}, might know where Sven Bull Neck is."),
      
      (call_script, "script_change_player_party_morale", 90),
      (call_script, "script_start_quest", "qst_kennemer_jarl", "$g_talk_troop"),
  ]],
  
  [anyone|plyr,"village_elder_thonkrik14", [],
    "Thanks for everything.", "village_elder_pretalk",[]],
  
  [anyone,"village_elder_thonkrik15", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "{s1}^^{playername}, look at yourself! You are weak, puny! Almost dead just weeks ago saved by lowly fishermen. You've lost all your possessions. You don't have weapons, resources or men. " +
    "I don't know where Sven keeps his hideout, but if you go there someday, you will meet your death.", "village_elder_thonkrik16",[
      (str_store_string, s1, "@--He rubs his hands nervously.--", color_bad_news),
  ]],
  
  
  [anyone|plyr,"village_elder_thonkrik16", [],
    "I don't fear death, Thonkrik. I know what I want to do, and it is to kill Sven. Farewell!", "village_elder_thonkrik17",[]],
  
  [anyone|plyr,"village_elder_thonkrik16", [],
    "I see you don't know anything. Thanks for everything. Farewell.", "village_elder_thonkrik18",[]],
  
  [anyone,"village_elder_thonkrik17", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "I see the determination in your eyes. Here, take these few coins and my advice along with them: find a job and forget about Sven. Otherwise, feel free to ask the jarl of Kennemer, he might be able to help you.", "village_elder_pretalk",[
      (call_script, "script_troop_add_gold", "trp_player", 100),
      (str_store_troop_name, s9, "$g_talk_troop"),
      (str_store_troop_name_link, s3, "trp_knight_4_3"),
      (str_store_party_name_link, s1, "p_castle_63"),
      
      (str_store_string, s2, "@{s9} told me that {s3}, jarl of {s1}, might know where Sven Bull Neck is."),
      
      (call_script, "script_change_player_party_morale", 90),
      (call_script, "script_start_quest", "qst_kennemer_jarl", "$g_talk_troop"),
      # (assign, "$g_leave_encounter",1),
      
  ]],
  
  [anyone,"village_elder_thonkrik18", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "You are right. I don't know anything, but you can ask the jarl of Kennemer. Please take some food. You have a long journey ahead of you.", "village_elder_pretalk",[
      (str_store_troop_name, s9, "$g_talk_troop"),
      (str_store_troop_name_link, s3, "trp_knight_4_3"),
      (str_store_party_name_link, s1, "p_castle_63"),
      
      (str_store_string, s2, "@{s9} told me that {s3}, jarl of {s1}, might know where Sven Bull Neck is."),
      (troop_add_item, "trp_player", "itm_smoked_fish"),
      (call_script, "script_change_player_party_morale", 90),
      (call_script, "script_start_quest", "qst_kennemer_jarl", "$g_talk_troop"),
      #  (assign, "$g_leave_encounter",1),
  ]],
  
  #coastal assault doccinga
  
  [anyone|plyr,"doccinga_thonkrikca", [],
    "Calm down, Thonkrik! I'm here to help.", "doccinga_thonkrikca2",[]],
  
  [anyone,"doccinga_thonkrikca2", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "The young people of the village have gathered on the beach with the king's troops to try to prevent the landing of Sven Bull Neck, but they are few. Thanks for coming to our aid!", "doccinga_thonkrikca3",[(assign, "$option_switches", 0)]],
  
  [anyone|plyr,"doccinga_thonkrikca3", [
      (store_and, reg0, "$option_switches", option_1),
      (eq, reg0, 0),
    ],
    "Finally, Sven is near. He will pay greatly for what he did to me.", "doccinga_thonkrikca4",[(val_or, "$option_switches", option_1)]],
  
  [anyone|plyr,"doccinga_thonkrikca3", [
      (str_clear, s4),
      (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      (str_store_troop_name,s4,":town_lord"),
      ], "Where are the men of {s4}? ", "doccinga_thonkrikca5",[]],
  
  [anyone,"doccinga_thonkrikca4", [#chief village_elder_talk thonkrik from Doccinga
      (str_clear, s2),
    ],
    "{s2}^^Those boats are Sven's, that's for sure. He always leads them. But this many men... I've never heard of Sven Bull Neck attacking a village with so many. It looks like an invasion!", "doccinga_thonkrikca3",[
      (str_store_string, s2, "@--He points to the sea, where you can distinguish three sails.--", color_bad_news),
  ]],
  
  [anyone,"doccinga_thonkrikca5", [
      # (str_clear, s4),
      # (party_get_slot, ":town_lord", "p_castle_63", slot_town_lord),
      # (str_store_troop_name,s4,":town_lord"),
    ],
    "{s4} will not come, I know. Some of the people here sent messengers, too, like you and the king, but he did not respond.^^" +
    "Normally, I would not talk about this openly, for they are Danish problems, but {s4} has left my people to their fate. In fact, I fear that all this is because of him.", "doccinga_thonkrikca51",[
  ]],
  
  [anyone,"doccinga_thonkrikca51", [#chief village_elder_talk thonkrik from Doccinga
      (str_clear, s2),
    ],
    "{s2}^^I know people who work in the jarl's house, and it is rumored that he aspires to the throne of Friese... I should not say this, but Sven Bull Neck has been there in the past.^" +
    "I fear that these boats are attacking Doccinga to bring Sven's warriors to help the jarl capture the throne, but these are just my assumptions.", "doccinga_thonkrikca6",[
      (str_store_string, s2, "@--He seems nervous, not gesturing with hands.--", color_bad_news),
  ]],
  
  
  [anyone|plyr,"doccinga_thonkrikca6", [],
    "Damn traitor. He's been playing with me.", "doccinga_thonkrikca71",[]],
  
  [anyone|plyr,"doccinga_thonkrikca6", [],
    "I'll take care of that issue later. Right now, I have to stop an invasion.", "doccinga_thonkrikca72",[]],
  
  [anyone,"doccinga_thonkrikca71", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "Be careful with him, he is a dangerous man.", "doccinga_thonkrikca72",[
  ]],
  
  [anyone,"doccinga_thonkrikca72", [
      #chief village_elder_talk thonkrik from Doccinga
    ],
    "Ic bancie the! Thank you for coming to help, {playername}. I will join my people now. A huskarl from the king leads the defense.", "doccinga_thonkrikca72_f",[
      #  (assign, "$g_leave_encounter", 1),
      (call_script, "script_change_player_relation_with_faction", "fac_kingdom_4", 2),
      (call_script, "script_change_player_relation_with_center", "p_village_150", 50),
      (str_clear, s3),
      (str_clear, s9),
      (str_store_troop_name_link, s9, "trp_knight_4_3"),
      (str_store_party_name_link, s3, "p_village_150"),
      (str_store_string, s2, "@Thonkrik from {s3} told you that {s9} might be allied with Sven Neck Bull in his attempt to capture the throne of Friese."),
      (add_quest_note_from_sreg, "qst_kennemer_jarl_missions", 4, s2, 0),
      (quest_set_slot,"qst_doccinga_assault",slot_quest_current_state, 2), #status 2
  ]],
  [anyone,"doccinga_thonkrikca72_f", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "Follow his orders. Please fight with us! Good luck.", "close_window",[
  ]],
  #despidiendose de thonkrik
  [anyone,"doccinga_interrogation_1", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "What you want to do with the prisoner?", "doccinga_interrogation_12",[
  ]],
  [anyone|plyr,"doccinga_interrogation_12", [],
    "Kill him! He is a murderer and does not deserve to live.", "doccinga_interrogation_mu",[
      (str_clear, s3),
      (str_store_party_name_link, s3, "p_village_150"),
      (str_store_string, s2, "@Note 4: You chose to kill the Viking prisoner in {s3}."),
      (add_quest_note_from_sreg, "qst_notes_frisa", 7, s2, 0),
      (call_script, "script_change_player_honor", -2),
  ]],
  [anyone|plyr,"doccinga_interrogation_12", [],
    "Free him. I don't want his blood to weigh on our hands.", "doccinga_interrogation_mu",[
      (str_clear, s3),
      (str_store_party_name_link, s3, "p_village_150"),
      (str_store_string, s2, "@Note 4: You chose to spare the life the Viking prisoner in {s3}."),
      (add_quest_note_from_sreg, "qst_notes_frisa", 7, s2, 0),
      (assign,"$doccinga_prisoner",1),
      (call_script, "script_change_player_honor", 2),
  ]],
  [anyone,"doccinga_interrogation_mu", [#chief village_elder_talk thonkrik from Doccinga
      (quest_set_slot,"qst_doccinga_interrogation",slot_quest_current_state, 3),
      (call_script, "script_end_quest", "qst_doccinga_interrogation"),
      (call_script, "script_troop_add_gold", "trp_player", 1000),
      (add_xp_as_reward,600),
    ],
    "It will be done as you have said. As for you, what will you do now?", "doccinga_interrogation_11",[
  ]],
  
  [anyone|plyr,"doccinga_interrogation_11", [],
    "In Friese, I'm not wanted. I've earned powerful enemies against whom I cannot fight now, Thonkrik. My priority is my mother. I must save her. " +
    "I will try finding passage to Danmark on some ship and looking for Sven Bull Neck. Maybe we will never meet again...", "doccinga_interrogation_2",[
      (str_clear, s3),
      (str_store_party_name_link, s3, "p_village_150"),
      (str_store_string, s2, "@Note 2: The Viking prisoner in {s3} told you there were other survivors of the attack on the Woden Ric. They seem to have been taken to a hideout that Sven Bull Neck has in Danmark."),
      (add_quest_note_from_sreg, "qst_notes_global", 5, s2, 0),
  ]],
  [anyone,"doccinga_interrogation_2", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "I know you'll be back someday...", "doccinga_interrogation_3",[
  ]],
  [anyone|plyr,"doccinga_interrogation_3", [],
    "Yes, with an army. The jarls and the king of Friese will pay for what they have done to me.", "doccinga_interrogation_31",[]],
  [anyone|plyr,"doccinga_interrogation_3", [],
    "No, I hate this land. You will not see me again.", "doccinga_interrogation_32",[]],
  [anyone|plyr,"doccinga_interrogation_3", [],
    "It is possible. If I return, I will stop in Doccinga to say hello, friend.", "doccinga_interrogation_33",[]],
  [anyone,"doccinga_interrogation_31", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "I understand it. You're a {reg59?woman:man} haunted by revenge: Sven, Sigurd, and now the jarl of Kennemer. I hope you find peace someday.", "doccinga_interrogation_4",[
  ]],
  [anyone,"doccinga_interrogation_32", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "Then, may fate accept that someday you will make your way back.", "doccinga_interrogation_4",[
  ]],
  [anyone,"doccinga_interrogation_33", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "So I hope! The people of Doccinga love and admire you. Here you will always find a bed to sleep on and fire to warm up by.", "doccinga_interrogation_4",[
  ]],
  [anyone|plyr,"doccinga_interrogation_4", [],
    "Now, I need to find a boat that is traveling to Ribe...", "doccinga_interrogation_5",[]],
  [anyone,"doccinga_interrogation_5", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "I can help you with that. One of the Sven's boats was left behind relatively undamaged and has been repaired in secret. It is our gift to you for saving us. The ship awaits you at a beach near Doccinga... and also someone else is waiting for you there. " +
    "I have a favor to ask, {playername}.", "doccinga_interrogation_51",[
  ]],
  [anyone,"doccinga_interrogation_51", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "You remember I told you that someone was in the house of the jarl of Kennemer? Someone passing me information? Well that person is my daughter. " +
    "The jarl snatched her to serve in his house as a maid for his wife. She managed to escape from Kennemer, and now I want you to take her along. If the jarl finds her, he'd take her back to his house, or maybe he would kill her. " +
    "I need you to do this for me, {playername}, and the boat is yours.", "doccinga_interrogation_52",[
  ]],
  
  [anyone|plyr,"doccinga_interrogation_52", [],
    "I'll take her with me and will protect her.", "doccinga_interrogation_6",[
  ]],
  [anyone|plyr,"doccinga_interrogation_52", [],
    "No. Where I'm going is no place for a girl. I cannot protect her. She should stay here.", "doccinga_interrogation_54",[]],
  [anyone,"doccinga_interrogation_54", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "Do not make me beg, my friend. Do you think you have several ships to choose from? There is no other mode of transportation for you. With Sven's attacks, merchants take weeks to come back here. " +
    "You don't know what they did to my daughter in Kennemer, {playername}... I do not want her warming again the bed of any of the jarl's men. Sorry, but there is no choice: the ship and my daughter go together.", "doccinga_interrogation_6",[
  ]],
  [anyone|plyr,"doccinga_interrogation_6", [],
    "Well, I'll take her and the ship. Farewell, Thonkrik.", "doccinga_interrogation_61",[
      (call_script, "script_change_player_relation_with_center", "p_village_150", 5),
  ]],
  [anyone,"doccinga_interrogation_61", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "Wes gesund, my friend.", "doccinga_interrogation_61_f",[
      (str_store_troop_name_link, s11, "$g_talk_troop"),
      (str_store_string, s2, "@{s11} told me that I have a boat waiting for me at a beach near to Doccinga. The only condition is to take his daughter with me. It's time to leave Friese."),
      
      (call_script, "script_start_quest", "qst_getting_ship", "$g_talk_troop"),
      (quest_set_slot,"qst_getting_ship",slot_quest_current_state, 1),
      # (party_relocate_near_party, "p_fort", "p_main_party"),
      (enable_party, "p_frisa_beach"),
      #(assign, "$g_leave_encounter",1),
  ]],
  [anyone|plyr,"doccinga_interrogation_61_f", [#chief village_elder_talk thonkrik from Doccinga
    ],
    "Wes gesund.", "close_window",[
  ]],
  
  ####chief mainquest acaba
  
  [anyone,"start", [(is_between,"$g_talk_troop", village_elders_begin, village_elders_end),(eq,"$g_talk_troop_met",0),	 (eq, "$g_encountered_party_type", spt_village),
      (str_store_party_name, s9, "$current_town")],
    "Good day, {reg59?madam:sir}, and welcome to {s9}. I am the leader of this village.", "village_elder_talk",[]],
  
  [anyone,"start", [(is_between,"$g_talk_troop", village_elders_begin, village_elders_end),(eq,"$g_talk_troop_met",0),
      (str_store_party_name, s9, "$current_town"),
      (eq, "$g_encountered_party_type", spt_village),
      (party_slot_eq, "$current_town", slot_town_lord, "trp_player"),],
    "Welcome to {s9}, my {reg59?lady:lord}. We were rejoiced by the news that you are the new {reg59?lady:lord} of our humble village. " +
    "I am the village elder and I will be honoured to serve you in any way I can.", "village_elder_talk",[]],
  
  [anyone ,"start", [(is_between,"$g_talk_troop",village_elders_begin,village_elders_end),
      (party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
      (eq, "$g_encountered_party_type", spt_village),
      (party_get_slot, ":tax", "$current_town", slot_center_tax_rate),
      (try_begin),
        (eq, ":tax", 0),
        (str_store_string, s33, "@ May I remind you that currently we are paying medium taxes to your {reg59?ladyship:lordship}?"),
      (else_try),
        (eq, ":tax", 1),
        (str_store_string, s33, "@ May I remind you that currently we are paying low taxes to your {reg59?ladyship:lordship}? We are infinitely grateful for such generosity."),
      (else_try),
        (eq, ":tax", 2),
        (str_store_string, s33, "@ May I remind you that currently we are paying high taxes to your {reg59?ladyship:lordship}? Many people are cursing you for your greed."),
      (try_end),
    ],
    "{reg59?My lady:My lord}, you honour our humble village with your presence.{s33}", "village_elder_talk",[]],
  
  [anyone,"start", [(is_between,"$g_talk_troop", village_elders_begin, village_elders_end),(eq,"$g_talk_troop_met",0),
      (eq, "$g_encountered_party_type", spt_village),
      (str_store_party_name, s9, "$current_town")],
    "Good day, {reg59?madam:sir}, and welcome to {s9}. I am the local leader of this village.", "village_elder_talk",[]],
  
  
  [anyone,"start", [(eq,"$g_talk_troop", "trp_village_150_elder"),
      (eq, "$g_encountered_party_type", spt_village)], #chief village_elder_talk thonkrik from Doccinga
    "Good day. I am happy to see you back.", "village_elder_talk",[]],
  
  [anyone ,"start", [(is_between,"$g_talk_troop",village_elders_begin,village_elders_end),
      (eq, "$g_encountered_party_type", spt_village),],
    "Good day, {reg59?madam:sir}.", "village_elder_talk",[]],
  
  [anyone ,"village_elder_pretalk", [],
    "Is there anything else I can do for you?", "village_elder_talk",[]],
  ###chief doccinga prisoner interrogation, interrogatorio Thonkrik
  [anyone|plyr,"village_elder_talk_p", [(eq,"$g_talk_troop", "trp_village_150_elder"),(check_quest_active,"qst_doccinga_interrogation"),],
    "Sure, Thonkrik. Take me to him. It is time for some words.", "village_elder_talk_p_f",[
      (quest_set_slot,"qst_doccinga_interrogation",slot_quest_current_state, 1),
  ]],
  
  [anyone ,"village_elder_talk_p_f", [],
    "Follow me.", "close_window",[
      (modify_visitors_at_site,"scn_doccinga_prison"),
      (reset_visitors),
      (set_visitor, 41, "trp_sea_raider_prisoner"), #prisoner
      (set_visitor, 42, "trp_doccinga_torturador"), #torturador
      (set_visitor, 43, "trp_norse_level0_companion"), #guard
      (set_visitor, 44, "trp_norse_level0_companion"), #guard
      (set_visitor, 45, "trp_village_150_elder"), #elder
      (set_jump_entry, 0),
      
      (set_jump_mission, "mt_doccinga_interrogatorio"),
      (jump_to_scene,"scn_doccinga_prison"),
      (change_screen_mission),
  ]],
  
  
  ###
  [anyone|plyr,"village_elder_talk", [(check_quest_active, "qst_blank_quest_13"),
      (neg|check_quest_concluded, "qst_blank_quest_13"),
      (quest_slot_eq, "qst_blank_quest_13", slot_quest_target_center, "$current_town"),
      (is_between, "$current_town", villages_begin, villages_end),
      (eq, "$g_encountered_party_type", spt_village),
      ], "I am looking for someone who may or may not be a ghost.", "village_elder_ask_ghost",[]],
  
  [anyone ,"village_elder_ask_ghost", [  (neg|is_currently_night),
    ],
    "A ghost? Hah! Ghosts don't appear during the day! Try finding him at night!", "close_window",[]],
  [anyone ,"village_elder_ask_ghost", [  (is_currently_night),
    ],
    "A ghost? Ghosts don't appear on their own! You need to walk by him to wake him up.", "close_window",[]],
  
  
  [anyone|plyr,"village_elder_talk", [(check_quest_active, "qst_blank_quest_10"),
      (neg|check_quest_concluded, "qst_blank_quest_10"),
      (quest_get_slot, ":giver_center", "qst_blank_quest_10", slot_quest_giver_center),
      (store_distance_to_party_from_party, ":distance", ":giver_center", "$current_town"),
      (lt, ":distance", 50),
      (quest_get_slot, ":item", "qst_blank_quest_10", slot_quest_target_item),
      (str_store_item_name, s22, ":item"),
      (eq, "$g_encountered_party_type", spt_village),
      #									  (str_store_party_name, s23, ":giver_center"),
      #                                    (neg|quest_slot_eq, "qst_blank_quest_10", slot_quest_target_center, "$current_town"),
    ],
    "Have you seen any {s22}-playing guards around here?", "village_elder_ask_music",[]],
  
  [anyone ,"village_elder_ask_music", [(is_currently_night)],
    "Strangers come and go to our village, {reg59?madam:sir}, but I doubt you'll run into him at this hour of the night. You would have better luck during the day.", "village_elder_pretalk",[]],
  [anyone ,"village_elder_ask_music", [
      (neg|quest_slot_eq, "qst_blank_quest_10", slot_quest_target_center, "$current_town"),
    ],
    "Strangers come and go to our village, {reg59?madam:sir}. Haven't heard or seen anyone like that, but if he is hiding here, you might be able to find him if you look around.", "close_window",[]],
  [anyone ,"village_elder_ask_music", [
      (quest_slot_eq, "qst_blank_quest_10", slot_quest_target_center, "$current_town"),
      (quest_get_slot, ":item", "qst_blank_quest_10", slot_quest_target_item),
      (str_store_item_name, s22, ":item"),
    ],
    "Strangers come and go to our village, {reg59?madam:sir}. I have heard some sweet sounds of a {s22} lately, but don't know if... hmm... You are welcome to look around.", "close_window",[]],
  
  ###
  ### Add-ons story, local leader talk about Morrigan
  [anyone|plyr,"village_elder_talk", [(eq,"$g_talk_troop", "trp_village_78_elder"),
      (check_quest_active, "qst_blank_quest_23"),
      (quest_slot_eq,"qst_blank_quest_23",slot_quest_current_state,1),
      (eq, "$g_encountered_party_type", spt_village)
      ], "Caliacas? The abbot of Finian sent me.", "village_elder_caliacas1",[]],
  ###backing from hut
  [anyone|plyr,"village_elder_talk", [(eq,"$g_talk_troop", "trp_village_78_elder"),
      (check_quest_active, "qst_blank_quest_23"),
      (quest_slot_eq,"qst_blank_quest_23",slot_quest_current_state,3),
      (eq, "$g_encountered_party_type", spt_village)
      ], "Caliacas? Is everything well? We received your message.", "village_elder_caliacasdesp1",[]],
  ###Morrigan quest end optional reward for roleplay players.
  [anyone|plyr,"village_elder_talk", [(eq,"$g_talk_troop", "trp_village_78_elder"),
      (check_quest_active, "qst_blank_quest_23"),
      (check_quest_succeeded, "qst_blank_quest_23"),
      (neg|main_party_has_troop,"trp_caliacas_son"),
      (eq, "$g_encountered_party_type", spt_village)
      ], "Your village is safe. You will not have more problems with Morrigan.", "village_elder_caliacassuccess1",[]],
  ###
  [anyone, "village_elder_caliacas1", [], "Ah, the abbot is a good man to respond to our call so promptly! I asked him for three heroes, and in fact, three heroes have come! " +
    "You are the last to arrive, so you are the most anticipated, since the evil that has befallen our land is terrible indeed. " +
    "Many have died, others have fled, and the few that remain can hardly keep their sanity.","village_elder_caliacas2",[
      (call_script, "script_change_player_relation_with_center", "$g_encountered_party", 30),
  ]],
  [anyone|plyr,"village_elder_caliacas2", [
      ], "Stop! Three heroes? What do you mean?", "village_elder_caliacas3", [
  ]],
  [anyone|plyr,"village_elder_caliacas2", [
      ], "Three heroes? You do not need so many. You have me. Dismiss them.", "village_elder_caliacas3", [
      (call_script, "script_change_player_relation_with_center", "$g_encountered_party", -5),
  ]],
  [anyone, "village_elder_caliacas3", [], "The evil that afflicts us is magical, so we must fight it with magic. " +
    "Three is the number of the old gods, so the old man said three should be the number of heroes. Any other number will fail and die. " +
    "At first, we did not believe him, you understand. We are Christians, and our priest said the old man was a pagan and should be burned, and that's what we did. " +
    "But we were idiots. The old gods are still here, and they want revenge. Now the old man is dead and cannot aid us more, and our priest has disappeared.","village_elder_caliacas4",[]],
  [anyone|plyr,"village_elder_caliacas4", [
      ], "You burned the poor old man? You deserve what you're going through!", "village_elder_caliacas5_1", [
  ]],
  [anyone|plyr,"village_elder_caliacas4", [
      ], "No doubt, that old man had something to do with this. Better to solve this without him.", "village_elder_caliacas5_2", [
  ]],
  [anyone|plyr,"village_elder_caliacas4", [
      ], "What else did this old man say?", "village_elder_caliacas5_3", [
  ]],
  [anyone, "village_elder_caliacas5_1", [], "Do our women and children also deserve this? " +
    "And that old man was not poor. He prayed to demons, performed rituals, and sacrificed animals. " +
    "He lived in a hut from which he sold potions and ointments. Many believe that it was because of him that all this evil is happening to us. That he invoked something... " +
    "Therefore, when our priest ordered us to burn the old man, we locked him up in his hut and burned it to the ground, listening all the while to his screams and curses.","village_elder_caliacas6",[
      (call_script, "script_change_player_relation_with_center", "$g_encountered_party", -5),
  ]],
  [anyone, "village_elder_caliacas5_2", [], "We should not have burned him. " +
    "That old man was powerful. He prayed to demons, performed rituals, and sacrificed animals. He lived in a hut from which he sold potions and ointments. Many believe that it was because of him that all this evil is happening to us. That he invoked something... " +
    "Therefore, when our priest ordered us to burn the old man, we locked him up in his hut and burned it to the ground, listening all the while to his screams and curses. The only advice he left us was that we should bring three heroes, or the evil that lurks around us will end up destroying us.","village_elder_caliacas6",[]],
  [anyone, "village_elder_caliacas5_3", [], "That old man was powerful. He prayed to demons, performed rituals, and sacrificed animals. He lived in a hut from which he sold potions and ointments. Many believe that it was because of him that all this evil is happening to us. That he invoked something... " +
    "Before our priest ordered us to burn him, he told us that we should bring three heroes, or the evil that lurks around us will end up destroying us.","village_elder_caliacas6",[]],
  [anyone|plyr,"village_elder_caliacas6", [
      ], "You were right to call three heroes then.", "village_elder_caliacas6_1", [
  ]],
  [anyone|plyr,"village_elder_caliacas6", [
      ], "What evil is attacking you?", "village_elder_caliacas7", [
  ]],
  [anyone, "village_elder_caliacas6_1", [], "Yes, I think it was the right thing to do. I'm also glad that the abbot respected my reasons, for anyone might have thought us to be heretics.","village_elder_caliacas7",[]],
  [anyone, "village_elder_caliacas7", [], "A month or so ago, a shepherd disappeared. A few days later, we found his dismembered body near an old tree. " +
    "That scared us, because an animal would never do that to a man. After that, nobody left the village without a companion, " +
    "but that did not help. A few days later, a group of people was attacked. Women and children disappeared, and we later found them dismembered.","village_elder_caliacas8",[]],
  [anyone, "village_elder_caliacas8", [], "--His hands tremble as he speaks.--^^" +
    "Then we hired a group of Norsemen for a lot of money, but evil did the same to them as to our people, and their dismembered bodies were soon food for the crows.^^" +
    "Then the old man told us to invite three heroes. Then we burned him.","village_elder_caliacas9",[]],
  [anyone|plyr,"village_elder_caliacas9", [
      ], "Did you ask your lord for help?", "village_elder_caliacas10_1", [
  ]],
  [anyone|plyr,"village_elder_caliacas9", [
      ], "You talk about evil. Why suspect the supernatural?", "village_elder_caliacas10_2", [
  ]],
  [anyone, "village_elder_caliacas10_1", [], "--He sighs heavily.--^^" +
    "Yes, that was the first thing we did. He sent a group of twenty warriors. They were found dead and dismembered a few days later. " +
    "Now our lord says he cannot send more men. He needs them for his wars. Since he had left us to our own devices, we asked the abbot.","village_elder_caliacas10_2",[]],
  [anyone, "village_elder_caliacas10_2", [], "The old gods are back, thirsty for blood after so many centuries.^^" +
    "They have not only killed people and warriors, but we have seen them watching the village from afar. " +
    "They announce they are coming for us. One of these days, the fog will fall, and then we all will die.","village_elder_caliacas11",[]],
  [anyone|plyr,"village_elder_caliacas11", [
      (str_clear, s10),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@Old gods? This is a concern. I have never faced any 'god' before. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@Tell me more about these 'gods' and how are they watching you. (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Look at me. I'm here with you, listening, Caliacas. Tell me more about those 'gods' that watching you. (Choleric)"),
        (call_script, "script_change_player_relation_with_center", "$g_encountered_party", 5),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Come on man, no need to be sad. Now I'm here, and I'll take care of this problem. Tell me, who is watching you? (Sanguine)"),
        (call_script, "script_change_player_relation_with_center", "$g_encountered_party", 5),
      (try_end),
    ],
    "{!}{s10}", "village_elder_caliacas12",[
  ]],
  [anyone, "village_elder_caliacas12", [], "When there is fog, we can hear their singing and the howl of their wolves. We can even see their figures between dark wisps of fog. " +
    "The creatures are huge. Well, all except her.","village_elder_caliacas13",[]],
  [anyone|plyr,"village_elder_caliacas13", [
      ], "Her? A woman?", "village_elder_caliacas14_1", [
  ]],
  [anyone|plyr,"village_elder_caliacas13", [
      ], "(Say nothing)", "village_elder_caliacas14_2", [
  ]],
  [anyone, "village_elder_caliacas14_1", [], "No, not a woman, she is something else... The ancient gods have sent her to kill us all.","village_elder_caliacas14_2",[]],
  [anyone, "village_elder_caliacas14_2", [], "--He lowers his voice to a whisper.--^^" +
    "She is Morrigan, the Phantom Queen, the pagan goddess of battle and... carnal encounters. She was worshipped before Saint Patrick brought us the word of Christ.","village_elder_caliacas14_2",[]],
  [anyone|plyr,"village_elder_caliacas14_2", [
      ], "A shield-maiden?", "village_elder_caliacas15_1", [
      (call_script, "script_change_player_relation_with_center", "$g_encountered_party", -5),
  ]],
  [anyone|plyr,"village_elder_caliacas14_2", [
      ], "(Say nothing)", "village_elder_caliacas15_2", [
  ]],
  [anyone, "village_elder_caliacas15_1", [], "What! Please speak lower. Morrigan might hear us. " +
    "No, she is powerful through magic rather than through physical strength.","village_elder_caliacas15_2",[]],
  [anyone, "village_elder_caliacas15_2", [], "My grandfather told me stories about her. The Raven Goddess selects who is going to be slain and takes the blood from their hearts, along with their valor. " +
    "When they arrive on the battlefield, they are already doomed.^^" +
    "She appears as a beautiful dark haired woman or sometimes as a crow. A beautiful maiden dressed with a hooded cloak, my grandfather said. She is usually to be found by a river, washing the clothes of men about to die. " +
    "Centuries ago, she was one of the Tuatha De Danann, the demons that ruled the island before the Gaels arrived. Now she lives in Sidhe, the Underworld, whose entry is the ancient mounds.","village_elder_caliacas15_3",[]],
  [anyone, "village_elder_caliacas15_3", [], "She has left Sidhe and has brought her beasts with her. She will destroy us unless some hero defeats her and sends her back to her world.","village_elder_caliacas15_4",[]],
  
  [anyone|plyr,"village_elder_caliacas15_4", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@Demons? This could be a serious problem, indeed. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@I sure hope I am ready to face a 'demon.' (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Morrigan is a pretty name, even for a 'demon.' (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Tuatha De Danann? I have no fear of 'demons.' (Sanguine)"),
      (try_end),
    ],
    "{!}{s10}", "village_elder_caliacas16_1",[
      (str_clear, s10),
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (call_script, "script_change_player_relation_with_center", "$g_encountered_party", -5),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (call_script, "script_change_player_relation_with_center", "$g_encountered_party", 5),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (call_script, "script_change_player_relation_with_center", "$g_encountered_party", 5),
      (else_try),
        #   (eq, "$virtue_type", cb5_bold),
        (call_script, "script_change_player_relation_with_center", "$g_encountered_party", -5),
      (try_end),
  ]],
  
  [anyone|plyr,"village_elder_caliacas15_4", [
      ], "I am that hero. Where might I find her?", "village_elder_caliacas16_1", [
  ]],
  [anyone|plyr,"village_elder_caliacas15_4", [
      ], "I do not believe in this Morrigan, but I'll put an end to the murderers of your people.", "village_elder_caliacas16_2", [
  ]],
  [anyone, "village_elder_caliacas16_1", [], "She can't be defeated by one hero, so three were summoned. You should find them first.","village_elder_caliacas16_2",[]],
  [anyone, "village_elder_caliacas16_2", [], "The fog always comes from the coast, and with it come Morrigan and her beasts. You have to go there if you want to find her. " +
    "The other two heroes await you near the burned hut of the old man, a few hours away from this village. They are looking for more clues as they await you. " +
    "Be warned! When you leave this village and move towards the coast, be alert and flee from the fog, as Morrigan and her animals could catch you before the three of you are joined.","village_elder_caliacas17",[
      (str_store_string, s2, "@Caliacas told you that the evil attacking them is an ancient demon called Morrigan, the Raven Goddess, who leads a bunch of beasts. " +
      "You've discovered that you're not the only hero destined to defeat Morrigan, and have to meet the other two in the burnt hut of the old man who worshiped the old gods."),
      (add_quest_note_from_sreg, "qst_blank_quest_23", 5, s2, 0),
      (quest_set_slot,"qst_blank_quest_23",slot_quest_current_state, 2), #status 0
      (enable_party, "p_oldpagan_hut"),
      (set_global_cloud_amount, 50),
      (set_global_haze_amount, 80),
  ]],
  [anyone|plyr,"village_elder_caliacas17", [
      ], "I pray Morrigan attacks me, so I get my reward sooner.", "close_window", [
      (call_script, "script_change_player_relation_with_center", "$g_encountered_party", -5),
  ]],
  [anyone|plyr,"village_elder_caliacas17", [
      ], "I will be alert, thank you. Farewell, then.", "close_window", [
  ]],
  
  ###calicas after first meeting with morrigan
  [anyone, "village_elder_caliacasdesp1", [], "I'm glad to see you alive. Where are the other champions? I hope they are well. " +
    "After you had left, we saw go behind you the beasts of Morrigan, and we feared the worst!","village_elder_caliacasdesp2",[
      (call_script, "script_change_player_relation_with_center", "$g_encountered_party", 5),
  ]],
  [anyone|plyr,"village_elder_caliacasdesp2", [
      ], "Yes, everybody is fine. You called me back for this?", "village_elder_caliacasdesp3_1", [
  ]],
  [anyone|plyr,"village_elder_caliacasdesp2", [
      ], "Morrigan attacked me, but I am fine, and the other champions, too.", "village_elder_caliacasdesp3_2", [
  ]],
  [anyone, "village_elder_caliacasdesp3_1", [], "Err, yes, sorry. I sent the messenger to warn you of the danger. Since you are all well, I guess he succeeded in his mission. " +
    "My intention was not to cause you to come here, but I understand how you might have interpreted it that way.","village_elder_caliacasdesp4",[
      (call_script, "script_change_player_relation_with_center", "$g_encountered_party", -1),
  ]],
  [anyone, "village_elder_caliacasdesp3_2", [], "That's what I thought. Morrigan wanted to take you by surprise. " +
    "We saw his wolves and bears following in your steps, and a brave lad volunteered to go to the hut of the old pagan to warn you.","village_elder_caliacasdesp4",[]],
  
  [anyone|plyr,"village_elder_caliacasdesp4", [
      ], "Well, the other champions will send me notice of where Morrigan's camp is.", "village_elder_caliacasdesp5_1", [
  ]],
  [anyone|plyr,"village_elder_caliacasdesp4", [     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
      (ge, ":free_capacity", 2),
      ], "I lost some men in the battle with Morrigan. I need warriors.", "village_elder_caliacasdesp5_2", [
  ]],
  [anyone|plyr,"village_elder_caliacasdesp4", [
      ], "I'll wait here for the messenger with news about Morrigan's lair. Send mead and women to my quarters.", "village_elder_caliacasdesp5_3", [
  ]],
  [anyone, "village_elder_caliacasdesp5_1", [], "In that case, {playername}, you're free to roam the village. Relax here or go hunting nearby, but beware of the fog. " +
    "We have prepared the big house for you and your men, may its previous occupants rest in peace.","village_elder_caliacasdesp11",[
      (call_script, "script_change_player_relation_with_center", "$g_encountered_party", 10),
  ]],
  [anyone, "village_elder_caliacasdesp5_2", [
      (party_get_slot, ":player_relation", "$current_town", slot_center_player_relation),
      (ge, ":player_relation",20), #relation must be positive with center
    ], "My {reg59?lady:lord}, many of our young people want to fight to avenge what happened. I do not like sending them to their deaths, but I could allow some to join you. " +
    "Just promise me you'll take care of them, because they are heedless and impulsive.","village_elder_caliacasdesp6",[
  ]],
  [anyone, "village_elder_caliacasdesp5_2", [
      ], "My {reg59?lady:lord}, many of our young people want to fight to avenge what happened. However, I would be sending them to their deaths, as they are heedless and impulsive. Sorry.","village_elder_caliacasdesp10",[
  ]],
  [anyone, "village_elder_caliacasdesp5_3", [
      (party_get_slot, ":player_relation", "$current_town", slot_center_player_relation),
      (ge, ":player_relation",25), #relation must be positive with center
    ], "It will be done, my {reg59?lady:lord}. The large house is for you and your men, may its previous occupants rest in peace. I will send our best food and mead. Our young girls will serve you and keep you company. It's the least we can do for our saviors. " +
    "You are free to roam the village or go hunting nearby, but beware of the fog.","village_elder_caliacasdesp11",[
      (call_script, "script_change_player_party_morale", 40),
  ]],
  [anyone, "village_elder_caliacasdesp5_3", [
    ], "The large house is for you and your men, may its previous occupants rest in peace. I will send our food and mead, but excuse me, my {reg59?lady:lord} -- we prefer to keep our young girls far from your men, as is proper. " +
    "You are free to roam the village or go hunting nearby, but beware of the fog.","village_elder_caliacasdesp11",[
  ]],
  
  [anyone|plyr,"village_elder_caliacasdesp6", [
      ], "Sure. I will take good care of them.", "village_elder_caliacasdesp7", [
  ]],
  
  [anyone|plyr,"village_elder_caliacasdesp6", [
      ], "Then it would be better to leave those boys with their mothers.", "village_elder_caliacasdesp5_1", [
  ]],
  
  [anyone ,"village_elder_caliacasdesp7", [
      (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
      (val_min, ":free_capacity", 12),
      (assign, reg5, ":free_capacity"),
    ],
    "I can think of {reg5} youths whom I suspect would join you. " +
    "Does that suit you?", "village_elder_caliacasdesp8",[]],
  
  [anyone|plyr,"village_elder_caliacasdesp8", [],
    "Any you can spare are welcome.", "village_elder_caliacasdesp10",[
      (party_add_members,"p_main_party","trp_irish_bowman",reg5),
  ]],
  
  [anyone|plyr,"village_elder_caliacasdesp8", [],
    "No, they please me not.", "village_elder_caliacasdesp10",[]],
  
  [anyone, "village_elder_caliacasdesp10", [], "In that case, {playername}, you're free to roam the village. Relax here or go hunting nearby, but beware of the fog. " +
    "We have prepared the big house for you and your men, may its previous occupants rest in peace.","village_elder_caliacasdesp11",[
  ]],
  [anyone|plyr,"village_elder_caliacasdesp11", [],
    "Thank you for your hospitality, Caliacas. We will wait here until we receive information on where Morrigan's lair is. Then we will finish her off and bring peace back to your people.", "village_elder_pretalk",[
      (str_store_string, s2, "@It seems that there is no problem in the village. It was all a false alarm. Now you just have to wait for the messenger from the two champions."),
      (add_quest_note_from_sreg, "qst_blank_quest_23", 7, s2, 0),
      (quest_set_slot,"qst_blank_quest_23",slot_quest_current_state, 4), #status 0
      
      (assign,"$auto_enter_town","$current_town"),
      (assign, "$g_last_rest_center", "$current_town"),
      
      (rest_for_hours_interactive, 24 * 7, 5, 0), #rest while attackable
      
      (change_screen_return),
  ]],
  ####################
  ###calicas after morrigan end
  [anyone, "village_elder_caliacassuccess1", [], "--His face shows a disproportionate joy. He seems barely able to keep himself from hugging you.--^^" +
    "You... you are a hero, my friend! You saved this village, and we will be eternally grateful.^" +
    "Everyone in this village knows what you have done. You will always be welcome here as a hero. " +
    "I also give you one of my children, the youngest, to join your army and serve under your name. His name is Bran, and he is very dear to me.","village_elder_caliacassuccess2",[
      (call_script, "script_change_player_relation_with_center", "$g_encountered_party", 60),
  ]],
  [anyone|plyr,"village_elder_caliacassuccess2", [
      ], "Thanks, Caliacas. I will take good care of him.", "village_elder_caliacassuccess3", [
  ]],
  [anyone|plyr,"village_elder_caliacassuccess2", [
      ], "That's not necessary. I can't guarantee his safety.", "village_elder_caliacassuccess4", [
  ]],
  [anyone, "village_elder_caliacassuccess3", [ ################# Space for companions in storyline
      (try_begin), #
        (neg|hero_can_join, "p_main_party"),
        (call_script, "script_game_get_party_companion_limit"),
        (assign, ":party_size_limit", reg0),
        (party_get_num_companions, ":num_men", "p_main_party"),
        (store_sub, ":difference", ":num_men", ":party_size_limit"),
        (try_begin),
          (gt, ":difference", 0),
          (assign, ":num_troops", ":difference"),
          (try_for_range, ":unused", 0, ":num_troops"),
            (call_script, "script_cf_party_remove_random_regular_troop", "p_main_party"),
          (try_end),
        (try_end),
        #  (call_script, "script_change_troop_renown", "trp_player", 18),
      (try_end),
      
      (try_begin), #chief +10 renown in storyline
        (call_script, "script_change_troop_renown", "trp_player", 10),
        (party_add_members,"p_main_party","trp_caliacas_son",1),
      (try_end),
      ################
    ], "You have saved many lives here. Thanks, {playername}! " +
    "Return to the abbot of Finian. I'm sure he is ready to reward you and hear the good news. Good luck, my friend.","village_elder_pretalk",[
  ]],
  [anyone, "village_elder_caliacassuccess4", [], "Sorry, but the decision is taken. I am not a rich man, but my children are strong and healthy, and I find no better way to reward you for what you've done.","village_elder_caliacassuccess3",[]],
  #############
  
  [anyone|plyr,"village_elder_talk", [(check_quest_active, "qst_hunt_down_fugitive"),
      (neg|check_quest_concluded, "qst_hunt_down_fugitive"),
      (neq, "$g_encountered_party_type", spt_levy),
      (quest_slot_eq, "qst_hunt_down_fugitive", slot_quest_target_center, "$current_town"),
      (quest_get_slot, ":quest_target_dna", "qst_hunt_down_fugitive", slot_quest_target_dna),
      (call_script, "script_get_name_from_dna_to_s50", ":quest_target_dna"),
      (str_store_string, s4, s50),
    ],
    "I am looking for a man by the name of {s4}. I was told he might be hiding here.", "village_elder_ask_fugitive",[]],
  
  [anyone ,"village_elder_ask_fugitive", [(is_currently_night)],
    "Strangers come and go to our village, {reg59?madam:sir}, but I doubt you'll run into him at this hour of the night. You would have better luck during the day.", "village_elder_pretalk",[]],
  [anyone ,"village_elder_ask_fugitive", [],
    "Strangers come and go to our village, {reg59?madam:sir}. If he is hiding here, you will surely find him if you look around.", "close_window",[]],
  
  [anyone|plyr,"village_elder_talk", [ (neq, "$g_encountered_party_type", spt_levy),(store_partner_quest,":elder_quest"),(ge,":elder_quest",0)],
    "About the task you asked of me...", "village_elder_active_mission_1",[]],
  
  [anyone|plyr,"village_elder_talk", [(neq, "$g_encountered_party_type", spt_levy),
      
      (assign, ":continue", 0),
      (store_faction_of_party, ":party_faction", "$current_town"),
      (store_troop_faction, ":player_faction", "trp_player"),
      (try_begin),
        (eq, ":party_faction", ":player_faction"),
        (assign, ":continue", 1),
      (else_try),
        (store_relation, ":relation", ":party_faction", ":player_faction"),
        (ge, ":relation", 0),
        (assign, ":continue", 1),
      (try_end),
      (eq, ":continue", 1),
      #(party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),(ge, ":center_relation", 0),
      #(ge, "$g_talk_troop_faction_kingdom_relation", 0),
      (store_partner_quest,":elder_quest"),(lt,":elder_quest",0)],
    "Do you have any tasks I can help you with?", "village_elder_request_mission_ask",[]],
  
  [anyone|plyr,"village_elder_talk", [(party_slot_eq, "$current_town", slot_village_state, 0),
      (neq, "$g_encountered_party_type", spt_levy),
      (neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),],
    "I want to buy some supplies. I will pay with silver.", "village_elder_trade_begin",[]],
  #Levy
  [anyone|plyr,"village_elder_talk", [(party_slot_eq, "$current_town", slot_village_state, 0),
      (neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
      (party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
      (party_slot_eq,"$current_town", slot_party_levy_on, 0),
      (eq, "$g_encountered_party_type", spt_village),
      (party_get_slot, ":prosperity", "$current_town", slot_town_prosperity),
      (gt, ":prosperity", 25),
    ],
    "I need to raise the levy.", "village_elder_levy_begin",[]],
  
  [anyone, "village_elder_levy_begin",[(party_get_slot, ":prosperity", "$current_town", slot_town_prosperity),
      (val_div, ":prosperity", 2),
      (val_max, ":prosperity", 30),
      (assign, reg33, ":prosperity"),],"Very well. We can raise {reg33} people. Do you want to proceed? Please, keep in mind that taking men away from the fields will negatively impact our village.", "village_elder_levy_1",[(assign, "$temp", reg33),]],
  [anyone|plyr,"village_elder_levy_1", [],"Hmm, no, I don't want to do that.","village_elder_pretalk",[]],
  [anyone|plyr,"village_elder_levy_1", [],"Yes, please call up all the eligible men. And get your gear, too.","village_elder_levy_2",[]],
  [anyone, "village_elder_levy_2",[],"As you wish, {playername}.", "close_window", [
      (set_spawn_radius, 5),
      (spawn_around_party,"$current_town","pt_village_elder"),
      (assign, ":party_no", reg(0)),
      (party_add_leader, ":party_no", "$g_talk_troop"),
      (party_set_faction, ":party_no", "$players_kingdom"),
      (party_set_slot, ":party_no", slot_party_home_center, "$current_town"),
      (troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, ":party_no"),
      (party_set_slot, ":party_no", slot_party_type, spt_levy),
      (troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, -1),
      (party_get_slot, ":center_culture", "$current_town", slot_center_culture),
      (faction_get_slot, ":levy_troop1", ":center_culture", slot_faction_tier_1_troop),
      (faction_get_slot, ":levy_troop2", ":center_culture", slot_faction_tier_2_troop),
      (troop_get_upgrade_troop, ":levy_troop2a", ":levy_troop1", 1),
      (store_div, ":amount", "$temp", 2),
      (party_add_members, ":party_no", ":levy_troop2",":amount"),
      (party_get_slot, ":prosperity", "$current_town", slot_town_prosperity),
      (try_begin),
        (lt, ":prosperity", "$temp"),
        (party_set_slot, "$current_town", slot_town_prosperity, 0),
      (else_try),
        (val_sub, ":prosperity", "$temp"),
        (party_set_slot, "$current_town", slot_town_prosperity, ":prosperity"),
      (try_end),
      (store_div, ":amount2", ":amount", 2),
      (party_add_members, ":party_no", ":levy_troop2a",":amount2"),
      (party_add_members, ":party_no", ":levy_troop1",":amount2"),
      (val_sub, ":amount", ":amount2"),
      (val_sub, ":amount", ":amount2"),
      (try_begin),
        (gt, ":amount", 0),
        (party_add_members, ":party_no", ":levy_troop1",":amount"),
      (try_end),
      (call_script, "script_change_player_relation_with_center", "$current_town", -3),
      (party_set_ai_behavior, ":party_no", ai_bhvr_hold),
      (party_set_slot,":party_no", slot_party_ai_state, spai_accompanying_army),
      (party_set_slot, ":party_no", slot_party_ai_object, "p_main_party"),
      (str_store_party_name, s40, "$current_town"),
      (str_store_string, s40, "@{s40}'s Levy"),
      (troop_set_health, "$g_talk_troop", 100),
      (party_set_name, ":party_no", s40),
      (try_begin),
        (troop_get_slot, ":banner", "trp_player", slot_troop_banner_scene_prop),
        (try_begin),
          (gt, ":banner", 0),
          (val_sub, ":banner", banner_scene_props_begin),
          (val_add, ":banner", banner_map_icons_begin),
        (try_end),
      (try_end),
      (party_set_banner_icon, ":party_no", ":banner"),
      (store_random_in_range, ":coat", "itm_gambeson21", "itm_gambeson1gael"),
      (troop_add_item,"$g_talk_troop", ":coat"),
      (troop_get_inventory_slot, ":slot_head", "$g_talk_troop", ek_head),
      (try_begin),
        (gt, ":slot_head", 0),
        (item_get_head_armor, ":ha", ":slot_head"),
        (gt, ":ha", 20),
      (else_try),
        (store_random_in_range, ":slot_head", "itm_briton_helm", "itm_briton_helm5"),
        (troop_add_item,"$g_talk_troop", ":slot_head"),
      (try_end),
      (store_random_in_range, ":axe", "itm_axe", "itm_axe_3"),
      (troop_add_item,"$g_talk_troop", ":axe"),
      (troop_add_item,"$g_talk_troop", "itm_javelin"),
      (store_random_in_range, ":shield", "itm_shield_1", "itm_shield_7"),
      (troop_add_item,"$g_talk_troop", ":shield"),
      (troop_equip_items, "$g_talk_troop"),
      (party_set_slot, "$current_town", slot_party_levy_on, 1),
  ]],
  #Levy
  [anyone,"start", [(is_between, "$g_talk_troop", village_elders_begin, village_elders_end),
      (eq, "$g_encountered_party_faction","$players_kingdom"),
      (eq, "$g_encountered_party_type", spt_levy),],
    "Yes, my {reg59?lady:lord}?", "village_elder_march",[(assign, "$g_leave_encounter", 1)]],
  
  [anyone|plyr,"village_elder_march",[],"I have a new task for you.", "village_elder_give_order",[]],
  
  [anyone,"village_elder_give_order", [],"What would you like us to do?", "village_elder_give_order1",[]],
  
  [anyone|plyr,"village_elder_give_order1",[],"Follow me.","village_elder_follow",[]],
  
  [anyone,"village_elder_follow",[],"Of course.","close_window",[
      (party_set_ai_object,"$g_encountered_party","p_main_party"),
      (party_set_ai_behavior,"$g_encountered_party",ai_bhvr_escort_party),
      (party_set_slot,"$g_encountered_party", slot_party_ai_state, spai_accompanying_army),
      (store_random_in_range, ":number", 200, 10000),
      (party_set_helpfulness, "$g_encountered_party", ":number"), ]],
  [anyone|plyr,"village_elder_give_order1",[],"I don't require your services any longer...","village_elder_disband",[]],
  [anyone,"village_elder_disband",[],"Thank you. We'll be happy to go back home.","close_window",[
      (store_party_size_wo_prisoners, ":size", "$g_encountered_party"),
      (val_sub, ":size", 1),
      (try_for_range, ":cur_village", villages_begin, villages_end),
        (party_get_slot, ":village_elder", ":cur_village", slot_town_elder),
        (eq, ":village_elder", "$g_talk_troop"),
        (try_for_range, ":slot", ek_item_0, ek_head),
          (troop_get_inventory_slot, ":weapon", ":village_elder", ":slot"),
          (gt, ":weapon", 0),
          (troop_inventory_slot_set_item_amount, ":village_elder", ":slot",0),
        (try_end),
        (troop_get_inventory_slot, ":slot_coat", ":village_elder", ek_body),
        (try_begin),
          (gt, ":slot_coat", 0),
          (item_get_body_armor, ":ba", ":slot_coat"),
          (gt, ":ba", 25),
          (troop_remove_item, ":village_elder", ":slot_coat"),
          (troop_equip_items, ":village_elder"),
        (try_end),
        (troop_get_inventory_slot, ":slot_coat", ":village_elder", ek_body),
        (try_begin),
          (le, ":slot_coat", 0),
          (party_get_slot, ":center_culture", ":cur_village", slot_center_culture),
          (try_begin),
            (this_or_next|eq,":center_culture","fac_culture_saxon"),
            (eq,":center_culture","fac_culture_angle"),
            (store_random_in_range, ":new", "itm_bl_tunic06", "itm_yellow_cloak"),
          (else_try),
            (eq, ":center_culture", "fac_culture_welsh"),
            (store_random_in_range, ":new", "itm_briton_tunic9", "itm_briton_tunic15"),
          (else_try),
            (eq, ":center_culture", "fac_culture_norse"),
            (store_random_in_range, ":new", "itm_btunic_3", "itm_btunic_12"),
          (else_try),
            (eq, ":center_culture", "fac_culture_scotch"),
            (store_random_in_range, ":new", "itm_briton_tunic15", "itm_briton_tunic19"),
          (else_try),
            (eq, ":center_culture", "fac_culture_irish"),
            (store_random_in_range, ":new", "itm_briton_tunic20", "itm_celta_capa3"),
          (try_end),
          (troop_add_item, ":village_elder", ":new"),
          (troop_equip_items, ":village_elder"),
        (try_end),
        (troop_get_inventory_slot, ":slot_head", ":village_elder", ek_head),
        (try_begin),
          (gt, ":slot_head", 0),
          (item_get_head_armor, ":ha", ":slot_head"),
          (gt, ":ha", 20),
          (troop_remove_item, ":village_elder", ":slot_head"),
        (try_end),
        (party_set_slot, ":cur_village", slot_party_levy_on, 0),
        (party_get_slot, ":prosperity", ":cur_village", slot_town_prosperity),
        (val_add, ":prosperity", ":size"),
        (party_set_slot, ":cur_village", slot_town_prosperity, ":prosperity"),
      (try_end),
      (assign, "$g_leave_encounter", 1),
      (remove_party, "$g_encountered_party"),
      (assign, "$g_encountered_party", -1),
      (troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, -1),
      (leave_encounter), ]],
  #castle tax rate
  [anyone|plyr,"reeve_talk",[(party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
      (eq, "$g_encountered_party_type", spt_castle),], "I would like to set a new tax rate for this fort.", "castle_tax",[(assign, "$temp",0),]],
  [anyone|plyr,"reeve_talk", [], "[Leave]", "close_window",[]],
  [anyone, "castle_tax", [],"Certainly. What taxes do you want us to pay you?","castle_tax2",[]],
  
  [anyone|plyr, "castle_tax2", [(party_get_slot, ":tax", "$current_town", slot_center_tax_rate),
      (assign, "$tax_rate", ":tax"),
      (this_or_next|eq, "$tax_rate", 0),
      (eq, "$tax_rate", 2),],"I would like to set a low tax rate.", "castle_tax3", [(assign, "$temp",1),]],
  
  [anyone|plyr, "castle_tax2", [(party_get_slot, ":tax", "$current_town", slot_center_tax_rate),
      (assign, "$tax_rate", ":tax"),
      (this_or_next|eq, "$tax_rate", 0),
      (eq, "$tax_rate", 1),],"I would like to set a high tax rate.", "castle_tax3", [(assign, "$temp",2),]],
  
  [anyone|plyr, "castle_tax2", [(party_get_slot, ":tax", "$current_town", slot_center_tax_rate),
      (assign, "$tax_rate", ":tax"),
      (this_or_next|eq, "$tax_rate", 1),
      (eq, "$tax_rate", 2),],"I would like to set a normal tax rate.", "castle_tax3", [(assign, "$temp",0),]],
  
  [anyone|plyr, "castle_tax2",[],"Actually, I changed my mind.","reeve_pretalk",[]],
  
  [anyone, "castle_tax3", [], "Most certainly. We shall abide by your most gracious order.", "reeve_pretalk", [(party_set_slot, "$current_town", slot_center_tax_rate, "$temp"),]],
  
  [anyone|plyr,"village_elder_talk",[(party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
      (eq, "$g_encountered_party_type", spt_village),], "I would like to set a new tax rate for this village.", "village_tax",[(assign, "$temp",0),]],
  #Village tax rate
  [anyone, "village_tax", [],"Certainly. What taxes do you want us to pay you?","village_tax2",[]],
  
  [anyone|plyr, "village_tax2", [(party_get_slot, ":tax", "$current_town", slot_center_tax_rate),
      (assign, "$tax_rate", ":tax"),
      (this_or_next|eq, "$tax_rate", 0),
      (eq, "$tax_rate", 2),],"I would like to set a low tax rate.", "village_tax3", [(assign, "$temp",1),]],
  
  [anyone|plyr, "village_tax2", [(party_get_slot, ":tax", "$current_town", slot_center_tax_rate),
      (assign, "$tax_rate", ":tax"),
      (this_or_next|eq, "$tax_rate", 0),
      (eq, "$tax_rate", 1),],"I would like to set a high tax rate.", "village_tax3", [(assign, "$temp",2),]],
  
  [anyone|plyr, "village_tax2", [(party_get_slot, ":tax", "$current_town", slot_center_tax_rate),
      (assign, "$tax_rate", ":tax"),
      (this_or_next|eq, "$tax_rate", 1),
      (eq, "$tax_rate", 2),],"I would like to set a normal tax rate.", "village_tax3", [(assign, "$temp",0),]],
  
  [anyone|plyr, "village_tax2",[],"Actually, I changed my mind.","village_elder_pretalk",[]],
  
  [anyone, "village_tax3", [], "Most certainly. We shall abide by your most gracious order.", "village_elder_pretalk", [(party_set_slot, "$current_town", slot_center_tax_rate, "$temp"),]],
  
  
  
  
  
  
  
  
  
  
  
  [anyone|plyr,"village_elder_give_order1", [],"Never mind.", "close_window",[]],
  
  [anyone ,"village_elder_trade_begin", [], "Of course, {reg59?madam:sir}. Do you want to buy goods or cattle?", "village_elder_trade_talk",[]],
  
  [anyone|plyr,"village_elder_trade_talk", [], "I want to buy food and supplies.", "village_elder_trade",[]],
  
  [anyone ,"village_elder_trade", [],
    "We have some food and other supplies in our storehouse. Come and have a look.", "village_elder_pretalk",[(troop_set_auto_equip, "$g_talk_troop", 0),(change_screen_trade, "$g_talk_troop"),]],
  
  [anyone|plyr,"village_elder_trade_talk", [(party_slot_eq, "$current_town", slot_village_state, 0),
      (neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
      (assign, ":quest_village", 0),
      (try_begin),
        (check_quest_active, "qst_deliver_cattle"),
        (quest_slot_eq, "qst_deliver_cattle", slot_quest_target_center, "$current_town"),
        (assign, ":quest_village", 1),
      (try_end),
      (eq, ":quest_village", 0),
    ],
    "I want to buy some cattle.", "village_elder_buy_cattle",[]],
  
  ###gift cattle Mike
  [anyone|plyr, "village_elder_talk", [ (is_between,"$g_talk_troop",village_elders_begin,village_elders_end),
      (eq, "$g_encountered_party_type", spt_village),
      (store_partner_quest,":elder_quest"),
      (neq,":elder_quest","qst_deliver_cattle"),
      (neg|check_quest_active, "qst_move_cattle_herd"),
      (assign, reg25, 0),
      (try_for_parties, ":party_no"),
        (party_slot_eq, ":party_no", slot_party_type, spt_cattle_herd),
        (party_slot_eq, ":party_no", slot_cattle_driven_by_player, 1),
        (store_distance_to_party_from_party, ":distance", ":party_no", "p_main_party"),
        (lt, ":distance", 3),
        (party_count_members_of_type, ":num", ":party_no", "trp_cattle"),
        (val_add, reg25, ":num"),
      (try_end),
      (gt, reg25, 0),
      (assign, "$temp", reg25),
      ],"I have {reg25} head of cattle that I would like to gift to your village.", "village_elder_get_cattle_gift",[]],
  
  [anyone,  "village_elder_get_cattle_gift", [],
    "Yes, definitely. Our people will be extremely grateful for such a generous gift.","village_elder_pretalk",[
      (assign, reg25, "$temp"),
      (call_script, "script_remove_cattles_if_herd_is_close_to_party", "$current_town", reg25),
      (store_div, ":change", reg25, 5),
      (val_min, ":change", 5),
      (call_script, "script_change_center_prosperity", "$current_town", ":change"),
      
      (try_begin),
        (party_get_slot, ":cur_relation", "$current_town", slot_center_player_relation),
        (le, ":cur_relation", 45),
        (call_script, "script_change_player_relation_with_center", "$current_town", ":change"),
      (try_end),
      (val_min, ":change", 1),
      (try_begin),
        (le, "$player_honor", 20),
        (call_script, "script_change_player_honor", ":change"),
      (try_end),
  ]],
  #####
  
  [anyone|plyr,"village_elder_trade_talk", [], "I changed my mind. I don't need to buy anything.", "village_elder_pretalk",[]],
  
  [anyone|plyr,"village_elder_talk",
    [	 (eq, "$g_encountered_party_type", spt_village),
    ],
    "Have you seen any enemies around here recently?", "village_elder_ask_enemies",[]],
  
  [anyone,"village_elder_ask_enemies",
    [
      (assign, ":give_report", 0),
      (party_get_slot, ":original_faction", "$g_encountered_party", slot_center_original_faction),
      (store_relation, ":original_faction_relation", ":original_faction", "fac_player_faction"),
      (try_begin),
        (gt, ":original_faction_relation", 0),
        (party_slot_ge, "$g_encountered_party", slot_center_player_relation, 0),
        (assign, ":give_report", 1),
      (else_try),
        (party_slot_ge, "$g_encountered_party", slot_center_player_relation, 30),
        (assign, ":give_report", 1),
      (try_end),
      (eq, ":give_report", 0),
    ],
    "I am sorry, {reg59?madam:sir}. We have neither seen nor heard of any war parties in this area.", "village_elder_pretalk",
    []],
  
  [anyone,"village_elder_ask_enemies",
    [],
    "Hmm. Let me think about it...", "village_elder_tell_enemies",
    [
      (assign, "$temp", 0),
  ]],
  
  [anyone,"village_elder_tell_enemies",
    [
      (assign, ":target_hero_index", "$temp"),
      (assign, ":end_cond", active_npcs_end),
      (try_for_range, ":cur_troop", active_npcs_begin, ":end_cond"),
        (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
        (troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party),
        (gt, ":cur_party", 0),
        (store_troop_faction, ":cur_faction", ":cur_troop"),
        (store_relation, ":reln", ":cur_faction", "fac_player_faction"),
        (lt, ":reln", 0),
        (store_distance_to_party_from_party, ":dist", "$g_encountered_party", ":cur_party"),
        (lt, ":dist", 10),
        (call_script, "script_get_information_about_troops_position", ":cur_troop", 0),
        (eq, reg0, 1), #Troop's location is known.
        (val_sub, ":target_hero_index", 1),
        (lt, ":target_hero_index", 0),
        (assign, ":end_cond", 0),
        (str_store_string, s2, "@He is not commanding any men at the moment."),
        (assign, ":num_troops", 0),
        (assign, ":num_wounded_troops", 0),
        (party_get_num_companion_stacks, ":num_stacks", ":cur_party"),
        (try_for_range_backwards, ":i_stack", 0, ":num_stacks"),
          (party_stack_get_troop_id, ":stack_troop", ":cur_party", ":i_stack"),
          (neg|troop_is_hero, ":stack_troop"),
          (party_stack_get_size, ":stack_size", ":cur_party", ":i_stack"),
          (party_stack_get_num_wounded, ":num_wounded", ":cur_party", ":i_stack"),
          (val_add, ":num_troops", ":stack_size"),
          (val_add, ":num_wounded_troops", ":num_wounded"),
        (try_end),
        (gt, ":num_troops", 0),
        (call_script, "script_round_value", ":num_wounded_troops"),
        (assign, reg1, reg0),
        (call_script, "script_round_value", ":num_troops"),
        (str_store_string, s2, "@He currently commands {reg0} men{reg1?, of which around {reg1} are wounded:}."),
      (try_end),
      (eq, ":end_cond", 0),
    ],
    "{!}{s1} {s2}", "village_elder_tell_enemies",
    [
      (val_add, "$temp", 1),
  ]],
  
  [anyone,"village_elder_tell_enemies",
    [(eq, "$temp", 0)],
    "No, {reg59?madam:sir}. We haven't seen any war parties in this area for some time.", "village_elder_pretalk",
    []],
  
  [anyone,"village_elder_tell_enemies",
    [],
    "Well, I guess that was all.", "village_elder_pretalk",
    []],
  
  ##Torturer dialogs -- Juju70
  
  [anyone, "tort_explained", [(eq, "$g_talk_troop", "trp_doccinga_torturador"),
      (store_current_scene,":current_scene"),(neq,":current_scene","scn_doccinga_prison"), ],"My {reg59?lady:lord}, I can beat and torture your enemies for your pleasure or if you want to make an enemy lord do something. " +
    "For example, you can force an enemy lord to grant permission to court his daughter or sister, if such permission is hard to gain for you by any other means. Or you can force the lord to grant you parts of his rents from his " +
    "fief for some time in exchange for freedom. If the lord is pagan and married, you can try to force him to divorce his wife. Then, of course, you will be free to pursue her as a free woman.", "torture_1",[]],
  
  [anyone|plyr,"torture_1",[],"Thank you. That was informative.", "torture_pretalk",[]],
  
  [anyone, "start", [(eq, "$g_talk_troop", "trp_doccinga_torturador"),
      (store_current_scene,":current_scene"),(neq,":current_scene","scn_doccinga_prison"),], "My {reg59?lady:lord}, what can I do for you?", "torture_menu",[]],
  
  [anyone|plyr, "torture_menu", [], "Torturer? What is it you can do?", "tort_explained",[]],
  
  [anyone|plyr,"torture_menu",[(party_get_num_prisoner_stacks, ":num_stacks","$current_town"),
      (party_clear, "p_temp_party"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_prisoner_stack_get_troop_id, ":stack_troop","$current_town",":i_stack"),
        (troop_is_hero, ":stack_troop"),
        (troop_set_slot, ":stack_troop", slot_troop_prisoner_of_party, "$current_town"),
        (party_add_members, "p_temp_party", ":stack_troop", 1),
      (try_end),
      (party_get_num_companion_stacks, ":num_stacks","p_temp_party"),
      (gt, ":num_stacks", 0),],"I'd like you to have a little chat with one of the prisoners.", "torture_menu1",[]],
  
  
  [anyone|plyr,"torture_menu",[],"Nothing, I'm just checking the prison out.", "close_window",[]],
  
  [anyone, "torture_menu1", [], "Whom do you want me to talk to?", "torture_menu2",[]],
  
  [anyone|plyr|repeat_for_troops,"torture_menu2",[
      (store_repeat_object, ":troop_no"),
      (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (troop_slot_eq, ":troop_no", slot_troop_prisoner_of_party, "$current_town"),
      (store_troop_health, ":health", ":troop_no", 0),
      (gt, ":health", 60),
      (str_store_troop_name, s10, ":troop_no"),
      ], "{!}{s10}","torture_menu3", [ (store_repeat_object, "$temp"),]],
  
  [anyone|plyr,"torture_menu2",[],"Never mind.", "close_window",[]],
  
  [anyone, "torture_menu3", [ (str_store_troop_name, s10, "$temp"),
      (try_for_agents, ":cur_agent"),
        (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
        (eq,":cur_agent_troop","$temp"),
        (assign, "$temp2",  ":cur_agent"),
      (try_end),
      (store_troop_health, ":health", "$temp", 0),
      (agent_set_slot, "$temp2", slot_agent_fatiga, ":health"),
      (agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (gt, ":basic_stamina", 1),
      ], "Alright, what do you want me to do with {s10}?", "torture_menu4",[(set_conversation_speaker_troop,"trp_doccinga_torturador"),
  ]],
  
  [anyone|plyr,"torture_menu4",[
      (agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (le, ":basic_stamina", 1),
      ],"Dump that bucket of water on him. Maybe then he'll come back to life.", "torture_menu5",[
      (troop_get_slot, ":tor", "$temp", slot_troop_tortured),
      (val_add, ":tor", 1),
      (troop_set_slot, "$temp", slot_troop_tortured, ":tor"),
  ]],
  [anyone|plyr,"torture_menu4",[
      (agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (gt, ":basic_stamina", 1),
      ],"I'd like you to hit his face, but be careful. He hasn't been ransomed yet.", "torture_menu5",[
      (troop_get_slot, ":tor", "$temp", slot_troop_tortured),
      (val_add, ":tor", 4),
      (troop_set_slot, "$temp", slot_troop_tortured, ":tor"),
  ]],
  
  [anyone|plyr,"torture_menu4",[
      (agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (gt, ":basic_stamina", 1),],"Just beat him up... a little bit, but be gentle.", "torture_menu5",[
      (troop_get_slot, ":tor", "$temp", slot_troop_tortured),
      (val_add, ":tor", 6),
      (troop_set_slot, "$temp", slot_troop_tortured, ":tor"),
  ]],
  
  [anyone|plyr,"torture_menu4",[
      (agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (gt, ":basic_stamina", 1),],"Warm up that iron rod. Let's see how well he can handle the heat.", "torture_menu5a",[
      (troop_get_slot, ":tor", "$temp", slot_troop_tortured),
      (val_add, ":tor", 8),
      (troop_set_slot, "$temp", slot_troop_tortured, ":tor"),
  ]],
  
  [anyone|plyr,"torture_menu4",[],"Never mind.", "torture_pretalk",[
      (agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (store_troop_health, ":health", "$temp", 0),
      (lt, ":basic_stamina", ":health"),
      (troop_set_health,  "$temp", ":basic_stamina"),
  ]],
  
  [anyone, "torture_menu5", [(agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (gt, ":basic_stamina", 1),], "Very well, I will do that.", "torture_menu6",[]],
  
  [anyone, "torture_menu5a", [(agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (gt, ":basic_stamina", 1),
      ], "Very well, I will do that.", "torture_menu6a",[]],
  
  [anyone, "torture_menu5", [(agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (le, ":basic_stamina", 1),
      ], "Very well, I will do that.", "torture_menu6b",[]],
  
  [anyone,"torture_menu6", [
      (agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (store_skill_level, ":player_power_strike", "skl_power_strike", "trp_player"),
      (store_skill_level, ":torturer_power_strike", "skl_power_strike", "trp_doccinga_torturador"),
      (store_add, ":ps_max", ":player_power_strike", ":torturer_power_strike"),
      (store_random_in_range, ":rand", 1, ":ps_max"),
      (val_sub, ":basic_stamina", ":rand"),
      (val_max, ":basic_stamina", 1),
      (agent_set_slot, "$temp2", slot_agent_fatiga, ":basic_stamina"),
      (try_begin),
        (store_troop_health, ":health", "$temp", 0),
        (lt, ":basic_stamina", ":health"),
        (troop_set_health, "$temp", ":basic_stamina"),
      (try_end),
      (call_script, "script_change_player_relation_with_troop", "$temp", -4),
      (call_script, "script_change_player_honor", -2),
      (agent_set_no_death_knock_down_only, "$temp2", 1),
      (agent_deliver_damage_to_agent, "$g_talk_agent", "$temp2", 10000),
      (play_sound,"snd_aaa_scream")],"Aaaaaaaaaaaaaaaaaaaaaaaaaaaaah","torture_menu3",[(set_conversation_speaker_troop,"$temp"),]],
  
  [anyone,"torture_menu6a", [
      (agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (store_skill_level, ":player_power_strike", "skl_power_strike", "trp_player"),
      (store_skill_level, ":torturer_power_strike", "skl_power_strike", "trp_doccinga_torturador"),
      (store_add, ":ps_max", ":player_power_strike", ":torturer_power_strike"),
      (store_random_in_range, ":rand", 5, ":ps_max"),
      (val_sub, ":basic_stamina", ":rand"),
      (val_max, ":basic_stamina", 1),
      (agent_set_slot, "$temp2", slot_agent_fatiga, ":basic_stamina"),
      (try_begin),
        (store_troop_health, ":health", "$temp", 0),
        (lt, ":basic_stamina", ":health"),
        (troop_set_health, "$temp", ":basic_stamina"),
      (try_end),
      (call_script, "script_change_player_relation_with_troop", "$temp", -6),
      (call_script, "script_change_player_honor", -4),
      (agent_set_no_death_knock_down_only, "$temp2", 1),
      (agent_deliver_damage_to_agent, "$g_talk_agent", "$temp2", 10000),
      (play_sound,"snd_man_scream")],"Aaaaaaaaaaaaaaaaaaaaaaaaaaaaah!!!!!!!!","torture_menu3",[(set_conversation_speaker_troop,"$temp"),]],
  
  [anyone,"torture_menu6b", [
      (agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (store_skill_level, ":player_wound", "skl_wound_treatment", "trp_player"),
      (store_skill_level, ":first_aid", "skl_first_aid", "trp_player"),
      (store_add, ":wt_max", ":player_wound", ":first_aid"),
      #		(assign, reg44, ":wt_max"),
      #		(display_message, "@max is {reg44}"),
      (val_max, ":wt_max", 1),
      (store_random_in_range, ":rand", 1, ":wt_max"),
      (val_add, ":basic_stamina", ":rand"),
      (val_max, ":basic_stamina", 1),
      #		(assign, reg33, ":basic_stamina"),
      #		(display_message, "@Stamina is {reg33}"),
      (agent_set_slot, "$temp2", slot_agent_fatiga, ":basic_stamina"),
      (troop_set_health, "$temp", ":basic_stamina"),
      (play_sound,"snd_water")],"Whoooosh!!!!!!!!","torture_menu6c",[]],
  
  [anyone,"torture_menu6c", [
      (agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (lt, ":basic_stamina", 15),],"Looks like he's alive, but he needs to recover a little bit for further conversations.","torture_pretalk",[]],
  
  [anyone,"torture_menu6c", [], "Looks like that one fell short. Shall we try something else?", "torture_menu",[]],
  
  [anyone, "torture_pretalk", [], "Anything else?", "torture_menu",[]],
  
  [anyone, "torture_menu3", [
      (agent_get_slot, ":basic_stamina", "$temp2", slot_agent_fatiga),
      (le, ":basic_stamina", 1),
    ],
    "I think the prisoner has passed out.", "torture_menu4", [
      (agent_set_no_death_knock_down_only, "$temp2", 0),
      (agent_deliver_damage_to_agent, "$g_talk_agent", "$temp2", 10000),
      (troop_set_health, "$temp", 0),
      (store_random_in_range, ":rand", 0, 100),
      (try_begin),
        (lt, ":rand", 8),
        (store_skill_level, ":leadership", "skl_leadership", "$temp"),
        (gt, ":leadership", 5),
        (troop_raise_skill, "$temp",skl_leadership,-1),
        (str_store_troop_name, s33, "$temp"),
        (display_message, "@{s33} lost 1 point of leadership"),
      (else_try),
        (lt, ":rand", 15),
        (store_attribute_level, ":charisma", "$temp", ca_charisma),
        (gt, ":charisma", 14),
        (troop_raise_attribute,"$temp",ca_charisma, -1),
        (str_store_troop_name, s33, "$temp"),
        (display_message, "@{s33} lost 1 point of charisma"),
      (else_try),
        (str_store_troop_name, s33, "$temp"),
        (display_message, "@{s33} didn't suffer any injuries"),
      (try_end),
      (call_script, "script_change_player_honor", -5),
  ]],
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  #(fire set up dialogs begin) Asking village elder to set up fire for making prison break easier.
  [anyone|plyr,"village_elder_talk",
    [	 (eq, "$g_encountered_party_type", spt_village),
      (party_get_slot, ":bound_center", "$current_town", slot_village_bound_center),
      
      (assign, ":num_heroes_in_dungeon", 0),
      (assign, ":num_heroes_given_parole", 0),
      
      (party_get_num_prisoner_stacks, ":num_stacks", ":bound_center"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_prisoner_stack_get_troop_id, ":stack_troop",":bound_center",":i_stack"),
        (troop_is_hero, ":stack_troop"),
        (try_begin),
          (call_script, "script_cf_prisoner_offered_parole", ":stack_troop"),
          (party_add_members, "p_temp_party_2", ":stack_troop", 1),
          (val_add, ":num_heroes_given_parole", 1),
        (else_try),
          (party_add_members, "p_temp_party", ":stack_troop", 1),
          (val_add, ":num_heroes_in_dungeon", 1),
        (try_end),
      (try_end),
      
      (ge, ":num_heroes_in_dungeon", 1),
    ],
    "I need you to set a large fire on the outskirts of this village.", "village_elder_ask_set_fire",[]],
  
  [anyone,"village_elder_ask_set_fire",
    [
      (eq, "$g_village_elder_did_not_liked_money_offered", 0),
      (party_get_slot, ":bound_center", "$current_town", slot_village_bound_center),
      (party_get_slot, ":fire_time", ":bound_center", slot_town_last_nearby_fire_time),
      (store_current_hours, ":cur_time"),
      (ge, ":fire_time", ":cur_time"),
    ],
    "We have already agreed upon this, {reg59?my lady:sir}. I will do my best. You can trust me.", "close_window",[]],
  
  [anyone,"village_elder_ask_set_fire",
    [
      (eq, "$g_village_elder_did_not_liked_money_offered", 0),
    ],
    "A fire, {reg59?madam:sir}! Fires are dangerous! Why would you want such a thing?", "village_elder_ask_set_fire_1",[]],
  
  [anyone,"village_elder_ask_set_fire", #elder did not accepted 100 peningas before
    [
      (eq, "$g_village_elder_did_not_liked_money_offered", 1),
    ],
    "I believe that we have already discussed this issue, {reg59?my lady:sir}.", "village_elder_ask_set_fire_5",[]],
  
  [anyone,"village_elder_ask_set_fire", #elder did not accepted 100 and 200 peningas before
    [
      (eq, "$g_village_elder_did_not_liked_money_offered", 2),
    ],
    "We talked about this before, {reg59?madam:sir}. Your previous offers were low compared to risk you want me to take.", "village_elder_ask_set_fire_5",[]],
  
  [anyone|plyr,"village_elder_ask_set_fire_1",[],
    "I have my reasons, and you will have yours -- a purse of silver. Will you do it, or not?", "village_elder_ask_set_fire_2",[]],
  
  [anyone|plyr,"village_elder_ask_set_fire_1",[],
    "Given the risk you are taking, you are entitled to know my plan.", "village_elder_ask_set_fire_explain_plan",[]],
  
  [anyone|plyr,"village_elder_ask_set_fire_explain_plan",[
      (party_get_slot, ":bound_center", "$g_encountered_party", slot_village_bound_center),
      (str_store_party_name, s4, ":bound_center"),
    ],
    "I wish to rescue a prisoner from {s4}. When you light the fire, the guards in {s4} will see the smoke, and some of them will rush outside to see what is going on. ", "village_elder_ask_set_fire_2",[]],
  
  
  [anyone,"village_elder_ask_set_fire_2",[
      (gt, "$g_talk_troop_effective_relation", 9),
    ],
    "As you wish, {reg59?my lady:sir}. You have been a good friend to this village, and, even though there is a risk, we should be glad to return the favor. When do you want this fire to start?", "village_elder_ask_set_fire_9",[]],
  
  [anyone,"village_elder_ask_set_fire_2",[
      (lt, "$g_talk_troop_relation", 0),
    ],
    "I'm sorry, {reg59?my lady:sir}. You will forgive me for saying this, but we don't exactly have good reason to trust you. This is too dangerous.", "close_window",[]],
  
  [anyone,"village_elder_ask_set_fire_2",[],
    "As you say, {reg59?my lady:sir}, but in doing this, we are taking a very great risk. What's in it for us?", "village_elder_ask_set_fire_3",[]],
  
  
  [anyone|plyr,"village_elder_ask_set_fire_3",
    [
      (store_troop_gold, ":cur_gold", "trp_player"),
      (ge, ":cur_gold", 100),
    ],
    "I can give you 100 peningas.", "village_elder_ask_set_fire_4",[(assign, "$g_last_money_offer_to_elder", 100),]],
  
  [anyone|plyr,"village_elder_ask_set_fire_3",
    [
      (store_troop_gold, ":cur_gold", "trp_player"),
      (ge, ":cur_gold", 200),
    ],
    "I can give you 200 peningas.", "village_elder_ask_set_fire_6",[(assign, "$g_last_money_offer_to_elder", 200),]],
  
  [anyone|plyr,"village_elder_ask_set_fire_3",
    [
      (store_troop_gold, ":cur_gold", "trp_player"),
      (ge, ":cur_gold", 300),
    ],
    "I can give you 300 peningas.", "village_elder_ask_set_fire_6",[(assign, "$g_last_money_offer_to_elder", 300),]],
  
  [anyone|plyr,"village_elder_ask_set_fire_3",[],
    "Never mind.", "close_window",[]],
  
  [anyone,"village_elder_ask_set_fire_4",
    [
      (eq, "$g_village_elder_did_not_liked_money_offered", 0),
    ],
    "This is madness. I cannot take such a risk.", "village_elder_talk",
    [
      (assign, "$g_village_elder_did_not_liked_money_offered", 1),
  ]],
  
  [anyone|plyr,"village_elder_ask_set_fire_5",
    [
      (eq, "$g_village_elder_did_not_liked_money_offered", 1),
      (store_troop_gold, ":cur_gold", "trp_player"),
      (ge, ":cur_gold", 200),
    ],
    "Then let's increase your reward to 200 peningas.", "village_elder_ask_set_fire_7", [(assign, "$g_last_money_offer_to_elder", 200),]],
  
  [anyone|plyr,"village_elder_ask_set_fire_5",
    [
      (eq, "$g_village_elder_did_not_liked_money_offered", 1),
      (store_troop_gold, ":cur_gold", "trp_player"),
      (ge, ":cur_gold", 300),
    ],
    "Then let's increase your reward to 300 peningas.", "village_elder_ask_set_fire_6",[(assign, "$g_last_money_offer_to_elder", 300),]],
  
  [anyone|plyr,"village_elder_ask_set_fire_5",
    [
      (eq, "$g_village_elder_did_not_liked_money_offered", 2),
      (store_troop_gold, ":cur_gold", "trp_player"),
      (ge, ":cur_gold", 300),
    ],
    "Then let's increase your reward to 300 peningas. This is my last offer.", "village_elder_ask_set_fire_6",[(assign, "$g_last_money_offer_to_elder", 300),]],
  
  [anyone|plyr,"village_elder_ask_set_fire_5",[],
    "Never mind.", "close_window",[]],
  
  [anyone,"village_elder_ask_set_fire_6",[],
    "Very well. You are asking me to take a very great risk, but I will do it. When do you want this fire to start?", "village_elder_ask_set_fire_9",
    [
      (troop_remove_gold, "trp_player", "$g_last_money_offer_to_elder"),
  ]],
  
  [anyone,"village_elder_ask_set_fire_7",[],
    "I cannot do such a dangerous thing for 200 peningas.", "village_elder_talk",
    [
      (assign, "$g_village_elder_did_not_liked_money_offered", 2),
  ]],
  
  [anyone|plyr,"village_elder_ask_set_fire_9",[],
    "Continue with your preparations. One hour from now, I need that fire.", "village_elder_ask_set_fire_10",
    [
      (party_get_slot, ":bound_center", "$current_town", slot_village_bound_center),
      (store_current_hours, ":cur_time"),
      (val_add, ":cur_time", 1),
      (assign, ":fire_time", ":cur_time"),
      (party_set_slot, ":bound_center", slot_town_last_nearby_fire_time, ":fire_time"),
      (try_begin),
        (is_between, "$next_center_will_be_fired", villages_begin, villages_end),
        (party_get_slot, ":is_there_already_fire", "$next_center_will_be_fired", slot_village_smoke_added),
        (eq, ":is_there_already_fire", 0),
        (party_get_slot, ":fire_time", "$next_center_will_be_fired", slot_town_last_nearby_fire_time),
        (store_current_hours, ":cur_hours"),
        (store_sub, ":cur_time_sub_fire_duration", ":cur_hours", fire_duration),
        (val_sub, ":cur_time_sub_fire_duration", 1),
        (ge, ":fire_time", ":cur_time_sub_fire_duration"),
        (party_clear_particle_systems, "$next_center_will_be_fired"),
      (try_end),
      (assign, "$next_center_will_be_fired", "$current_town"),
      (assign, "$g_village_elder_did_not_liked_money_offered", 0),
  ]],
  
  [anyone|plyr,"village_elder_ask_set_fire_9",
    [
      (store_time_of_day, ":cur_day_hour"),
      (ge, ":cur_day_hour", 6),
      (lt, ":cur_day_hour", 23),
    ],
    "Do this in at the stroke of midnight. I will wait exactly one hour.", "village_elder_ask_set_fire_11",
    [
      (party_get_slot, ":bound_center", "$current_town", slot_village_bound_center),
      (store_time_of_day, ":cur_day_hour"),
      (store_current_hours, ":cur_time"),
      (store_sub, ":difference", 24, ":cur_day_hour"), #fire will be at 24 midnight today
      (store_add, ":fire_time", ":cur_time", ":difference"),
      (party_set_slot, ":bound_center", slot_town_last_nearby_fire_time, ":fire_time"),
      (try_begin),
        (is_between, "$next_center_will_be_fired", villages_begin, villages_end),
        (party_get_slot, ":is_there_already_fire", "$next_center_will_be_fired", slot_village_smoke_added),
        (eq, ":is_there_already_fire", 0),
        (party_get_slot, ":fire_time", "$next_center_will_be_fired", slot_town_last_nearby_fire_time),
        (store_current_hours, ":cur_hours"),
        (store_sub, ":cur_time_sub_fire_duration", ":cur_hours", fire_duration),
        (val_sub, ":cur_time_sub_fire_duration", 1),
        (ge, ":fire_time", ":cur_time_sub_fire_duration"),
        (party_clear_particle_systems, "$next_center_will_be_fired"),
      (try_end),
      (assign, "$next_center_will_be_fired", "$current_town"),
      (assign, "$g_village_elder_did_not_liked_money_offered", 0),
  ]],
  
  [anyone,"village_elder_ask_set_fire_10",[],
    "Very well, {reg59?my lady:sir}. We will make our preparations. Now you make yours.", "close_window",
    [
      (assign, ":maximum_distance", -1),
      (try_for_agents, ":cur_agent"),
        (agent_get_troop_id, ":troop_id", ":cur_agent"),
        (is_between, ":troop_id", village_elders_begin, village_elders_end),
        (agent_get_position, pos0, ":cur_agent"),
        (try_for_range, ":entry_point_id", 0, 64),
          (entry_point_get_position, pos1, ":entry_point_id"),
          (get_distance_between_positions, ":dist", pos0, pos1),
          (gt, ":dist", ":maximum_distance"),
          (assign, ":maximum_distance", ":dist"),
          (copy_position, pos2, pos1),
          (assign, ":village_elder_agent", ":cur_agent"),
        (try_end),
        (try_begin),
          (gt, ":maximum_distance", -1),
          (agent_set_scripted_destination, ":village_elder_agent", pos2),
        (try_end),
      (try_end),
  ]],
  
  [anyone,"village_elder_ask_set_fire_11",[],
    "As you wish, {reg59?my lady:sir}. May the heavens protect you.", "close_window",[]],
  #(fire set up dialogs end)
  
  
  
  
  
  
  [anyone|plyr,"village_elder_talk", [(neg|party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
      (eq, "$g_encountered_party_type", spt_village),
      (party_slot_eq, "$current_town", recruit_permission_need, 1), #no have permission, elder will give him Reclutamiento
    ],
    "I'm looking for men who are willing to follow me. I am recruiting...", "village_elder_recruit_start",[]],
  
  ###extortion
  [anyone|plyr,"village_elder_talk", [
      (eq, "$g_encountered_party_type", spt_village),
      (party_slot_eq, "$g_encountered_party", slot_center_fee_paid, 0),
      #(eq, "$village_elder_tax", 0),
    ],
    "I can protect this village from harm -- for a fee.", "village_elder_angry",[]],
  
  [anyone,"village_elder_angry", [        (le, "$player_honor", -25),
    ],
    "Ach, not another one! For the sake of our families, I will pay your fee.", "village_elder_extortion", [
      ###less honor + money
      (try_begin),
        (le, "$player_honor", -80),
        (store_random_in_range, ":random", 100, 200),
      (else_try),
        (le, "$player_honor", -40),
        (store_random_in_range, ":random", 50, 100),
      (else_try),
        (store_random_in_range, ":random", 10, 50),
      (try_end),
      (troop_add_gold, "trp_player", ":random"),
      (call_script, "script_change_player_honor", -5),
      (call_script, "script_change_player_relation_with_center", "$g_encountered_party", -10),
      (party_get_slot, ":village_owner", "$g_encountered_party", slot_town_lord),
      (gt, ":village_owner", -1),
      (call_script, "script_change_player_relation_with_troop", ":village_owner", -5),
  ]],
  
  [anyone|plyr, "village_elder_extortion", [],
    "You have done well. Your families will thank you.", "close_window", [
      #   (assign, "$village_elder_tax", 1)
      (party_set_slot, "$g_encountered_party", slot_center_fee_paid, 1),
  ]],
  
  [anyone,"village_elder_angry", [
    ],
    "Hah, you joker, you... You don't fool me one bit!", "close_window", [
      #  (assign, "$village_elder_tax", 1)
      (party_set_slot, "$g_encountered_party", slot_center_fee_paid, 1),
  ]],
  
  ### Dog
  [anyone|plyr,"village_elder_talk",
    [
      (eq, "$g_encountered_party_type", spt_village),
      (eq, "$dog_companion", 0),
      (neq, "$curr_menu_slot", slot_quest_menu_meet_leader),#VC-2934 (not in menu)
      
      #VC-3669 no dogs in doccinga tutorial
      (this_or_next|neq, "$campaign_type", camp_storyline),
      (this_or_next|neq, "$g_encountered_party", "p_village_150"),
      (check_quest_finished,"qst_doccinga_assault"),
    ],
    "Are there any stray dogs here?", "village_elder_ask_dog",[]],
  [anyone,"village_elder_ask_dog", [(gt, "$player_dog_agent_no", 0),],
    "Yes, recently I saw a stray dog. He was begging for food, but nobody here needs a new dog. I think he is currently sitting somewhere around here.", "village_elder_pretalk", []],
  [anyone,"village_elder_ask_dog", [],
    "No, I haven't seen any stray dog here recently. ", "village_elder_pretalk", []],
  ###
  [anyone|plyr,"village_elder_talk", [],
    "[Leave]", "close_window",[]],
  
  
  
  [anyone ,"village_elder_buy_cattle", [(party_get_slot, reg5, "$g_encountered_party", slot_village_number_of_cattle),
      (gt, reg5, 0),
      (store_item_value, ":cattle_cost", "itm_cattle_meat"),
      (call_script, "script_game_get_item_buy_price_factor", "itm_cattle_meat"),
      (val_mul, ":cattle_cost", reg0),
      #Multiplied by 2 and divided by 100
      (val_div, ":cattle_cost", 50),
      (assign, "$temp", ":cattle_cost"),
      (assign, reg6, ":cattle_cost"),
    ],
    "We have {reg5} head of cattle, each for {reg6} peningas. How many do you want to buy?", "village_elder_buy_cattle_2",[]],
  
  [anyone ,"village_elder_buy_cattle", [],
    "I am afraid we have no cattle left in the village, {reg59?madam:sir}.", "village_elder_buy_cattle_2",[]],
  
  
  [anyone|plyr,"village_elder_buy_cattle_2", [(party_get_slot, ":num_cattle", "$g_encountered_party", slot_village_number_of_cattle),
      (ge, ":num_cattle", 1),
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", "$temp"),],
    "One.", "village_elder_buy_cattle_complete",[(call_script, "script_buy_cattle_from_village", "$g_encountered_party", 1, "$temp"),
  ]],
  
  [anyone|plyr,"village_elder_buy_cattle_2", [(party_get_slot, ":num_cattle", "$g_encountered_party", slot_village_number_of_cattle),
      (ge, ":num_cattle", 2),
      (store_troop_gold, ":gold", "trp_player"),
      (store_mul, ":cost", "$temp", 2),
      (ge, ":gold", ":cost"),],
    "Two.", "village_elder_buy_cattle_complete",[(call_script, "script_buy_cattle_from_village", "$g_encountered_party", 2, "$temp"),
  ]],
  
  [anyone|plyr,"village_elder_buy_cattle_2", [(party_get_slot, ":num_cattle", "$g_encountered_party", slot_village_number_of_cattle),
      (ge, ":num_cattle", 3),
      (store_troop_gold, ":gold", "trp_player"),
      (store_mul, ":cost", "$temp", 3),
      (ge, ":gold", ":cost"),],
    "Three.", "village_elder_buy_cattle_complete",[(call_script, "script_buy_cattle_from_village", "$g_encountered_party", 3, "$temp"),
  ]],
  
  [anyone|plyr,"village_elder_buy_cattle_2", [(party_get_slot, ":num_cattle", "$g_encountered_party", slot_village_number_of_cattle),
      (ge, ":num_cattle", 4),
      (store_troop_gold, ":gold", "trp_player"),
      (store_mul, ":cost", "$temp", 4),
      (ge, ":gold", ":cost"),],
    "Four.", "village_elder_buy_cattle_complete",[(call_script, "script_buy_cattle_from_village", "$g_encountered_party", 4, "$temp"),
  ]],
  
  [anyone|plyr,"village_elder_buy_cattle_2", [(party_get_slot, ":num_cattle", "$g_encountered_party", slot_village_number_of_cattle),
      (ge, ":num_cattle", 5),
      (store_troop_gold, ":gold", "trp_player"),
      (store_mul, ":cost", "$temp", 5),
      (ge, ":gold", ":cost"),],
    "Five.", "village_elder_buy_cattle_complete",[(call_script, "script_buy_cattle_from_village", "$g_encountered_party", 5, "$temp"),
  ]],
  [anyone|plyr,"village_elder_buy_cattle_2", [(party_get_slot, ":num_cattle", "$g_encountered_party", slot_village_number_of_cattle),
      (ge, ":num_cattle", 6),
      (store_troop_gold, ":gold", "trp_player"),
      (store_mul, ":cost", "$temp", 6),
      (ge, ":gold", ":cost"),],
    "Six.", "village_elder_buy_cattle_complete",[(call_script, "script_buy_cattle_from_village", "$g_encountered_party", 6, "$temp"),
  ]],
  [anyone|plyr,"village_elder_buy_cattle_2", [(party_get_slot, ":num_cattle", "$g_encountered_party", slot_village_number_of_cattle),
      (ge, ":num_cattle", 7),
      (store_troop_gold, ":gold", "trp_player"),
      (store_mul, ":cost", "$temp", 7),
      (ge, ":gold", ":cost"),],
    "Seven.", "village_elder_buy_cattle_complete",[(call_script, "script_buy_cattle_from_village", "$g_encountered_party", 7, "$temp"),
  ]],
  [anyone|plyr,"village_elder_buy_cattle_2", [(party_get_slot, ":num_cattle", "$g_encountered_party", slot_village_number_of_cattle),
      (ge, ":num_cattle", 8),
      (store_troop_gold, ":gold", "trp_player"),
      (store_mul, ":cost", "$temp", 8),
      (ge, ":gold", ":cost"),],
    "Eight.", "village_elder_buy_cattle_complete",[(call_script, "script_buy_cattle_from_village", "$g_encountered_party", 8, "$temp"),
  ]],
  
  
  [anyone|plyr,"village_elder_buy_cattle_2", [],
    "Forget it.", "village_elder_pretalk",[]],
  
  [anyone ,"village_elder_buy_cattle_complete", [],
    "I will tell the herders to round up the animals and bring them to you, {reg59?madam:sir}. I am sure you will be satisfied with your purchase.", "village_elder_pretalk",[]],
  
  
  ###reclutamiento empieza
  [anyone, "village_elder_recruit_start", [ #reclutamiento
      (str_clear, s4),
      (str_clear, s11),
      (str_clear, s12),
      (str_clear, s13),
    ],
    "{!}{s4}", "village_elder_recruit2_b", [
      (str_store_string, s11, "@I am the leader of this area. It was smart for you to ask me."),
      (str_store_string, s12, "@Looking for men who are willing to risk their skin for glory and wealth, eh?"),
      (str_store_string, s13, "@Interesting. You're looking for men and I, by coincidence, know people in the area."),
      (store_random_in_range, ":random", 11, 14),
      (str_store_string_reg, s4, ":random"),
  ]],
  
  [anyone, "village_elder_recruit2_b", [ #reclutamiento
      (assign, ":continue", 0),
      (store_faction_of_party, ":party_faction", "$current_town"),
      (store_troop_faction, ":player_faction", "trp_player"),
      (try_begin),
        (eq, ":party_faction", ":player_faction"),
        (assign, ":continue", 0),
      (else_try),
        (store_relation, ":relation", ":party_faction", ":player_faction"),
        (le, ":relation", -10),
        (assign, ":continue", 1),
      (try_end),
      (eq, ":continue", 1),
      #(le, "$g_talk_troop_faction_relation", -10),
    ],
    "Forget it! Why would I help an enemy of the kingdom?", "village_elder_talk", [
  ]],
  [anyone, "village_elder_recruit2_b", [ #reclutamiento
      (party_get_slot, ":center_relation", "$g_encountered_party", slot_center_player_relation),
      (lt, ":center_relation", 0),
    ],
    "Forget it! In this community, you are not welcome.", "village_elder_talk", [
  ]],
  
  [anyone, "village_elder_recruit2_b", [ #reclutamiento
      (try_begin),
        (call_script, "script_cf_village_recruit_volunteers_cond"),
        (assign, ":available", 1),
      (else_try),
        (assign, ":available", 0),
      (try_end),
      
      (eq, ":available", 0),
    ],
    "Unfortunately, I know of no one that may be interested.", "village_elder_recruit6", [
  ]],
  
  ###recruitment easy reclutar facil
  [anyone, "village_elder_recruit2_b", [ #reclutamiento
      (eq, "$recruitment_on", 1),
    ],
    "Sure. You are welcome!", "village_elder_recruit6", [
  ]],
  ######
  [anyone, "village_elder_recruit2_b", [ #reclutamiento
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (party_get_slot, ":center_relation", "$g_encountered_party", slot_center_player_relation),
      (lt, ":center_relation", 20),
      (le, ":player_renown", 150),
    ],
    "You do not look like anyone special. A wanderer like many others, with promises and words, but nothing more. Why should I help you find recruits?", "village_elder_recruit2_1", [
  ]],
  
  [anyone, "village_elder_recruit2_b", [ #reclutamiento
      (le, "$player_honor", -20),
    ],
    "I know you're someone feared. I'm not sure many men would want to join you.", "village_elder_recruit2_1", [
  ]],
  
  [anyone, "village_elder_recruit2_b", [ #reclutamiento
    ],
    "What I can say...", "village_elder_recruit2", [
  ]],
  
  
  [anyone|plyr, "village_elder_recruit2_1", [  #persuasion
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (gt, ":persuasion", 4),
      ], "I'll take some men that might be nothing but trouble and you would even get paid for that.", "village_elder_recruit4_2", [
  ]],
  
  [anyone|plyr, "village_elder_recruit2_1", [  #threat
      (le, "$player_honor", -20),
      ], "You know my reputation. Avoid damage to your people. Give me permission.", "village_elder_recruit4_2threat", [
      (call_script, "script_change_troop_renown", "trp_player", -3),
  ]],
  
  [anyone|plyr, "village_elder_recruit2_1", [  #sobord
      (store_troop_gold,":total_cost","trp_player"),
      (ge,":total_cost",300),
      ], "Take these 300 peningas for any inconvenience I may have caused.", "village_elder_recruit4_3", [
      (store_random_in_range, ":rand", 0, 3),
      (try_begin),
        (ge, ":rand", 1),
        (assign, "$temp", 2), #success
      (else_try),
        (assign, "$temp", 1), #fail
      (try_end),
  ]],
  
  [anyone|plyr,"village_elder_recruit2_1", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@You don't trust me. I understand. I may be new here, but I am a good person. (Phlegmatic)"),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (str_store_string, s10, "@I don't like what you say. I came here to recruit. Why waste my time? (Melancholic)"),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Believe me, I have little patience. We can do things the easy way, or the hard way. (Choleric)"),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@I see. Well, you look like someone reasonable. Let's negotiate... (Sanguine)."),
      (try_end),
    ],
    "{!}{s10}", "village_elder_recruit4_1",[
      (str_clear, s10),
  ]],
  #leave
  [anyone|plyr, "village_elder_recruit2_1", [ #reclutamiento
    ],
    "I see I did not come at a good time. We'll talk again another day. Farewell.", "close_window", [
  ]],
  
  #
  [anyone,"village_elder_recruit4_1", [
      (str_clear, s4),
    ],
    "{!}{s4}", "village_elder_recruit4_11",[
      
      (try_begin),
        (le, "$player_honor", -30),
        (try_begin),
          (eq, "$virtue_type", cb5_calm),
          (str_store_string, s4, "@You, a good person? Ha! Your reputation says otherwise. Very much so."),
          (assign, "$temp", 1), #fail
        (else_try),
          (eq, "$virtue_type", cb5_responsible),
          (str_store_string, s4, "@I see where you are going. Well, I'd rather deal with you now than lose sleep waiting for you to kill me. Your reputation is completely justified."),
          (assign, "$temp", 2), #success
        (else_try),
          (eq, "$virtue_type", cb5_extroverted),
          (str_store_string, s4, "@I understand, for your reputation precedes you. I'd rather negotiate than be your enemy."),
          (assign, "$temp", 2), #success
        (else_try),
          (eq, "$virtue_type", cb5_bold),
          (str_store_string, s4, "@There is no negotiation between the cat and the rat."),
          (assign, "$temp", 1), #fail
        (try_end),
      (else_try),
        (store_random_in_range, ":rand", 0, 3),
        (try_begin),
          (ge, ":rand", 2),
          (try_begin),
            (eq, "$virtue_type", cb5_calm),
            (str_store_string, s4, "@I see, you look like a decent person. Let's talk."),
            (assign, "$temp", 2), #success
          (else_try),
            (eq, "$virtue_type", cb5_responsible),
            (str_store_string, s4, "@It is you who wastes my time and patience."),
            (assign, "$temp", 1), #fail
          (else_try),
            (eq, "$virtue_type", cb5_extroverted),
            (str_store_string, s4, "@You'll get nothing with threats."),
            (assign, "$temp", 1), #fail
          (else_try),
            (eq, "$virtue_type", cb5_bold),
            (str_store_string, s4, "@Very well. Let's start the negotiation."),
            (assign, "$temp", 2), #success
          (try_end),
        (else_try),
          (try_begin),
            (eq, "$virtue_type", cb5_calm),
            (str_store_string, s4, "@I don't trust you. Stop wasting my time."),
            (assign, "$temp", 1), #fail
          (else_try),
            (eq, "$virtue_type", cb5_responsible),
            (str_store_string, s4, "@I see where you are going. Well, I'd rather deal with you now than lose sleep waiting for you to kill me."),
            (assign, "$temp", 2), #success
          (else_try),
            (eq, "$virtue_type", cb5_extroverted),
            (str_store_string, s4, "@Yes, yes, I got it. Your way or your way."),
            (assign, "$temp", 2), #success
          (else_try),
            (eq, "$virtue_type", cb5_bold),
            (str_store_string, s4, "@Negotiation? Ha! Find yourself a friend, for you can't count me as one!"),
            (assign, "$temp", 1), #fail
          (try_end),
        (try_end),
      (try_end),
  ]],
  
  
  [anyone, "village_elder_recruit4_11", [ #reclutamiento
      (eq, "$temp", 2), #success
    ],
    "Let's get down to business. Now, listen carefully.", "village_elder_recruit2", [
      (assign, "$temp", 0), #
  ]],
  
  [anyone, "village_elder_recruit4_11", [ #reclutamiento
    ],
    "I think this conversation is over. Farewell.", "close_window", [
      (party_set_slot,"$current_town",recruit_permission_need, 2), #no puede reclutar, temporal para evitar village elder insistencia
      (assign, "$temp", 0), #
  ]],
  
  ###money
  [anyone, "village_elder_recruit4_3", [ #reclutamiento
      (eq, "$temp", 2), #success
      (store_troop_gold,":total_cost","trp_player"),
      (ge,":total_cost",300),
    ],
    "Your silver is music to my ears. Now, let us talk.", "village_elder_recruit2", [
      (assign, "$temp", 0), #
      (troop_remove_gold,"trp_player",300),
  ]],
  
  [anyone, "village_elder_recruit4_3", [ #reclutamiento
    ],
    "I am an honest person. Do you think I'll take your bribe? This conversation is over. Farewell.", "close_window", [
      (party_set_slot,"$current_town",recruit_permission_need, 2), #no puede reclutar, temporal para evitar village elder insistencia
      (assign, "$temp", 0), #
  ]],
  ####
  [anyone, "village_elder_recruit4_2", [ #reclutamiento
      (str_clear, s4),
      (str_clear, s11),
      (str_clear, s12),
      (str_clear, s13),
    ],
    "{!}{s4}", "village_elder_recruit2", [
      (str_store_string, s11, "@I see, you look like someone with a silver tongue. Well, let's talk."),
      (str_store_string, s12, "@Yes, I must admit you're right."),
      (str_store_string, s13, "@Interesting. Seems I'm not talking to an idiot."),
      (store_random_in_range, ":random", 11, 14),
      (str_store_string_reg, s4, ":random"),
  ]],
  
  [anyone, "village_elder_recruit4_2threat", [ #threat
    ],
    "Yes, I have heard of your iniquity and what you do against people. Let's see...", "village_elder_recruit2", [
      (call_script, "script_change_troop_renown", "trp_player", -6),
  ]],
  
  ##todo ok
  
  [anyone, "village_elder_recruit2", [ #reclutamiento
    ],
    "My influence here is vast. Many listen to what I say and do what I suggest. I will not allow you to take men who work the land, but there are others... landless losers that contribute nothing more than misery to the community. " +
    "I could ask them to join you, but you don't look like much of a leader to follow. You will likely take them to their deaths, and they will never return. Surely, even people like them don't deserve such a fate.", "village_elder_recruit3", [
  ]],
  
  [anyone|plyr, "village_elder_recruit3", [ #reclutamiento
    ],
    "Of course, your time and help will be rewarded.", "village_elder_recruit5_1", [
      (store_random_in_range, ":rand", 0, 3),
      (try_begin),
        (ge, ":rand", 1),
        (assign, "$temp", 2), #success
      (else_try),
        (assign, "$temp", 1), #fail
      (try_end),
  ]],
  
  [anyone|plyr, "village_elder_recruit3", [  #persuasion
      (store_troop_gold,":total_cost","trp_player"),
      (ge,":total_cost",500),
      ], "I see what you trying to say, old man. Here, take these 500 peningas.", "village_elder_recruit6", [
      (troop_remove_gold,"trp_player",500),
  ]],
  
  #leave
  [anyone|plyr, "village_elder_recruit3", [ #reclutamiento
    ],
    "I think I did not come at a good time. Let us talk some other day. Farewell.", "close_window", [
      (party_set_slot,"$current_town",recruit_permission_need, 2), #no puede reclutar, temporal para evitar village elder insistencia
      (assign, "$temp", 0), #
  ]],
  
  
  ###money
  [anyone, "village_elder_recruit5_1", [ #reclutamiento
      (eq, "$temp", 2), #success
      (store_troop_gold,":total_cost","trp_player"),
      (ge,":total_cost",300),
    ],
    "Of course, let's talk about that now.", "village_elder_recruit6", [
      (assign, "$temp", 0), #
      (troop_remove_gold,"trp_player",300),
  ]],
  
  [anyone, "village_elder_recruit5_1", [ #reclutamiento
    ],
    "It doesn't make sense to discuss things that are so vague. I think that I've been wasting my time with you. Farewell.", "village_elder_talk", [
      (party_set_slot,"$current_town",recruit_permission_need, 2), #no puede reclutar, temporal para evitar village elder insistencia
      (assign, "$temp", 0), #
  ]],
  ####
  [anyone, "village_elder_recruit6", [ #reclutamiento
    ],
    "Well, you have my permission to take those troublemakers off my hands. I think they are eager for adventure anyway. You may go to the center of the village and take anyone loitering there. " +
    "For every recruit you take from this village, I'll take a commission.", "village_elder_talk", [
      (party_set_slot,"$current_town",recruit_permission_need, 0), #puede reclutar
      (display_message, "@From this moment on, you may recruit in this village."),
  ]],
  
  ##  [anyone ,"village_elder_recruit_start", [(party_get_slot, ":num_volunteers", "$current_town", slot_center_volunteer_troop_amount),
  ##                                           (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
  ##                                           (val_min, ":num_volunteers", ":free_capacity"),
  ##                                           (store_troop_gold, ":gold", "trp_player"),
  ##                                         #  (store_div, ":gold_capacity", ":gold", 10),#10 peningas per man Moto chief off
  ##
  ##                                           (call_script, "script_cost_per_village_recruit"),	#MOTO chief variable cost
  ##                                           (store_div, ":gold_capacity", ":gold", reg0),	#MOTO chief variable cost
  ##                                           (val_min, ":num_volunteers", ":gold_capacity"),
  ##                                           (le, ":num_volunteers", 0),
  ##                                           ],
  ##   "I don't think anyone would be interested, {reg59?madam:sir}. Is there anything else I can do for you?", "village_elder_talk",[]],
  ##
  ##  [anyone ,"village_elder_recruit_start", [(party_get_slot, ":num_volunteers", "$current_town", slot_center_volunteer_troop_amount),
  ##                                           (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
  ##                                           (val_min, ":num_volunteers", ":free_capacity"),
  ##                                           (store_troop_gold, ":gold", "trp_player"),
  ##                                           #(store_div, ":gold_capacity", ":gold", 10),#10 peningas per man moto chief off
  ##                                           (call_script, "script_cost_per_village_recruit"),    #MOTO chief variable cost
  ##                                           (store_div, ":gold_capacity", ":gold", reg0),    #MOTO chief variable cost
  ##                                           (val_min, ":num_volunteers", ":gold_capacity"),
  ##                                           (assign, "$temp",  ":num_volunteers"),
  ##                                           (assign, reg5, ":num_volunteers"),
  ##                                           (store_add, reg7, ":num_volunteers", -1),
  ##                                           ],
  ##   "I can think of {reg5} whom I suspect would jump at the chance. If you could pay {reg0} peningas {reg7?each for their equipment:for his equipment}.\
  ## Does that suit you?", "village_elder_recruit_decision",[]], #MOTO variable cost chief
  
  
  ##  [anyone|plyr,"village_elder_recruit_decision", [(assign, ":num_volunteers", "$temp"),
  ##                                                  (ge, ":num_volunteers", 1),
  ##                                                  (store_add, reg7, ":num_volunteers", -1)],
  ##   "Tell {reg7?them:him} to make ready.", "village_elder_pretalk",[(call_script, "script_village_recruit_volunteers_recruit"),]],
  ##
  ##  [anyone|plyr,"village_elder_recruit_decision", [(party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 1)],
  ##   "No, not now.", "village_elder_pretalk",[]],
  ###reclutamiento acaba
  
  [anyone,"village_elder_active_mission_1", [], "Yes {reg59?madam:sir}, have you made any progress on it?", "village_elder_active_mission_2",[]],
  
  [anyone|plyr,"village_elder_active_mission_2",[(store_partner_quest,":elder_quest"),
      (eq, ":elder_quest", "qst_deliver_grain"),
      (quest_get_slot, ":quest_target_amount", "qst_deliver_grain", slot_quest_target_amount),
      (call_script, "script_get_troop_item_amount", "trp_player", "itm_grain"),
      (assign, ":cur_amount", reg0),
      (ge, ":cur_amount", ":quest_target_amount"),
      (assign, reg5, ":quest_target_amount"),
    ],
    "Indeed. I brought you {reg5} sacks of grain.", "village_elder_deliver_grain_thank",
    []],
  
  [anyone,"village_elder_deliver_grain_thank", [(str_store_party_name, s13, "$current_town")],
    "My good {reg59?lady:lord}. You have saved us from hunger and desperation. We cannot thank you enough, but you'll always be in our prayers. " +
    "The village of {s13} will not forget what you have done for us.", "village_elder_deliver_grain_thank_2",
    [(quest_get_slot, ":quest_target_amount", "qst_deliver_grain", slot_quest_target_amount),
      (troop_remove_items, "trp_player", "itm_grain", ":quest_target_amount"),
      (add_xp_as_reward, 400),
      (call_script, "script_change_center_prosperity", "$current_town", 4),
      (call_script, "script_change_player_relation_with_center", "$current_town", 10),
      (call_script, "script_end_quest", "qst_deliver_grain"),
      #Troop commentaries begin
      (call_script, "script_add_log_entry", logent_helped_peasants, "trp_player",  "$current_town", -1, -1),
      #Troop commentaries end
  ]],
  
  [anyone,"village_elder_deliver_grain_thank_2", [],
    "My good {reg59?lady:lord}, please, is there anything I can do for you?", "village_elder_talk",[]],
  
  
  [anyone|plyr,"village_elder_active_mission_2", [], "I am still working on it.", "village_elder_active_mission_3",[]],
  [anyone|plyr,"village_elder_active_mission_2", [], "I am afraid I won't be able to finish it.", "village_elder_mission_failed",[]],
  
  [anyone,"village_elder_active_mission_3", [], "Thank you, {reg59?madam:sir}. We are praying for your success every day.", "village_elder_pretalk",[]],
  
  [anyone,"village_elder_mission_failed", [], "Ah, I am sorry to hear that, {reg59?madam:sir}. I'll try to think of something else.", "village_elder_pretalk",
    [(store_partner_quest,":elder_quest"),
      (call_script, "script_abort_quest", ":elder_quest", 1)]],
  ##
  ##  [anyone,"village_elder_generic_mission_thank", [],
  ##   "You have been so helpful {reg59?madam:sir}. I do not know how to thank you.", "village_elder_generic_mission_completed",[]],
  ##
  ##  [anyone|plyr,"village_elder_generic_mission_completed", [],
  ##   "Speak not of it. I only did what needed to be done.", "village_elder_pretalk",[]],
  
  # Currently not needed.
  ##  [anyone|plyr,"village_elder_generic_mission_failed", [],
  ##   "TODO: I'm sorry I failed you sir. It won't happen again.", "village_elder_pretalk",
  ##   [(store_partner_quest,":elder_quest"),
  ##    (call_script, "script_finish_quest", ":elder_quest", 0),
  ##    ]],
  
  
  [anyone,"village_elder_request_mission_ask", [(store_partner_quest,":elder_quest"),(ge,":elder_quest",0)],
    "Well, {reg59?her:his} Highness is already engaged with a task helping us. We cannot ask more from you.", "village_elder_pretalk",[]],
  
  [anyone,"village_elder_request_mission_ask", [(troop_slot_eq, "$g_talk_troop", slot_troop_does_not_give_quest, 1)],
    "No, {reg59?madam:sir}. We don't have any other tasks for you.", "village_elder_pretalk",[]],
  
  [anyone|auto_proceed,"village_elder_request_mission_ask", [], "A task?", "village_elder_tell_mission",
    [
      (call_script, "script_get_quest", "$g_talk_troop"),
      (assign, "$random_quest_no", reg0),
  ]],
  
  
  [anyone,"village_elder_tell_mission", [(eq,"$random_quest_no","qst_deliver_grain")],
    "{reg59?My good lady:My good lord}, our village has been going through such hardships lately. " +
    "The harvest has been bad, and recently some merciless bandits took away our wheat that we had reserved for the planting season. " +
    "If we cannot find some seed soon, we will not be able to plant our fields and then we will have nothing to eat for the coming year. " +
    "If you can help us, we would be indebted to you forever.", "village_elder_tell_deliver_grain_mission",
    [
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (str_store_party_name_link,s3,":quest_target_center"),
      (quest_get_slot, reg5, "$random_quest_no", slot_quest_target_amount),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@The elder of the village of {s3} asked you to bring them {reg5} sacks of wheat."),
  ]],
  
  [anyone|plyr,"village_elder_tell_deliver_grain_mission", [],
    "Hmmm. How much grain do you need?", "village_elder_tell_deliver_grain_mission_2",[]],
  [anyone|plyr,"village_elder_tell_deliver_grain_mission", [],
    "I can't be bothered with this. Ask help from someone else.", "village_elder_deliver_grain_mission_reject",[]],
  
  [anyone,"village_elder_tell_deliver_grain_mission_2", [(quest_get_slot, reg5, "$random_quest_no", slot_quest_target_amount)],
    "I think {reg5} packs of grain will let us start the planting. I hope that we can find charitable people to help us with the rest.", "village_elder_tell_deliver_grain_mission_3",[]],
  
  [anyone|plyr,"village_elder_tell_deliver_grain_mission_3", [],
    "Then I will go and find you the grain you need.", "village_elder_deliver_grain_mission_accept",[]],
  [anyone|plyr,"village_elder_tell_deliver_grain_mission_3", [],
    "I am afraid I don't have time for this. You'll need to find help elsewhere.", "village_elder_deliver_grain_mission_reject",[]],
  
  [anyone,"village_elder_deliver_grain_mission_accept", [], "Thank you, {reg59?madam:sir}. We'll be praying for you night and day.", "close_window",
    [(assign, "$g_leave_encounter",1),
      (call_script, "script_change_player_relation_with_center", "$current_town", 5),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
  ]],
  
  [anyone,"village_elder_deliver_grain_mission_reject", [], "Yes, {reg59?madam:sir}, of course. I am sorry if I have bothered you with our troubles.", "close_window",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
  ]],
  
  ## JuJu70 quest begin
  
  [anyone,"village_elder_tell_mission", [(eq,"$random_quest_no","qst_blank_quest_6")],
    "{reg59?My good lady:My good lord}, we have a bit of a problem on our hands. Although the harvest was good, and we are not doing " +
    "that badly either, too many of our men can't marry, because there are not enough women in our village, only God knows why. " +
    "That brings about unnecessary tension among our men, and with it all kind of rowdy behavior and incessant fistfights. You look like a {reg59?lady:man} " +
    "of the sword. Would you be able to capture and bring us some young women so our poor men can stop fighting and start farming?", "village_elder_tell_capture_mission",
    [
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (str_store_party_name_link,s3,":quest_target_center"),
      (quest_get_slot, reg5, "$random_quest_no", slot_quest_target_amount),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@The elder of the village of {s3} asked you to capture and bring {reg5} women to them (as prisoners)."),
  ]],
  
  [anyone|plyr,"village_elder_tell_capture_mission", [
      (try_begin),
        (eq, "$defect_type", cb6_justice),
        (str_store_string, s10, "@I see your problem, but wouldn't it be unfair to those women?"),
      (else_try),
        (eq, "$defect_type", cb6_prudence),
        (str_store_string, s10, "@Hmmm, why can't your men marry women from a nearby village?"),
      (else_try),
        (eq, "$defect_type", cb6_temperance),
        (str_store_string, s10, "@Your men should really learn how to control their, errr... instincts."),
      (else_try),
        (eq, "$defect_type", cb6_fortitude),
        (str_store_string, s10, "@Your men should take matters into their own hands, don't you think?"),
      (try_end),
    ],
    "{!}{s10}", "village_elder_tell_capture_mission_2a",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@Interesting problem, and even more interesting solution..."),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (eq,reg59,tf_male),
        (str_store_string, s10, "@Lonely men and lack of women? Looks like I'm not the only one..."),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (eq,reg59,tf_female),
        (str_store_string, s10, "@Huh, poor boys have to show off and no one is paying attention..."),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@I can sympathize with your men. Your proposal sounds intriguing."),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Your men are patsies, but glorious {playername} is always up to the challenge!"),
      (try_end),
    ],
    "{!}{s10}", "village_elder_tell_capture_mission_2b",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission", [],
    "I am not a kidnapper. Ask someone else to help you.", "village_elder_capture_mission_reject",[]],
  
  [anyone,"village_elder_tell_capture_mission_2a", [
      (try_begin),
        (eq, "$defect_type", cb6_justice),
        (str_store_string, s10, "@Unfair you say? But our men are hard working and well off, not some kind of drunks. " +
          "If you take these women from a poor village, or find some refugees, you in fact will be doing them a favor. " +
        "A good, caring husband, plenty of food, and a warm house. What more could a good wife possibly need?"),
      (else_try),
        (eq, "$defect_type", cb6_prudence),
        (str_store_string, s10, "@Well, it's a long story. Let's just say our relations aren't that great, given their past " +
          "transgressions. Our men will be ridiculed if they attempt to court any of those ladies. I can't allow " +
        "my men to be humiliated, especially by the indolent louts inhabiting that place!"),
      (else_try),
        (eq, "$defect_type", cb6_temperance),
        (str_store_string, s10, "@My good {reg59?lady:lord}, I fully agree with you, but you see, we need more hands to help " +
          "during the harvest time. It ain't easy to work the fields and take care of the cattle. How could we possibly have more help " +
        "if my men aren't married? And to be honest, men do behave when they have a wife and kids to take care of."),
      (else_try),
        (eq, "$defect_type", cb6_fortitude),
        (str_store_string, s10, "@Ah, my {reg59?lady:lord} gives excellent advice! Unfortunately, it is impossible to follow. " +
          "Pity, isn't it? You see, if our men go and kidnap those women, your poor humble servant will most assuredly lose his head, and " +
        "something tells me that is not the outcome my head and I desire."),
      (try_end),
    ],
    "{!}{s10}", "village_elder_tell_capture_mission_3a",[]],
  
  [anyone,"village_elder_tell_capture_mission_2b", [
      (try_begin),
        (eq, "$virtue_type", cb5_calm),
        (str_store_string, s10, "@My {reg59?lady:lord} seems somewhat hesitant about this situation. I can assure you the solution " +
          "I propose is quite common nowadays among us common folk. {reg59?Her:His} Highness shouldn't put too much thought and " +
        "contemplation into the everyday events of lowly folks like us. Your help will undoubtedly be appreciated."),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (eq,reg59,tf_male),
        (str_store_string, s10, "@Yes, my lord, a warrior like you probably spends a lot more time with his mates than he desires, but " +
          "if you can help us with this delicate problem, I promise you, one day, when you are tired of all the head-bashing and ready to retire, you " +
        "can always come back here. We'll get you a nice woman to warm your old, achy bones at night."),
      (else_try),
        (eq, "$virtue_type", cb5_responsible),
        (eq,reg59,tf_female),
        (str_store_string, s10, "@You're absolutely right, {reg59?my lady:my lord}. Men need women to keep them focused on doing things that are pleasing to God. " +
          "And that is exactly what I'm trying to accomplish - making sure my men follow God's path. I hope you would find it rewarding to help these " +
        "poor souls to fulfill God's will."),
      (else_try),
        (eq, "$virtue_type", cb5_extroverted),
        (str_store_string, s10, "@Yes, {reg59?my lady:my lord}, this will indeed be an adventure of a lifetime for you. Who knows? Maybe it will be " +
        "so much to your liking that you can turn it into a profitable business."),
      (else_try),
        (eq, "$virtue_type", cb5_bold),
        (str_store_string, s10, "@Glad to hear that, oh most valorous one! Perhaps we should discuss this matter in more detail..."),
      (try_end),
    ],
    "{!}{s10}", "village_elder_tell_capture_mission_3b",[]],
  
  [anyone,"village_elder_capture_mission_reject", [], "Yes, {reg59?my lady:my lord}, of course. I am sorry if I have bothered you with our troubles.", "close_window",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
  ]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_3b", [
      (eq, "$virtue_type", cb5_calm),],
    "I'm not sure how common this is... Why not ask your lord to help you?", "village_elder_capture_mission_4b",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_3b", [
      (eq, "$virtue_type", cb5_responsible),
      (eq,reg59,tf_male),
    ],
    "That sounds fascinating. Perhaps I will take you up on that offer when I'm ready...", "village_elder_capture_mission_4b",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_3b", [
      (eq, "$virtue_type", cb5_responsible),
      (eq,reg59,tf_female),
    ],
    "You seem to know a lot about women, my good man. This all seems so logical now.", "village_elder_capture_mission_4b",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_3b", [
      (eq, "$virtue_type", cb5_extroverted),],
    "I have to admit I'm really excited about undertaking this mission.", "village_elder_capture_mission_4b",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_3b", [
      (eq, "$virtue_type", cb5_bold),],
    "Perhaps we should, I can smell a good reward coming my way.", "village_elder_capture_mission_4b",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_3a", [
      (eq, "$defect_type", cb6_prudence),],
    "Would you consider taking some of my women warriors instead?", "village_elder_capture_mission_4a",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_3a", [
      (eq, "$defect_type", cb6_fortitude),],
    "Is there a reward?", "village_elder_capture_mission_4a",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_3a", [
      (eq, "$defect_type", cb6_justice),],
    "I have to admit that you make a lot of sense.", "village_elder_capture_mission_4a",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_3a", [
      (eq, "$defect_type", cb6_temperance),],
    "Your men lack willpower, but they're lowly peasants after all...", "village_elder_capture_mission_4a",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_3a", [],
    "Sorry, but you have failed to convince me.", "village_elder_capture_mission_reject",[]],
  
  [anyone,"village_elder_capture_mission_4a", [(eq, "$defect_type", cb6_fortitude),],
    "Well, we will highly appreciate your {reg59?Ladyship's:Lordship's} helping us. What kind of reward do you have in mind?", "village_elder_tell_capture_mission_4c",[]],
  [anyone,"village_elder_capture_mission_4a", [(eq, "$defect_type", cb6_justice),],
    "I am glad that you can be made to see reason. Your {reg59?Ladyship's:Lordship's} help will be most appreciated, of course.", "village_elder_tell_capture_mission_4c",[]],
  [anyone,"village_elder_capture_mission_4a", [(eq, "$defect_type", cb6_temperance),],
    "Yes, my {reg59?lady:lord}, these men are weak. They're chock full of temptations. Wouldn't it make sense for you to help them be at peace with themselves? " +
    "Your help, of course, will be appreciated.", "village_elder_tell_capture_mission_4c",[]],
  [anyone,"village_elder_capture_mission_4a", [(eq, "$defect_type", cb6_prudence),],
    "I apologize, my {reg59?lady:lord}, but my men hardly need spear-wielding warrior wives. They need women who can work the fields and take care of the animals, " +
    "not pull a knife out when an argument arises.", "village_elder_tell_capture_mission_4c",[]],
  
  [anyone,"village_elder_capture_mission_4b", [(eq, "$virtue_type", cb5_calm),],
    "Well, your {reg59?Ladyship:Lordship} could possibly understand how asking our lord to help us in a delicate matter such this " +
    "could be dangerous for one's well-being. You, on the other hand, are an outsider, and your aid will be rewarded.", "village_elder_tell_capture_mission_4c",[]],
  
  [anyone,"village_elder_capture_mission_4b", [(eq, "$virtue_type", cb5_responsible),
      (eq,reg59,tf_male),],
    "Your {reg59?Ladyship:Lordship} will always be welcome in our village, especially if he helps us with this delicate problem. I assure you, our gratitude " +
    "is not limited just to this invitation.", "village_elder_tell_capture_mission_4c",[]],
  
  [anyone,"village_elder_capture_mission_4b", [(eq, "$virtue_type", cb5_responsible),
      (eq,reg59,tf_female),],
    "My {reg59?lady:lord}, I'm old and have seen and heard a lot of things. I can definitely see the way the world works. Women play a very important role in " +
    "men's lives, inspiring and guiding them. If you can help us with our little problem, we will find a way to show our gratitude.", "village_elder_tell_capture_mission_4c",[]],
  
  [anyone,"village_elder_capture_mission_4b", [(eq, "$virtue_type", cb5_extroverted),],
    "Yes, my {reg59?lady:lord}, you really should be excited. Judging from the sparkles in your eyes, you are really up to this little challenge, aren't you? " +
    "We are, too, your Highness, as it will relieve our men of their anxiety. Your help, of course, will be duly appreciated.", "village_elder_tell_capture_mission_4c",[]],
  
  [anyone,"village_elder_capture_mission_4b", [(eq, "$virtue_type", cb5_bold),],
    "My {reg59?lady's:lord's} intuition is second to none. What kind of reward can you smell?", "village_elder_tell_capture_mission_4c",[]],
  
  
  
  [anyone|plyr,"village_elder_tell_capture_mission_4c", [(this_or_next|eq, "$defect_type", cb6_fortitude),
      (eq, "$virtue_type", cb5_bold),
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (store_attribute_level, ":charisma", "trp_player", ca_charisma),
      (val_div, ":charisma", 3),
      (store_add, ":bonus", ":persuasion", ":charisma"),
      (assign, "$temp2", ":bonus"),
      (store_random_in_range, ":rand", 23, 31),
      (val_mul, ":bonus", ":rand"),
      (assign, reg25, ":bonus"),
      (assign,"$temp", reg25),
    ],
    "Cash, my good man. {reg25} of it, give or take.", "village_elder_capture_mission_4d",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_4c", [(this_or_next|eq, "$defect_type", cb6_prudence),
      (eq, "$virtue_type", cb5_calm),],
    "Perhaps you're right. What's in it for me?", "village_elder_capture_mission_4c1",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_4c", [(this_or_next|eq, "$defect_type", cb6_justice),
      (eq, "$virtue_type", cb5_responsible),],
    "I'm sure my efforts will be appreciated, but I'd like something more tangible, like cash.", "village_elder_capture_mission_4c1",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_4c", [(this_or_next|eq, "$defect_type", cb6_temperance),
      (eq, "$virtue_type", cb5_extroverted),],
    "Yes, I will help you, but I would require something more tangible than appreciation.", "village_elder_capture_mission_4c1",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_4c", [],
    "Sorry, but you failed to convince me.", "village_elder_capture_mission_reject",[]],
  
  [anyone,"village_elder_capture_mission_4c1", [],
    "Oh, I see. {reg59?Her ladyship:His lordship} desires coins. How many would {reg59?she:he} like?", "village_elder_tell_capture_mission_4c2",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_4c2", [(eq, "$defect_type", cb6_prudence),
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (store_attribute_level, ":charisma", "trp_player", ca_charisma),
      (val_div, ":charisma", 3),
      (store_add, ":bonus", ":persuasion", ":charisma"),
      (assign, "$temp2", ":bonus"),
      (store_random_in_range, ":rand", 10,20),
      (val_mul, ":bonus", ":rand"),
      (assign, reg25, ":bonus"),
      (assign,"$temp", reg25),
    ],
    "I think {reg25} peningas would suffice.", "village_elder_capture_mission_4d",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_4c2", [(eq, "$defect_type", cb6_justice),
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (store_attribute_level, ":charisma", "trp_player", ca_charisma),
      (val_div, ":charisma", 3),
      (store_add, ":bonus", ":persuasion", ":charisma"),
      (assign, "$temp2", ":bonus"),
      (store_random_in_range, ":rand", 13,27),
      (val_mul, ":bonus", ":rand"),
      (assign, reg25, ":bonus"),
      (assign,"$temp", reg25),
    ],
    "I think we can settle on {reg25} peningas.", "village_elder_capture_mission_4d",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_4c2", [(eq, "$defect_type", cb6_prudence),
    ],
    "I think you misunderstood me. I don't need your money. How many women do you need?", "village_elder_tell_capture_mission_5a",[(quest_set_slot, "qst_blank_quest_6", slot_quest_gold_reward, 0),
      (call_script, "script_change_player_honor", 1),
  ]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_4c2", [(eq, "$defect_type", cb6_temperance),
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (store_attribute_level, ":charisma", "trp_player", ca_charisma),
      (val_div, ":charisma", 3),
      (store_add, ":bonus", ":persuasion", ":charisma"),
      (assign, "$temp2", ":bonus"),
      (store_random_in_range, ":rand", 8,24),
      (val_mul, ":bonus", ":rand"),
      (assign, reg25, ":bonus"),
      (assign,"$temp", reg25),
    ],
    "{reg25} peningas - I think your village can handle this amount.", "village_elder_capture_mission_4d",[]],
  
  [anyone,"village_elder_capture_mission_4d", [
      (assign, reg25, "$temp"),
      (assign, reg26, "$temp2"),
      (store_skill_level, ":persuasion", "skl_persuasion", "$g_talk_troop"),
      (store_attribute_level, ":charisma", "$g_talk_troop", ca_charisma),
      (val_div, ":charisma", 2),
      (store_add, ":elder_bonus", ":persuasion", ":charisma"),
      (store_sub, ":diff", reg26, ":elder_bonus"),
      (try_begin),
        (lt, ":diff", 0),
        (assign, ":diff", 0),
      (try_end),
      (str_clear, s33),
      (try_begin),
        (lt,":diff",3),
        (le, reg25, 100),
        (str_store_string, s33, "@My dear {reg59?lady:lord}, I would be happy to pay you {reg25} peningas."),
      (else_try),
        (lt,":diff",3),
        (gt, reg25, 100),
        (assign, reg25, 100),
        (str_store_string, s33, "@My dear {reg59?lady:lord}, I am only a poor villager, and can only offer you {reg25} peningas."),
      (else_try),
        (is_between, ":diff", 3, 6),
        (le, reg25, 250),
        (str_store_string, s33, "@My dear {reg59?lady:lord}, I would be happy to pay you {reg25} peningas."),
      (else_try),
        (is_between, ":diff", 3, 6),
        (gt, reg25, 250),
        (store_skill_level, ":p_persuasion", "skl_persuasion", "trp_player"),
        (val_sub, ":p_persuasion",":persuasion"),
        (val_div, ":p_persuasion", 2),
        (try_begin),
          (lt, ":p_persuasion", 2),
          (assign, reg25, 250),
          (str_store_string, s33, "@My dear {reg59?lady:lord}, I am only a poor villager. I can only offer you {reg25} peningas."),
        (else_try),
          (str_store_string, s33, "@My dear {reg59?lady:lord}, you sound very persuasive. I would be happy to pay you {reg25} peningas."),
        (try_end),
      (else_try),
        (str_store_string, s33, "@My dear {reg59?lady:lord}, your persuasion and charisma are hard to resist. I would be delighted to pay you {reg25} peningas."),
      (try_end),
      (assign, "$temp", reg25),
    ],
    "{!}{s33}", "village_elder_capture_mission_4d1",[]],
  
  [anyone|plyr,"village_elder_capture_mission_4d1", [(assign, reg25, "$temp"),],
    "Hmmm, alright, {reg25} peningas will do. How many women do you need?", "village_elder_tell_capture_mission_5a",[  (quest_set_slot, "qst_blank_quest_6", slot_quest_gold_reward, reg25),]],
  
  [anyone|plyr,"village_elder_capture_mission_4d1", [(assign, reg25, "$temp"),],
    "Hmmm, {reg25} peningas is far too little. I have better things to do. Good day.", "village_elder_capture_mission_reject",[]],
  
  [anyone,"village_elder_tell_capture_mission_5a", [(quest_get_slot, reg5, "$random_quest_no", slot_quest_target_amount)],
    "I think {reg5} women will be enough for now.", "village_elder_tell_capture_mission_6",[]],
  
  [anyone|plyr,"village_elder_tell_capture_mission_6", [],
    "Then I will go and find you the women you need.", "village_elder_capture_mission_accept",[]],
  [anyone|plyr,"village_elder_tell_capture_mission_6", [],
    "I am afraid I don't have time for this. You'll need to find help elsewhere.", "village_elder_capture_mission_reject",[]],
  
  [anyone,"village_elder_capture_mission_accept", [], "Thank you, {reg59?my lady:my lord}. May your paths guide you to the best women.", "close_window",
    [(assign, "$g_leave_encounter",1),
      (call_script, "script_change_player_relation_with_center", "$current_town", 2),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
  ]],
  
  [anyone|plyr,"village_elder_active_mission_2",[(store_partner_quest,":elder_quest"),
      (eq, ":elder_quest", "qst_blank_quest_6"),
      (quest_get_slot, ":quest_target_amount", "qst_blank_quest_6", slot_quest_target_amount),
      (party_count_prisoners_of_type, ":prisoner", "p_main_party", "trp_peasant_woman"),
      (ge, ":prisoner", ":quest_target_amount"),
      (assign, reg5, ":quest_target_amount"),
      (assign, "$temp", ":prisoner"),
    ],
    "Indeed. I have brought you {reg5} women, as you requested.", "village_elder_capture_thank",
    []],
  
  [anyone,"village_elder_capture_thank", [(str_store_party_name, s13, "$current_town")],
    "My good {reg59?lady:lord}, you are a true savior for our village. We cannot thank you enough, but you'll always be in our prayers. " +
    "The men of {s13} will not forget what you have done for us. We will all name our first {reg59?daughter:son} after you!", "village_elder_capture_thank_2",
    [(quest_get_slot, ":quest_target_amount", "qst_blank_quest_6", slot_quest_target_amount),
      (quest_get_slot, ":quest_gold_reward", "qst_blank_quest_6", slot_quest_gold_reward),
      (assign, reg35, "$temp"),
      (party_remove_prisoners, "p_main_party", "trp_peasant_woman", ":quest_target_amount"),
      (store_mul, ":xp", ":quest_target_amount", 100),
      (add_xp_as_reward, ":xp"),
      (call_script, "script_change_center_prosperity", "$current_town", 3),
      (call_script, "script_change_player_relation_with_center", "$current_town", 12),
      (call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"),
      (call_script, "script_end_quest", "qst_blank_quest_6"),
      #Troop commentaries begin
      (call_script, "script_add_log_entry", logent_helped_peasants, "trp_player",  "$current_town", -1, -1),
      #Troop commentaries end
  ]],
  [anyone,"village_elder_capture_thank_2", [],
    "My good {reg59?lady:lord}, please, is there anything I can do for you?", "village_elder_talk",[]],
  
  ## JuJu70 quest end
  
  ## VC-1883 begin
  
  [anyone,"village_elder_tell_mission", [(eq,"$random_quest_no", "qst_blank_quest_7")],
    "One of our slaves has overwhelmed his owner and fled. You look like a {reg59?woman:man} of war strong enough " +
    "to capture him. Would you be able to find him and bring him back? He cannot have gone far. He must be hiding somewhere next to the village.",
    "village_elder_tell_capture_slave_mission",
    [
      
      (quest_get_slot, ":village", "$random_quest_no",slot_quest_target_center),
      (str_store_party_name_link, s3, ":village"),
      (setup_quest_text, "$random_quest_no"),
      (str_store_string, s2, "@The leader of the village of {s3} asked you to bring the runaway slave back to the village. Most probably, he is hiding in the area around the village."),
  ]],
  
  [anyone|plyr, "village_elder_tell_capture_slave_mission", [],
    "I will find him and bring him back.", "village_elder_capture_slave_mission_accept",[]],
  [anyone|plyr, "village_elder_tell_capture_slave_mission", [],
    "I'm no slave hunter.", "village_elder_capture_slave_mission_reject",[]],
  [anyone|plyr,"village_elder_tell_capture_slave_mission", [],
    "I am afraid I don't have time for this now.", "village_elder_capture_slave_mission_reject",[]],
  
  [anyone,"village_elder_capture_slave_mission_accept", [], "You will? Oh, splendid! " +
    "Thank you, {reg59?madam:sir}. " +
    "He must be hiding somewhere near our village.", "close_window",
    [
      (assign, "$g_leave_encounter",1),
      (call_script, "script_change_player_relation_with_center", "$current_town", 1),
      (set_spawn_radius, 11),
      (spawn_around_party, "$current_town", "pt_slave_hideout"),
      (assign, ":party_no", reg(0)),
      (party_set_flags, ":party_no", pf_disabled, 1),
      (quest_set_slot, "$random_quest_no", slot_quest_target_party,":party_no"),
      (quest_set_slot, "$random_quest_no", slot_quest_current_state, 1),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
  ]],
  
  [anyone,"village_elder_capture_slave_mission_reject", [], "Yes, of course {reg59?madam:sir}. " +
    "Well, we will find someone else for the job.", "close_window",
    [
      (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
  ]],
  
  # slave dialogue part
  
  [trp_slave,"start", [(quest_slot_eq, "qst_blank_quest_7", slot_quest_current_state, 2),],
    "Greetings, traveller.", "capture_slave_pretalk_1",[]],
  [anyone|plyr, "capture_slave_pretalk_1", [],
    "Greetings. What are you doing here in the middle of nowhere?", "capture_slave_pretalk_2",[]],
  [anyone,"capture_slave_pretalk_2", [],
    "I ran away from a nearby village, and I'm hiding here trying to decide what to do next.", "capture_slave_talk",[]],
  [anyone,"capture_slave_pretalk_x", [],
    "Anything else you want to know?", "capture_slave_talk",[]],
  
  [anyone|plyr, "capture_slave_talk", [],
    "Why did you run away?", "capture_slave_ask_why",[]],
  [anyone,"capture_slave_ask_why", [],
    "My master has beaten me on more than one occasion. I could not stand it any longer.", "capture_slave_pretalk_x",[]],
  
  [anyone|plyr, "capture_slave_talk", [],
    "I'm here to bring you back to your master.", "capture_slave_talk_2",[]],
  [anyone,"capture_slave_talk_2", [],
    "I'm begging you, {reg59?madam:sir}. Anything but that. Death awaits me there.", "capture_slave_talk_3",[]],
  
  [anyone|plyr, "capture_slave_talk_3", [],
    "I care very little about your destiny. Follow me!", "close_window",
    [
      (quest_set_slot, "qst_blank_quest_7", slot_quest_current_state, 3),
      (quest_get_slot, ":village", "qst_blank_quest_7", slot_quest_target_center),
      (str_store_party_name_link, s13, ":village"),
      (add_quest_note_from_sreg, "qst_blank_quest_7", 7, "@The runaway slave is now forced to follow you. Bring him back to the leader of {s13}.", 1),
      (mission_disable_talk),
      (finish_mission, 3),
    ]
  ],
  [anyone|plyr, "capture_slave_talk_3", [],
    "If death is awaiting you anyway, I will kill you right here.", "capture_slave_kill",
    [
      (get_player_agent_no, ":player_agent"),
      (agent_add_relation_with_agent, ":player_agent", "$alpha_animal", -1),
      (agent_add_relation_with_agent, "$alpha_animal", ":player_agent", -1),
      (mission_disable_talk),
      (call_script, "script_equip_best_melee_weapon", "$alpha_animal", 0, 0, 0),
      (call_script, "script_equip_best_melee_weapon", ":player_agent", 0, 0, 0),
    ]
  ],
  [anyone,"capture_slave_kill", [],
    "In that case, I will defend myself.", "close_window",[]],
  [anyone|plyr, "capture_slave_talk_3", [(hero_can_join, "p_main_party"),],
    "Join my war band, and you won't have to go back to your master.", "capture_slave_talk_4",
    [ (quest_set_slot, "qst_blank_quest_7", slot_quest_current_state, 3),
      (quest_get_slot, ":village", "qst_blank_quest_7", slot_quest_target_center),
      (party_add_members, "p_main_party", "trp_slave", 1),
      
      (call_script, "script_fail_quest", "qst_blank_quest_7"),
      (call_script, "script_change_player_relation_with_center", ":village", -3),
      (add_xp_as_reward, 100),
  ]],
  [anyone|plyr, "capture_slave_talk_3", [],
    "Then leave now. I will pretend I haven't seen you.", "capture_slave_talk_4",
    [ (quest_set_slot, "qst_blank_quest_7", slot_quest_current_state, 3),
      (quest_get_slot, ":village", "qst_blank_quest_7", slot_quest_target_center),
      (agent_start_running_away, "$alpha_animal", 0),
      
      (call_script, "script_fail_quest", "qst_blank_quest_7"),
      (call_script, "script_change_player_relation_with_center", ":village", -1),
      (add_xp_as_reward, 100),
  ]],
  
  [anyone,"capture_slave_talk_4", [],
    "Thank you so much, {reg59?madam:sir}!", "close_window",[(mission_disable_talk),(finish_mission, 3),]],
  
  ## VC-1883 end
  
  [anyone,"village_elder_tell_mission", [(eq,"$random_quest_no", "qst_train_peasants_against_bandits")],
    "We are suffering greatly at the hands of a group of bandits. They take our food and livestock, " +
    "and kill anyone who doesn't obey them immediately. Our men are angry that we cannot defend ourselves, but we are only simple farmers... " +
    "However, with some help, I think that some of the people here could be more than that. " +
    "We just need an experienced warrior to teach us how to fight.",
    "village_elder_tell_train_peasants_against_bandits_mission",
    [
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (str_store_party_name_link, s13, ":quest_target_center"),
      (quest_get_slot, reg5, "$random_quest_no", slot_quest_target_amount),
      (setup_quest_text, "$random_quest_no"),
      (str_store_string, s2, "@The elder of the village of {s13} asked you to train {reg5} peasants to fight against local bandits."),
  ]],
  
  [anyone|plyr, "village_elder_tell_train_peasants_against_bandits_mission", [],
    "I can teach you how to defend yourself.", "village_elder_train_peasants_against_bandits_mission_accept",[]],
  [anyone|plyr, "village_elder_tell_train_peasants_against_bandits_mission", [],
    "You peasants have no business taking up arms. Just pay the bandits and be off with it.", "village_elder_train_peasants_against_bandits_mission_reject",[]],
  
  [anyone,"village_elder_train_peasants_against_bandits_mission_accept", [], "You will? Oh, splendid! " +
    "We would be deeply indebted to you, {reg59?madam:sir}. " +
    "I'll instruct the village folk to assemble here and receive your training. " +
    "If you can teach us how to defend ourselves, I promise you'll receive everything we can give you in return for your efforts.", "close_window",
    [
      (assign, "$g_leave_encounter",1),
      #TODO: Change this value
      (call_script, "script_change_player_relation_with_center", "$current_town", 5),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
      (quest_set_slot,"qst_train_peasants_against_bandits",slot_quest_current_state, 0),
  ]],
  
  [anyone,"village_elder_train_peasants_against_bandits_mission_reject", [], "Yes, of course {reg59?madam:sir}. " +
    "Thank you for your counsel.", "close_window",
    [
      (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
  ]],
  
  
  [anyone,"village_elder_tell_mission", [(eq,"$random_quest_no","qst_deliver_cattle")],
    "Bandits have driven away our cattle. Our pastures are empty. If we had just a few head of cattle, we could start to raise a herd again.",
    "village_elder_tell_deliver_cattle_mission",
    [
      (quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
      (str_store_party_name_link,s3,":quest_target_center"),
      (quest_get_slot, reg5, "$random_quest_no", slot_quest_target_amount),
      (setup_quest_text,"$random_quest_no"),
      (str_store_string, s2, "@The elder of the village of {s3} asked you to bring them {reg5} head of cattle."),
  ]],
  
  [anyone|plyr,"village_elder_tell_deliver_cattle_mission", [],
    "How many animals do you need?", "village_elder_tell_deliver_cattle_mission_2",[]],
  [anyone|plyr,"village_elder_tell_deliver_cattle_mission", [],
    "I don't have time for this. Ask help from someone else.", "village_elder_deliver_cattle_mission_reject",[]],
  
  [anyone,"village_elder_tell_deliver_cattle_mission_2", [(quest_get_slot, reg5, "$random_quest_no", slot_quest_target_amount)],
    "I think {reg5} head of cattle will suffice for a small herd.", "village_elder_tell_deliver_cattle_mission_3",[]],
  
  [anyone|plyr,"village_elder_tell_deliver_cattle_mission_3", [],
    "Then I will bring you the cattle you need.", "village_elder_deliver_cattle_mission_accept",[]],
  [anyone|plyr,"village_elder_tell_deliver_cattle_mission_3", [],
    "I am afraid I don't have time for this. You'll need to find help elsewhere.", "village_elder_deliver_cattle_mission_reject",[]],
  
  [anyone,"village_elder_deliver_cattle_mission_accept", [], "Thank you, {reg59?madam:sir}. We'll be praying for you night and day.", "close_window",
    [(assign, "$g_leave_encounter",1),
      (call_script, "script_change_player_relation_with_center", "$current_town", 3),
      (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
  ]],
  
  [anyone,"village_elder_deliver_cattle_mission_reject", [], "Yes, {reg59?madam:sir}, of course. I am sorry to have bothered you with our troubles.", "close_window",
    [(troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
  ]],
  
  [anyone,"village_elder_tell_mission", [], "Thank you, {reg59?madam:sir}, but we do not really need anything right now.", "village_elder_pretalk",[
    (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
  ]],
  
  ##  [anyone|plyr,"village_elder_mission_told", [], "TODO: As you wish sir. You can count on me.", "village_elder_mission_accepted",[]],
  ##  [anyone|plyr,"village_elder_mission_told", [], "TODO: I'm afraid I can't carry out this mission right now, sir.", "village_elder_mission_rejected",[]],
  ##
  ##  [anyone,"village_elder_mission_accepted", [], "TODO: Excellent. Do this {playername}. I really have high hopes for you.", "close_window",
  ##   [(assign, "$g_leave_encounter",1),
  ##    (try_begin),
  ##    #TODO: Add quest initializations here
  ##    (try_end),
  ##    (call_script, "script_start_quest", "$random_quest_no", "$g_talk_troop"),
  ##    ]],
  
  ##  [anyone,"village_elder_mission_rejected", [], "TODO: Is that so? Perhaps you are not up for the task anyway...", "close_window",
  ##   [(assign, "$g_leave_encounter",1),
  ##    (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
  ##    (troop_set_slot, "$g_talk_troop", slot_troop_does_not_give_quest, 1),
  ##    ]],
  
  
  
  
  #Goods Merchants
  
  [anyone ,"start", [(is_between,"$g_talk_troop",goods_merchants_begin,goods_merchants_end),
      (party_slot_eq, "$current_town", slot_town_lord, "trp_player")],
    "{reg59?My lady:My lord}, you honour my humble shop with your presence.", "goods_merchant_talk",[]],
  [anyone ,"start", [(is_between,"$g_talk_troop",goods_merchants_begin,goods_merchants_end)],
    "Welcome {reg59?madam:sir}. What can I do for you?", "goods_merchant_talk",[]],
  
  #  [trp_salt_mine_merchant,"start", [], "Hello.", "goods_merchant_talk",[]],
  
  #  [anyone,"merchant_begin", [], " What can I do for you?", "goods_merchant_talk",[]],
  
  [anyone,"goods_merchant_pretalk", [], "Anything else?", "goods_merchant_talk",[]],
  #mainquest chief
  ###pieles quest
  [anyone|plyr,"goods_merchant_talk", [(eq,"$g_talk_troop","trp_town_7_merchant"), #hogni, quest pieles
      (check_quest_active,"qst_entregando_pieles"),
      (quest_slot_eq,"qst_entregando_pieles",slot_quest_current_state, 1),
      ], "Hogni, the port master of Ribe sends these furs to you.", "quest_pieles1",[
  ]],
  [anyone,"quest_pieles1", [], "Finally! I spent weeks waiting for this delivery. Thanks, but do not expect a tip. It has come very late.", "goods_merchant_pretalk",[
      (troop_remove_item, "trp_player", "itm_vc_furs"),
      (call_script, "script_change_player_relation_with_center", "$current_town", 10),
      (call_script, "script_succeed_quest", "qst_entregando_pieles"),
      (quest_set_slot,"qst_entregando_pieles",slot_quest_current_state, 2),
  ]],
  
  ####Reginhard quest
  [anyone|plyr,"goods_merchant_talk", [(eq,"$g_talk_troop","trp_town_11_merchant"), #adda, quest Reginhard donations
      (check_quest_active,"qst_reginhard_donations"),
      (quest_slot_eq,"qst_reginhard_donations",slot_quest_current_state, 1),
      ], "A man sent me to see you. His name is Reginhard.", "goods_reginhard_donations",[
  ]],
  [anyone,"goods_reginhard_donations", [], "I know who Reginhard is, and it is not a name that it pleases me to hear. " +
    "I have no time for people coming from him.", "goods_reginhard_donations2",[]],
  [anyone|plyr,"goods_reginhard_donations2", [], "Wait! I just want to make a donation to the widows and orphans in this town.", "goods_reginhard_donations3",[]],
  [anyone, "goods_reginhard_donations3", [
      (str_clear, s2),
    ],
    "{s2}^^Err, I do not expect this from Reginhard. How much is your donation? We accept 100, 300 and 600 peningas.", "goods_reginhard_donations4", [
      (str_store_string, s2, "@--She looks puzzled and surprised.--", color_good_news),
  ]],
  [anyone|plyr,"goods_reginhard_donations4", [
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 600),
      ], "These children deserve a better future. Donate 600 peningas.", "goods_reginhard_donations5",[
      (troop_remove_gold, "trp_player", 600),
      (call_script, "script_change_player_honor", 3),
      #(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 20),
      (call_script, "script_change_player_relation_with_center", "$current_town", 15),
  ]],
  [anyone|plyr,"goods_reginhard_donations4", [
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 300),
      ], "I think 300 peningas will allow many families to get through the next winter.", "goods_reginhard_donations5",[
      (troop_remove_gold, "trp_player", 300),
      (call_script, "script_change_player_honor", 2),
      #(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (call_script, "script_change_player_relation_with_center", "$current_town", 10),
  ]],
  [anyone|plyr,"goods_reginhard_donations4", [
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 100),
      ], "I will donate 100 peningas.", "goods_reginhard_donations5",[
      (troop_remove_gold, "trp_player", 100),
      #  (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 1),
      (call_script, "script_change_player_honor", 1),
      (call_script, "script_change_player_relation_with_center", "$current_town", 5),
  ]],
  [anyone|plyr,"goods_reginhard_donations4", [
      ], "I do not have enough money to make a good donation. I will come back later.", "goods_merchant_pretalk",[
  ]],
  
  [anyone, "goods_reginhard_donations5", [
      (str_clear, s2),
    ],
    "{s2}^^Many people will be grateful to you and Reginhard. God bless you.", "goods_merchant_pretalk", [
      (str_store_string, s2, "@--She smiles, happy for your donation.--", color_good_news),
      (call_script, "script_succeed_quest", "qst_reginhard_donations"),
      (quest_set_slot,"qst_reginhard_donations",slot_quest_current_state, 2),
  ]],
  ###
  [anyone|plyr,"goods_merchant_talk", [], "I want to buy a few items... and perhaps sell some.", "goods_trade_requested",[]],
  [anyone,"goods_trade_requested", [], "Sure, sure... Here, have a look at my stock...", "goods_trade_completed",[[change_screen_trade]]],
  [anyone,"goods_trade_completed", [], "Anything else?", "goods_merchant_talk",[]],
  
  [anyone|plyr,"goods_merchant_talk", [], "What goods should I buy here to trade with other towns?", "trade_info_request",[]],
  
  [anyone|plyr,"goods_merchant_talk", [], "Nothing. Thanks.", "close_window",[]],
  
  [anyone,"trade_info_request", [], "That information can be best obtained from caravan masters " +
    "and travelling merchants. If you want, I can send you to the district where foreign merchants stay at when they come to the town. " +
    "If you spend some time there and listen to the talk, " +
    "you can learn a lot about what to buy and where to sell it.", "trade_info_request_2",[]],
  
  [anyone|plyr,"trade_info_request_2", [], "Then I'll go and spend some time with these merchants.", "close_window",
    [
      (jump_to_menu,"mnu_town_trade_assessment_begin"),
      (finish_mission),
  ]],
  
  [anyone|plyr,"trade_info_request_2", [], "I have no time for this right now.", "goods_merchant_pretalk",[]],
  
  
  #  [anyone|plyr,"goods_merchant_talk", [], "What do caravans buy and sell in this town?", "goods_merchant_town_info",[]],
  #  [anyone,"goods_merchant_town_info_completed", [], "Anything else?", "goods_merchant_talk",[]],
  
  
  ##  [anyone,"goods_merchant_town_info", [],
  ##   "TODO: We produce {s1}, and we consume {s2}.", "goods_merchant_town_info_completed",
  ##   [(call_script, "script_print_productions_above_or_below_50", "$g_encountered_party", 1),
  ##    (str_store_string_reg, s1, s51),
  ##    (call_script, "script_print_productions_above_or_below_50", "$g_encountered_party", -1),
  ##    (str_store_string_reg, s2, s51)]],
  ##
  ##  [anyone,"goods_merchant_town_info", [(store_encountered_party,reg(1)),(eq,reg(1),"p_zendar")],
  ##"You can buy tools from here at a very good price.\
  ## The best place to sell them would be Tulga. Heard they pay quite well for tools over there.\
  ## And next time you come here bring some salt. I will pay well for salt.", "goods_merchant_town_info_completed",[]],
  ##  [anyone,"goods_merchant_town_info", [(store_encountered_party,reg(1)),(eq,reg(1),"p_town_1")],
  ##"Sargoth is famous for its fine linen. Many caravans come here to buy that.\
  ## I heard you can sell it at Halmar and make a nice profit.\
  ## And next time you come here bring some iron. I will pay well for iron.", "goods_merchant_town_info_completed",[]],
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_2"]],
  ##"I can sell you some smoked fish with a special price.\
  ## I heard that caravans take smoked fish to Uxkhal and make a good profit.\
  ## And next time you come here bring some wool. I will pay you well for wool.", "goods_merchant_town_info_completed",[]],
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_3"]],
  ##"I can sell you some wine with a special price.\
  ## I heard that caravans buy wine from here and sell it at Wercheg, making a good profit.\
  ## And next time you come here, bring some dried meat. I will pay you well for dried meat.", "goods_merchant_town_info_completed",[]],
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_4"]],
  ##"I have a stock of oil which I can sell you with a good price.\
  ## They say they offer a fortune for oil in Rivacheg, so maybe you can sell it there.\
  ## And next time you come here, bring some furs. I will pay you well for furs.", "goods_merchant_town_info_completed",[]],
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_5"]],
  ##"Jelkala is famous for its velvet. Many caravans come here to buy that.\
  ## They say merchants will buy it at insane prices in Reyvadin, so maybe you can take it there.\
  ## And next time you come here, bring some pottery. I will pay you well for pottery.", "goods_merchant_town_info_completed",[]],
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_6"]],
  ##"We produce some excellent ale here in Praven. Most caravans come here to buy that.\
  ## They say that the folks at Khudan will sell their right arms for ale, so maybe you can take it there.\
  ## And next time you come here, bring some spice. I have sold out my stock of spice and I will pay you well for it.", "goods_merchant_town_info_completed",[]],
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_7"]],
  ##"We produce mostly wheat here in Uxkhal. I would suggest you buy that.\
  ## I heard you can sell it with a good profit in Tulga, so maybe you can take it there.\
  ## And next time you come here, bring some smoked fish. I will pay you well for it.", "goods_merchant_town_info_completed",[]],
  ##
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_8"]],
  ##"Most caravans come to Reyvadin to buy wool.\
  ## I heard that they take it to Tihr where they pay well for wool.\
  ## And next time you come here, bring some velvet. I will buy it from you at a good price.", "goods_merchant_town_info_completed",[]],
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_9"]],
  ##"Most caravans come to Khudan to buy furs.\
  ## I heard that they take it to Suno where they pay well for it.\
  ## And next time you come here, bring some ale. I will buy it from you at a good price.", "goods_merchant_town_info_completed",[]],
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_10"]],
  ##"Most caravans come to Tulga to buy spice.\
  ## They say that in Praven they pay well for spice, so you may think of selling it to the mechants there.\
  ## And next time you come here, bring some wheat. I will buy it from you at a good price.", "goods_merchant_town_info_completed",[]],
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_11"]],
  ##"We mine a lot of iron here in Curaw. I would suggest you buy that.\
  ## I heard you can take it to Sargoth and sell it with a good profit.\
  ## And next time you come here, bring some dried meat. I will pay you well for it.", "goods_merchant_town_info_completed",[]],
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_12"]],
  ##"I can sell you some smoked fish with a special price.\
  ## I heard that caravans take smoked fish to Uxkhal and make a good profit.\
  ## And next time you come here bring some wine. I will pay you well for wine.", "goods_merchant_town_info_completed",[]],
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_13"]],
  ##"I have a stock of dried meat which I can sell you with a good price.\
  ## They say they pay very well for dried meat in Veluca, so maybe you can sell it there.\
  ## And next time you come here, bring some oil. I have sold out my stock of oil and I will pay you well for it.", "goods_merchant_town_info_completed",[]],
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_town_14"]],
  ##"We produce some good quality pottery here in Halmar. Most caravans come here to buy that.\
  ## I heard that caravans buy pottery from here and sell it at Jelkala, making a good profit.\
  ## And next time you come here, bring some linen. I have sold out my stock of linen and I will pay you well for it.", "goods_merchant_town_info_completed",[]],
  ##
  ##  [anyone,"goods_merchant_town_info", [[store_encountered_party,reg(1)],[eq,reg(1),"p_salt_mine"]],
  ##"Heh. Are you joking with me? This is the salt mine. Merchants come here to buy salt.", "goods_merchant_town_info_completed",[]],
  ##
  ##  [anyone,"goods_merchant_town_info", [
  ##                                       (store_encountered_party,reg(9)),
  ##                                       (party_get_slot,reg(5),reg(9),slot_town_export_good),
  ##                                       (party_get_slot,reg(6),reg(9),slot_town_import_good),
  ##                                       (ge,reg(5),1),
  ##                                       (ge,reg(6),1),
  ##                                       (str_store_item_name,1,reg(5)),
  ##                                       (str_store_item_name,2,reg(6)),
  ##                                       ],
  ##  "I can sell you some {s1} with a special price.\
  ##And next time you come here bring some {s2}. I will pay you well for that.", "goods_merchant_town_info_completed",[]],
  ##
  ##  [anyone,"goods_merchant_town_info", [
  ##                                       (store_encountered_party,reg(9)),
  ##                                       (party_get_slot,reg(5),reg(9),slot_town_export_good),
  ##                                       (ge,reg(5),1),
  ##                                       (str_store_item_name,1,reg(5)),
  ##                                       ],
  ##  "I can sell you some {s1} with a special price.", "goods_merchant_town_info_completed",[]],
  ##
  ##  [anyone,"goods_merchant_town_info", [
  ##                                       (store_encountered_party,reg(9)),
  ##                                       (party_get_slot,reg(6),reg(9),slot_town_import_good),
  ##                                       (ge,reg(6),1),
  ##                                       (str_store_item_name,2,reg(6)),
  ##                                       ],
  ##  "If you have some {s2} with you, I am ready to pay you good money for it.", "goods_merchant_town_info_completed",[]],
  ##
  ##  [anyone,"goods_merchant_town_info", [],
  ##"Sorry. Caravans hardly ever trade anything here.", "goods_merchant_town_info_completed",[]],
  
  
  
  
  
  
  #############################################################################
  #### ARENA MASTERS
  #############################################################################
  [anyone ,"start", [(store_conversation_troop,reg(1)),
      (is_between,reg(1),arena_masters_begin,arena_masters_end),
      (assign, "$arena_reward_asked", 0), #set some variables.
      (assign, "$arena_tournaments_asked", 0),
      (eq,1,0),
    ],
    "{!}.", "arena_intro_1",[]],
  [anyone ,"start", [(store_conversation_troop,reg(1)),
      (is_between,reg(1),arena_masters_begin,arena_masters_end),
      (eq,"$arena_master_first_talk", 0),
    ],
    "Good day, friend. If you've come to watch the tournaments, you've come in vain. There won't be a tournament here any time soon.", "arena_intro_1",[(assign,"$arena_master_first_talk", 1)]],
  [anyone|plyr,"arena_intro_1", [], "Tournaments? So they hold the tournaments here...", "arena_intro_2",[]],
  [anyone,"arena_intro_2", [], "Yes. You should see this place during one of the tournament fights. " +
    "Everyone from the town and nearby villages comes here. The crowd becomes mad with excitement. " +
    "Anyway, as I said, there won't be an event here soon, so there isn't much to see. " +
    "Except, there is an official duel every now and then, and of course we have melee fights almost every day.", "arena_intro_3",[]],
  [anyone|plyr,"arena_intro_3", [], "Tell me about the melee fights.", "arena_training_melee_intro",[]],
  [anyone,"arena_training_melee_intro", [], "The fighters and knights get bored waiting for the next tournament, " +
    "so they have invented the training melee. It is a simple idea really. " +
    "Fighters jump into the arena with a weapon. There are no rules, no teams. " +
    "Everyone beats at each other until there is only one fighter left standing. " +
    "Sounds like fun, eh?", "arena_training_melee_intro_2",[]],
  [anyone|plyr,"arena_training_melee_intro_2", [(eq, "$arena_reward_asked", 0)], "Is there a reward?", "arena_training_melee_intro_reward",[(assign, "$arena_reward_asked", 1)]],
  [anyone,"arena_training_melee_intro_reward", [(assign, reg1, arena_tier1_opponents_to_beat),(assign, reg11, arena_tier1_prize),
      (assign, reg2, arena_tier2_opponents_to_beat),(assign, reg12, arena_tier2_prize),
      (assign, reg3, arena_tier3_opponents_to_beat),(assign, reg13, arena_tier3_prize),
      (assign, reg4, arena_tier4_opponents_to_beat),(assign, reg14, arena_tier4_prize),
      (assign, reg15, arena_grand_prize)
    ], "There is, actually. Some of the wealthy townsmen offer prizes for those fighters who show great skill in the fights. " +
    "If you can beat {reg1} opponents before going down, you'll earn {reg11} peningas. You'll get {reg12} peningas for striking down at least {reg2} opponents, " +
    "{reg13} peningas if you can defeat {reg3} opponents, and {reg14} peningas if you can survive long enough to beat {reg4} opponents. " +
    "If you can manage to be the last {reg59?fighter:man} standing, you'll earn the great prize of the fights, {reg15} peningas. Sounds good, eh?", "arena_training_melee_intro_2",[(assign, "$arena_tournaments_asked", 1),]],
  [anyone,"arena_training_melee_explain_reward", [
      (assign, reg1, arena_tier1_opponents_to_beat),(assign, reg11, arena_tier1_prize),
      (assign, reg2, arena_tier2_opponents_to_beat),(assign, reg12, arena_tier2_prize),
      (assign, reg3, arena_tier3_opponents_to_beat),(assign, reg13, arena_tier3_prize),
      (assign, reg4, arena_tier4_opponents_to_beat),(assign, reg14, arena_tier4_prize),
      (assign, reg15, arena_grand_prize)
    ], "Some of the wealthy townsmen offer prizes for those fighters who show great skill in the fights. " +
    "If you can beat {reg1} opponents before going down, you'll earn {reg11} peningas. You'll get {reg12} peningas for striking down at least {reg2} opponents, " +
    "{reg13} peningas if you can defeat {reg3} opponents, and {reg14} peningas if you can survive long enough to beat {reg4} opponents. " +
    "If you can manage to be the last {reg59?fighter:man} standing, you'll earn the great prize of the fights, {reg15} peningas. Sounds good, eh?", "arena_master_melee_pretalk",[]],
  [anyone|plyr,"arena_training_melee_intro_2", [], "Can I join too?", "arena_training_melee_intro_3",[]],
  [anyone,"arena_training_melee_intro_3", [], "Ha ha. You would have to be out of your mind not to. Of course. The melee fights are open to all. " +
    "Actually, there is going to be a fight soon. You can go and hop in if you want to.", "arena_master_melee_talk",[]],
  
  
  [anyone ,"start", [(store_conversation_troop,reg(1)),
      (is_between,reg(1),arena_masters_begin,arena_masters_end),
      (eq,"$g_talk_troop_met", 0),
    ],
    "Hello. You seem to be new here. Care to share your name?", "arena_master_intro_1",[]],
  [anyone|plyr,"arena_master_intro_1", [], "I am {playername}.", "arena_master_intro_2",[]],
  [anyone,"arena_master_intro_2", [(store_encountered_party,reg(2)),(str_store_party_name,1,reg(2))],
    "Well met, {playername}. I am the master of the tournaments here at {s1}. Talk to me if you want to join the fights.", "arena_master_pre_talk",[]],
  
  
  [anyone|auto_proceed ,"start", [(store_conversation_troop,reg(1)),(is_between,reg(1),arena_masters_begin,arena_masters_end),
      (eq, "$last_training_fight_town", "$current_town"),
      (store_current_hours,":cur_hours"),
      (val_add, ":cur_hours", -4),
      (lt, ":cur_hours", "$training_fight_time")],
    ".", "arena_master_fight_result",[(assign, "$arena_reward_asked", 0)]],
  
  [anyone ,"arena_master_fight_result",
    [
      (eq, "$g_arena_training_won", 0),
      (eq, "$g_arena_training_kills", 0)
    ],
    "Ha-ha, that's quite the bruise you're sporting, but don't worry. Everybody gets trounced once in awhile. The important thing is to pick yourself up, dust yourself off and keep fighting. That's what champions do.", "arena_master_pre_talk",[(assign, "$last_training_fight_town", -1)]],
  
  [anyone ,"arena_master_fight_result",
    [
      (eq, "$g_arena_training_won", 0),
      (lt, "$g_arena_training_kills", arena_tier1_opponents_to_beat),
      (assign, reg8, "$g_arena_training_kills")
    ],
    "Hey, you managed to take down {reg8} opponents. Not bad, but that won't bring you any prize money. " +
    "Now, if I were you, I would go back there and show everyone what I can do...", "arena_master_pre_talk",[(assign, "$last_training_fight_town", -1)]],
  
  [anyone ,"arena_master_fight_result",
    [
      (eq, "$g_arena_training_won", 0),
      (lt, "$g_arena_training_kills", arena_tier2_opponents_to_beat),
      (assign, reg8, "$g_arena_training_kills"),
      (assign, reg10, arena_tier1_prize),
    ],
    "You put up quite a good fight there. Good moves. You definitely show promise. " +
    "And you earned a prize of {reg10} peningas for knocking down {reg8} opponents.", "arena_master_pre_talk",[
      (call_script, "script_troop_add_gold", "trp_player", arena_tier1_prize),
      (add_xp_to_troop,5,"trp_player"),
      (assign, "$last_training_fight_town", -1)]],
  
  [anyone ,"arena_master_fight_result",
    [
      (eq, "$g_arena_training_won", 0),
      (lt, "$g_arena_training_kills", arena_tier3_opponents_to_beat),
      (assign, reg8, "$g_arena_training_kills"),
      (assign, reg10, arena_tier2_prize),
      (assign, reg12, arena_tier2_opponents_to_beat),
    ],
    "That was a good fight you put up there. You managed to take down no less than {reg8} opponents. " +
    "And of course, you earned a prize money of {reg10} peningas.", "arena_master_pre_talk",[
      (call_script, "script_troop_add_gold", "trp_player", arena_tier2_prize),
      (add_xp_to_troop,10,"trp_player"),
      (assign, "$last_training_fight_town", -1)]],
  
  [anyone ,"arena_master_fight_result",
    [
      (eq, "$g_arena_training_won", 0),
      (lt, "$g_arena_training_kills", arena_tier4_opponents_to_beat),
      (assign, reg8, "$g_arena_training_kills"),
      (assign, reg10, arena_tier3_prize)
    ],
    "Your performance was amazing! You are without doubt a very skilled fighter. " +
    "Not everyone can knock down {reg8} people in the fights. Of course, you deserve a prize with that performance: {reg10} peningas. Nice, eh?", "arena_master_pre_talk",[
      (call_script, "script_troop_add_gold", "trp_player", arena_tier3_prize),
      (add_xp_to_troop,10,"trp_player"),
      (assign, "$last_training_fight_town", -1)]],
  
  [anyone ,"arena_master_fight_result",
    [
      (eq, "$g_arena_training_won", 0),
      (assign, reg8, "$g_arena_training_kills"),
      (assign, reg10, arena_tier4_prize),
    ],
    "That was damned good fighting, {playername}. You have very good moves, excellent tactics. " +
    "And you earned a prize of {reg10} peningas for knocking down {reg8} opponents.", "arena_master_pre_talk",
    [
      (call_script, "script_troop_add_gold", "trp_player", arena_tier4_prize),
      (add_xp_to_troop,10,"trp_player"),
      (assign, "$last_training_fight_town", -1),
  ]],
  
  [anyone ,"arena_master_fight_result", [(assign, reg10, arena_grand_prize)],
    "Congratulations champion! Your fight there was something to remember! You managed to be the last fighter standing beating down everyone else. And of course, you won the grand prize of the fights: {reg10} peningas.", "arena_master_pre_talk",[
      (call_script, "script_troop_add_gold", "trp_player", arena_grand_prize),
      (add_xp_to_troop,200,"trp_player"),
      (assign, "$last_training_fight_town", -1)]],
  
  
  [anyone ,"start", [(store_conversation_troop,reg(1)),(is_between,reg(1),arena_masters_begin,arena_masters_end)],
    "Hello, {playername}. Good to see you again.", "arena_master_pre_talk",[(assign, "$arena_reward_asked", 0)]],
  
  
  [anyone,"arena_master_pre_talk", [], "What would you like to do?", "arena_master_talk",[]],
  
  
  #  [anyone|plyr,"arena_master_talk", [], "About the arena fights...", "arena_master_melee",[]],
  [anyone|plyr,"arena_master_talk", [], "About the melee fights...", "arena_master_melee_pretalk",[]],
  [anyone|plyr,"arena_master_talk", [(eq, "$arena_tournaments_asked", 0)], "Will there be a tournament in nearby towns soon?", "arena_master_ask_tournaments",[(assign, "$arena_tournaments_asked", 1)]],
  [anyone|plyr,"arena_master_talk", [], "I need to leave now. Farewell.", "close_window",[]],
  
  [anyone,"arena_master_ask_tournaments", [
      (assign, ":num_tournaments", 0),
      (str_clear, s15),
      (str_clear, s16),
      (try_for_range_backwards, ":town_no", towns_begin, towns_end),
        (party_slot_ge, ":town_no", slot_town_has_tournament, 1),
        (neq, ":town_no", "$current_town"),
        (val_add, ":num_tournaments", 1),
        (try_begin),
          (eq, ":num_tournaments", 1),
          (str_store_party_name, s15, ":town_no"),
        (else_try),
          (eq, ":num_tournaments", 2),
          (str_store_party_name, s16, ":town_no"),
          (str_store_string, s15, "@{s16} and {s15}"),
        (else_try),
          (gt, ":num_tournaments", 2),
          (str_store_party_name, s16, ":town_no"),
          (str_store_string, s15, "@{s16}, {s15}"),
        (try_end),
      (try_end),
      (try_begin),
        (eq, ":num_tournaments", 0),
        (assign, reg2, 1),
      (else_try),
        (assign, reg2, 0),
        (store_sub, reg1, ":num_tournaments", 1),
      (try_end),
    ], "{reg2?There won't be any tournaments any time soon.:{reg1?Tournaments are:A tournament is} going to be held at {s15}.}", "arena_master_talk",
    []],
  
  [anyone,"arena_master_melee_pretalk", [], "There will be a fight here soon. You can go and jump in if you like.", "arena_master_melee_talk",[]],
  [anyone|plyr,"arena_master_melee_talk", [], "Good. That's what I am going to do.", "close_window",
    [
      (assign, "$last_training_fight_town", "$current_town"),
      (store_current_hours,"$training_fight_time"),
      (assign, "$g_mt_mode", abm_training),
      (party_get_slot, ":scene","$current_town",slot_town_arena),
      (modify_visitors_at_site,":scene"),
      (reset_visitors),
      (store_random_in_range, "$g_player_entry_point", 32, 40),
      (set_visitor, "$g_player_entry_point", "trp_player"),
      (set_jump_mission,"mt_arena_melee_fight"),
      (jump_to_scene, ":scene"),
  ]],
  [anyone|plyr,"arena_master_melee_talk", [], "Thanks, but I will give my bruises some time to heal.", "arena_master_melee_reject",[]],
  [anyone,"arena_master_melee_reject", [], "Good {reg59?girl:man}. That's clever of you.", "arena_master_pre_talk",[]],
  
  [anyone|plyr,"arena_master_melee_talk", [(eq, "$arena_reward_asked", 0)], "Actually, can you tell me about the rewards again?", "arena_training_melee_explain_reward",[(assign, "$arena_reward_asked", 1)]],
  
  #  [anyone,"arena_master_pre_talk",
  #   [(eq,"$arena_join_or_watch",1),
  #    (ge,"$arena_bet_amount",1),
  #    (eq,"$arena_bet_team","$arena_winner_team"),
  #    (assign,reg(5),"$arena_win_amount")],
  # "You've won the bet, eh? Let me see. The sum you have earned amounts to {reg5} peningas. Here you go.", "arena_master_pre_talk",
  #   [(call_script, "script_troop_add_gold", "trp_player", "$arena_win_amount"),
  #    (assign,"$arena_bet_amount",0),
  #    (assign,"$arena_win_amount",0),
  #    ]],
  
  #  [anyone,"arena_master_pre_talk",
  #   [(eq,"$arena_join_or_watch",0),
  #    (ge,"$arena_bet_amount",1),
  #    (eq,"$arena_fight_won",1),
  #    (assign,reg(5),"$arena_win_amount"),
  #   ],
  # "And you had the good sense to bet on yourself too. Hmm let me see. You have won yourself some {reg5} peningas. Here you are.", "arena_master_pre_talk",
  #   [(call_script, "script_troop_add_gold", "trp_player", "$arena_win_amount"),
  #    (assign,"$arena_bet_amount",0),
  #    (assign,"$arena_win_amount",0)]],
  
  #  [anyone,"start", [(store_conversation_troop,reg(1)),(is_between,reg(1),arena_masters_begin,arena_masters_end),(eq,"$waiting_for_arena_fight_result",1),(eq,"$arena_join_or_watch",0),(eq,"$arena_fight_won",1)],
  # "Congratulations champion. You made some pretty good moves out there. Here is your share of share of the prize money, 2 peningas.", "arena_master_pre_talk",
  #   [(assign,"$waiting_for_arena_fight_result",0),(add_xp_to_troop,20,"trp_player"),(call_script, "script_troop_add_gold", "trp_player",2)]],
  #  [anyone,"start", [(store_conversation_troop,reg(1)),(is_between,reg(1),arena_masters_begin,arena_masters_end),(eq,"$waiting_for_arena_fight_result",1),(eq,"$arena_join_or_watch",0)],
  # "That's quite the bruise you're sporting. But don't worry; everybody gets trounced once in awhile. The important thing is to pick yourself up, dust yourself off and keep fighting. That's what champions do.", "arena_master_pre_talk",[[assign,"$waiting_for_arena_fight_result"]]],
  #  [anyone,"start", [(store_conversation_troop,reg(1)),(is_between,reg(1),arena_masters_begin,arena_masters_end),(eq,"$waiting_for_arena_fight_result",1)],
  # "That was exciting wasn't it? Nothing like a good fight to get the blood flowing.", "arena_master_pre_talk",[(assign,"$waiting_for_arena_fight_result",0)]],
  
  ##  [anyone,"arena_master_melee", [], "The next arena fight will start in a while. Hurry up if you want to take part in it.", "arena_master_melee_talk",[
  ##    (party_get_slot, ":arena_cur_tier","$current_town",slot_town_arena_melee_cur_tier),
  ##    (try_begin), #reg3 = num teams, reg4 = team size
  ##      (eq, ":arena_cur_tier", 0),
  ##      (party_get_slot, "$_num_teams","$current_town",slot_town_arena_melee_1_num_teams),
  ##      (party_get_slot, "$_team_size","$current_town",slot_town_arena_melee_1_team_size),
  ##    (else_try),
  ##      (eq, ":arena_cur_tier", 1),
  ##      (party_get_slot, "$_num_teams","$current_town",slot_town_arena_melee_2_num_teams),
  ##      (party_get_slot, "$_team_size","$current_town",slot_town_arena_melee_2_team_size),
  ##    (else_try),
  ##      (party_get_slot, "$_num_teams","$current_town",slot_town_arena_melee_3_num_teams),
  ##      (party_get_slot, "$_team_size","$current_town",slot_town_arena_melee_3_team_size),
  ##    (try_end),
  ##   ]],
  ##  [anyone|plyr,"arena_master_melee_talk", [], "I want to join the next fight", "arena_master_next_melee_join",[(assign,"$arena_join_or_watch",0)]],
  ##  [anyone|plyr,"arena_master_melee_talk", [], "I would like to watch the next fight", "arena_master_next_melee_watch",
  ##   [(assign,"$arena_join_or_watch",1)]],
  ##  [anyone|plyr,"arena_master_melee_talk", [], "No. perhaps later.", "arena_master_we_will_fight_not",[]],
  ##  [anyone,"arena_master_we_will_fight_not", [], "Alright. Talk to me when you are ready.", "close_window",[]],
  ##  [anyone,"arena_master_next_melee_join", [
  ##    (assign,"$arena_bet_amount"),
  ##    (assign,"$arena_bet_team",0),
  ##    (party_get_slot, ":player_odds", "$g_encountered_party", slot_town_player_odds),
  ##    (store_div, ":divider", ":player_odds", 20),
  ##    (store_mul, ":odds_simple", ":divider", 20),
  ##    (val_sub, ":odds_simple", ":player_odds"),
  ##    (try_begin),
  ##      (lt, ":odds_simple", 0),
  ##      (val_add, ":divider", 1),
  ##    (try_end),
  ##    (val_max, ":divider", 50),
  ##    (store_div, ":odds_player", ":player_odds", ":divider"),
  ##    (store_div, ":odds_other", 1000, ":divider"),
  ##    (try_for_range, ":unused", 0, 5),
  ##      (assign, ":last_divider", 21),
  ##      (try_for_range, ":cur_divider", 2, ":last_divider"),
  ##        (store_div, ":odds_player_test", ":odds_player", ":cur_divider"),
  ##        (val_mul, ":odds_player_test", ":cur_divider"),
  ##        (eq, ":odds_player_test", ":odds_player"),
  ##        (store_div, ":odds_other_test", ":odds_other", ":cur_divider"),
  ##        (val_mul, ":odds_other_test", ":cur_divider"),
  ##        (eq, ":odds_other_test", ":odds_other"),
  ##        (val_div, ":odds_player", ":cur_divider"),
  ##        (val_div, ":odds_other", ":cur_divider"),
  ##        (assign, ":last_divider", 0),
  ##      (try_end),
  ##    (try_end),
  ##    (assign, reg5, ":odds_player"),
  ##    (assign, reg6, ":odds_other"),], "Do you want to place a bet on yourself? The odds against you are {reg5} to {reg6}.", "arena_master_will_you_bet",
  ##   []],
  ##
  ##  [anyone|plyr,"arena_master_will_you_bet", [], "No.", "arena_master_start_fight",[]],
  ##  [anyone|plyr,"arena_master_will_you_bet", [(store_troop_gold,reg(0)),(ge,reg(0),10)], "I want to bet 10 peningas.",
  ##   "arena_master_bet_placed",[(assign,"$arena_bet_amount",10),(troop_remove_gold, "trp_player",10)]],
  ##  [anyone|plyr,"arena_master_will_you_bet", [(store_troop_gold,reg(0)),(ge,reg(0),50)], "I want to bet 50 peningas.",
  ##   "arena_master_bet_placed",[(assign,"$arena_bet_amount",50),(troop_remove_gold, "trp_player",50)]],
  ##  [anyone|plyr,"arena_master_will_you_bet", [(store_troop_gold,reg(0)),(ge,reg(0),100)], "I want to bet 100 peningas.",
  ##   "arena_master_bet_placed",[(assign,"$arena_bet_amount",100),(troop_remove_gold, "trp_player",100)]],
  ##  [anyone,"arena_master_next_melee_watch", [], "Do you want to place a bet?", "arena_master_will_you_bet",[]],
  ##  [anyone,"arena_master_bet_placed", [(eq,"$arena_join_or_watch",1)], "Hmm. That's good. If you win, you'll get {reg5} peningas. And which team do you want to place your bet on?", "arena_master_select_team",
  ##   [(store_mul, "$arena_win_amount", "$arena_bet_amount", "$_num_teams"),
  ##    (val_mul, "$arena_win_amount", 9),
  ##    (val_div, "$arena_win_amount", 10),
  ##    (assign, reg5, "$arena_win_amount"),
  ##    ]],
  ##  [anyone|plyr,"arena_master_select_team", [], "The red team. I have a feeling they will win this one.",
  ##   "arena_master_start_fight",[(assign,"$arena_bet_team",0)]],
  ##  [anyone|plyr,"arena_master_select_team", [], "The blue team. They will sweep the ground with the reds.",
  ##   "arena_master_start_fight",[(assign,"$arena_bet_team",1)]],
  ##  [anyone|plyr,"arena_master_select_team", [(ge,"$_num_teams",3)], "The green team. My money is on them this time.",
  ##   "arena_master_start_fight",[(assign,"$arena_bet_team",2)]],
  ##  [anyone|plyr,"arena_master_select_team", [(ge,"$_num_teams",4)], "The yellow team. They will be victorious.",
  ##   "arena_master_start_fight",[(assign,"$arena_bet_team",3)]],
  ##  [anyone,"arena_master_bet_placed", [], "That's good. Let me record that. If you win, you'll get {reg5} peningas.", "arena_master_start_fight",
  ##   [(store_mul,"$arena_win_amount", "$arena_bet_amount", "$_num_teams"),
  ##    (party_get_slot, ":player_odds", "$g_encountered_party", slot_town_player_odds),
  ##    (val_sub, "$arena_win_amount", "$arena_bet_amount"),
  ##    (val_mul, "$arena_win_amount", ":player_odds"),
  ##    (val_div, "$arena_win_amount", 1000),
  ##    (val_add, "$arena_win_amount", "$arena_bet_amount"),
  ##    (val_mul, "$arena_win_amount", 9),
  ##    (val_div, "$arena_win_amount", 10),
  ##    (assign, reg5, "$arena_win_amount"),
  ##    ]],
  ##
  ##  [anyone,"arena_master_start_fight", [], "Very well. The fight starts in a moment. Good luck.", "close_window",
  ##   [
  ##    (store_encountered_party,"$current_town"),
  ##    (party_get_slot, ":arena_scene","$current_town",slot_town_arena),
  ##    (modify_visitors_at_site,":arena_scene"),
  ##    (reset_visitors),
  ##
  ##    #Assemble participants
  ##    (assign, ":slot_no", 0),
  ##    (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_xerina"),
  ##    (val_add, ":slot_no", 1),
  ##    (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_dranton"),
  ##    (val_add, ":slot_no", 1),
  ##    (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_kradus"),
  ##    (val_add, ":slot_no", 1),
  ##    (try_for_range, reg(4), 0, 10),
  ##      (lt, ":slot_no", 48),
  ##      (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_regular_fighter"),
  ##      (val_add, ":slot_no", 1),
  ##    (try_end),
  ##    (try_for_range, reg(4), 0, 10),
  ##      (lt, ":slot_no", 48),
  ##      (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_veteran_fighter"),
  ##      (val_add, ":slot_no", 1),
  ##    (try_end),
  ##    (try_for_range, reg(4), 0, 10),
  ##      (lt, ":slot_no", 48),
  ##      (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_champion_fighter"),
  ##      (val_add, ":slot_no", 1),
  ##    (try_end),
  ##    (try_for_range, reg(4), 0, 5),
  ##      (lt, ":slot_no", 48),
  ##      (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_sword_sister"),
  ##      (val_add, ":slot_no", 1),
  ##    (try_end),
  ##    (try_for_range, reg(4), 0, 10),
  ##      (lt, ":slot_no", 48),
  ##      (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_hired_blade"),
  ##      (val_add, ":slot_no", 1),
  ##    (try_end),
  ##    (try_for_range, reg(4), 0, 10),
  ##      (lt, ":slot_no", 48),
  ##      (troop_set_slot, "trp_temp_array_a", ":slot_no", "trp_mercenary"),
  ##      (val_add, ":slot_no", 1),
  ##    (try_end),
  ##    (assign, "$pin_troop", "trp_temp_array_a"),
  ##    (call_script, "script_shuffle_troop_slots", 0, 48),
  ##
  ##    (try_for_range, reg(12), 0, 48),
  ##      (troop_set_slot, "trp_temp_array_b", reg(12),reg(12)), #Initialize temp_array_b such that temp_array_b[i] = i
  ##    (try_end),
  ##
  ##    (store_random_in_range, "$arena_player_team", 0, "$_num_teams"),
  ##    (try_for_range, ":i_team", 0, "$_num_teams"), # repeat for num_teams; reg(55) = cur_team
  ##      (assign, ":team_slots_start", ":i_team"),
  ##      (val_mul, ":team_slots_start", 8),
  ##      (assign, ":team_slots_end", ":team_slots_start"),
  ##      (val_add, ":team_slots_end", 8),
  ##      (assign, "$pin_troop", "trp_temp_array_b"),
  ##      (call_script, "script_shuffle_troop_slots", ":team_slots_start", ":team_slots_end"),
  ##      (assign, ":cur_slot", ":team_slots_start"),
  ##      (try_for_range, reg(6), 0, "$_team_size"), # repeat for team_size;
  ##        (troop_get_slot, ":cur_slot_troop", "trp_temp_array_a", ":cur_slot"),
  ##        (try_begin), #place player
  ##          (eq,"$arena_join_or_watch",0),
  ##          (eq, ":i_team", "$arena_player_team"),
  ##          (eq, reg(6), 0),
  ##          (assign, ":cur_slot_troop", "trp_player"),
  ##        (try_end),
  ##        (troop_get_slot, ":cur_entry_no", "trp_temp_array_b", ":cur_slot"),
  ##        (set_visitor,":cur_entry_no",":cur_slot_troop"),
  ##        (val_add, ":cur_slot", 1),
  ##      (try_end),
  ##    (try_end),
  ##
  ##    (try_begin),
  ##      (eq, "$arena_join_or_watch", 1),
  ##      (set_visitor, 33, "trp_player"),#entry point 51
  ##    (try_end),
  ##    (assign, "$arena_fight_won", 0),
  ##    (assign, "$arena_winner_team", -1),
  ##    (assign, "$waiting_for_arena_fight_result", 1),
  ##    (assign, "$g_mt_mode", abm_fight),
  ##    (party_get_slot, reg(6),"$current_town",slot_town_arena_melee_cur_tier),
  ##    (val_add,reg(6),1),
  ##    (val_mod,reg(6),3),
  ##    (party_set_slot, "$current_town",slot_town_arena_melee_cur_tier, reg(6)),
  ###    (set_jump_mission,"mt_arena_melee_fight"),
  ##    (party_get_slot, ":arena_mission_template", "$current_town", slot_town_arena_template),
  ##    (set_jump_mission, ":arena_mission_template"),
  ##    (party_get_slot, reg(7), "$current_town", slot_town_arena),
  ##    (jump_to_scene, reg(7)),
  ##    ]],
  
  
  
  ######################################################################################
  [trp_galeas,"start", [], "Hello, {reg59?girl:boy}. If you have any prisoners, I will be happy to buy them from you.", "galeas_talk",[]],
  
  [trp_galeas|plyr,"galeas_talk",
    [[store_num_regular_prisoners,reg(0)],[ge,reg(0),1]],
    "Then you'd better bring your purse. I have prisoners to sell.", "galeas_sell_prisoners",[]],
  [trp_galeas|plyr,"galeas_talk",[], "Not this time. Farewell.", "close_window",[]],
  [trp_galeas,"galeas_sell_prisoners", [],
    "Let me see what you have...", "galeas_sell_prisoners_2",
    [[change_screen_trade_prisoners]]],
  [trp_galeas, "galeas_sell_prisoners_2", [], "When you take more prisoners, bring them to me. I pay well.", "close_window",[]],
  
  ##  [party_tpl|pt_refugees,"start", [], "We have been driven out of our homes because of this war.", "close_window",[(assign, "$g_leave_encounter",1)]],
  ##  [party_tpl|pt_farmers,"start", [], "We are just simple farmers.", "close_window",[(assign, "$g_leave_encounter",1)]],
  
  
  # Ryan BEGIN
  [party_tpl|pt_mountain_bandits|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker)],
    "{!}Warning: This line should never display.", "bandit_introduce",[]],
  [party_tpl|pt_forest_bandits|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker)],
    "{!}Warning: This line should never display.", "bandit_introduce",[]],
  [party_tpl|pt_taiga_bandits|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker)],
    "{!}Warning: This line should never display.", "bandit_introduce",[]],
  [party_tpl|pt_steppe_bandits|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker)],
    "{!}Warning: This line should never display.", "bandit_introduce",[]],
  [party_tpl|pt_desert_bandits|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter),(encountered_party_is_attacker)],
    "{!}Warning: This line should never display.", "bandit_introduce",[]],
  
  
  [anyone,"bandit_introduce", [
      (store_random_in_range, ":rand", 11, 15),
      (str_store_string, s11, "@I can smell a fat purse a mile away. Methinks yours could do with some lightening, eh?"),
      (str_store_string, s12, "@Why, it be another traveller, chance met upon the road! I should warn you, country here's a mite dangerous for a good {reg59?woman:fellow} like you. But for a small donation my boys and I'll make sure you get rightways to your destination, eh?"),
      (str_store_string, s13, "@Well, well. Look at this! You'd best start coughing up some silver, friend, or me and my boys'll have to break you."),
      (str_store_string, s14, "@There's a toll for passin' through this land, payable to us, so if you don't mind we'll just be collectin' our due from your purse..."),
      (str_store_string_reg, s5, ":rand"),
      ], "{!}{s5}", "bandit_talk",[(play_sound,"snd_encounter_bandits")]],
  
  [anyone|plyr,"bandit_talk", [], "I'll give you nothing but cold steel, you scum!", "close_window",[
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  [anyone|plyr,"bandit_talk", [], "There's no need to fight. I can pay for free passage.", "bandit_barter",[]],
  [anyone,"bandit_barter",
    [(store_relation, ":bandit_relation", "fac_player_faction", "$g_encountered_party_faction"),
      (ge, ":bandit_relation", -50),
      (store_troop_gold, ":total_value", "trp_player"),
      (troop_get_inventory_capacity, ":inv_size", "trp_player"),
      (try_for_range, ":i_slot", 0, ":inv_size"),
        (troop_get_inventory_slot, ":item_id", "trp_player", ":i_slot"),
        (ge, ":item_id", 0),
        (try_begin),
          (is_between, ":item_id", trade_goods_begin, trade_goods_end),
          (store_item_value, ":item_value", ":item_id"),
          (val_add, ":total_value", ":item_value"),
        (try_end),
      (try_end),
      (store_div, "$bandit_tribute", ":total_value", 10), #10000 gold = excellent_target
      (val_max, "$bandit_tribute", 10),
      (assign, reg5, "$bandit_tribute")
      ], "Silver without blood, that's our favourite kind! Hmm, having a look at you, I reckon you could easily come up with {reg5} peningas. Pay it, and we'll let you be on your way.", "bandit_barter_2",[]],
  [anyone|plyr,"bandit_barter_2", [[store_troop_gold,reg(2)],[ge,reg(2),"$bandit_tribute"],[assign,reg(5),"$bandit_tribute"]],
    "Very well, take it.", "bandit_barter_3a",[[troop_remove_gold, "trp_player","$bandit_tribute"]]],
  [anyone|plyr,"bandit_barter_2", [],
    "I don't have that much money with me", "bandit_barter_3b",[]],
  [anyone,"bandit_barter_3b", [],
    "That's too bad. I guess we'll just have to sell you into slavery. Take {reg59?her:him}, lads!", "close_window",[
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  [anyone,"bandit_barter", [],
    "Hey, I've heard of you! You slaughter us freebooters like dogs, and now you expect us to let you go for a few stinking coins? " +
    "Forget it. You gave us no quarter, and you'll get none from us.", "close_window",[]],
  
  
  
  [anyone,"bandit_barter_3a", [], "Heh, that wasn't so hard, was it? All right, we'll let you go now. Be off.", "close_window",[
      (store_current_hours,":protected_until"),
      (val_add, ":protected_until", 72),
      (party_set_slot,"$g_encountered_party",slot_party_ignore_player_until,":protected_until"),
      (party_ignore_player, "$g_encountered_party", 72),
      (assign, "$g_leave_encounter",1)
  ]],
  
  
  [anyone,"start", [	(neg|encountered_party_is_attacker),
      (this_or_next|eq, "$g_encountered_party_template", "pt_mountain_bandits"),
      (this_or_next|eq, "$g_encountered_party_template", "pt_steppe_bandits"),
      (this_or_next|eq, "$g_encountered_party_template", "pt_sea_raiders"),
      (this_or_next|eq, "$g_encountered_party_template", "pt_desert_bandits"),
      (eq, "$g_encountered_party_template", "pt_forest_bandits")
    ],
    "Eh? What is it?", "bandit_meet",[]],
  
  [anyone,"start", [	(encountered_party_is_attacker),
      (this_or_next|eq, "$g_encountered_party_template", "pt_mountain_bandits"),
      (this_or_next|eq, "$g_encountered_party_template", "pt_steppe_bandits"),
      (this_or_next|eq, "$g_encountered_party_template", "pt_sea_raiders"),
      (this_or_next|eq, "$g_encountered_party_template", "pt_desert_bandits"),
      (eq, "$g_encountered_party_template", "pt_forest_bandits")
    ],
    "Time to hand over that big purse of yours, isn't it?", "bandit_meet",[]],
  
  
  [anyone|plyr,"bandit_meet", [(neg|encountered_party_is_attacker),], "Your luck has run out, wretch. Prepare to die!", "bandit_attack",
    [
      (party_ignore_player, "$g_encountered_party", 0),
      (party_set_slot,"$g_encountered_party",slot_party_ignore_player_until, 0),
  ]],
  [anyone|plyr,"bandit_meet", [(encountered_party_is_attacker),], "Why wouldn't you hand over yours, scum?", "bandit_attack",
    [
      (party_ignore_player, "$g_encountered_party", 0),
      (party_set_slot,"$g_encountered_party",slot_party_ignore_player_until, 0),
  ]],
  [anyone,"bandit_attack", [
      (store_random_in_range, ":rand", 11, 15),
      (str_store_string, s11, "@Another fool come to throw {reg59?her:him}self on my weapon, eh? Fine, let's fight!"),
      (str_store_string, s12, "@We're not afraid of you, {reg59?wench:sirrah}. Time to break some heads!"),
      (str_store_string, s13, "@That was a mistake. Now I'm going to have to make your death long and painful."),
      (str_store_string, s14, "@Brave words. Let's see you back them up with deeds, cur!"),
      (str_store_string_reg, s5, ":rand"),
      ], "{!}{s5}", "close_window",[
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  #normal bandits chief#############
  [anyone|plyr,"bandit_meet", [], "Do you know whom you are talking to? I will not kill you if you join me.", "bandit_meet1",
    []],
  [anyone,"bandit_meet1", [
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (gt, ":player_renown", 150), # you have to be someone
      (gt, "$player_honor", -50),
      (store_random_in_range,":rand",0,20),
      (gt,":rand",9),
    ], "I care very little who you are. It's time for you to die.","close_window",
    [
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  [anyone,"bandit_meet1", [
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (le, ":player_renown", 150), # you have to be someone
    ], "I care very little who you are. It's time for you to die.","close_window",
    [
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  
  [anyone,"bandit_meet1", [
      (party_slot_eq, "$g_encountered_party", slot_party_bribed, 0),
      (le, "$player_honor", -50),
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (gt, ":player_renown", 150), # you have to be someone
      (store_random_in_range,":rand",0,20),
      (gt,":rand",16),#from 10, too often
      (store_party_size_wo_prisoners, ":size", "$g_encountered_party"),
      (assign, ":cont", 0),
      (try_begin),
        (this_or_next|eq, "$g_encountered_party_template", "pt_sea_raiders"),
        (eq, "$g_encountered_party_template", "pt_desert_bandits"),
        (lt, ":size", 40),
        (assign, ":cont", 1),
      (else_try),
        (lt, ":size", 50),
        (assign, ":cont", 1),
      (try_end),
      (eq, ":cont", 1),
      (store_party_size_wo_prisoners, ":size1", "p_main_party"),
      (val_mul, ":size", 2),
      (gt, ":size1", ":size"),
      ], "Yes, I've heard of you. They say your men get the best loot. Forgive us, and we will be delighted to join such a fierce leader.","bandit_meet1g",[]],
  
  [anyone,"bandit_meet1",[
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (gt, ":player_renown", 150), # you have to be someone
      (store_encountered_party,":party"),
      (assign, ":total", 0),
      (party_get_num_companion_stacks, ":num_stacks",":party"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop",":party",":i_stack"),
        (party_stack_get_size, ":stack_size",":party",":i_stack"),
        (store_character_level, ":troop_level", ":stack_troop"),
        (store_mul, ":troop_total",":troop_level", ":stack_size"),
        (val_add, ":total", ":troop_total"),
      (try_end),
      (store_mul,reg0,":total",12),# 70 to cheap, you get mercenaries for hundreds
      (assign, "$temp", reg0),
      ],"We would consider your offer if you added {reg0} peningas to it.","bandit_meet1e",[]],
  
  [anyone|plyr,"bandit_meet1e",
    [
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold","$temp"),
      (party_can_join),
    ],"Peningas come to me more easily than quality fighters do. Welcome to my army.","close_window",
    [
      (troop_remove_gold, "trp_player", "$temp"),
      (party_join),
      (call_script, "script_change_player_honor", -7),
      (call_script, "script_change_player_party_morale", -7),
      (assign, "$g_leave_encounter", 1)
  ]],
  [anyone|plyr,"bandit_meet1e",[        (store_troop_gold, ":gold", "trp_player"),
      (le, ":gold", "$temp"),
      ],"I don't have enough money...","bandit_meet12",[]],
  
  [anyone|plyr,"bandit_meet1e",[],"Now I know why they call you bandits. Never mind.","bandit_meet12",[]],
  
  [anyone|plyr,"bandit_meet1g",
    [
      (party_can_join),
    ],"And I for my part welcome such doughty men!","close_window",
    [
      (party_join),
      (call_script, "script_change_player_honor", -7),
      (call_script, "script_change_player_party_morale", -7),
      (assign, "$g_leave_encounter", 1)
  ]],
  
  [anyone|plyr,"bandit_meet1g",[],"On second thought, I want fighters more loyal to me than the spoils. Never mind.","bandit_meet13",[]],
  
  [anyone,"bandit_meet12", [
    ], "Huh. I've always fancied being called 'Killer.' Time to make me a new name.","close_window",
    [(party_set_slot, "$g_encountered_party", slot_party_bribed, 1),
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  [anyone,"bandit_meet13", [
    ], "Here's my second thought: eat my steel!","close_window",
    [(party_set_slot, "$g_encountered_party", slot_party_bribed, 1),
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  #bandit bribery end########
  [anyone|plyr,"bandit_meet", [(neg|encountered_party_is_attacker),], "Never mind, I have no business with you.", "close_window",[(assign, "$g_leave_encounter", 1)]],
  # Ryan END
  
  [party_tpl|pt_rescued_prisoners,"start", [(eq,"$talk_context",tc_party_encounter)], "Do you want us to follow you?", "disbanded_troop_ask",[]],
  [anyone|plyr,"disbanded_troop_ask", [], "Yes. Let us ride together.", "disbanded_troop_join",[]],
  [anyone|plyr,"disbanded_troop_ask", [], "No. Not at this time.", "close_window",[(assign, "$g_leave_encounter",1)]],
  [anyone,"disbanded_troop_join", [[neg|party_can_join]], "Unfortunately, you do not have room in your party for us.", "close_window",[(assign, "$g_leave_encounter",1)]],
  [anyone,"disbanded_troop_join", [], "We are at your command.", "close_window",[[party_join],(assign, "$g_leave_encounter",1)]],
  
  [party_tpl|pt_enemy,"start", [(eq,"$talk_context",tc_party_encounter)], "You will not capture me again. Not this time.", "enemy_talk_1",[]],
  [party_tpl|pt_enemy|plyr,"enemy_talk_1", [], "You don't have a chance against me. Give up.", "enemy_talk_2",[]],
  [party_tpl|pt_enemy,"enemy_talk_2", [], "I will give up when you are dead!", "close_window",[(call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  
  ######################################
  # ROUTED WARRIORS
  ######################################
  
  [party_tpl|pt_routed_warriors, "start", [(eq,"$talk_context",tc_party_encounter)],
    "I beg you! Please leave us alone.", "party_encounter_routed_agents_are_caught",
    []],
  
  [party_tpl|pt_routed_warriors|plyr, "party_encounter_routed_agents_are_caught", [],
    "Do you think you can run away from me? You will be my prisoner or die!", "party_encounter_routed_agents_are_caught2",
    []],
  
  [party_tpl|pt_routed_warriors|plyr,"party_encounter_routed_agents_are_caught", [],
    "Very well, we'll leave you in peace this time. Do not oppose us again.", "close_window", [(assign, "$g_leave_encounter",1)]],
  
  [party_tpl|pt_routed_warriors, "party_encounter_routed_agents_are_caught2",
    [
      #(store_party_size_wo_prisoners, ":routed_party_size", "$g_encountered_party"),
      #(store_party_size_wo_prisoners, ":main_party_size", "p_main_party"),
      
      # calculate power of routed party
      (assign, ":routed_party_power", 0),
      (party_get_num_companion_stacks, ":num_stacks", "$g_encountered_party"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop", "$g_encountered_party", ":i_stack"),
        (store_character_level, ":troop_level", ":stack_troop"),
        (try_begin),
          (troop_is_mounted, ":stack_troop"),
          (val_add, ":troop_level", 5),
        (try_end),
        (party_stack_get_size, ":stack_size", "$g_encountered_party", ":i_stack"),
        (val_mul, ":troop_level", ":stack_size"),
        (val_add, ":routed_party_power", ":troop_level"),
      (try_end),
      
      # calculate power of our party
      (assign, ":main_party_power", 0),
      (party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop", "p_main_party", ":i_stack"),
        (store_character_level, ":troop_level", ":stack_troop"),
        (try_begin),
          (troop_is_mounted, ":stack_troop"),
          (val_add, ":troop_level", 5),
        (try_end),
        (party_stack_get_size, ":stack_size", "p_main_party", ":i_stack"),
        (val_mul, ":troop_level", ":stack_size"),
        (val_add, ":main_party_power", ":troop_level"),
      (try_end),
      
      (store_div, ":main_party_power_divided_by_5", ":main_party_power", 5),
      
      #find num attached parties to routed warriors
      (party_get_num_attached_parties, ":num_attached_parties", "$g_encountered_party"),
      
      (this_or_next|gt, ":num_attached_parties", 0), #always fight
      (ge, ":routed_party_power", ":main_party_power_divided_by_5"),
    ],
    "Haven't you got any mercy? Well, we will fight you to the last man!", "close_window",
    []],
  
  [party_tpl|pt_routed_warriors, "party_encounter_routed_agents_are_caught2",
    [
      #(store_party_size_wo_prisoners, ":routed_party_size", "$g_encountered_party"),
      #(store_party_size_wo_prisoners, ":main_party_size", "p_main_party"),
      
      # calculate power of routed party
      (assign, ":routed_party_population", 0),
      (assign, ":routed_party_power", 0),
      (party_get_num_companion_stacks, ":num_stacks", "$g_encountered_party"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop", "$g_encountered_party", ":i_stack"),
        (store_character_level, ":troop_level", ":stack_troop"),
        (try_begin),
          (troop_is_mounted, ":stack_troop"),
          (val_add, ":troop_level", 5),
        (try_end),
        (party_stack_get_size, ":stack_size", "$g_encountered_party", ":i_stack"),
        (val_mul, ":troop_level", ":stack_size"),
        (val_add, ":routed_party_power", ":troop_level"),
        (val_add, ":routed_party_population", ":stack_size"),
      (try_end),
      
      # calculate power of our party
      (assign, ":main_party_power", 0),
      (party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop", "p_main_party", ":i_stack"),
        (store_character_level, ":troop_level", ":stack_troop"),
        (try_begin),
          (troop_is_mounted, ":stack_troop"),
          (val_add, ":troop_level", 5),
        (try_end),
        (party_stack_get_size, ":stack_size", "p_main_party", ":i_stack"),
        (val_mul, ":troop_level", ":stack_size"),
        (val_add, ":main_party_power", ":troop_level"),
      (try_end),
      
      (store_div, ":main_party_power_divided_by_5", ":main_party_power", 5),
      (lt, ":routed_party_power", ":main_party_power_divided_by_5"),
      
      (store_party_size_wo_prisoners, ":routed_party_size", "$g_encountered_party"),
      (assign, reg3, ":routed_party_size"),
      
      (try_begin),
        (gt, ":routed_party_population", 1),
        (str_store_string, s1, "str_we_resign"),
      (else_try),
        (str_store_string, s1, "str_i_resign"),
      (try_end),
    ],
    "{!}{s1}", "close_window",
    [(assign,"$g_enemy_surrenders", 1),
      (call_script, "script_party_wound_all_members", "$g_encountered_party"),
      (call_script, "script_party_copy", "p_total_enemy_casualties", "$g_encountered_party"),
      #(change_screen_exchange_with_party, "$g_encountered_party"),
  ]],
  
  #[party_tpl|pt_routed_warriors,"close_window_anythink_else", [],
  # "Anythink else.", "close_window", [(assign, "$g_leave_encounter",1)]],
  
  
  # Ryan BEGIN
  [anyone,"sell_prisoner_outlaws", [[store_troop_kind_count,0,"trp_looter"],[ge,reg(0),1],[assign,reg(1),reg(0)],[val_mul,reg(1),10],[val_mul,reg(2),reg(0)],[val_mul,reg(2),10]],
    "Hmmm. Ten peningas for each looter makes {reg1} peningas for all {reg0} of them.", "sell_prisoner_outlaws",
    [[call_script, "script_troop_add_gold", "trp_player", reg(1)],[add_xp_to_troop,reg(2)],[remove_member_from_party,"trp_looter"]]],
  [anyone,"sell_prisoner_outlaws", [[store_troop_kind_count,0,"trp_bandit"],[ge,reg(0),1],[assign,reg(1),reg(0)],[val_mul,reg(1),20],[assign,reg(2),reg(0)],[val_mul,reg(2),20]],
    "Let me see. You've brought {reg0} bandits, so 20 peningas for each comes up to {reg1} peningas.", "sell_prisoner_outlaws",
    [[call_script, "script_troop_add_gold", "trp_player", reg(1)],[add_xp_to_troop,reg(2)],[remove_member_from_party,"trp_bandit"]]],
  [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]],
    "Well, well, you've captured {reg0} brigands. Each one is worth 30 peningas, so I'll give you {reg1} for them in total.", "sell_prisoner_outlaws",
    [[call_script, "script_troop_add_gold", "trp_player", reg(1)],[add_xp_to_troop,reg(2)],[remove_member_from_party,"trp_brigand"]]],
  [anyone,"sell_prisoner_outlaws", [], "I suppose that'll be all, then.", "close_window",[]],
  # Ryan END
  
  
  
  
  
  
  #JuJu70 - religious conversion for freedom
  [anyone|plyr, "prisoner_chat", [(store_conversation_troop,"$g_talk_troop"),
      (troop_is_hero, "$g_talk_troop"),
      (neg|is_between,"$g_talk_troop", kingdom_ladies_begin, kingdom_ladies_end),
      (str_store_troop_name, s1, "$g_talk_troop")], "{!}{s1}", "prisoner_chat_lord", []],
  [anyone, "prisoner_chat_lord", [(str_store_troop_name, s1, "trp_player")], "Yes, {reg59?Lady:Lord} {s1}?", "prisoner_chat_noble",[]],
  [anyone|plyr,"prisoner_chat_noble", [(str_store_troop_name, s1, "$g_talk_troop"),
      (troop_slot_eq, "trp_player", slot_troop_religion, 2),#pagan
      (troop_slot_eq, "$g_talk_troop", slot_troop_religion, 1),#christian
      (troop_slot_eq, "$g_talk_troop", slot_troop_conv, 0),
      ], "{s1}, redeem yourself in the eyes of Odin, and rid yourself of that Christian weakling God!", "prisoner_chat_noble_conv",[]],
  
  [anyone|plyr,"prisoner_chat_noble", [(str_store_troop_name, s1, "$g_talk_troop"),
      (troop_slot_eq, "trp_player", slot_troop_religion, 1),#christian
      (troop_slot_eq, "$g_talk_troop", slot_troop_religion, 2),#pagan
      (troop_slot_eq, "$g_talk_troop", slot_troop_conv, 0),
      ], "{s1}, repent of your sins and accept the one true Lord, our saviour, Jesus Christ!", "prisoner_chat_noble_conv",[]],
  
  [anyone, "prisoner_chat_noble_conv", [
      (troop_slot_eq, "trp_player", slot_troop_religion, 1),#christian
      (troop_slot_eq, "$g_talk_troop", slot_troop_religion, 2),#pagan
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (store_skill_level, ":persuasionl", "skl_persuasion", "$g_talk_troop"),
      (store_attribute_level, ":charisma", "trp_player", ca_charisma),
      (store_attribute_level, ":charismal", "$g_talk_troop", ca_charisma),
      (val_div, ":charisma", 2),
      (val_div, ":charismal", 2),
      (val_add, ":persuasionl", ":charismal"),
      (val_add, ":persuasion", ":charisma"),
      (store_sub, ":diff", ":persuasion", ":persuasionl"),
      (val_max, ":diff" ,1),
      (store_random_in_range, ":rand", 0, 100),
      (try_begin),
        (le, ":diff", 1),
        (try_begin),
          (lt, ":rand", 97),
          (str_store_string, s22, "@Your God is for wimps and weaklings! Across the rainbow bridge to Walhalla Odin's waiting for me!"),
          (troop_set_slot, "$g_talk_troop", slot_troop_conv, 1),
          (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
        (else_try), #4%, difficult but no impossible
          (str_store_string, s22, "@I've been pondering the Christian religion for a while now. Perhaps it's time for me to experience fully what it means to be " +
          "a true Christian. However, I can hardly be baptized while wearing chains!"),
          (troop_set_slot, "$g_talk_troop", slot_troop_conv, 2),
        (try_end),
      (else_try),
        (gt, ":diff", 1),
        (lt, ":rand", 18),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
        (str_store_string, s22, "@I've always felt Christianity was to my liking, especially the forgiving part. Yes, {playername}, I'm a true Christian now. " +
          "As soon as I am able to move around freely, I will pay a visit to one of the monasteries and will pray hard for my sins to be forgiven. Now, let me go, so " +
        "I can fulfill the will of the mighty Christian God!"),
        (troop_set_slot, "$g_talk_troop", slot_troop_conv, 2),
      (else_try),
        (gt, ":diff", 1),
        (lt, ":rand", 14),
        (neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
        (str_store_string, s22, "@I've been pondering the Christian religion for a while now. Perhaps it's time for me to experience fully what it means to be " +
        "a true Christian. However, I can hardly be baptized while wearing chains!"),
        (troop_set_slot, "$g_talk_troop", slot_troop_conv, 2),
      (else_try),
        (str_store_string, s22, "@I see no reason even to discuss things like that with someone like you!"),
        (troop_set_slot, "$g_talk_troop", slot_troop_conv, 1),
        #		(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
      (try_end),],"{!}{s22}", "prisoner_chat_noble_conv2",[]],
  
  [anyone, "prisoner_chat_noble_conv", [
      (troop_slot_eq, "trp_player", slot_troop_religion, 2),#pagan
      (troop_slot_eq, "$g_talk_troop", slot_troop_religion, 1),#christian
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (store_skill_level, ":persuasionl", "skl_persuasion", "$g_talk_troop"),
      (store_attribute_level, ":charisma", "trp_player", ca_charisma),
      (store_attribute_level, ":charismal", "$g_talk_troop", ca_charisma),
      (val_div, ":charisma", 2),
      (val_div, ":charismal", 2),
      (val_add, ":persuasionl", ":charismal"),
      (val_add, ":persuasion", ":charisma"),
      (store_sub, ":diff", ":persuasion", ":persuasionl"),
      (val_max, ":diff" ,1),
      (store_random_in_range, ":rand", 0, 100),
      (try_begin),
        (le, ":diff", 1),
        (try_begin),
          (lt, ":rand", 97),
          (str_store_string, s22, "@Your Odin knows nothing more but how to force people to kill themselves. I will remain a Christian!"),
          (troop_set_slot, "$g_talk_troop", slot_troop_conv, 1),
          (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1),
        (else_try), #4%, difficult but no impossible
          (str_store_string, s22, "@I've been pondering this Christian religion for a while now. It's definitely not to my liking! Too much time is spent " +
          "bending your knees instead of swinging an axe. As of this moment, I renounce Christianity and return to the true gods of Odin, Thor and Freya!"),
          (troop_set_slot, "$g_talk_troop", slot_troop_conv, 2),
        (try_end),
      (else_try),
        (gt, ":diff", 1),
        (lt, ":rand", 18),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
        (str_store_string, s22, "@You know, {playername}, I only recently converted to Christianity, and still remember our old gods, Odin, " +
        "Thor and Freya. Christianity does nothing but make men wimps and weaklings, I am definitely better than that. As of this moment, I'm no longer Christian!"),
        (troop_set_slot, "$g_talk_troop", slot_troop_conv, 2),
      (else_try),
        (gt, ":diff", 1),
        (lt, ":rand", 14),
        (neg|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
        (str_store_string, s22, "@I've been pondering this Christian religion for a while now. It's definitely not to my liking! Too much time is spent " +
        "bending your knees instead of swinging an axe. As of this moment, I renounce Christianity and return to the true gods of Odin, Thor and Freya!"),
        (troop_set_slot, "$g_talk_troop", slot_troop_conv, 2),
      (else_try),
        (str_store_string, s22, "@I see no reason to even discuss things like that with someone like you!"),
        (troop_set_slot, "$g_talk_troop", slot_troop_conv, 1),
      (try_end),],"{!}{s22}", "prisoner_chat_noble_conv2",[]],
  
  [anyone|plyr,"prisoner_chat_noble_conv2", [(troop_slot_eq, "$g_talk_troop", slot_troop_conv, 2)], "Wonderful news, you're free to go!", "prisoner_chat_noble_release",[]],
  
  [anyone|plyr,"prisoner_chat_noble_conv2", [(troop_slot_eq, "$g_talk_troop", slot_troop_conv, 2)], "On the second thought, maybe you should stay my prisoner", "prisoner_chat_noble_keep",[(troop_set_slot, "$g_talk_troop", slot_troop_conv, 1),]],
  
  [anyone|plyr,"prisoner_chat_noble_conv2", [(troop_slot_eq, "$g_talk_troop", slot_troop_conv, 1)], "Whatever suits you!", "close_window",[]],
  
  [anyone,"prisoner_chat_noble_release", [], "I will not forget this act of Honor!", "close_window",
    [
      # remove the troop from prison
      (call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
      (party_remove_prisoners, "p_main_party", "$g_talk_troop", 1),
      (troop_set_slot, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (try_begin),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_cunning),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 5),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_martial),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_roguish),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_selfrighteous),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 7),
      (else_try),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_upstanding),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_benefactor),
        (this_or_next|troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_custodian),
        (troop_slot_eq, "$g_talk_troop", slot_lord_reputation_type, lrep_goodnatured),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (else_try),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 3),
      (try_end),
      (call_script, "script_change_player_honor", 5),
      (call_script, "script_change_player_relation_with_faction", "$g_talk_troop_faction", 5),
      (troop_get_slot, ":religion","trp_player", slot_troop_religion),
      (troop_set_slot, "$g_talk_troop", slot_troop_religion, ":religion"),	#same as player
      (troop_get_slot, ":controversy", "$g_talk_troop", slot_troop_controversy),
      (val_add, ":controversy", 5),
      (troop_set_slot, "$g_talk_troop", slot_troop_controversy, ":controversy"),
  ]],
  
  [anyone|plyr,"prisoner_chat_noble", [], "You will remain my prisoner until one of your relatives reimburses me for you.", "prisoner_chat_noble_keep",[]],
  
  [anyone,     "prisoner_chat_noble_keep", [(ge, "$player_honor", 30),(ge, "$g_talk_troop_relation", 30)], "Truly, this is beneath you.", "close_window",[]],
  [anyone,     "prisoner_chat_noble_keep", [], "I trust you will be as understanding when I hunt you down like the dog you are!", "close_window",[(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -1)]],
  
  [anyone|plyr,"prisoner_chat_noble", [
      (neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin),
      (troop_slot_eq, "$g_talk_troop", slot_troop_tortured, 0),
      (neg|troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
      (troop_slot_eq, "$g_talk_troop", slot_troop_refused, 0),
      (assign, ":wedding", -1),
      (try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
        (troop_get_slot, ":guardian", ":lady", slot_troop_guardian),
        (eq, ":guardian", "$g_talk_troop"),
        (troop_get_slot, ":spouse", ":lady", slot_troop_spouse),
        (lt, ":spouse", 0),
        (assign, ":wedding", ":lady"),
      (try_end),
      (gt, ":wedding", 0),
      (str_store_troop_name, s33, ":wedding"),
      (call_script, "script_troop_get_family_relation_to_troop",  ":wedding", "$g_talk_troop"),
      (assign, "$temp_2", ":wedding"),
      ], "I will set you free if you allow me to court your {s11}, {s33}.", "prisoner_chat_noble_offer",[]],
  
  [anyone, "prisoner_chat_noble_offer", [
    (ge, "$g_talk_troop_relation", 30),
    (troop_slot_ge, "trp_player", slot_troop_renown, 450),
    (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
    (gt, ":persuasion", 6),
    (store_random_in_range, ":rand", 0, 100),
    (lt, ":rand", 10),
  ], "I suppose I can live with that.", "close_window",[
    (call_script, "script_remove_troop_from_prison", "$g_talk_troop"),
    (party_remove_prisoners, "p_main_party", "$g_talk_troop", 1),
    (troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, -1),
    (troop_set_slot, "$g_talk_troop", slot_lord_granted_courtship_permission, 1),
  ]],
  
  [anyone, "prisoner_chat_noble_offer",[], "I think you are plain crazy to offer me something like that!", "close_window",[(troop_set_slot, "$g_talk_troop", slot_troop_refused, 1),]],
  
  [anyone|plyr,"prisoner_chat_noble", [(store_faction_of_troop, ":faction", "$g_talk_troop"), (neq, ":faction", "fac_adventurers"),], "I see you have some fine armor and weapons in good condition...", "prisoner_chat_noble_arm",[]],
  
  [anyone, "prisoner_chat_noble_arm",[], "Yes, and what is it to you?","prisoner_chat_noble_arm1",[]],
  
  [anyone|plyr,"prisoner_chat_noble_arm1", [], "Nothing, just admiring.", "close_window",[]],
  
  [anyone|plyr,"prisoner_chat_noble_arm1", [], "Perhaps, it's time to share it with someone needy.", "prisoner_chat_noble_arm2",[]],
  
  [anyone,  "prisoner_chat_noble_arm2", [],"Eh?",  "prisoner_chat_noble_arm3",[]],
  
  [anyone|plyr,"prisoner_chat_noble_arm3", [
      (troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_body),
      (gt, ":slot_item", 0),
      (item_get_body_armor, ":armor", ":slot_item"),
      (gt, ":armor", 25),
      (str_store_item_name, s13, ":slot_item"),
      ], "I'd like to try on your {s13}.", "prisoner_chat_noble_arm3a",[(assign, "$temp2",ek_body),(troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_body),	 (assign, "$temp", ":slot_item"),]],
  
  [anyone|plyr,"prisoner_chat_noble_arm3", [
      (troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_head),
      (gt, ":slot_item",0),
      (neq, ":slot_item", "itm_crown1"),
      (item_get_head_armor, ":armor", ":slot_item"),
      (gt, ":armor", 35),
      (str_store_item_name, s13, ":slot_item"),
      ], "I'd like to try on your {s13}.", "prisoner_chat_noble_arm3a",[(assign, "$temp2",ek_head),(troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_head),(assign, "$temp", ":slot_item"),]],
  
  # [anyone|plyr,"prisoner_chat_noble_arm3", [
  # (troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_foot),
  # (gt, ":slot_item", -1),
  # (str_store_item_name, s13, ":slot_item"),
  # ], "I'd like to try on your {s13}.", "prisoner_chat_noble_arm3a",[(assign, "$temp2",ek_foot), (troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_foot),(assign, "$temp", ":slot_item"),]],
  
  [anyone|plyr,"prisoner_chat_noble_arm3", [
      (troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_item_0),
      (gt, ":slot_item", 0),
      (assign, ":cont", 0),
      (item_get_type, ":item_type", ":slot_item"),
      (try_begin),
        (eq, ":item_type", itp_type_one_handed_wpn),
        (item_get_swing_damage, ":swing", ":slot_item"),
        (this_or_next|lt, ":swing", 21),
        (is_between, ":slot_item", "itm_longseax6", "itm_seax_1"),
        (assign, ":cont", 1),
      (try_end),
      (eq, ":cont", 0),
      (str_store_item_name, s13, ":slot_item"),
      
      ], "I don't think you'll need your {s13} any time soon.", "prisoner_chat_noble_arm3a",[(assign, "$temp2",ek_item_0), (troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_item_0), (assign, "$temp", ":slot_item"),]],
  
  [anyone|plyr,"prisoner_chat_noble_arm3", [
      (troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_item_1),
      (gt, ":slot_item", 0),
      (assign, ":cont", 0),
      (item_get_type, ":item_type", ":slot_item"),
      (try_begin),
        (eq, ":item_type", itp_type_one_handed_wpn),
        (item_get_swing_damage, ":swing", ":slot_item"),
        (this_or_next|lt, ":swing", 21),
        (is_between, ":slot_item", "itm_longseax6", "itm_seax_1"),
        (assign, ":cont", 1),
      (try_end),
      (eq, ":cont", 0),
      (str_store_item_name, s13, ":slot_item"),
      ], "I don't think you'll need your {s13} any time soon.", "prisoner_chat_noble_arm3a",[(assign, "$temp2",ek_item_1), (troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_item_1),(assign, "$temp", ":slot_item"),]],
  
  [anyone|plyr,"prisoner_chat_noble_arm3", [
      (troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_item_2),
      (gt, ":slot_item", 0),
      (assign, ":cont", 0),
      (item_get_type, ":item_type", ":slot_item"),
      (try_begin),
        (eq, ":item_type", itp_type_one_handed_wpn),
        (item_get_swing_damage, ":swing", ":slot_item"),
        (this_or_next|lt, ":swing", 21),
        (is_between, ":slot_item", "itm_longseax6", "itm_seax_1"),
        (assign, ":cont", 1),
      (try_end),
      (eq, ":cont", 0),
      (str_store_item_name, s13, ":slot_item"),
      ], "I don't think you'll need your {s13} any time soon.", "prisoner_chat_noble_arm3a",[(assign, "$temp2",ek_item_2),(troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_item_2), (assign, "$temp", ":slot_item"),]],
  
  [anyone|plyr,"prisoner_chat_noble_arm3", [
      (troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_item_3),
      (gt, ":slot_item", 0),
      (assign, ":cont", 0),
      (item_get_type, ":item_type", ":slot_item"),
      (try_begin),
        (eq, ":item_type", itp_type_one_handed_wpn),
        (item_get_swing_damage, ":swing", ":slot_item"),
        (this_or_next|lt, ":swing", 21),
        (is_between, ":slot_item", "itm_longseax6", "itm_seax_1"),
        (assign, ":cont", 1),
      (try_end),
      (eq, ":cont", 0),
      (str_store_item_name, s13, ":slot_item"),
      ], "I don't think you'll need your {s13} any time soon.", "prisoner_chat_noble_arm3a",[(assign, "$temp2",ek_item_3),(troop_get_inventory_slot, ":slot_item", "$g_talk_troop", ek_item_3),(assign, "$temp", ":slot_item"),]],
  
  [anyone|plyr,"prisoner_chat_noble_arm3", [], "Nothing, just joking.", "close_window",[]],
  
  [anyone, "prisoner_chat_noble_arm3a",[],"Hah! I think you are thinking of having fun at my expense.", "prisoner_chat_noble_arm3b",[]],
  
  [anyone|plyr, "prisoner_chat_noble_arm3b", [ (str_store_item_name, s13, "$temp"),],"I am not joking. Remove your {s13} and hand it over to me!", "prisoner_chat_noble_arm3c",[]],
  
  [anyone,  "prisoner_chat_noble_arm3c", [], "You are nothing but a common thief, {playername}. I will always remember this!","close_window",[
      (troop_get_slot, ":rob", "$g_talk_troop", slot_troop_robbed),
      (val_add, ":rob", 1),
      (troop_set_slot, "$g_talk_troop",slot_troop_robbed, ":rob"),
      (item_get_type, ":item_type", "$temp"),
      (store_random_in_range, ":rand", 0, 10),
      (assign, ":mod", 0),
      (try_begin),
        (this_or_next|eq, ":item_type", itp_type_polearm),
        (eq, ":item_type", itp_type_thrown),
        (try_begin),
          (lt, ":rand", 5),
          (assign, ":mod", imod_cracked),
        (else_try),
          (assign, ":mod", imod_bent),
        (try_end),
      (else_try),
        (this_or_next|eq, ":item_type", itp_type_one_handed_wpn),
        (eq, ":item_type", itp_type_two_handed_wpn),
        (try_begin),
          (lt, ":rand", 5),
          (assign, ":mod", imod_chipped),
        (else_try),
          (assign, ":mod", imod_rusty),
        (try_end),
      (else_try),
        (eq, ":item_type", itp_type_shield),
        (try_begin),
          (lt, ":rand", 5),
          (assign, ":mod", imod_cracked),
        (else_try),
          (assign, ":mod", imod_battered),
        (try_end),
      (else_try),
        (this_or_next|eq, ":item_type",itp_type_head_armor),
        (eq, ":item_type", itp_type_body_armor),
        (try_begin),
          (lt, ":rand", 5),
          (assign, ":mod", imod_rusty),
        (else_try),
          (assign, ":mod", imod_battered),
        (try_end),
      (try_end),
      (troop_remove_item, "$g_talk_troop", "$temp"),
      (troop_add_item ,"trp_player", "$temp", ":mod"),
      (troop_inventory_slot_set_item_amount, "$g_talk_troop", "$temp2", 0),
      (try_begin),
        (eq, ":item_type", itp_type_body_armor),
        (troop_get_inventory_capacity, ":capacity", "$g_talk_troop"),
        (try_for_range, ":cur_slot", 0, ":capacity"),
          (troop_get_inventory_slot, ":cur_item", "$g_talk_troop", ":cur_slot"),
          (gt, ":cur_item", 0),
          (item_get_type, ":item_type", ":cur_item"),
          (eq, ":item_type", itp_type_body_armor),
          (troop_add_item,"$g_talk_troop", ":cur_item"),
        (try_end),
      (try_end),
      
      
      (call_script, "script_change_player_honor", -25),
      (call_script, "script_troop_get_relation_with_troop", "trp_player", "$g_talk_troop"),
      (assign, ":rels", reg0),
      (try_begin),
        (le, ":rels", 0),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -50),
      (else_try),
        (val_add, ":rels", 50),
        (val_mul, ":rels", -1),
        (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", ":rels"),
      (try_end),
      (try_for_range, ":npc", active_npcs_begin,kingdom_ladies_end),
        (neq, ":npc", "$g_talk_troop"),
        (call_script, "script_troop_get_family_relation_to_troop", ":npc", "$g_talk_troop"),
        (gt, reg0, 0),
        (call_script, "script_troop_get_relation_with_troop", "trp_player", ":npc"),
        (assign, ":rels", reg0),
        (try_begin),
          (le, ":rels", 0),
          (call_script, "script_change_player_relation_with_troop", ":npc", -50),
        (else_try),
          (val_add, ":rels", 50),
          (val_mul, ":rels", -1),
          (call_script, "script_change_player_relation_with_troop", ":npc", ":rels"),
        (try_end),
      (try_end),
      (store_faction_of_troop, ":faction", "$g_talk_troop"),
      (call_script,  "script_change_player_relation_with_faction", ":faction", -10),]],
  
  
  [anyone|plyr, "prisoner_chat", [(store_conversation_troop,"$g_talk_troop"),
      (neg|troop_is_hero, "$g_talk_troop"),], "Hey, you!", "prisoner_chat1", []],
  
  [anyone|plyr,"prisoner_chat1", [(store_conversation_troop,"$g_talk_troop"),
      (neg|troop_is_hero, "$g_talk_troop"),
      (eq,"$g_talk_troop", "trp_looter_leader2"),
      (party_get_num_prisoners, ":num_prisoners", "p_main_party"),
      (gt, ":num_prisoners", 50),], "I will set you and the rest of your lot free, if you attack my enemies.", "prisoner_chat_attack",[]],
  
  [anyone|plyr,"prisoner_chat1", [(neg|troop_is_hero, "$g_talk_troop"),], "Do not try running away or trying something stupid. I am watching you.", "prisoner_chat_2",[]],
  [anyone|plyr,"prisoner_chat1", [(neg|troop_is_hero, "$g_talk_troop"),(party_slot_eq, "p_main_party", slot_party_on_water, 0),], "I can't stand the sight of you! Die!", "prisoner_chat_die1",[]],
  [anyone|plyr,"prisoner_chat1", [(neg|troop_is_hero, "$g_talk_troop"),(eq, "$g_player_prisoner_released", 0)], "It could be the mead talking, but today I really feel like setting you free.", "prisoner_chat_release",[]],
  [anyone,     "prisoner_chat_release", [], "Oh, thank you, your Highness.  God bless you!", "close_window",
    [(remove_troops_from_prisoners, "$g_talk_troop", 1),
      (assign,"$g_player_prisoner_released", 1),
      (store_character_level, ":troop_level", "$g_talk_troop"),
      (store_character_level, ":player_level", "trp_player"),
      (store_sub, ":level_diff", ":troop_level", ":player_level"),
      (assign, ":honor_var", "$player_honor"),
      (assign, ":honor_mod", 0),
      (try_begin),
        (lt, ":level_diff", 0),
      (else_try),
        (is_between, "$player_honor", -50, 51),
        (ge, ":level_diff", 0),
        (val_mul, ":honor_var", ":honor_var"),
        (store_sub, ":honor_mod", 2500, ":honor_var"),
        (val_mul, ":honor_mod", ":level_diff"),
        (val_div, ":honor_mod", ":troop_level"),
        (val_div, ":honor_mod", 1000),
      (try_end),
      (neq, ":honor_mod", 0),
      (try_begin),
        (neg|is_between, "$g_talk_troop", "trp_looter", "trp_manhunter"),
        (call_script, "script_change_player_honor", ":honor_mod"),
      (else_try),
        (val_mul, ":honor_mod", -1),
        (call_script, "script_change_player_honor", ":honor_mod"),
      (try_end),
  ]],
  [anyone|plyr,"prisoner_chat1", [(neg|troop_is_hero, "$g_talk_troop"),(eq, "$g_recruit_attempt", 0),], "I would like to offer you a place in my shield wall.", "prisoner_chat_offer",[
      (store_attribute_level, ":charisma", "trp_player", ca_charisma),
      (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (store_skill_level, ":leadership", "skl_leadership", "trp_player"),
      (troop_get_slot, ":renown", "trp_player", slot_troop_renown),
      (val_sub, ":persuasion", 6),
      (val_sub, ":leadership", 7),
      (val_sub, ":charisma", 12),
      (val_div, ":renown", 150),
      (assign, ":mod", 0),
      (try_begin),
        (this_or_next|eq, "$g_talk_troop", "trp_todos_cuerno"),
        (this_or_next|is_between, "$g_talk_troop", "trp_follower_woman", "trp_refugeeromanruins"),
        (call_script, "script_cf_troop_religion_matches_players", "$g_talk_troop"),
        (assign, ":mod", 5),
      (else_try),
        (assign, ":mod", -5),
      (try_end),
      (store_character_level, ":level1", "$g_talk_troop"),
      (store_character_level, ":level", "trp_player"),
      (val_sub, ":level", ":level1"),
      (val_div, ":level", 2),
      (val_add, ":mod", ":level"),
      (val_add, ":mod", ":persuasion"),
      (val_add, ":mod", ":leadership"),
      (val_add, ":mod", ":charisma"),
      (val_add, ":mod", ":renown"),
      (assign, ":p_honor", "$player_honor"),
      (val_clamp, ":p_honor", -100, 101),
      (store_div, ":half_honor", ":p_honor", 2),
      (try_begin),
        (is_between, "$g_talk_troop", "trp_looter", "trp_manhunter"),
        (val_mul, ":half_honor", -1),
      (try_end),
      (val_add, ":mod", ":half_honor"),
      #	(assign, reg33, ":mod"),
      #	(display_message, "@Mod is {reg33}"),
      (try_begin),
        (le, ":mod", 0),
        (assign, "$temp", 0),
      (else_try),
        (store_random_in_range, ":random", 0, 40),
        #		(assign, reg45, ":random"),
        #		(display_message, "@random is {reg45}"),
        (try_begin),
          (lt, ":random", 12),
          (assign, "$temp", 1),
        (else_try),
          (assign, "$temp", 0),
        (try_end),
      (try_end),
  ]],
  [anyone, "prisoner_chat_offer", [
      (eq, "$temp", 1), (assign, "$g_recruit_attempt", 1),], "Yes, {reg59?madam:sir}. I swear on my mothers grave I will serve you, my {reg59?lady:lord}!","prisoner_chat_accept1",[]],
  [anyone, "prisoner_chat_offer", [(assign, "$g_recruit_attempt", 1)], "It would be best if your highness just let me go home, I'm not interested.", "prisoner_chat_refuse",[]],
  
  [anyone|plyr,"prisoner_chat_refuse", [], "I see...", "prisoner_chat1",[]],
  [anyone|plyr, "prisoner_chat_accept1", [], "In my shield wall, we are all treated as equals.  I expect your obedience and also your trust.", "prisoner_chat_accept2",[]],
  
  [anyone,      "prisoner_chat_accept2", [], "I will obey your wishes, my {reg59?lady:lord}.  I swear!", "prisoner_chat_accept3",[]],
  
  [anyone|plyr, "prisoner_chat_accept3", [(neg|troops_can_join, 1)], "Sorry, but I really don't have space for you at the moment.", "close_window", []],
  [anyone|plyr, "prisoner_chat_accept3", [(troops_can_join, 1)], "Excellent news.", "close_window",
    [
      (remove_troops_from_prisoners, "$g_talk_troop",1),
      (party_add_members, "p_main_party", "$g_talk_troop", 1),
      (store_character_level, ":level1", "$g_talk_troop"),
      (store_character_level, ":level", "trp_player"),
      (val_sub, ":level", ":level1"),
      (try_begin),
        (ge, ":level", 0),
        (assign, ":level", -4),
      (else_try),
        (val_min, ":level", -4),
      (try_end),
      (call_script, "script_change_player_party_morale", ":level"),
  ]],
  
  [anyone,"prisoner_chat_2", [], "No, I swear I won't.", "close_window",[]],
  
  [anyone,"prisoner_chat_attack", [ (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (lt, ":persuasion", 6),
      ], "Sorry, but I am not your puppet!", "close_window",[]],
  [anyone,"prisoner_chat_attack", [ (store_skill_level, ":persuasion", "skl_persuasion", "trp_player"),
      (ge, ":persuasion", 6),
      ], "It sounds intriguing. Which enemy do you have in mind?", "prisoner_chat_attack1",[]],
  
  [anyone|plyr|repeat_for_troops,"prisoner_chat_attack1", [
      (store_repeat_object, ":troop_no"),
      (neq, "$g_talk_troop", ":troop_no"),
      (is_between, ":troop_no", active_npcs_begin, active_npcs_end),
      (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
      (call_script, "script_troop_get_player_relation", ":troop_no"),
      (assign, ":troop_relation", reg0),
      (lt, ":troop_relation", -7),
      (str_store_troop_name, s33, ":troop_no"),
      ], "{!}{s33}", "prisoner_chat_attack2",[(store_repeat_object, "$temp"),]],
  
  [anyone|plyr,"prisoner_chat_attack1",[], "Actually, I changed my mind.","close_window", []],
  [anyone,"prisoner_chat_attack2", [], "Very well, what do you want me to do?", "prisoner_chat_attack3", []],
  
  [anyone|plyr|repeat_for_parties,"prisoner_chat_attack3", [
      (store_repeat_object, ":center"),
      (is_between, ":center", villages_begin, villages_end),
      (party_slot_eq, ":center", slot_town_lord, "$temp"),
      (neg|party_slot_eq, ":center", slot_village_state, svs_looted),
      (str_store_party_name, s34, ":center"),
      ], "I want you to attack {s34}.", "prisoner_chat_attack4",[(store_repeat_object, "$temp_2")]],
  
  [anyone|plyr,"prisoner_chat_attack3", [
      (str_store_troop_name, s35, "$temp"),
      (neg|troop_slot_ge, "$temp", slot_troop_prisoner_of_party, 0),
      (troop_get_slot, ":troop_party", "$temp", slot_troop_leaded_party),
      (gt, ":troop_party", 0),
      (party_is_active,":troop_party"),
      ], "I want you to attack {s35}.", "prisoner_chat_attack4a",[]],
  
  [anyone|plyr,"prisoner_chat_attack3", [
      ], "Actually, I changed my mind.", "close_window",[]],
  
  [anyone,"prisoner_chat_attack4", [
      (gt, "$temp_2", 0),
      (str_store_party_name, s33, "$temp_2"),
      ], "Very well, we will try to attack {s33}.", "close_window", [
      (party_clear, "p_temp_party"),
      (party_get_num_prisoner_stacks, ":prisoner_stacks", "p_main_party"),
      (try_for_range_backwards, ":prisoner_stack_no", 0, ":prisoner_stacks"),
        (party_prisoner_stack_get_troop_id, ":prisoner_troop_no", "p_main_party", ":prisoner_stack_no"),
        (neg|troop_is_hero, ":prisoner_troop_no"),
        (party_prisoner_stack_get_size, ":prisoner_stack_size", "p_main_party", ":prisoner_stack_no"),
        (party_remove_prisoners, "p_main_party", ":prisoner_troop_no", ":prisoner_stack_size"),
        (party_add_members, "p_temp_party", ":prisoner_troop_no", ":prisoner_stack_size"),
      (try_end),
      (spawn_around_party,"p_main_party","pt_deserters"),
      (assign, ":new_party", reg(0)),
      (call_script, "script_party_add_party", ":new_party", "p_temp_party"),
      (party_set_faction, ":new_party", "fac_deserters"),
      (party_get_position, pos1, "$temp_2"),
      (map_get_random_position_around_position, pos2, pos1, 1),
      (party_set_ai_behavior, ":new_party", ai_bhvr_travel_to_point),
      (party_set_ai_object, ":new_party", "$temp_2"),
      (party_set_slot, ":new_party", slot_party_ai_state ,spai_raiding_around_center),
      (party_set_slot, ":new_party", slot_party_ai_substate, 1),
  ]],
  [anyone,"prisoner_chat_attack4a", [
      (str_store_troop_name, s33, "$temp"),
      ], "Very well, we will attack {s33}.", "close_window", [
      (party_clear, "p_temp_party"),
      (party_get_num_prisoner_stacks, ":prisoner_stacks", "p_main_party"),
      (try_for_range_backwards, ":prisoner_stack_no", 0, ":prisoner_stacks"),
        (party_prisoner_stack_get_troop_id, ":prisoner_troop_no", "p_main_party", ":prisoner_stack_no"),
        (neg|troop_is_hero, ":prisoner_troop_no"),
        (party_prisoner_stack_get_size, ":prisoner_stack_size", "p_main_party", ":prisoner_stack_no"),
        (party_remove_prisoners, "p_main_party", ":prisoner_troop_no", ":prisoner_stack_size"),
        (party_add_members, "p_temp_party", ":prisoner_troop_no", ":prisoner_stack_size"),
      (try_end),
      (spawn_around_party,"p_main_party","pt_deserters"),
      (assign, ":new_party", reg(0)),
      (call_script, "script_party_add_party", ":new_party", "p_temp_party"),
      (party_set_faction, ":new_party", "fac_deserters"),
      (party_set_ai_behavior, ":new_party", ai_bhvr_travel_to_party),
      (troop_get_slot, ":troop_party", "$temp", slot_troop_leaded_party),
      (party_set_ai_object, ":new_party", ":troop_party"),
      (party_set_slot, ":new_party", slot_party_ai_state ,spai_engaging_army),
      (party_set_flags, ":new_party", pf_default_behavior, 0),
  ]],
  [anyone|plyr,"prisoner_chat_die1", [], "I will show you how to use your weapons properly, so next time you will not surrender, coward!", "prisoner_chat_die2",[]],
  [anyone,     "prisoner_chat_die2", [], "Please, {reg59?lady:sir}, don't kill me. There is no honor in killing someone who can't defend himself.", "prisoner_chat_die3",[]],
  [anyone|plyr,"prisoner_chat_die3", [], "There may be no honor, but I will feel better after I separate your head from your shoulders!", "prisoner_chat_die4",[]],
  [anyone|plyr,"prisoner_chat_die3", [], "You're right. I'd better use pumpkins for my practice.", "close_window",[]],
  [anyone|plyr,"prisoner_chat_die4", [], "(One swing of your weapon cuts off the prisoner's head, and it rolls across the floor.)", "close_window",
    [(remove_troops_from_prisoners, "$g_talk_troop", 1),
      (call_script, "script_change_player_honor", -1),
      (try_begin),
        (this_or_next|is_between, "$g_talk_troop", christian_troops_begin, christian_troops_end),
        (this_or_next|is_between, "$g_talk_troop", christian_troops2_begin, christian_troops2_end),
        (this_or_next|is_between, "$g_talk_troop", christian_troops3_begin, christian_troops3_end),
        (is_between, "$g_talk_troop", christian_troops4_begin, christian_troops4_end),
        (call_script, "script_change_player_relation_with_faction", "fac_christians", -1),
      (else_try),
        (this_or_next|is_between, "$g_talk_troop", pagan_troops_begin, pagan_troops_end),
        (this_or_next|is_between, "$g_talk_troop", pagan_troops2_begin, pagan_troops2_end),
        (is_between, "$g_talk_troop", pagan_troops3_begin, pagan_troops3_end),
        (call_script, "script_change_player_relation_with_faction", "fac_pagans", -1),
      (try_end),
  ]],
  
  [anyone|plyr,"prisoner_chat_noble",
    [
      #      (troop_slot_eq "$g_talk_troop", slot_troop_prisoner_of_party, 0),
    ], "You are free to go.", "prisoner_chat_noble_go",
    [
      (party_remove_prisoners, "p_main_party", "$g_talk_troop", 1),
      (troop_set_slot, "$g_talk_troop", slot_troop_leaded_party, -1),
      (troop_set_slot, "$g_talk_troop", slot_troop_prisoner_of_party, -1),
      (troop_set_slot, "$g_talk_troop", slot_troop_occupation, slto_kingdom_hero),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 10),
      (call_script, "script_change_player_honor", 3),
      (call_script, "script_add_log_entry", logent_lord_defeated_but_let_go_by_player, "trp_player",  -1, "$g_talk_troop", "$g_talk_troop_faction"),
  ]],
  [anyone,"prisoner_chat_noble_go", [],
    "{!}{s43}", "close_window", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_prisoner_released_default"),
      #   (party_remove_prisoners, "$current_town", "$g_talk_troop",1),
  ]],
  
  [anyone|plyr,"prisoner_chat_noble", [], "Farewell.", "prisoner_chat_noble_noconversation",[]],
  [anyone,"prisoner_chat_noble_noconversation", [], "{!}...", "close_window",[]],
  
  
  
  
  
  
  # Prisoner chat end
  
  [anyone,"start", [(party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
      (this_or_next|is_between,"$g_talk_troop",weapon_merchants_begin,weapon_merchants_end),
      (this_or_next|is_between,"$g_talk_troop",armor_merchants_begin, armor_merchants_end),
      (             is_between,"$g_talk_troop",horse_merchants_begin, horse_merchants_end),
    ],
    "Greetings, {reg59?my lady:your lordship}. How can I serve you today?", "town_merchant_talk",[]],
  
  [anyone,"start", [(this_or_next|is_between,"$g_talk_troop",weapon_merchants_begin,weapon_merchants_end),
      (this_or_next|is_between,"$g_talk_troop",armor_merchants_begin, armor_merchants_end),
      (             is_between,"$g_talk_troop",horse_merchants_begin, horse_merchants_end)], "Good day. What can I do for you?", "town_merchant_talk",[]],
  
  [anyone|plyr,"town_merchant_talk", [(is_between,"$g_talk_troop",weapon_merchants_begin,weapon_merchants_end)],
    "I want to buy a new weapon. Show me your wares.", "trade_requested_weapons",[]],
  [anyone|plyr,"town_merchant_talk", [(is_between,"$g_talk_troop",armor_merchants_begin,armor_merchants_end)],
    "I am looking for some equipment. Show me what you have.", "trade_requested_armor",[]],
  [anyone|plyr,"town_merchant_talk", [(is_between,"$g_talk_troop",horse_merchants_begin,horse_merchants_end)],
    "I am thinking of buying a horse.", "trade_requested_horse",[]],
  
  [anyone,"trade_requested_weapons", [], "Ah, yes {reg59?madam:sir}. These arms are the best you'll find anywhere.", "merchant_trade",[[change_screen_trade]]],
  [anyone,"trade_requested_armor", [], "Of course, {reg59?madam:sir}. No better prices in all the land!", "merchant_trade",[[change_screen_trade]]], #chief sot camba cosas
  [anyone,"trade_requested_horse", [], "You have a fine eye for horses, {reg59?madam:sir}. You won't find better beasts than these anywhere else.", "merchant_trade",[[change_screen_trade]]],
  
  #weapon fix begin
  [anyone|plyr,"town_merchant_talk", [(is_between,"$g_talk_troop",weapon_merchants_begin,weapon_merchants_end),
      (neq, "$g_talk_troop", "trp_town_31_weaponsmith"),
    ],
    "I want to refine one of my weapons.", "smith_requested_repair_1",[]],
  
  [anyone,"smith_requested_repair_1", [],
    "Which one?", "smith_requested_repair_2",[(assign, "$temp3", "trp_player"),]],
  
  # first outfit
  [anyone|plyr,"smith_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_player", ek_item_0),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_item_0),]],
  [anyone|plyr,"smith_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_player", ek_item_1),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_item_1),]],
  [anyone|plyr,"smith_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_player", ek_item_2),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_item_2),]],
  [anyone|plyr,"smith_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_player", ek_item_3),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_item_3),]],
  
  # second outfit
  [anyone|plyr,"smith_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_pseudo_troop_end", ek_item_0),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_item_0),
      (assign, "$temp3", "trp_pseudo_troop_end"),]],
  [anyone|plyr,"smith_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_pseudo_troop_end", ek_item_1),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_item_1),
      (assign, "$temp3", "trp_pseudo_troop_end"),]],
  [anyone|plyr,"smith_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_pseudo_troop_end", ek_item_2),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_item_2),
      (assign, "$temp3", "trp_pseudo_troop_end"),]],
  [anyone|plyr,"smith_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_pseudo_troop_end", ek_item_3),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_item_3),
      (assign, "$temp3", "trp_pseudo_troop_end"),]],
  
  [anyone|plyr,"smith_requested_repair_2", [],
    "Never mind.", "merchant_trade",[]],
  
  [anyone,"item_improve_1",
    [
      (assign, ":inventory_slot_no", "$repair_wielded_item_slot"),
      (troop_get_inventory_slot, ":slot_item", "$temp3", ":inventory_slot_no"),
      (gt, ":slot_item", 0),
      (troop_get_inventory_slot_modifier, ":slot_item_imod", "$temp3", ":inventory_slot_no"),
      (call_script, "script_get_next_higher_imod_for_item", ":slot_item", ":slot_item_imod"),
      (assign, "$repair_wielded_item_tareget_modifier", reg0),
      (neq, ":slot_item_imod", "$repair_wielded_item_tareget_modifier"),
      
      (str_store_item_name, s7, ":slot_item"),
      
      (store_item_value, ":plain_item_value", ":slot_item"),
      (item_get_type, ":item_type", ":slot_item"),
      
      # current value
      (str_store_string, s0, "@Plain"),
      (call_script, "script_get_item_modifier_effects", ":item_type", ":slot_item_imod"),
      (str_store_string, s8, s0),
      (store_mul, ":curr_item_value", ":plain_item_value", reg5),
      (val_div, ":curr_item_value", 100),
      
      # target value
      (str_store_string, s0, "@Plain"),
      (call_script, "script_get_item_modifier_effects", ":item_type", "$repair_wielded_item_tareget_modifier"),
      (str_store_string, s9, s0),
      (store_mul, ":target_item_value", ":plain_item_value", reg5),
      (val_div, ":target_item_value", 100),
      
      (store_sub, "$current_dialog_cost", ":target_item_value", ":curr_item_value"),
      
      #trade skill influence
      (call_script, "script_game_get_item_buy_price_factor", ":slot_item"),
      #(val_add, reg0, 5),		#new: +5% penalty
      (val_mul, "$current_dialog_cost", reg0),
      (val_div, "$current_dialog_cost", 100),
      (gt, "$current_dialog_cost", 0),	#VC-2431
      (assign, reg1, "$current_dialog_cost"),
      # VC-2206
      (try_begin),
        (str_clear, s10),
        (eq, "$repair_wielded_item_tareget_modifier", imod_tempered),
        (str_store_string, s10, "@Please note that this refinement makes the weapon cause more damage but also makes it slower."),
      (end_try),
    ],
    "Hmm, let me take a look... Your {s7} is {s8}. I think I will be able to make it {s9} for {reg1} peningas. {s10}", "item_improve_2",[]],
  
  [anyone,"item_improve_1",
    [
      (str_clear, s1),
      (try_begin),
        (assign, ":inventory_slot_no", "$repair_wielded_item_slot"),
        (troop_get_inventory_slot, ":slot_item", "$temp3", ":inventory_slot_no"),
        (gt, ":slot_item", 0),
        (str_store_item_name, s7, ":slot_item"),
      (end_try),
    ],
    "Hmm, let me take a look... There is nothing I can do for your {s7}. I can't refine it.", "merchant_trade",[]],
  
  [anyone|plyr,"item_improve_2",
    [
      (store_troop_gold, reg7, "trp_player"),
      (ge, reg7, "$current_dialog_cost"),
    ],
    "Agreed!", "item_improve_3",
    [
      (troop_remove_gold, "trp_player", "$current_dialog_cost"),
      (store_conversation_troop, ":smith_troop"),
      (troop_add_gold, ":smith_troop", "$current_dialog_cost"),
      (troop_set_inventory_slot_modifier, "$temp3", "$repair_wielded_item_slot", "$repair_wielded_item_tareget_modifier"),
  ]],
  [anyone|plyr,"item_improve_2",
    [
      (store_troop_gold, reg7, "trp_player"),
      (ge, reg7, "$current_dialog_cost"),
    ],
    "I changed my mind.", "merchant_trade", []],
  [anyone|plyr,"item_improve_2", [], "I don't have enough money.", "merchant_trade", []],
  
  [anyone,"item_improve_3", [],
    "Here you have your {s7} back. It's refined.", "merchant_trade",[]],
  
  #weapon fix end
  
  # armor fix begin
  [anyone|plyr,"town_merchant_talk", [(is_between,"$g_talk_troop",armor_merchants_begin,armor_merchants_end),
    ],
    "I want to refine one of my armor parts.", "armorer_requested_repair_1",[]],
  
  [anyone,"armorer_requested_repair_1", [],
    "Which one?", "armorer_requested_repair_2",[(assign, "$temp3", "trp_player"),]],
  
  # first outfit
  [anyone|plyr,"armorer_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_player", ek_head),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_head),]],
  [anyone|plyr,"armorer_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_player", ek_body),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_body),]],
  [anyone|plyr,"armorer_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_player", ek_gloves),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_gloves),]],
  [anyone|plyr,"armorer_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_player", ek_foot),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_foot),]],
  
  # second outfit
  [anyone|plyr,"armorer_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_pseudo_troop_end", ek_head),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_head),
      (assign, "$temp3", "trp_pseudo_troop_end"),]],
  [anyone|plyr,"armorer_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_pseudo_troop_end", ek_body),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_body),
      (assign, "$temp3", "trp_pseudo_troop_end"),]],
  [anyone|plyr,"armorer_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_pseudo_troop_end", ek_gloves),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_gloves),
      (assign, "$temp3", "trp_pseudo_troop_end"),]],
  [anyone|plyr,"armorer_requested_repair_2",
    [  (troop_get_inventory_slot, ":slot_item", "trp_pseudo_troop_end", ek_foot),
      (gt, ":slot_item", 0),
      (str_store_item_name, s1, ":slot_item"),],
    "{!}{s1}.", "item_improve_1",
    [  (assign, "$repair_wielded_item_slot", ek_foot),
      (assign, "$temp3", "trp_pseudo_troop_end"),]],
  
  [anyone|plyr,"armorer_requested_repair_2", [],
    "Never mind.", "merchant_trade",[]],
  
  #armor fix end
  
  [anyone,"merchant_trade", [], "Anything else?", "town_merchant_talk",[]],
  ##chief rumores
  [anyone|plyr,"town_merchant_talk", [(eq, "$rumors_inquired", 0)], "Tell me, what are people talking about these days?", "merchant_gossip",[(assign, "$rumors_inquired", 1)]],
  #  [anyone|plyr,"town_merchant_talk", [], "Tell me. What are people talking about these days?", "merchant_gossip",[]],
  [anyone,"merchant_gossip", [(neg|party_slot_ge, "$current_town", slot_center_player_relation, 0)], "I don't know anything that would be of interest to you.", "town_merchant_talk",[]],
  [anyone,"merchant_gossip", [(store_mul, ":rumor_id", "$current_town", 197),
      (val_add,  ":rumor_id", "$g_talk_agent"),
      (call_script, "script_get_rumor_to_s61", ":rumor_id"),
      (gt, reg0, 0)], "{!}{s61}", "town_merchant_talk",[]],
  #chief rumores acaba
  [anyone,"merchant_gossip", [], "Well, nothing new lately. Prices, weather, the war, the same old things.", "town_merchant_talk",[]],
  [anyone|plyr,"town_merchant_talk", [], "Farewell.", "close_window",[]],
  
  
  
  
  ##  [anyone,"start", [(eq, "$talk_context", 0),
  ##                    (is_between,"$g_talk_troop",walkers_begin, walkers_end),
  ##                    (eq, "$sneaked_into_town",1),
  ##                     ], "Stay away beggar!", "close_window",[]],
  
  [anyone,"start", [(eq, "$talk_context", 0),
      (is_between,"$g_talk_troop",walkers_begin, walkers_end),
      (party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
      ], "My {reg59?lady:lord}?", "town_dweller_talk",[(assign, "$welfare_inquired",0),(assign, "$rumors_inquired",0),(assign, "$info_inquired",0)]],
  
  [anyone,"start", [(eq, "$talk_context", 0),
      (is_between,"$g_talk_troop",walkers_begin, walkers_end),
      ], "Good day, {reg59?madam:sir}.", "town_dweller_talk",[(assign, "$welfare_inquired", 0),(assign, "$rumors_inquired",0),(assign, "$info_inquired",0)]],
  
  [anyone|plyr,"town_dweller_talk", [(check_quest_active, "qst_hunt_down_fugitive"),
      (neg|check_quest_concluded, "qst_hunt_down_fugitive"),
      (quest_slot_eq, "qst_hunt_down_fugitive", slot_quest_target_center, "$current_town"),
      (quest_get_slot, ":quest_target_dna", "qst_hunt_down_fugitive", slot_quest_target_dna),
      (call_script, "script_get_name_from_dna_to_s50", ":quest_target_dna"),
      (str_store_string, s4, s50),
    ],
    "I am looking for a man by the name of {s4}. I was told he may be hiding here.", "town_dweller_ask_fugitive",[]],
  [anyone ,"town_dweller_ask_fugitive", [],
    "Strangers come and go to our village, {reg59?madam:sir}. If he is hiding here, you will surely find him if you look around.", "close_window",[]],
  
  [anyone|plyr,"town_dweller_talk", [(check_quest_active, "qst_blank_quest_10"),
      (neg|check_quest_concluded, "qst_blank_quest_10"),
      (quest_get_slot, ":giver_center", "qst_blank_quest_10", slot_quest_giver_center),
      (store_distance_to_party_from_party, ":distance", ":giver_center", "$current_town"),
      (is_between, "$current_town", villages_begin, villages_end),
      (lt, ":distance", 50),
      (quest_get_slot, ":item", "qst_blank_quest_10", slot_quest_target_item),
      (str_store_item_name, s22, ":item"),
      #									  (str_store_party_name, s23, ":giver_center"),
      #                                    (neg|quest_slot_eq, "qst_blank_quest_10", slot_quest_target_center, "$current_town"),
    ],
    "Have you seen any {s22}-playing guards around here?", "town_dweller_ask_music",[]],
  
  [anyone ,"town_dweller_ask_music", [
      (neg|quest_slot_eq, "qst_blank_quest_10", slot_quest_target_center, "$current_town"),
    ],
    "Strangers come and go to our village, {reg59?madam:sir}. Haven't heard or seen anyone like that, but if he is hiding here, you might be able to find him if you look around.", "close_window",[]],
  [anyone ,"town_dweller_ask_music", [
      (quest_slot_eq, "qst_blank_quest_10", slot_quest_target_center, "$current_town"),
      (quest_get_slot, ":item", "qst_blank_quest_10", slot_quest_target_item),
      (str_store_item_name, s22, ":item"),
    ],
    "Strangers come and go to our village, {reg59?madam:sir}. Me and my friends were listening to the sounds of a {s22} the other day, but I don't recall that person. Perhaps he's left already?", "close_window",[]],
  
  [anyone|plyr,"town_dweller_talk", [(check_quest_active, "qst_blank_quest_13"),
      (neg|check_quest_concluded, "qst_blank_quest_13"),
      (quest_slot_eq, "qst_blank_quest_13", slot_quest_target_center, "$current_town"),
      (is_between, "$current_town", villages_begin, villages_end),
      ], "I am looking for someone who may or may not be a ghost.", "town_dweller_ask_ghost",[]],
  
  [anyone ,"town_dweller_ask_ghost", [  (neg|is_currently_night),
    ],
    "A ghost? Hah! Ghosts don't appear during the day! Try finding him at night!", "close_window",[]],
  [anyone ,"town_dweller_ask_ghost", [  (is_currently_night),
    ],
    "A ghost? Ghosts don't appear on their own! You need to walk by him to wake him up.", "close_window",[]],
  
  # Ryan BEGIN
  # [anyone|plyr,"town_dweller_talk",
    # [
      # (eq, 1, 0),
      # (check_quest_active, "qst_meet_spy_in_enemy_town"),
      # (neg|check_quest_succeeded, "qst_meet_spy_in_enemy_town"),
      # (quest_slot_eq, "qst_meet_spy_in_enemy_town", slot_quest_target_center, "$current_town"),
      # (str_store_item_name,s5,"$spy_item_worn"),
    # ],
    # "Pardon me, but is that a {s5} you're wearing?", "town_dweller_quest_meet_spy_in_enemy_town_ask_item",
    # [
  # ]],
  # [anyone, "town_dweller_quest_meet_spy_in_enemy_town_ask_item", [
      # (str_store_item_name,s5,"$spy_item_worn"),
      
      # (try_begin),
        # (troop_has_item_equipped,"$g_talk_troop","$spy_item_worn"),
        # (str_store_string,s6,"@A {s5}? Well... Yes, I suppose it is. What a strange thing to ask."),
      # (else_try),
        # (str_store_string,s6,"@Eh? No, it most certainly is not a {s5}. I'd start questioning my eyesight if I were you."),
      # (try_end),
    # ],
    # "{s6}", "town_dweller_talk",[]],
  
  [anyone|plyr|repeat_for_100,"town_dweller_talk",
    [
      (store_repeat_object,":object"),
      (lt,":object",4), # repeat only 4 times
      
      (check_quest_active, "qst_meet_spy_in_enemy_town"),
      (neg|check_quest_succeeded, "qst_meet_spy_in_enemy_town"),
      (quest_slot_eq, "qst_meet_spy_in_enemy_town", slot_quest_target_center, "$current_town"),
      
      (store_add,":string",":object","str_secret_sign_1"),
      (str_store_string, s4, ":string"),
    ],
    "{!}{s4}", "town_dweller_quest_meet_spy_in_enemy_town",
    [
      (store_repeat_object,":object"),
      (assign, "$temp", ":object"),
  ]],
  
  [anyone ,"town_dweller_quest_meet_spy_in_enemy_town",
    [
      (call_script, "script_agent_get_town_walker_details", "$g_talk_agent"),
      (assign, ":walker_type", reg0),
      (eq, ":walker_type", walkert_spy),
      (quest_get_slot, ":secret_sign", "qst_meet_spy_in_enemy_town", slot_quest_target_amount),
      (val_sub, ":secret_sign", secret_signs_begin),
      (eq, ":secret_sign", "$temp"),
      (store_add, ":countersign", ":secret_sign", countersigns_begin),
      (str_store_string, s4, ":countersign"),
    ],
    "{!}{s4}", "town_dweller_quest_meet_spy_in_enemy_town_know",[]],
  
  [anyone, "town_dweller_quest_meet_spy_in_enemy_town", [],
    "Eh? What kind of gibberish is that?", "town_dweller_quest_meet_spy_in_enemy_town_dont_know",[]],
  
  [anyone|plyr, "town_dweller_quest_meet_spy_in_enemy_town_dont_know", [],
    "Never mind.", "close_window",[]],
  
  [anyone|plyr, "town_dweller_quest_meet_spy_in_enemy_town_know", [
      (quest_get_slot, ":quest_giver", "qst_meet_spy_in_enemy_town", slot_quest_giver_troop),
      (str_store_troop_name, s4, ":quest_giver"),
    ],
    "{s4} sent me to collect your reports. Do you have them with you?", "town_dweller_quest_meet_spy_in_enemy_town_chat",[]],
  
  [anyone, "town_dweller_quest_meet_spy_in_enemy_town_chat", [
      (quest_get_slot, ":quest_giver", "qst_meet_spy_in_enemy_town", slot_quest_giver_troop),
      (str_store_troop_name, s4, ":quest_giver"),
    ],
    "I've been expecting you. Here they are, make sure they reach {s4} intact and without delay.", "town_dweller_quest_meet_spy_in_enemy_town_chat_2",[
      (call_script, "script_succeed_quest", "qst_meet_spy_in_enemy_town"),
      (call_script, "script_center_remove_walker_type_from_walkers", "$current_town", walkert_spy),
  ]],
  
  [anyone|plyr, "town_dweller_quest_meet_spy_in_enemy_town_chat_2", [],
    "Farewell.", "close_window",
    [
  ]],
  # Ryan END
  
  [anyone|plyr,"town_dweller_talk", [(party_slot_eq, "$current_town", slot_party_type, spt_village),
      (eq, "$info_inquired", 0)], "What can you tell me about this village?", "town_dweller_ask_info",[(assign, "$info_inquired", 1)]],
  [anyone|plyr,"town_dweller_talk", [(party_slot_eq, "$current_town", slot_party_type, spt_town),
      (eq, "$info_inquired", 0)], "What can you tell me about this town?", "town_dweller_ask_info",[(assign, "$info_inquired", 1)]],
  ###mainquest chief adda quest
  [anyone|plyr,"town_dweller_talk", [(eq, "$g_encountered_party", "p_town_11"),(check_quest_active,"qst_reginhard_donations"),(quest_slot_eq,"qst_reginhard_donations",slot_quest_current_state, 1),
      ], "Where can I find Adda?", "town_adda_ask_info",[]],
  [anyone,"town_adda_ask_info", [],
    "She lives on the wharf, {reg59?madam:sir}, where she trades in goods brought by merchants. It is one of the tall houses there.", "town_dweller_talk",[]],
  ###
  [anyone,"town_dweller_ask_info", [(str_store_party_name, s5, "$current_town"),
      (assign, reg4, 0),
      (try_begin),
        (party_slot_eq, "$current_town", slot_party_type, spt_town),
        (assign, reg4, 1),
      (try_end),
      (str_store_string, s6, "@This is the {reg4?town:village} of {s5}, {reg59?madam:sir}."),
      (str_clear, s10),
      (try_begin),
        (party_slot_eq, "$current_town", slot_town_lord, "trp_player"),
        (str_store_string, s10, "@{s6} Our {reg4?town:village} and the surrounding lands belong to you of course, my {reg59?lady:lord}."),
      (else_try),
        (party_get_slot, ":town_lord", "$current_town", slot_town_lord),
        (ge, ":town_lord", 0),
        (str_store_troop_name, s7, ":town_lord"),
        (store_troop_faction, ":town_lord_faction", ":town_lord"),
        (str_store_faction_name, s8, ":town_lord_faction"),
        (str_store_string, s10, "@{s6} Our {reg4?town:village} and the surrounding lands belong to {s7} of the {s8}."),
      (try_end),
      (str_clear, s5),
      (assign, ":number_of_goods", 0),
      (try_for_range, ":cur_good", trade_goods_begin, trade_goods_end),
        #(store_sub, ":cur_good_slot", ":cur_good", trade_goods_begin),
        #(val_add, ":cur_good_slot", slot_town_trade_good_productions_begin),
        #(party_get_slot, ":production", "$g_encountered_party", ":cur_good_slot"),
        
        (call_script, "script_center_get_production", "$g_encountered_party", ":cur_good"),
        (assign, ":production", reg0),
        (ge, ":production", 20),
        
        (str_store_item_name, s3, ":cur_good"),
        (try_begin),
          (eq, ":number_of_goods", 0),
          (str_store_string, s5, s3),
        (else_try),
          (eq, ":number_of_goods", 1),
          (str_store_string, s5, "@{s3} and {s5}"),
        (else_try),
          (str_store_string, s5, "@{!}{s3}, {s5}"),
        (try_end),
        (val_add, ":number_of_goods", 1),
      (try_end),
      (try_begin),
        (gt, ":number_of_goods", 0),
        (assign, reg20, 1),
      (else_try),
        (assign, reg20, 0),
      (try_end),
      
      (str_store_string, s11, "@{reg20?We mostly produce {s5} here:We don't produce much here these days}. " +
      "If you would like to learn more, you can speak with our {reg4?mayor:village elder}. He is nearby, right over there."),
    ],
    "{!}{s10} {s11}", "close_window",[]],
  
  [anyone|plyr,"town_dweller_talk", [(party_slot_eq, "$current_town", slot_party_type, spt_village),
      (eq, "$welfare_inquired", 0)], "How is life here?", "town_dweller_ask_situation",[(assign, "$welfare_inquired", 1)]],
  [anyone|plyr,"town_dweller_talk", [(party_slot_eq, "$current_town", slot_party_type, spt_town),
      (eq, "$welfare_inquired", 0)], "How is life here?", "town_dweller_ask_situation",[(assign, "$welfare_inquired", 1)]],
  
  
  [anyone,"town_dweller_ask_situation", [(call_script, "script_agent_get_town_walker_details", "$g_talk_agent"),
      (assign, ":walker_type", reg0),
      (eq, ":walker_type", walkert_needs_money),
      (party_slot_eq, "$current_town", slot_party_type, spt_village)],
    "Disaster has struck my family, {reg59?madam:sir}. We have no land of our own, and the others have no money to pay for our labor, or even to help us. My poor children lie at home hungry and sick. I don't know what we'll do.", "town_dweller_poor",[]],
  
  [anyone,"town_dweller_ask_situation", [(call_script, "script_agent_get_town_walker_details", "$g_talk_agent"),
      (assign, ":walker_type", reg0),
      (eq, ":walker_type", walkert_needs_money)],
    "My life is miserable, {reg59?madam:sir}. I haven't been able to find a job for months, and my poor children go to bed hungry each night. " +
    "My neighbours are too poor themselves to help me.", "town_dweller_poor",[]],
  
  [anyone|plyr,"town_dweller_poor", [(store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", 300),
    ],
    "Then take these 300 peningas. I hope this will help you and your family.", "town_dweller_poor_paid",
    [(troop_remove_gold, "trp_player", 300),
  ]],
  
  [anyone|plyr,"town_dweller_poor", [],
    "Then clearly, you must travel somewhere else or learn another trade.", "town_dweller_poor_not_paid",[]],
  
  [anyone,"town_dweller_poor_not_paid", [], "Yes, {reg59?madam:sir}. I will do as you say.", "close_window",[]],
  
  [anyone,"town_dweller_poor_paid", [], "{reg59?My good lady:My lord}, " +
    "you are so good and generous. I will tell everyone how you helped us.", "close_window",
    [(call_script, "script_change_player_relation_with_center", "$g_encountered_party", 1),
      (call_script, "script_agent_get_town_walker_details", "$g_talk_agent"),
      (assign, ":walker_no", reg2),
      (call_script, "script_center_set_walker_to_type", "$g_encountered_party", ":walker_no", walkert_needs_money_helped),
  ]],
  
  [anyone,"town_dweller_ask_situation", [(call_script, "script_agent_get_town_walker_details", "$g_talk_agent"),
      (assign, ":walker_type", reg0),
      (eq, ":walker_type", walkert_needs_money_helped)
    ],
    "Thank you for your kindness, {reg59?madam:sir}. With your help, our lives will be better. I will pray for you every day.", "close_window",[]],
  
  [anyone,"town_dweller_ask_situation", [(neg|party_slot_ge, "$current_town", slot_town_prosperity, 30)],
    "Times are hard, {reg59?madam:sir}. We work hard all day, yet we go to sleep hungry most nights.", "town_dweller_talk",[]],
  
  [anyone,"town_dweller_ask_situation", [(neg|party_slot_ge, "$current_town", slot_town_prosperity, 70)],
    "Times are hard, {reg59?madam:sir}, but we must count our blessings.", "town_dweller_talk",[]],
  [anyone,"town_dweller_ask_situation", [],
    "We are not doing too badly, {reg59?madam:sir}. We must count our blessings.", "town_dweller_talk",[]],
  
  
  [anyone|plyr,"town_dweller_talk", [], "What is your trade?", "town_dweller_ask_trade",[]],
  
  [anyone,"town_dweller_ask_trade", [
      (call_script, "script_town_walker_occupation_string_to_s14", "$g_talk_agent"),
    ],
    "{!}{s14}", "town_dweller_talk",[]],
  
  
  
  [anyone|plyr,"town_dweller_talk", [(eq, "$rumors_inquired", 0)], "What is the latest rumor around here?", "town_dweller_ask_rumor",[(assign, "$rumors_inquired", 1)]],
  [anyone,"town_dweller_ask_rumor", [(neg|party_slot_ge, "$current_town", slot_center_player_relation, -5)], "I don't know anything that would be of interest to you.", "town_dweller_talk",[]],
  
  [anyone,"town_dweller_ask_rumor", [(store_mul, ":rumor_id", "$current_town", 197),
      (val_add,  ":rumor_id", "$g_talk_agent"),
      (call_script, "script_get_rumor_to_s61", ":rumor_id"),
      (gt, reg0, 0)], "{!}{s61}", "town_dweller_talk",[]],
  
  [anyone,"town_dweller_ask_rumor", [], "I haven't heard anything interesting lately.", "town_dweller_talk",[]],
  
  [anyone|plyr,"town_dweller_talk", [], "[Leave]", "close_window",[]],
  
  [anyone,"start", [(eq, "$talk_context", 0),
      # (this_or_next|is_between,"$g_talk_troop",regular_troops_begin, regular_troops_end), make default for player town
      # (is_between,"$g_talk_troop","trp_sea_raider_leader", "trp_bandit_leaders_end"),
      (party_slot_eq,"$current_town",slot_town_lord, "trp_player"),
      ], "Yes, {reg59?madam:sir}?", "player_castle_guard_talk",[]],
  [anyone|plyr,"player_castle_guard_talk", [], "How goes the watch, soldier?", "player_castle_guard_talk_2",[]],
  
  [anyone,"player_castle_guard_talk_2", [], "All is quiet, {reg59?madam:sir}. Nothing to report.", "player_castle_guard_talk_3",[]],
  [anyone|plyr,"player_castle_guard_talk_3", [], "Good. Keep your eyes open.", "close_window",[]],
  
  
  [anyone,"start", [(eq, "$talk_context", 0),
      (this_or_next|is_between,"$g_talk_troop",regular_troops_begin, regular_troops_end),
      (is_between,"$g_talk_troop","trp_sea_raider_leader", "trp_bandit_leaders_end"),
      (neq, "$g_talk_troop","trp_irish_prison_guard"),
      (neq, "$g_talk_troop","trp_angle_prison_guard"),
      (neq, "$g_talk_troop","trp_scotch_prison_guard"),
      (neq, "$g_talk_troop","trp_saxon_prison_guard"),
      (neq, "$g_talk_troop","trp_briton_prison_guard"),
      (neq, "$g_talk_troop","trp_norse_prison_guard"),
      (is_between,"$g_encountered_party_faction",kingdoms_begin, kingdoms_end),
      (eq, "$players_kingdom", "$g_encountered_party_faction"),
      (troop_slot_ge, "trp_player", slot_troop_renown, 200),
      (str_store_party_name, s10, "$current_town"),
      ], "Good day, {reg59?madame:sir}. Always an honor to have you here in {s10}.", "close_window",[]],
  
  [anyone,"start", [(eq, "$talk_context", 0),
      (this_or_next|is_between,"$g_talk_troop",regular_troops_begin, regular_troops_end),
      (is_between,"$g_talk_troop","trp_sea_raider_leader", "trp_bandit_leaders_end"),
      (neq, "$g_talk_troop","trp_irish_prison_guard"),
      (neq, "$g_talk_troop","trp_angle_prison_guard"),
      (neq, "$g_talk_troop","trp_scotch_prison_guard"),
      (neq, "$g_talk_troop","trp_saxon_prison_guard"),
      (neq, "$g_talk_troop","trp_briton_prison_guard"),
      (neq, "$g_talk_troop","trp_norse_prison_guard"),
      (neq, "$g_talk_troop","trp_irish_deserter"),
      (neq, "$g_talk_troop","trp_angle_deserter"),
      (neq, "$g_talk_troop","trp_scotch_deserter"),
      (neq, "$g_talk_troop","trp_saxon_deserter"),
      (neq, "$g_talk_troop","trp_briton_deserter"),
      (neq, "$g_talk_troop","trp_norse_deserter"),
      (is_between,"$g_encountered_party_faction",kingdoms_begin, kingdoms_end),
      (store_random_in_range, ":rand", 0,3),
      (str_clear, s44),
      (try_begin),
        (eq, ":rand", 0),
        (str_store_string, s44, "@Mind your manners within the walls and we'll have no trouble."),
      (else_try),
        (eq, ":rand", 1),
        (str_store_string, s44, "@Bugger off, stranger. Can't you see I am busy watching that plump wench over there?"),
      (else_try),
        (str_store_string, s44, "@Make sure to keep your hands in the open, and no funny business around merchants' booths."),
      (try_end),
      ], "{!}{s44}", "close_window",[]],
  
  [anyone,"start", [(eq, "$talk_context", tc_court_talk),
      (this_or_next|is_between,"$g_talk_troop",regular_troops_begin, regular_troops_end),
      (is_between,"$g_talk_troop","trp_sea_raider_leader", "trp_bandit_leaders_end"),
      (is_between,"$g_encountered_party_faction",kingdoms_begin, kingdoms_end),
      (party_slot_eq,"$current_town",slot_town_lord, "trp_player"),
      ], "Your orders, {reg59?my lady:my lord}?", "hall_guard_talk",[]],
  
  [anyone,"start", [(eq, "$talk_context", tc_court_talk),
      (this_or_next|is_between,"$g_talk_troop",regular_troops_begin, regular_troops_end),
      (is_between,"$g_talk_troop","trp_sea_raider_leader", "trp_bandit_leaders_end"),
      (is_between,"$g_encountered_party_faction",kingdoms_begin, kingdoms_end),
      (party_get_slot,":lord","$g_encountered_party",slot_town_lord),
      (gt,":lord",0),
      (assign,":is_here",0),
      (try_for_agents,":agent"),
        (agent_get_troop_id,":troop",":agent"),
        (eq,":troop",":lord"),
        (assign,":is_here",1),
      (try_end),
      (eq,":is_here",0),
      (assign,"$hero_requested_to_learn_location",":lord"),
      ], "We are not supposed to talk while on guard, {reg59?madam:sir}.", "court_guard_ask_location",[]],
  
  [anyone|plyr,"court_guard_ask_location", [], "I just wanted to ask about your lord. Do you know where he is now?", "court_guard_ask_location_2",[]],
  [anyone|plyr,"court_guard_ask_location", [], "I'll be on my way, then.", "close_window",[]],
  
  [anyone,"court_guard_ask_location_2",[
      (call_script, "script_update_troop_location_notes", "$hero_requested_to_learn_location", 1),
      (call_script, "script_get_information_about_troops_position", "$hero_requested_to_learn_location", 0),
    ],
    "{s1}^^Now forgive me. I must get back to my duties.", "close_window",[]],
  
  [anyone,"start", [(eq, "$talk_context", tc_court_talk),
      (this_or_next|is_between,"$g_talk_troop",regular_troops_begin, regular_troops_end),
      (is_between,"$g_talk_troop","trp_sea_raider_leader", "trp_bandit_leaders_end"),
      (is_between,"$g_encountered_party_faction",kingdoms_begin, kingdoms_end),
      ], "We are not supposed to talk while on guard, {reg59?madam:sir}.", "close_window",[]],
  
  [anyone|plyr,"hall_guard_talk", [], "Stay on duty and let me know if anyone comes to see me.", "hall_guard_duty",[]],
  [anyone,"hall_guard_duty", [], "Yes, {reg59?my lady:my lord}. As you wish.", "close_window",[]],
  
  # [anyone|plyr,"hall_guard_talk", [
      # (eq, 1, 0),
      # ], "I want you to arrest this man immediately!", "hall_guard_arrest",[]],
  # [anyone,"hall_guard_arrest", [], "Who do you want arrested {reg59?madam:sir}?", "hall_guard_arrest_2",[]],
  # [anyone|plyr,"hall_guard_arrest_2", [], "Ah, never mind my high spirits lads.", "close_window",[]],
  # [anyone|plyr,"hall_guard_arrest_2", [], "Forget it. I will find another way to deal with this.", "close_window",[]],
  
  [anyone,"enemy_defeated", [], "Arggh! I hate this.", "close_window",[]],
  
  [anyone,"party_relieved", [], "Thank you for helping us against those bastards.", "close_window",[]],
  
  [anyone,"start", [(eq,"$talk_context", tc_party_encounter),(store_encountered_party, reg(5)),(party_get_template_id,reg(7),reg(5)),(this_or_next|eq,reg(7),"pt_steppe_bandits"), (this_or_next|eq,reg(7),"pt_taiga_bandits"), (eq,reg(7),"pt_sea_raiders2")],
    "I will drink from your skull!", "battle_reason_stated",[(play_sound,"snd_encounter_sea_raiders")]],
  
  ######################################
  # GENERIC MEMBER CHAT
  ######################################
  
  [anyone,"member_chat", [], "Your orders, {reg59?madam:sir}?", "regular_member_talk",[]],
  [anyone|plyr,"regular_member_talk", [], "Tell me about yourself.", "view_regular_char_requested",[]],
  [anyone,"view_regular_char_requested", [], "Aye, {reg59?madam:sir}. Let me tell you all there is to know about me.", "do_regular_member_view_char",[[change_screen_view_character]]],
  [anyone,"do_regular_member_view_char", [], "Anything else?", "regular_member_talk",[]],
  #####caliacas_son
  [anyone|plyr,"regular_member_talk", [(store_conversation_troop,"$g_talk_troop"),(eq, "$g_talk_troop", "trp_caliacas_son"),], "Bran, what is your story?", "caliacas_son1",[]],
  [anyone|plyr,"regular_member_talk", [(store_conversation_troop,"$g_talk_troop"),(eq, "$g_talk_troop", "trp_caliacas_son"),], "Bran, are you happy in my shield wall?", "caliacas_son2",[]],
  
  [anyone,"caliacas_son1", [], "Not much to tell. I am the ninth child of Caliacas, the smallest. My father is more of an influential man than a rich one. He gave me two options: join you or enter the monastery. " +
    "Honestly, I'd rather fight and have the opportunity to get rich than be locked up behind stone walls, so I did not think long! And here I am!", "regular_member_talk",[]],
  [anyone,"caliacas_son2", [
      (str_clear, s4),
    ],
    "{!}{s4}", "regular_member_talk",[
      (call_script, "script_get_player_party_morale_values"),
      (assign, ":target_morale", reg0),
      (try_begin),
        (ge, ":target_morale", 70),
        (str_store_string, s4, "@I'm very happy. You're a good leader who knows how to keep his men happy!"),
      (else_try),
        (ge, ":target_morale", 50),
        (str_store_string, s4, "@I'm happy to be here, things are going well, and I think of getting enough wealth to buy a farm and pay the dowry on a good lass."),
      (else_try),
        (ge, ":target_morale", 30),
        (str_store_string, s4, "@Well ... I guess things could be better. If things continue on in this way, I will think about leaving this shield wall."),
      (else_try),
        (str_store_string, s4, "@Not happy, {playername}. Honestly, I think you should improve the morale of this shield wall, or you will have very serious problems soon."),
      (try_end),
  ]],
  ###
  [anyone|plyr,"regular_member_talk", [], "Nothing. Keep moving.", "close_window",[]],
  
  
  
  
  
  ######################################
  # GENERIC PARTY ENCOUNTER
  ######################################
  
  [anyone,"start", [(eq,"$talk_context",tc_party_encounter),
      (gt,"$encountered_party_hostile",0),
      (encountered_party_is_attacker),
    ],
    "You have no chance against us. Surrender now or we will kill you all...", "party_encounter_hostile_attacker",
    [(try_begin),
        (eq,"$g_encountered_party_template","pt_steppe_bandits"),
        (play_sound, "snd_encounter_steppe_bandits"),
      (try_end)]],
  #  [anyone|plyr,"party_encounter_hostile_attacker", [
  #                    ],
  #   "I will pay you 1000 peningas if you just let us go.", "close_window", []],
  [anyone|plyr,"party_encounter_hostile_attacker", [
    ],
    "We will fight you to the end!", "close_window", []],
  [anyone|plyr,"party_encounter_hostile_attacker", [
    ],
    "Don't attack! We surrender.", "close_window", [(assign,"$g_player_surrenders",1)]],
  
  [anyone,"start", [(eq,"$talk_context",tc_party_encounter),
      (neg|encountered_party_is_attacker),
    ],
    "What do you want?", "party_encounter_hostile_defender",
    []],
  
  [anyone|plyr,"party_encounter_hostile_defender", [],
    "Surrender or die!", "party_encounter_hostile_ultimatum_surrender", [
      
  ]],
  
  #post 0907 changes begin
  [anyone,"party_encounter_hostile_ultimatum_surrender", [],
    "{!}{s43}", "close_window", [
      (call_script, "script_lord_comment_to_s43", "$g_talk_troop", "str_lord_challenged_default"),
  ]],
  #post 0907 changes end
  
  [anyone|plyr,"party_encounter_hostile_defender", [],
    "Nothing. We'll leave you in peace.", "close_window", [(assign, "$g_leave_encounter",1)]],
  
  
  
  
  
  
  
  
  [anyone|auto_proceed, "start",
    [
      (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      (check_quest_active, "qst_collect_men"),
      #(neq, "$talk_context", tc_tavern_talk),
      #(neq, "$talk_context", tc_back_alley),
      (eq, "$talk_context", tc_merchants_house),
    ],
    "{!}.", "merchant_end", []],
  
  [anyone, "merchant_end", [],
    "You should go ask at Doccinga. The village is quite near. You need to talk to Thonkrik.", "close_window", []],
  
  [anyone, "start",
    [
      (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      (eq, "$talk_context", tc_merchants_house),
      (check_quest_active, "qst_save_town_from_bandits"),
      
      (store_div, ":number_of_civilian_loses_div_2", "$number_of_civilian_loses", 2),
      
      (try_begin),
        (eq, "$g_killed_first_bandit", 1),
        (store_add, ":player_success", "$number_of_bandits_killed_by_player", 1),
      (else_try),
        (store_add, ":player_success", "$number_of_bandits_killed_by_player", 0),
      (try_end),
      
      (val_sub, ":player_success", ":number_of_civilian_loses_div_2"),
      (val_max, ":player_success", 0),
      
      (call_script, "script_change_player_relation_with_center", "$g_starting_town", ":player_success"),
      
      (try_begin),
        (eq, "$g_killed_first_bandit", 1),
        (gt, "$number_of_bandits_killed_by_player", 2),
        (str_store_string, s3, "str_you_fought_well_at_town_fight_survived"),
        (troop_add_gold, "trp_player", 200),
      (else_try),
        (eq, "$g_killed_first_bandit", 1),
        (gt, "$number_of_bandits_killed_by_player", 0),
        (str_store_string, s3, "str_you_fought_normal_at_town_fight_survived"),
        (troop_add_gold, "trp_player", 200),
      (else_try),
        (eq, "$g_killed_first_bandit", 1),
        (eq, "$number_of_bandits_killed_by_player", 0),
        (str_store_string, s3, "str_you_fought_bad_at_town_fight_survived"),
        (troop_add_gold, "trp_player", 100),
      (else_try),
        (eq, "$g_killed_first_bandit", 0),
        (ge, "$number_of_bandits_killed_by_player", 2),
        (str_store_string, s3, "str_you_fought_well_at_town_fight"),
        (troop_add_gold, "trp_player", 100),
      (else_try),
        (str_store_string, s3, "str_you_wounded_at_town_fight"),
        (troop_add_gold, "trp_player", 100),
      (try_end),
      
      (try_begin),
        (ge, "$number_of_civilian_loses", 1),
        (assign, reg0, "$number_of_civilian_loses"),
        (str_store_string, s2, "str_unfortunately_reg0_civilians_wounded_during_fight_more"),
      (else_try),
        (eq, "$number_of_civilian_loses", 1),
        (assign, reg0, "$number_of_civilian_loses"),
        (str_store_string, s2, "str_unfortunately_reg0_civilians_wounded_during_fight"),
      (else_try),
        (str_store_string, s2, "str_also_one_another_good_news_is_any_civilians_did_not_wounded_during_fight"),
      (try_end),
      
      (call_script, "script_succeed_quest", "qst_save_town_from_bandits"),
      (call_script, "script_end_quest", "qst_save_town_from_bandits"),
    ],
    "{s3}{s2}", "merchant_quest_4e",
    []],
  
  [anyone|plyr,"merchant_quest_4e",
    [
      (try_begin),
        (eq, "$g_killed_first_bandit", 1),
        (gt, "$number_of_bandits_killed_by_player", 2),
        (str_store_string, s1, "str_you_fought_well_at_town_fight_survived_answer"),
      (else_try),
        (eq, "$g_killed_first_bandit", 1),
        (gt, "$number_of_bandits_killed_by_player", 0),
        (str_store_string, s1, "str_you_fought_normal_at_town_fight_survived_answer"),
      (else_try),
        (eq, "$g_killed_first_bandit", 1),
        (eq, "$number_of_bandits_killed_by_player", 0),
        (str_store_string, s1, "str_you_fought_bad_at_town_fight_survived_answer"),
      (else_try),
        (eq, "$g_killed_first_bandit", 0),
        (ge, "$number_of_bandits_killed_by_player", 2),
        (str_store_string, s1, "str_you_fought_well_at_town_fight_answer"),
      (else_try),
        (str_store_string, s1, "str_you_wounded_at_town_fight_answer"),
      (try_end),
    ],
    "{!}{s1}", "merchant_finale",
    [
      (assign, "$dialog_with_merchant_ended", 1),
  ]],
  
  #[anyone|auto_proceed, "start",
  #[
  #  (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
  #  (eq, "$talk_context", tc_merchants_house),
  #  (check_quest_finished, "qst_save_town_from_bandits"),
  #],
  #"{!}.", "merchant_all_quest_completed",
  #[
  #]],
  
  
  [anyone|plyr,"merchant_quest_4e",
    [
    ],
    "The Heavens alone grant us victory.", "merchant_finale",
    [  (assign, "$dialog_with_merchant_ended", 1),
  ]],
  
  [anyone|plyr,"merchant_quest_4e",
    [],
    "I'm glad to see that you're alive, too.", "merchant_finale",
    [
      (assign, "$dialog_with_merchant_ended", 1),
  ]],
  
  [anyone,"merchant_finale", [
      (faction_get_slot, ":faction_leader", "$g_encountered_party_faction", slot_faction_leader),
      (str_store_troop_name, s5, ":faction_leader"),
    ],
    "Yes, yes... Now, a couple of my boys have the watch captain pinned down in a back room with a knife at his throat. I'll need to go drag him before {s5} and explain what this breach of the peace is all about. You don't need to be part of that, though. I'll tell you what -- if all goes well, I'll meet you in the mead hall again shortly and let you know how it all came out. If you don't see me in the mead hall but instead see my head on a spike over the city gate, I'll assume you know enough to stay out of town for a while and forget this whole episode ever happened. So -- hopefully we'll meet again!", "close_window",
    [
      (assign, "$g_do_one_more_meeting_with_merchant", 2),
      # (assign, "$g_do_one_more_meeting_with_merchant", 1), no need to this, do not open this line, it is already assigning while leaving mission.
      # (jump_to_menu, "mnu_town"),
      # (finish_mission, 0),
  ]],
  
  
  ##chief cambia VC intro
  [anyone, "start",
    [
      (is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
      (eq, "$talk_context", tc_merchants_house),
      (neg|check_quest_finished, "qst_collect_men"),
      (eq, "$current_startup_quest_phase", 1),
      
      ##    (try_begin),
      ##      (eq, "$g_killed_first_bandit", 1),
      ##      (str_store_string, s1, "str_are_you_all_right"),
      ##    (else_try),
      (str_store_string, s1, "str_you_are_awake"),
      ##    (try_end),
    ],
    "{!}{s1}", "merchant_quest_1_prologue_11",
    []],
  
  [anyone|plyr,"merchant_quest_1_prologue_11",
    [
    ],
    "Who are you? How did I get here? Where am I?", "merchant_quest_1_prologue_1",[]],
  
  [anyone|plyr,"merchant_quest_1_prologue_11",
    [
    ],
    "My head hurts! I do not remember anything since I fell overboard from the boat.", "merchant_quest_1_prologue_1",
    [
  ]],
  
  [anyone,"merchant_quest_1_prologue_1",
    [
    ],
    "You have been close to death, unconscious for two weeks. Doccinga fishermen found you near the coast, clinging to a plank. You were barely breathing, and your body was covered with wounds. They brought you here so that I would heal you.", "merchant_quest_1_prologue_22",
    []],
  
  [anyone|plyr,"merchant_quest_1_prologue_22",
    [
    ],
    "Doccinga? Then I am in Friese! Are you the old sorcerer, the man who can cure all diseases?", "merchant_quest_1_prologue_2",[]],
  
  [anyone|plyr,"merchant_quest_1_prologue_22",
    [
    ],
    "I've heard enough. I will go to Doccinga and ask them about the other passengers. Farewell.", "merchant_player_go",
    [
  ]],
  
  [anyone,"merchant_quest_1_prologue_2",
    [],
    "No. One man only could claim such fame. People from around the world came in search of cures at his door. They were so numerous that came up the trails to Doccinga! But that man died a year ago. I am Aebbe, his son, a simple healer.", "merchant_quest_1_prologue_33",[]],
  
  
  [anyone|plyr,"merchant_quest_1_prologue_33",
    [
    ],
    "A year ago, you say? Damn, I've lost everything! This trip has been for nothing!", "merchant_quest_1_prologue_3",[]],
  
  [anyone|plyr,"merchant_quest_1_prologue_33",
    [
    ],
    "I've heard enough. I will go to Doccinga and ask them about the other passengers. Farewell.", "merchant_player_go",
    [
  ]],
  
  [anyone,"merchant_quest_1_prologue_3",
    [],
    "Many, like you, have been here since the death of my father, leaving everything for the promise of a cure that I cannot give them. I'm sorry, but the skills of my father died with him.", "merchant_quest_1a",[]],
  
  [anyone|plyr,"merchant_quest_1a",
    [
    ],
    "Do you know if the fishermen found more people? Maybe my mother is still alive...", "merchant_quest_1b",[]],
  
  [anyone|plyr,"merchant_quest_1a",
    [
    ],
    "I need to talk to the fishermen and ask them about the other Woden Ric passengers. Farewell.", "merchant_player_go",
    [
  ]],
  
  [anyone,"merchant_quest_1b",
    [
    ],
    "They brought only you here. I don't know more. You should go ask in Doccinga. The village is near. You need to talk to Thonkrik.", "merchant_quest_1c",
    [
      (str_store_troop_name, s9, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_village_150"),
      (str_store_string, s2, "@{s9} told me that I could find answers in {s3}. I need to ask one Thonkrik."),
      
      (call_script, "script_start_quest", "qst_collect_men", "$g_talk_troop"),
      
      (party_get_position, pos1, "$current_town"),
  ]],
  
  [anyone,"merchant_player_go",
    [
    ],
    "Well, aren't you impatient! You should go and ask in Doccinga. The village is near. You need to talk to Thonkrik.", "merchant_quest_1c",
    [
      (str_store_troop_name, s9, "$g_talk_troop"),
      (str_store_party_name_link, s3, "p_village_150"),
      (str_store_string, s2, "@{s9} told me that I could find answers in {s3}. I need to ask one Thonkrik."),
      
      (call_script, "script_start_quest", "qst_collect_men", "$g_talk_troop"),
      
      (party_get_position, pos1, "$current_town"),
  ]],
  
  [anyone|plyr,"merchant_quest_1c",
    [
    ],
    "Very good, healer. I'll talk to Thonkrik from Doccinga. Farewell.", "merchant_quest_1d",[]],
  
  [anyone,"merchant_quest_1d",
    [
      (str_store_party_name, s1, "$current_town"),
    ],
    "{s1} is near here. Good luck, foreigner. Thonkrik is a good man. He will help you.", "close_window",
    [
      (assign, "$dialog_with_merchant_ended", 1),
  ]],
  
  
  ###chief cambios acaban
  
  
  #[anyone, "merchant_all_quest_completed",
  #[
  #],
  #"TODO-STARTUP : You can leave now.", "close_window",
  #[
  #]],
  
  [anyone,"start", [], "Surrender or die. Make your choice", "battle_reason_stated",[]],
  [anyone|plyr,"battle_reason_stated", [], "I am not afraid of you. I will fight.", "close_window",[(call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  #vikings chief#############
  [anyone|plyr,"battle_reason_stated", [], "Do you know who you are talking to? I will not kill you if you join me.", "raiders_bribe1",
    []],
  [anyone,"raiders_bribe1", [
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (gt, ":player_renown", 180), # you have to be someone
      (ge, "$player_honor", -70),
      (store_random_in_range,":rand",0,20),
      (le,":rand",15),
    ], "I care very little about who you are. It's time for you to die.","close_window",
    [(call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  [anyone,"raiders_bribe1", [
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (le, ":player_renown", 180), # you have to be someone
    ], "I care very little who you are. It's time for you to die.","close_window",
    [
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  [anyone,"raiders_bribe1", [
      (party_slot_eq, "$g_encountered_party", slot_party_bribed, 0),
      (lt, "$player_honor", -70),
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (gt, ":player_renown", 180), # you have to be someone
      (store_random_in_range,":rand1",0,20),
      (gt,":rand1",16),
      (store_party_size_wo_prisoners, ":size","$g_encountered_party"),
      (store_party_size_wo_prisoners, ":size1","p_main_party"),
      (lt,":size", 40),
      (val_mul, ":size", 2),
      (gt, ":size1", ":size"),
      ], "Yes, I've heard of you. They say your men get the most loot. Forgive us, and we will be delighted to join such a fierce leader.","raiders_bribe1g",[]],
  
  [anyone,"raiders_bribe1",[
      (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
      (gt, ":player_renown", 180), # you have to be someone
      (store_encountered_party,":party"),
      (assign, ":total", 0),
      (party_get_num_companion_stacks, ":num_stacks",":party"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop",":party",":i_stack"),
        (party_stack_get_size, ":stack_size",":party",":i_stack"),
        (store_character_level, ":troop_level", ":stack_troop"),
        (store_mul, ":troop_total",":troop_level", ":stack_size"),
        (val_add, ":total", ":troop_total"),
      (try_end),
      (store_mul,reg0,":total",14),
      (assign, "$temp", reg0),
      ],"We would consider your offer if you better it by {reg0} peningas.","raiders_bribe1e",[]],
  
  [anyone|plyr,"raiders_bribe1e",
    [
      (store_troop_gold, ":gold", "trp_player"),
      (ge, ":gold", "$temp"),
      (party_can_join),
    ],"What? Would I let such a trifle spoil our friendship? Welcome to my army.","close_window",
    [
      (troop_remove_gold, "trp_player", "$temp"),
      (party_join),
      (call_script, "script_change_player_honor", -8),
      (call_script, "script_change_player_party_morale", -8),
      (assign, "$g_leave_encounter", 1)
  ]],
  [anyone|plyr,"raiders_bribe1e",[        (store_troop_gold, ":gold", "trp_player"),
      (le, ":gold", "$temp"),
      ],"I don't have enough money...","raiders_bribe12",[]],
  [anyone|plyr,"raiders_bribe1e",[],"Never mind. You fellows are just plain crazy.","raiders_bribe12",[]],
  
  [anyone|plyr,"raiders_bribe1g",
    [
      (party_can_join),
    ],"You fellows won't make my crew any uglier. Welcome!","close_window",
    [
      (party_join),
      (call_script, "script_change_player_honor", -8),
      (call_script, "script_change_player_party_morale", -8),
      (assign, "$g_leave_encounter", 1)
  ]],
  
  [anyone|plyr,"raiders_bribe1g",[],"Never mind. I have my reputation to consider.","raiders_bribe13",[]],
  
  [anyone,"raiders_bribe12", [
    ], "Now why would you ask us to turn insult into injury? You're the one that's crazy.","close_window",
    [(party_set_slot, "$g_encountered_party", slot_party_bribed, 1),
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  [anyone,"raiders_bribe13", [
    ], "It's your head that you should be considering. Not that it's very good at that. At 'em, boys!","close_window",
    [(party_set_slot, "$g_encountered_party", slot_party_bribed, 1),
      (call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  #bandit bribery end########
  
  
  
  [anyone,"start", [], "Hello. What can I do for you?", "free",[]],
  [anyone|plyr,"free", [[neg|in_meta_mission]], "Tell me about yourself.", "view_char_requested",[]],
  [anyone,"view_char_requested", [], "Very well, listen to this...", "view_char",[[change_screen_view_character]]],
  [anyone,"view_char", [], "Anything else?", "free",[]],
  
  [anyone|plyr,"end", [], "[Done]", "close_window",[]],
  
  [anyone|plyr,"start", [], "Drop your weapons and surrender if you want to live", "threaten_1",[]],
  [anyone,"threaten_1", [], "We will fight you first", "end",[(call_script, "script_make_kingdom_hostile_to_player", "$g_encountered_party_faction", -3),
      [encounter_attack]]],
  
  #  [anyone|plyr,"free", [[partner_is_mercmaster]], "I need to hire some mercenaries.", "mercenaries_requested",[]],
  #  [anyone,"mercenaries_requested", [], "I have the toughest fighters in all the Northlands.", "buy_mercenaries",[[change_screen_buy_mercenaries]]],
  #  [anyone,"buy_mercenaries", [], "Anything else?", "free",[]],
  
  #  [anyone|plyr,"free", [[partner_is_recruitable]], "I need a capable sergeant like yourself. How much do you ask to work for me?", "employ_mercenary_requested",[]],
  #  [anyone,"employ_mercenary_requested", [[store_mercenary_price,0],[store_mercenary_wage,1]], "I want {reg0} peningas now and {reg1} peningas as monthly payment.", "employ_mercenary_2",[]],
  #  [anyone|plyr,"employ_mercenary_2", [], "I see I need to think of this.", "employ_mercenary_giveup",[]],
  #  [anyone|plyr,"employ_mercenary_2", [[neg|hero_can_join]], "I don't have any more room in my party right now. I will talk to you again later.", "employ_mercenary_giveup",[]],
  #  [anyone|plyr,"employ_mercenary_2", [[player_gold_ge,reg(0)],[hero_can_join]], "That's fine. Here's the {reg0} peningas. From now on, you work for me.", "employ_mercenary_commit",[[troop_remove_gold, "trp_player",reg(0)],[recruit_mercenary]]],
  #  [anyone,"employ_mercenary_giveup", [], "Suits me.", "free",[]],
  #  [anyone,"employ_mercenary_commit", [], "You got yourself the best fighter in the land.", "end",[]],
  
  
  [anyone,"member_direct_campaign", [], "Yes, {reg59?my lady:my lord}. Which message do you wish to send to the vassals?", "member_direct_campaign_choice",
    []],
  
  
  
  [anyone|plyr,"member_direct_campaign_choice",
    [
      #     (eq, "$g_talk_troop_faction", "$players_kingdom"),
      (this_or_next|neg|faction_slot_ge, "$players_kingdom", slot_faction_marshal, active_npcs_begin),
      (eq, "$players_kingdom", "fac_player_supporters_faction"),
      (this_or_next|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_default),
      (faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_feast),
    ],
    "I want to start a new campaign. Let us assemble the army here.", "member_direct_campaign_call_to_arms_verify",
    [
      (faction_get_slot, ":old_marshal", "$players_kingdom", slot_faction_marshal),
      (try_begin),
        (ge, ":old_marshal", 0),
        (troop_get_slot, ":old_marshal_party", ":old_marshal", slot_troop_leaded_party),
        (party_is_active, ":old_marshal_party"),
        (party_set_marshal, ":old_marshal_party", 0),
      (try_end),
      
      (faction_set_slot, "$players_kingdom", slot_faction_marshal, "trp_player"),
  ]],
  
  [anyone|plyr,"member_direct_campaign_choice",
    [
      #     (eq, "$g_talk_troop_faction", "$players_kingdom"),
      (faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_default),
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_feast),
    ],
    "I want to end the campaign and let everyone return home.", "member_give_order_disband_army_verify", []],
  
  [anyone|plyr,"member_direct_campaign_choice",
    [
      #     (eq, "$g_talk_troop_faction", "$players_kingdom"),
      (faction_slot_eq, "$players_kingdom", slot_faction_marshal, "trp_player"),
      (neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_feast),
      (check_quest_active, "qst_organize_feast"),
      (quest_get_slot, ":venue", "qst_organize_feast", slot_quest_target_center),
      (store_faction_of_party, ":venue_faction", ":venue"),
      (eq, ":venue_faction", "$players_kingdom"),
      (is_between, ":venue", walled_centers_begin, walled_centers_end),
      (str_store_party_name, s4, ":venue"),
    ],
    "I wish to invite the vassals of the realm to a feast at {s4}.", "member_give_order_invite_feast_verify", []],
  
  
  
  
  [anyone|plyr,"member_direct_campaign_choice",
    [
    ],
    "Never mind", "member_pretalk",
    []],
  
  
  
  
  [anyone,"member_give_order_invite_feast_verify", [],
    "Do you wish to invite the lords of the realm to a feast?", "member_give_order_invite_feast_verify_2",[]],
  
  [anyone|plyr,"member_give_order_invite_feast_verify_2", [], "Yes. It is time for us to strengthen the bonds that bring us together.", "member_give_order_invite_feast",[]],
  [anyone|plyr,"member_give_order_invite_feast_verify_2", [], "On second thought, this is perhaps not the time.", "member_pretalk",[]],
  
  [anyone,"member_give_order_invite_feast",
    [
      (quest_get_slot, ":venue", "qst_organize_feast", slot_quest_target_center),
      (str_store_party_name, s4, ":venue"),
    ],
    "All right, then I shall dispatch messengers informing the lords of the realm of your feast at {s4}.", "member_pretalk",
    [
      (quest_get_slot, ":venue", "qst_organize_feast", slot_quest_target_center),
      
      (assign, "$player_marshal_ai_state", sfai_feast),
      (assign, "$player_marshal_ai_object", ":venue"),
      (call_script, "script_decide_faction_ai", "$players_kingdom"),
      (assign, "$g_recalculate_ais", 1),
      (str_store_party_name, s4, ":venue"),
      
  ]],
  
  
  
  
  
  [anyone,"member_direct_campaign_call_to_arms_verify", [],
    "Do you wish to summon all lords for a new campaign?", "member_give_order_call_to_arms_verify_2",[]],
  
  [anyone|plyr,"member_give_order_call_to_arms_verify_2", [], "Yes. We must gather all our forces before we march on the enemy.", "member_give_order_call_to_arms",[]],
  [anyone|plyr,"member_give_order_call_to_arms_verify_2", [], "On second thought, it won't be necessary to summon everyone.", "member_pretalk",[]],
  
  [anyone,"member_give_order_call_to_arms",
    [],
    "All right, then I will send messengers and tell everyone to come here.", "member_pretalk",
    [
      (assign, "$player_marshal_ai_state", sfai_gathering_army),
      (assign, "$player_marshal_ai_object", "p_main_party"),
      (call_script, "script_decide_faction_ai", "$players_kingdom"),
      (assign, "$g_recalculate_ais", 1),
  ]],
  
  
  [anyone,"member_give_order_disband_army_verify", [],
    "Do you want to end the current campaign and release all lords from duty?", "member_give_order_disband_army_2",[]],
  
  [anyone|plyr,"member_give_order_disband_army_2", [], "Yes. We no longer need all our forces here.", "member_give_order_disband_army",[]],
  [anyone|plyr,"member_give_order_disband_army_2", [], "On second thought, it will be better to stay together for now.", "member_pretalk",[]],
  
  [anyone,"member_give_order_disband_army",
    [],
    "All right, I will let everyone know that they are released from duty.", "member_pretalk",
    [
      (assign, "$player_marshal_ai_state", sfai_default),
      (assign, "$player_marshal_ai_object", -1),
      (call_script, "script_decide_faction_ai", "$players_kingdom"),
      (assign, "$g_recalculate_ais", 1),
      
  ]],
  
  
  [anyone,"mayor_wealth_comparison_1",[
      
      (assign, ":wealthiest_center", "$g_encountered_party"),
      (assign, ":poorer_centers", 0),
      (assign, ":richer_centers", 0),
      
      (party_get_slot, ":wealthiest_center_wealth", "$g_encountered_party", slot_town_prosperity),
      (party_get_slot, ":mayor_center_wealth", "$g_encountered_party", slot_town_prosperity),
      
      (try_for_range, ":other_center", towns_begin, towns_end),
        (neq, ":other_center", "$g_encountered_party"),
        (party_get_slot, ":other_center_wealth", ":other_center", slot_town_prosperity),
        (try_begin),
          (gt, ":other_center_wealth", ":wealthiest_center_wealth"),
          (val_add, ":richer_centers", 1),
          (assign, ":wealthiest_center", ":other_center"),
          (assign, ":wealthiest_center_wealth", ":other_center_wealth"),
        (else_try),
          (gt, ":other_center_wealth", ":mayor_center_wealth"),
          (val_add, ":richer_centers", 1),
        (else_try),
          (val_add, ":poorer_centers", 1),
        (try_end),
      (try_end),
      
      (assign, reg4, ":richer_centers"),
      (assign, reg5, ":poorer_centers"),
      (str_store_party_name, s5, "$g_encountered_party"),
      (str_store_party_name, s4, ":wealthiest_center"),
      
      ], "Overall, the wealthiest center in the Northlands is known to be {s4}. Here in {s5}, we are poorer than {reg4} centers, and richer than {reg5}.", "mayor_wealth_comparison_2",[
  ]],
  #Production of this town
  #Production of the hinterland
  #Volume of trade
  
  [anyone,"mayor_wealth_comparison_2",[
      
      (assign, ":wealthiest_center", "$g_encountered_party"),
      (assign, ":poorer_centers", 0),
      (assign, ":richer_centers", 0),
      
      (assign, ":mayor_town_production", 0),
      (try_for_range, ":item_kind_id", trade_goods_begin, trade_goods_end),
        (call_script, "script_center_get_production", "$g_encountered_party", ":item_kind_id"),
        (val_add, ":mayor_town_production", reg0),
      (try_end),
      (assign, ":wealthiest_town_production", ":mayor_town_production"),
      
      (try_begin),
        (ge, "$cheat_mode", 1),
        (assign, reg4, ":mayor_town_production"),
        (str_store_party_name, s4, "$g_encountered_party"),
        (display_message, "@{!}DEBUG -- Total production for {s4}: {reg4}"),
      (try_end),
      
      
      (try_for_range, ":other_center", towns_begin, towns_end),
        (neq, ":other_center", "$g_encountered_party"),
        (assign, ":other_town_production", 0),
        (try_for_range, ":item_kind_id", trade_goods_begin, trade_goods_end),
          (call_script, "script_center_get_production", ":other_center", ":item_kind_id"),
          (val_add, ":other_town_production", reg0),
        (try_end),
        (try_begin),
          (ge, "$cheat_mode", 1),
          (assign, reg4, ":other_town_production"),
          (str_store_party_name, s4, ":other_center"),
          (display_message, "@{!}DEBUG -- Total production for {s4}: {reg4}"),
        (try_end),
        
        (try_begin),
          (gt, ":other_town_production", ":wealthiest_town_production"),
          (val_add, ":richer_centers", 1),
          (assign, ":wealthiest_center", ":other_center"),
          (assign, ":wealthiest_town_production", ":other_town_production"),
        (else_try),
          (gt, ":other_town_production", ":mayor_town_production"),
          (val_add, ":richer_centers", 1),
        (else_try),
          (val_add, ":poorer_centers", 1),
        (try_end),
      (try_end),
      
      (assign, reg4, ":richer_centers"),
      (assign, reg5, ":poorer_centers"),
      (str_store_party_name, s5, "$g_encountered_party"),
      (str_store_party_name, s4, ":wealthiest_center"),
      
      ], "In terms of local industry, the most productive center in the Northlands is known to be {s4}. Here in {s5}, we produce less than {reg4} centers and produce more than {reg5}. Production is of course affected by the supply of raw materials, as well as by the overall prosperity of the center.", "mayor_wealth_comparison_3",[
  ]],
  
  [anyone,"mayor_wealth_comparison_3",[
      
      (assign, ":wealthiest_center", "$g_encountered_party"),
      (assign, ":poorer_centers", 0),
      (assign, ":richer_centers", 0),
      
      (try_for_range, ":town", walled_centers_begin, walled_centers_end),
        (party_set_slot, ":town", slot_party_temp_slot_1, 0),
      (try_end),
      
      (try_for_range, ":village", villages_begin, villages_end),
        (assign, ":village_good_production", 0),
        (try_for_range, ":item_kind_id", trade_goods_begin, trade_goods_end),
          (call_script, "script_center_get_production", ":village", ":item_kind_id"),
          (val_add, ":village_good_production", reg0),
        (try_end),
        (party_get_slot, ":market_town", ":village", slot_village_market_town),
        (party_get_slot, ":market_center_production", ":market_town", slot_party_temp_slot_1),
        (val_add, ":market_center_production", ":village_good_production"),
        (party_set_slot, ":market_town", slot_party_temp_slot_1, ":market_center_production"),
      (try_end),
      
      
      (party_get_slot, ":mayor_town_production", "$g_encountered_party", slot_party_temp_slot_1),
      (assign, ":wealthiest_town_production", ":mayor_town_production"),
      
      (try_begin),
        (ge, "$cheat_mode", 1),
        (assign, reg4, ":mayor_town_production"),
        (str_store_party_name, s4, "$g_encountered_party"),
        (display_message, "@{!}DEBUG -- Total rural production for {s4} region: {reg4}"),
      (try_end),
      
      
      (try_for_range, ":other_center", walled_centers_begin, walled_centers_end),
        (neq, ":other_center", "$g_encountered_party"),
        (party_get_slot, ":other_town_production", ":other_center", slot_party_temp_slot_1),
        
        (try_begin),
          (ge, "$cheat_mode", 1),
          (assign, reg4, ":other_town_production"),
          (str_store_party_name, s4, ":other_center"),
          (display_message, "@{!}DEBUG -- Total rural production for {s4} region: {reg4}"),
        (try_end),
        
        (try_begin),
          (gt, ":other_town_production", ":wealthiest_town_production"),
          (val_add, ":richer_centers", 1),
          (assign, ":wealthiest_center", ":other_center"),
          (assign, ":wealthiest_town_production", ":other_town_production"),
        (else_try),
          (gt, ":other_town_production", ":mayor_town_production"),
          (val_add, ":richer_centers", 1),
        (else_try),
          (val_add, ":poorer_centers", 1),
        (try_end),
      (try_end),
      
      (assign, reg4, ":richer_centers"),
      (assign, reg5, ":poorer_centers"),
      (str_store_party_name, s5, "$g_encountered_party"),
      (str_store_party_name, s4, ":wealthiest_center"),
      
      ], "In terms of the output of the surrounding villages, the center of {s4} is the richest in the Northlands. Here in {s5}, the villages produce less than the hinterland around {reg4} centers, and produce more than {reg5}. The wealth of a center's hinterland, of course, is heavily dependent on the tides of war. Looting and pillage, and shifts in territory, can make a major impact.", "mayor_wealth_comparison_4",[
  ]],
  
  
  [anyone,"mayor_wealth_comparison_4",[
      
      (assign, ":wealthiest_center", "$g_encountered_party"),
      (assign, ":poorer_centers", 0),
      (assign, ":richer_centers", 0),
      
      (try_for_range, ":town", towns_begin, towns_end),
        (party_set_slot, ":town", slot_party_temp_slot_1, 0),
      (try_end),
      
      (try_for_range, ":log_entry_iterator", 0, "$num_log_entries"),
        (store_sub, ":log_entry_no", "$num_log_entries", ":log_entry_iterator"),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_party_traded),
        
        (troop_get_slot, ":event_time",            "trp_log_array_entry_time",              ":log_entry_no"),
        (store_current_hours, ":cur_hour"),
        (store_sub, ":hours_ago", ":cur_hour", ":event_time"),
        (lt, ":hours_ago", 1344),
        
        (troop_get_slot, ":origin",    "trp_log_array_center_object",          ":log_entry_no"),
        (is_between, ":origin", towns_begin, towns_end), #exclude village trading here
        
        (troop_get_slot, ":destination",    "trp_log_array_troop_object",          ":log_entry_no"),
        (party_get_slot, ":num_visits", ":destination", slot_party_temp_slot_1),
        (val_add, ":num_visits", 1),
        (party_set_slot, ":destination", slot_party_temp_slot_1, ":num_visits"),
      (try_end),
      
      (party_get_slot, ":mayor_town_production", "$g_encountered_party", slot_party_temp_slot_1),
      (assign, ":wealthiest_town_production", ":mayor_town_production"),
      
      (try_begin),
        (ge, "$cheat_mode", 1),
        (assign, reg4, ":mayor_town_production"),
        (str_store_party_name, s4, "$g_encountered_party"),
        (display_message, "@{!}DEBUG -- Total trade for {s4}: {reg4}"),
      (try_end),
      
      
      (try_for_range, ":other_center", towns_begin, towns_end),
        (neq, ":other_center", "$g_encountered_party"),
        (party_get_slot, ":other_town_production", ":other_center", slot_party_temp_slot_1),
        
        (try_begin),
          (ge, "$cheat_mode", 1),
          (assign, reg4, ":other_town_production"),
          (str_store_party_name, s4, ":other_center"),
          (display_message, "@{!}DEBUG -- Total trade for {s4}: {reg4}"),
        (try_end),
        
        (try_begin),
          (gt, ":other_town_production", ":wealthiest_town_production"),
          (val_add, ":richer_centers", 1),
          (assign, ":wealthiest_center", ":other_center"),
          (assign, ":wealthiest_town_production", ":other_town_production"),
        (else_try),
          (gt, ":other_town_production", ":mayor_town_production"),
          (val_add, ":richer_centers", 1),
        (else_try),
          (val_add, ":poorer_centers", 1),
        (try_end),
      (try_end),
      
      (assign, reg4, ":richer_centers"),
      (assign, reg5, ":poorer_centers"),
      (str_store_party_name, s5, "$g_encountered_party"),
      (str_store_party_name, s4, ":wealthiest_center"),
      
      ], "In terms of trade, the town of {s4} is believed to have received the most visits from caravans over the past few months. Here in {s5}, we are less visited than {reg4} towns, and more visited than {reg5}. ", "mayor_wealth_comparison_5",[
  ]],
  
  
  [anyone,"mayor_wealth_comparison_5",[
      
      (assign, ":wealthiest_center", "$g_encountered_party"),
      (assign, ":poorer_centers", 0),
      (assign, ":richer_centers", 0),
      
      (try_for_range, ":town", towns_begin, towns_end),
        (party_set_slot, ":town", slot_party_temp_slot_1, 0),
      (try_end),
      
      (try_for_range, ":log_entry_iterator", 0, "$num_log_entries"),
        (store_sub, ":log_entry_no", "$num_log_entries", ":log_entry_iterator"),
        (troop_slot_eq, "trp_log_array_entry_type", ":log_entry_no", logent_traveller_attacked),
        
        (troop_get_slot, ":event_time",            "trp_log_array_entry_time",              ":log_entry_no"),
        (store_current_hours, ":cur_hour"),
        (store_sub, ":hours_ago", ":cur_hour", ":event_time"),
        (lt, ":hours_ago", 1344),
        
        (troop_get_slot, ":origin",    "trp_log_array_center_object",          ":log_entry_no"),
        (troop_get_slot, ":destination",    "trp_log_array_troop_object",          ":log_entry_no"),
        
        (try_begin),
          (is_between, ":destination", towns_begin, towns_end),
          (party_get_slot, ":num_attacks", ":destination", slot_party_temp_slot_1),
          (val_add, ":num_attacks", 1),
          (party_set_slot, ":destination", slot_party_temp_slot_1, ":num_attacks"),
        (try_end),
        
        (try_begin),
          (is_between, ":origin", towns_begin, towns_end),
          (party_get_slot, ":num_attacks", ":origin", slot_party_temp_slot_1),
          (val_add, ":num_attacks", 1),
          (party_set_slot, ":origin", slot_party_temp_slot_1, ":num_attacks"),
        (try_end),
      (try_end),
      
      (party_get_slot, ":mayor_town_production", "$g_encountered_party", slot_party_temp_slot_1),
      (assign, ":wealthiest_town_production", ":mayor_town_production"),
      
      (try_begin),
        (ge, "$cheat_mode", 1),
        (assign, reg4, ":mayor_town_production"),
        (str_store_party_name, s4, "$g_encountered_party"),
        (display_message, "@{!}DEBUG -- Total attacks for {s4}: {reg4}"),
      (try_end),
      
      
      (try_for_range, ":other_center", towns_begin, towns_end),
        (neq, ":other_center", "$g_encountered_party"),
        (party_get_slot, ":other_town_production", ":other_center", slot_party_temp_slot_1),
        
        (try_begin),
          (ge, "$cheat_mode", 1),
          (assign, reg4, ":other_town_production"),
          (str_store_party_name, s4, ":other_center"),
          (display_message, "@{!}DEBUG -- Total attacks for {s4}: {reg4}"),
        (try_end),
        
        (try_begin),
          (gt, ":other_town_production", ":wealthiest_town_production"),
          (val_add, ":richer_centers", 1),
          (assign, ":wealthiest_center", ":other_center"),
          (assign, ":wealthiest_town_production", ":other_town_production"),
        (else_try),
          (gt, ":other_town_production", ":mayor_town_production"),
          (val_add, ":richer_centers", 1),
        (else_try),
          (val_add, ":poorer_centers", 1),
        (try_end),
      (try_end),
      
      (assign, reg4, ":richer_centers"),
      (assign, reg5, ":poorer_centers"),
      (str_store_party_name, s5, "$g_encountered_party"),
      (str_store_party_name, s4, ":wealthiest_center"),
      
      ], "In terms of attacks on travellers, the town of {s4} is believed to be the most dangerous. Here in {s5}, we are less afflicted by bandits and raiders than {reg4} towns, and more afflicted than {reg5}. ", "mayor_pretalk",[
  ]],
  
  
  
  [anyone|plyr,"free", [[in_meta_mission]], "Farewell.", "close_window",[]],
  [anyone|plyr,"free", [[neg|in_meta_mission]], " [Leave]", "close_window",[]],
  #  [anyone,"free", [], "NO MATCHING SENTENCE!", "close_window",[]],
]
