# talk_to_start ####################################################### hispania 1200 hablar con todos
("fill_dialog_canditate_list_for_presentation",
[
# (troop_set_slot, "trp_temp_array_a", 0, "fac_player_supporters_faction"), # Player
(troop_set_slot, "trp_temp_array_a", 0, "trp_kingdom_1_lord"),
(troop_set_slot, "trp_temp_array_a", 1, "trp_kingdom_2_lord"),
(troop_set_slot, "trp_temp_array_a", 2, "trp_kingdom_3_lord"),
(troop_set_slot, "trp_temp_array_a", 3, "trp_kingdom_4_lord"),
(troop_set_slot, "trp_temp_array_a", 4, "trp_kingdom_5_lord"),
(troop_set_slot, "trp_temp_array_a", 5, "trp_kingdom_6_lord"),
# end of great lords list
(troop_set_slot, "trp_temp_array_a", 6, "trp_knight_6_1"), # Abd Al-wahid
(troop_set_slot, "trp_temp_array_a", 7, "trp_knight_6_2"), # Abd al-Qawi
(troop_set_slot, "trp_temp_array_a", 8, "trp_knight_6_3"), # Abd as Salam ibn hich
(troop_set_slot, "trp_temp_array_a", 9, "trp_knight_6_4"), # Abd'Allah ibn Zanun
(troop_set_slot, "trp_temp_array_a", 10, "trp_knight_6_5"), # Abdel Alim
(troop_set_slot, "trp_temp_array_a", 11, "trp_knight_6_6"), # Abdel Mutaal
(troop_set_slot, "trp_temp_array_a", 12, "trp_knight_6_7"), # Abdul ibn Hisham
(troop_set_slot, "trp_temp_array_a", 13, "trp_knight_6_8"), # Abu Abbas al-Siquili
(troop_set_slot, "trp_temp_array_a", 14, "trp_knight_6_9"), # Abu Abd'Allah
(troop_set_slot, "trp_temp_array_a", 15, "trp_knight_6_10"), # Abu Jalil ibn Bark
(troop_set_slot, "trp_temp_array_a", 16, "trp_knight_6_11"), # Abu Jazir Yajluf
(troop_set_slot, "trp_temp_array_a", 17, "trp_knight_6_12"), #Abu Rakin al-Ubayda
(troop_set_slot, "trp_temp_array_a", 18, "trp_knight_6_13"), # Abud'allah ibn Muhammad
(troop_set_slot, "trp_temp_array_a", 19, "trp_knight_6_14"), # Adham al-Anwar
(troop_set_slot, "trp_temp_array_a", 20, "trp_knight_2_15"), # Adulfo de Sarmiento
(troop_set_slot, "trp_temp_array_a", 23, "trp_knight_2_16"), # Alexo Varela
(troop_set_slot, "trp_temp_array_a", 24, "trp_knight_2_14"), # Alfonso de Quinyones
(troop_set_slot, "trp_temp_array_a", 25, "trp_knight_5_8"), # Alfonsu Henriques Tavora
(troop_set_slot, "trp_temp_array_a", 27, "trp_knight_2_3"), # Alonso Brierzo
(troop_set_slot, "trp_temp_array_a", 28, "trp_knight_4_2"), # Alvar Nunyez de Lara
(troop_set_slot, "trp_temp_array_a", 29, "trp_knight_4_22"), # Alvar de Villena
(troop_set_slot, "trp_temp_array_a", 31, "trp_knight_1_14"), # Artal de Alagon
(troop_set_slot, "trp_temp_array_a", 32, "trp_knight_1_4"), # Artal de Luna
(troop_set_slot, "trp_temp_array_a", 33, "trp_knight_1_20"), # Ato de Fozes
(troop_set_slot, "trp_temp_array_a", 35, "trp_knight_5_15"), # Belasco da Sella
(troop_set_slot, "trp_temp_array_a", 36, "trp_knight_3_3"), # Bladi Orozco
(troop_set_slot, "trp_temp_array_a", 37, "trp_knight_1_7"), # Blasco Maza
(troop_set_slot, "trp_temp_array_a", 38, "trp_knight_2_13"), # Blasco de villavar
(troop_set_slot, "trp_temp_array_a", 39, "trp_knight_2_20"), # Caitanu de Valdivia
(troop_set_slot, "trp_temp_array_a", 40, "trp_knight_4_15"), # Diego Boson
(troop_set_slot, "trp_temp_array_a", 41, "trp_knight_4_1"), # Diego Lopez de Haro
(troop_set_slot, "trp_temp_array_a", 42, "trp_knight_4_16"), # Diego Perez Davila
(troop_set_slot, "trp_temp_array_a", 43, "trp_knight_2_8"), # Diego de Valdivia
(troop_set_slot, "trp_temp_array_a", 44, "trp_knight_3_5"), # Elazar Guebara
(troop_set_slot, "trp_temp_array_a", 45, "trp_knight_3_6"), # Enneco Aibar
(troop_set_slot, "trp_temp_array_a", 46, "trp_knight_3_16"), # Enneco Ortiz de Stunica
(troop_set_slot, "trp_temp_array_a", 47, "trp_knight_1_2"), # Ermengol de Urgell
(troop_set_slot, "trp_temp_array_a", 48, "trp_knight_3_7"), # Erramun Baztan
(troop_set_slot, "trp_temp_array_a", 49, "trp_knight_3_15"), # Fernan de Alarcon
(troop_set_slot, "trp_temp_array_a", 50, "trp_knight_4_18"), # Fernando Ansurez
(troop_set_slot, "trp_temp_array_a", 51, "trp_knight_5_11"), # Fernando Fernandes de Braganza
(troop_set_slot, "trp_temp_array_a", 52, "trp_knight_4_7"), # Fernando Gonsalvez de Ariza
(troop_set_slot, "trp_temp_array_a", 53, "trp_knight_2_11"), # Fernando Gutierrez de Castro
(troop_set_slot, "trp_temp_array_a", 54, "trp_knight_4_5"), # Fernando Nunyez de Lara
(troop_set_slot, "trp_temp_array_a", 55, "trp_knight_5_6"), # Fernando Pelegrin
(troop_set_slot, "trp_temp_array_a", 56, "trp_knight_2_4"), # Fernando Velez de Zamora
(troop_set_slot, "trp_temp_array_a", 57, "trp_knight_3_14"), # Fortun Aritza
(troop_set_slot, "trp_temp_array_a", 58, "trp_knight_3_8"), # Froila Vidurre
(troop_set_slot, "trp_temp_array_a", 59, "trp_knight_4_9"), # Fruela de Cifuentes
(troop_set_slot, "trp_temp_array_a", 60, "trp_knight_1_17"), # Gasto de Cruilles
(troop_set_slot, "trp_temp_array_a", 61, "trp_knight_3_9"), # Geraldo Urroz
(troop_set_slot, "trp_temp_array_a", 62, "trp_knight_5_1"), # Gil Vazquez de Soverosa
(troop_set_slot, "trp_temp_array_a", 63, "trp_knight_2_18"), # Gonzalo Fernandez de Atan
(troop_set_slot, "trp_temp_array_a", 64, "trp_knight_4_17"), # Gomez Gonzales de Aza
(troop_set_slot, "trp_temp_array_a", 65, "trp_knight_4_3"), # Gonzalo Gomez de Roa
(troop_set_slot, "trp_temp_array_a", 66, "trp_knight_4_11"), # Gonzalo Nunyez de Lara
(troop_set_slot, "trp_temp_array_a", 67, "trp_knight_4_8"), # Gonzalo Rodriguez Giron
(troop_set_slot, "trp_temp_array_a", 68, "trp_knight_2_6"), # Gonzalo de Carvajal
(troop_set_slot, "trp_temp_array_a", 69, "trp_knight_4_12"), # Gonzalo de Uzero
(troop_set_slot, "trp_temp_array_a", 70, "trp_knight_5_5"), # Gualdim Pais
(troop_set_slot, "trp_temp_array_a", 71, "trp_knight_1_16"), # Guillem de Cardona
(troop_set_slot, "trp_temp_array_a", 72, "trp_knight_1_8"), # Guillem de Cervera
(troop_set_slot, "trp_temp_array_a", 73, "trp_knight_1_5"), # Guillem de Montcada
(troop_set_slot, "trp_temp_array_a", 74, "trp_knight_2_2"), # Guillermo Perez de Guzman
(troop_set_slot, "trp_temp_array_a", 75, "trp_knight_1_13"), # Gureau de Cabrera
(troop_set_slot, "trp_temp_array_a", 77, "trp_knight_4_23"), # Henrique de Vargas
(troop_set_slot, "trp_temp_array_a", 78, "trp_knight_3_2"), # Ianol Mauleon
(troop_set_slot, "trp_temp_array_a", 79, "trp_knight_4_4"), # Inyigo Lopez de Mendoza
(troop_set_slot, "trp_temp_array_a", 80, "trp_knight_3_13"), # Inyigo Vela
(troop_set_slot, "trp_temp_array_a", 82, "trp_knight_3_1"), # Jakes Escors
(troop_set_slot, "trp_temp_array_a", 83, "trp_knight_3_4"), # Joanes Muncharaz
(troop_set_slot, "trp_temp_array_a", 84, "trp_knight_5_14"), # Joao de Riba vizela
(troop_set_slot, "trp_temp_array_a", 85, "trp_knight_5_9"), # Johan Aboazar
(troop_set_slot, "trp_temp_array_a", 86, "trp_knight_4_21"), # Juan Velasco
(troop_set_slot, "trp_temp_array_a", 89, "trp_knight_3_10"), # Lehoi Egiguren
(troop_set_slot, "trp_temp_array_a", 90, "trp_knight_3_11"), # Lope Arriazu
(troop_set_slot, "trp_temp_array_a", 91, "trp_knight_1_15"), # Lope Martinez de Luna
(troop_set_slot, "trp_temp_array_a", 92, "trp_knight_4_6"), # Lope de Haro
(troop_set_slot, "trp_temp_array_a", 93, "trp_knight_5_16"), # Lourenzo Enriquez Ferreira
(troop_set_slot, "trp_temp_array_a", 94, "trp_knight_5_4"), # Lourenzo Mendes de Gundar
(troop_set_slot, "trp_temp_array_a", 96, "trp_knight_2_10"), # Martin Lurte
(troop_set_slot, "trp_temp_array_a", 97, "trp_knight_5_2"), # Martin Perez Correa
(troop_set_slot, "trp_temp_array_a", 98, "trp_knight_5_3"), # Martin Sanchez
(troop_set_slot, "trp_temp_array_a", 99, "trp_knight_5_13"), # Martinho Pires
(troop_set_slot, "trp_temp_array_a", 100, "trp_knight_5_7"), # Mendo de Susa
(troop_set_slot, "trp_temp_array_a", 105, "trp_knight_4_20"), # Nunyo Sanchez de Hinojosa
(troop_set_slot, "trp_temp_array_a", 106, "trp_knight_2_19"), # Ordonyo de molina
(troop_set_slot, "trp_temp_array_a", 107, "trp_knight_1_9"), # Pedro Ahones
(troop_set_slot, "trp_temp_array_a", 108, "trp_knight_2_5"), # Pedro Arias de Lamunyo
(troop_set_slot, "trp_temp_array_a", 109, "trp_knight_4_14"), # Pedro Arias de Villalobos
(troop_set_slot, "trp_temp_array_a", 110, "trp_knight_1_3"), # Pedro Cornel
(troop_set_slot, "trp_temp_array_a", 111, "trp_knight_1_10"), # Pedro Ferrandez de Azagra
(troop_set_slot, "trp_temp_array_a", 112, "trp_knight_5_10"), # Pedro Froilaz de Traba
(troop_set_slot, "trp_temp_array_a", 113, "trp_knight_4_13"), # Pedro Garcia de Lerna
(troop_set_slot, "trp_temp_array_a", 114, "trp_knight_5_12"), # Pedro Mendes Ganderei
(troop_set_slot, "trp_temp_array_a", 115, "trp_knight_5_17"), # Pedro Nunyez Vleno
(troop_set_slot, "trp_temp_array_a", 116, "trp_knight_3_12"), # Pedro Salazar
(troop_set_slot, "trp_temp_array_a", 117, "trp_knight_3_17"), # Pedro Ximenez de Zunyiga
(troop_set_slot, "trp_temp_array_a", 118, "trp_knight_2_12"), # Pelayo Gonzalez de Atan
(troop_set_slot, "trp_temp_array_a", 119, "trp_knight_1_18"), # Pero Ximenez de Urrea
(troop_set_slot, "trp_temp_array_a", 120, "trp_knight_4_19"), # Ponce de Minerva
(troop_set_slot, "trp_temp_array_a", 121, "trp_knight_1_12"), # Pons de Empuries
(troop_set_slot, "trp_temp_array_a", 123, "trp_knight_4_10"), # Ramiro de Castellar
(troop_set_slot, "trp_temp_array_a", 124, "trp_knight_1_19"), # Ramon Alemany
(troop_set_slot, "trp_temp_array_a", 125, "trp_knight_1_1"), # Ramon de Montcada
(troop_set_slot, "trp_temp_array_a", 127, "trp_knight_1_6"), # Rodrigo de Lizana
(troop_set_slot, "trp_temp_array_a", 128, "trp_knight_2_7"), # Sancho Diaz de Galicia
(troop_set_slot, "trp_temp_array_a", 129, "trp_knight_1_11"), # Sancho de Rosellon
(troop_set_slot, "trp_temp_array_a", 134, "trp_knight_2_17"), # Tello Perez de Meneses
(troop_set_slot, "trp_temp_array_a", 135, "trp_knight_2_1"), # Vasco Fernandez de Saverosa
(troop_set_slot, "trp_temp_array_a", 136, "trp_knight_2_15"), # Vermudo Ortega
# begin of faction list
(troop_set_slot, "trp_temp_array_b", 0, "fac_player_supporters_faction"), # Player
(troop_set_slot, "trp_temp_array_b", 1, "fac_kingdom_1"),
(troop_set_slot, "trp_temp_array_b", 2, "fac_kingdom_2"),
(troop_set_slot, "trp_temp_array_b", 3, "fac_kingdom_3"),
(troop_set_slot, "trp_temp_array_b", 4, "fac_kingdom_4"),
(troop_set_slot, "trp_temp_array_b", 5, "fac_kingdom_5"),
(troop_set_slot, "trp_temp_array_b", 6, "fac_kingdom_6"),
(store_script_param, ":pres_type", 1),
(store_script_param, ":base_candidates_y", 2),
# Type of list from global variable: 0 courtship, 1 known lords
(try_begin),
## For lord/lady dialog
(eq, ":pres_type", 1),
# Loop to identify
(try_for_range, ":cur_slt", 0, 328),
(troop_get_slot, ":active_npc", "trp_temp_array_a", ":cur_slt"),
(troop_set_slot, ":active_npc", slot_troop_temp_slot, 0),
(try_end),
(try_for_range, ":cur_slt", 0, 328),
(troop_get_slot, ":unused", "trp_temp_array_a", ":cur_slt"),
(assign, ":score_to_beat", 101),
(assign, ":best_relation_remaining_npc", -1),
(try_for_range, ":cur_slt", 0, 328),
(troop_get_slot, ":active_npc", "trp_temp_array_a", ":cur_slt"),
(troop_slot_eq, ":active_npc", slot_troop_temp_slot, 0),
(store_troop_faction, ":inactive", ":active_npc"), # not related to faction filter
(neq, ":inactive", "fac_commoners"), # hide inactive lords/ladies
(neq, ":inactive", "fac_outlaws"), #hispania 1200, hablar con todos, bug
(neq, ":active_npc", "trp_player"), #hispania 1200, hablar con todos, bug
(call_script, "script_troop_get_player_relation", ":active_npc"),
(assign, ":relation_with_player", reg0),
(le, ":relation_with_player", ":score_to_beat"),
(assign, ":best_relation_remaining_npc", ":active_npc"),
(try_end),
(gt, ":best_relation_remaining_npc", -1),
(str_store_troop_name, s4, ":best_relation_remaining_npc"),
(str_store_string, s1, "@{s4}"),
(troop_set_slot, ":best_relation_remaining_npc", slot_troop_temp_slot, 1),
# use faction filter
(store_troop_faction, ":npc_faction", ":best_relation_remaining_npc"),
(val_sub, ":npc_faction", kingdoms_begin),
(this_or_next|eq, "$g_jrider_faction_filter", -1),
(eq, "$g_jrider_faction_filter", ":npc_faction"),
#ORIGINAL
# use faction filter
# (store_troop_faction, ":npc_faction", ":best_relation_remaining_npc"),
# (assign, ":show_troop", 0),
# (try_begin),
# (eq, "$g_jrider_faction_filter", -1), #no filter, so always show
# (assign, ":show_troop", 1),
# (else_try),
# (try_for_range, ":cln_slt", 0, 21),
# (troop_get_slot, ":clan", "trp_temp_array_b", ":cln_slt"),
# (eq, "$g_jrider_faction_filter", ":cln_slt"), #first menu item
# (eq, ":npc_faction", ":clan"), #corresponding kingdom in the new order
# (assign, ":show_troop", 1),
# (try_end),
#(try_end),
# (eq, ":show_troop", 1),
#FINAL ORIGINAL
# candidate found,
# create custom listbox entry, set the container first
(store_mul, ":y_mult", "$num_charinfo_candidates", 16), # adapt y position to entry number, was 18
(store_add, ":line_y", ":base_candidates_y", ":y_mult"),
(call_script, "script_overlay_container_add_listbox_item", ":line_y", ":best_relation_remaining_npc"),
#store troop id for later use (could be merged with the object id)
(store_add, ":current_storage_index", "$g_base_character_presentation_storage_index", "$num_charinfo_candidates"),
(troop_set_slot, "trp_temp_array_c", ":current_storage_index", ":best_relation_remaining_npc"),
# update entry counter
(val_add, "$num_charinfo_candidates", 1),
(try_end),
## END Lords to talk
(try_end),
]),
# talk_to_end