code
stringlengths
1
1.72M
language
stringclasses
1 value
import types from header_game_menus import * from module_info import * from module_game_menus import * from module_parties import * from process_operations import * from process_common import * def save_parties(parties): file = open(export_dir + "parties.txt","w") file.write("partiesfile version 1\n") file.write("%d %d\n"%(len(parties), len(parties))) for i_party in xrange(len(parties)): party = parties[i_party] if (party[5] >= 0): add_tag_use(tag_uses,tag_faction,party[5]) file.write(" 1 %d %d "%(i_party, i_party)) # file.write(" 1 %d "%(i_party)) file.write("p_%s %s %d "%(convert_to_identifier(party[0]),replace_spaces(party[1]),party[2])) menu_no = 0 menu_param = party[3] if (type(menu_param) == types.StringType): menu_no = find_object(game_menus,menu_param) if (menu_no < 0): print "Error: Unable to find menu-id :" + menu_param else: menu_no = menu_param file.write("%d "%(menu_no)) file.write("%d %d %d %d %d "%(party[4], party[5], party[6], party[6],party[7])) ai_behavior_object = 0 ai_param = party[8] if (type(ai_param) == types.StringType): ai_behavior_object = find_object(parties,ai_param) if (ai_behavior_object < 0): print "Error: Unable to find party-id :" + ai_param else: ai_behavior_object = ai_param file.write("%d %d "%(ai_behavior_object,ai_behavior_object)) position = party[9] default_behavior_location = position file.write("%f %f "%(default_behavior_location[0],default_behavior_location[1])) file.write("%f %f "%(default_behavior_location[0],default_behavior_location[1])) file.write("%f %f 0.0 "%position) member_list = party[10] file.write("%d "%len(member_list)) for member in member_list: add_tag_use(tag_uses,tag_troop,member[0]) file.write("%d %d 0 %d "%(member[0],member[1],member[2])) bearing = 0.0 if (len(party) > 11): bearing = (3.1415926 / 180.0) * party[11] file.write("\n%f\n"%(bearing)) file.close() def save_python_header(parties): file = open("./ID_parties.py","w") for i_party in xrange(len(parties)): file.write("p_%s = %d\n"%(convert_to_identifier(parties[i_party][0]),i_party)) file.close() print "Exporting parties" tag_uses = load_tag_uses(export_dir) save_python_header(parties) save_parties(parties) save_tag_uses(export_dir, tag_uses) #print "Generating C header..." #save_c_header() #print "Generating Python header..." #print "Finished."
Python
from module_info import * from process_common import * from process_operations import * print "Checking global variable usages..." variable_uses = [] variables = load_variables(export_dir,variable_uses) i = 0 while (i < len(variables)): if (variable_uses[i] == 0): print "WARNING: Global variable never used: " + variables[i] i = i + 1
Python
from header_common import * from module_info import * from module_sounds import * def write_python_header(sounds): file = open("./ID_sounds.py","w") for i_sound in xrange(len(sounds)): file.write("snd_%s = %d\n"%(sounds[i_sound][0],i_sound)) file.write("\n\n") file.close() def write_sounds(sound_samples, sounds): ofile = open(export_dir + "sounds.txt","w") ofile.write("soundsfile version 2\n") ofile.write("%d\n"%len(sound_samples)) for sound_sample in sound_samples: ofile.write(" %s %d\n"%sound_sample) ofile.write("%d\n"%len(sounds)) for sound in sounds: ofile.write("snd_%s %d %d "%(sound[0], sound[1],len(sound[2]))) sample_list = sound[2] for s in sample_list: ofile.write("%d "%(s)) ofile.write("\n") ofile.close() def compile_sounds(sounds): all_sounds = [] for sound in sounds: sound_files = sound[2] sound_flags = sound[1] for i_sound_file in xrange(len(sound_files)): sound_file = sound_files[i_sound_file] sound_no = 0 found = 0 while (sound_no< (len(all_sounds))) and (not found): if all_sounds[sound_no][0] == sound_file: found = 1 else: sound_no += 1 if not found: all_sounds.append((sound_file,sound_flags)) sound_no = len(all_sounds) - 1 sound_files[i_sound_file] = sound_no return all_sounds print "Exporting sounds..." sound_samples = compile_sounds(sounds) write_sounds(sound_samples, sounds) write_python_header(sounds)
Python
mesh_pic_bandits = 0 mesh_pic_mb_warrior_1 = 1 mesh_pic_messenger = 2 mesh_pic_prisoner_man = 3 mesh_pic_prisoner_fem = 4 mesh_pic_prisoner_wilderness = 5 mesh_pic_siege_sighted = 6 mesh_pic_siege_sighted_fem = 7 mesh_pic_camp = 8 mesh_pic_payment = 9 mesh_pic_escape_1 = 10 mesh_pic_escape_1_fem = 11 mesh_pic_victory = 12 mesh_pic_defeat = 13 mesh_pic_wounded = 14 mesh_pic_wounded_fem = 15 mesh_pic_steppe_bandits = 16 mesh_pic_mountain_bandits = 17 mesh_pic_sea_raiders = 18 mesh_pic_deserters = 19 mesh_pic_forest_bandits = 20 mesh_pic_cattle = 21 mesh_pic_looted_village = 22 mesh_pic_village_p = 23 mesh_pic_village_s = 24 mesh_pic_village_w = 25 mesh_pic_recruits = 26 mesh_pic_arms_swadian = 27 mesh_pic_arms_vaegir = 28 mesh_pic_arms_khergit = 29 mesh_pic_arms_nord = 30 mesh_pic_arms_rhodok = 31 mesh_portrait_blend_out = 32 mesh_load_window = 33 mesh_checkbox_off = 34 mesh_checkbox_on = 35 mesh_white_plane = 36 mesh_white_dot = 37 mesh_player_dot = 38 mesh_flag_infantry = 39 mesh_flag_archers = 40 mesh_flag_cavalry = 41 mesh_color_picker = 42 mesh_custom_map_banner_01 = 43 mesh_custom_map_banner_02 = 44 mesh_custom_map_banner_03 = 45 mesh_custom_banner_01 = 46 mesh_custom_banner_02 = 47 mesh_custom_banner_bg = 48 mesh_custom_banner_fg01 = 49 mesh_custom_banner_fg02 = 50 mesh_custom_banner_fg03 = 51 mesh_custom_banner_fg04 = 52 mesh_custom_banner_fg05 = 53 mesh_custom_banner_fg06 = 54 mesh_custom_banner_fg07 = 55 mesh_custom_banner_fg08 = 56 mesh_custom_banner_fg09 = 57 mesh_custom_banner_fg10 = 58 mesh_custom_banner_fg11 = 59 mesh_custom_banner_fg12 = 60 mesh_custom_banner_fg13 = 61 mesh_custom_banner_fg14 = 62 mesh_custom_banner_fg15 = 63 mesh_custom_banner_fg16 = 64 mesh_custom_banner_fg17 = 65 mesh_custom_banner_fg18 = 66 mesh_custom_banner_fg19 = 67 mesh_custom_banner_fg20 = 68 mesh_custom_banner_fg21 = 69 mesh_custom_banner_fg22 = 70 mesh_custom_banner_fg23 = 71 mesh_custom_banner_charge_01 = 72 mesh_custom_banner_charge_02 = 73 mesh_custom_banner_charge_03 = 74 mesh_custom_banner_charge_04 = 75 mesh_custom_banner_charge_05 = 76 mesh_custom_banner_charge_06 = 77 mesh_custom_banner_charge_07 = 78 mesh_custom_banner_charge_08 = 79 mesh_custom_banner_charge_09 = 80 mesh_custom_banner_charge_10 = 81 mesh_custom_banner_charge_11 = 82 mesh_custom_banner_charge_12 = 83 mesh_custom_banner_charge_13 = 84 mesh_custom_banner_charge_14 = 85 mesh_custom_banner_charge_15 = 86 mesh_custom_banner_charge_16 = 87 mesh_custom_banner_charge_17 = 88 mesh_custom_banner_charge_18 = 89 mesh_custom_banner_charge_19 = 90 mesh_custom_banner_charge_20 = 91 mesh_custom_banner_charge_21 = 92 mesh_custom_banner_charge_22 = 93 mesh_custom_banner_charge_23 = 94 mesh_custom_banner_charge_24 = 95 mesh_custom_banner_charge_25 = 96 mesh_custom_banner_charge_26 = 97 mesh_custom_banner_charge_27 = 98 mesh_custom_banner_charge_28 = 99 mesh_custom_banner_charge_29 = 100 mesh_custom_banner_charge_30 = 101 mesh_custom_banner_charge_31 = 102 mesh_custom_banner_charge_32 = 103 mesh_custom_banner_charge_33 = 104 mesh_custom_banner_charge_34 = 105 mesh_custom_banner_charge_35 = 106 mesh_custom_banner_charge_36 = 107 mesh_custom_banner_charge_37 = 108 mesh_custom_banner_charge_38 = 109 mesh_custom_banner_charge_39 = 110 mesh_custom_banner_charge_40 = 111 mesh_custom_banner_charge_41 = 112 mesh_custom_banner_charge_42 = 113 mesh_custom_banner_charge_43 = 114 mesh_custom_banner_charge_44 = 115 mesh_custom_banner_charge_45 = 116 mesh_custom_banner_charge_46 = 117 mesh_tableau_mesh_custom_banner = 118 mesh_tableau_mesh_custom_banner_square = 119 mesh_tableau_mesh_custom_banner_tall = 120 mesh_tableau_mesh_custom_banner_short = 121 mesh_tableau_mesh_shield_round_1 = 122 mesh_tableau_mesh_shield_round_2 = 123 mesh_tableau_mesh_shield_round_3 = 124 mesh_tableau_mesh_shield_round_4 = 125 mesh_tableau_mesh_shield_round_5 = 126 mesh_tableau_mesh_shield_small_round_1 = 127 mesh_tableau_mesh_shield_small_round_2 = 128 mesh_tableau_mesh_shield_small_round_3 = 129 mesh_tableau_mesh_shield_kite_1 = 130 mesh_tableau_mesh_shield_kite_2 = 131 mesh_tableau_mesh_shield_kite_3 = 132 mesh_tableau_mesh_shield_kite_4 = 133 mesh_tableau_mesh_shield_heater_1 = 134 mesh_tableau_mesh_shield_heater_2 = 135 mesh_tableau_mesh_shield_pavise_1 = 136 mesh_tableau_mesh_shield_pavise_2 = 137 mesh_heraldic_armor_bg = 138 mesh_tableau_mesh_heraldic_armor_a = 139 mesh_tableau_mesh_heraldic_armor_b = 140 mesh_tableau_mesh_heraldic_armor_c = 141 mesh_tableau_mesh_heraldic_armor_d = 142 mesh_outer_terrain_plain_1 = 143 mesh_banner_a01 = 144 mesh_banner_a02 = 145 mesh_banner_a03 = 146 mesh_banner_a04 = 147 mesh_banner_a05 = 148 mesh_banner_a06 = 149 mesh_banner_a07 = 150 mesh_banner_a08 = 151 mesh_banner_a09 = 152 mesh_banner_a10 = 153 mesh_banner_a11 = 154 mesh_banner_a12 = 155 mesh_banner_a13 = 156 mesh_banner_a14 = 157 mesh_banner_a15 = 158 mesh_banner_a16 = 159 mesh_banner_a17 = 160 mesh_banner_a18 = 161 mesh_banner_a19 = 162 mesh_banner_a20 = 163 mesh_banner_a21 = 164 mesh_banner_b01 = 165 mesh_banner_b02 = 166 mesh_banner_b03 = 167 mesh_banner_b04 = 168 mesh_banner_b05 = 169 mesh_banner_b06 = 170 mesh_banner_b07 = 171 mesh_banner_b08 = 172 mesh_banner_b09 = 173 mesh_banner_b10 = 174 mesh_banner_b11 = 175 mesh_banner_b12 = 176 mesh_banner_b13 = 177 mesh_banner_b14 = 178 mesh_banner_b15 = 179 mesh_banner_b16 = 180 mesh_banner_b17 = 181 mesh_banner_b18 = 182 mesh_banner_b19 = 183 mesh_banner_b20 = 184 mesh_banner_b21 = 185 mesh_banner_c01 = 186 mesh_banner_c02 = 187 mesh_banner_c03 = 188 mesh_banner_c04 = 189 mesh_banner_c05 = 190 mesh_banner_c06 = 191 mesh_banner_c07 = 192 mesh_banner_c08 = 193 mesh_banner_c09 = 194 mesh_banner_c10 = 195 mesh_banner_c11 = 196 mesh_banner_c12 = 197 mesh_banner_c13 = 198 mesh_banner_c14 = 199 mesh_banner_c15 = 200 mesh_banner_c16 = 201 mesh_banner_c17 = 202 mesh_banner_c18 = 203 mesh_banner_c19 = 204 mesh_banner_c20 = 205 mesh_banner_c21 = 206 mesh_banner_d01 = 207 mesh_banner_d02 = 208 mesh_banner_d03 = 209 mesh_banner_d04 = 210 mesh_banner_d05 = 211 mesh_banner_d06 = 212 mesh_banner_d07 = 213 mesh_banner_d08 = 214 mesh_banner_d09 = 215 mesh_banner_d10 = 216 mesh_banner_d11 = 217 mesh_banner_d12 = 218 mesh_banner_d13 = 219 mesh_banner_d14 = 220 mesh_banner_d15 = 221 mesh_banner_d16 = 222 mesh_banner_d17 = 223 mesh_banner_d18 = 224 mesh_banner_d19 = 225 mesh_banner_d20 = 226 mesh_banner_d21 = 227 mesh_banner_e01 = 228 mesh_banner_e02 = 229 mesh_banner_e03 = 230 mesh_banner_e04 = 231 mesh_banner_e05 = 232 mesh_banner_e06 = 233 mesh_banner_e07 = 234 mesh_banner_e08 = 235 mesh_banner_e09 = 236 mesh_banner_e10 = 237 mesh_banner_e11 = 238 mesh_banner_e12 = 239 mesh_banner_e13 = 240 mesh_banner_e14 = 241 mesh_banner_e15 = 242 mesh_banner_e16 = 243 mesh_banner_e17 = 244 mesh_banner_e18 = 245 mesh_banner_e19 = 246 mesh_banner_e20 = 247 mesh_banner_e21 = 248 mesh_banner_f01 = 249 mesh_banner_f02 = 250 mesh_banner_f03 = 251 mesh_banner_f04 = 252 mesh_banner_f05 = 253 mesh_banner_f06 = 254 mesh_banner_f07 = 255 mesh_banner_f08 = 256 mesh_banner_f09 = 257 mesh_banner_f10 = 258 mesh_banner_f11 = 259 mesh_banner_f12 = 260 mesh_banner_f13 = 261 mesh_banner_f14 = 262 mesh_banner_f15 = 263 mesh_banner_f16 = 264 mesh_banner_f17 = 265 mesh_banner_f18 = 266 mesh_banner_f19 = 267 mesh_banner_f20 = 268 mesh_banner_f21 = 269 mesh_arms_a01 = 270 mesh_arms_a02 = 271 mesh_arms_a03 = 272 mesh_arms_a04 = 273 mesh_arms_a05 = 274 mesh_arms_a06 = 275 mesh_arms_a07 = 276 mesh_arms_a08 = 277 mesh_arms_a09 = 278 mesh_arms_a10 = 279 mesh_arms_a11 = 280 mesh_arms_a12 = 281 mesh_arms_a13 = 282 mesh_arms_a14 = 283 mesh_arms_a15 = 284 mesh_arms_a16 = 285 mesh_arms_a17 = 286 mesh_arms_a18 = 287 mesh_arms_a19 = 288 mesh_arms_a20 = 289 mesh_arms_a21 = 290 mesh_arms_b01 = 291 mesh_arms_b02 = 292 mesh_arms_b03 = 293 mesh_arms_b04 = 294 mesh_arms_b05 = 295 mesh_arms_b06 = 296 mesh_arms_b07 = 297 mesh_arms_b08 = 298 mesh_arms_b09 = 299 mesh_arms_b10 = 300 mesh_arms_b11 = 301 mesh_arms_b12 = 302 mesh_arms_b13 = 303 mesh_arms_b14 = 304 mesh_arms_b15 = 305 mesh_arms_b16 = 306 mesh_arms_b17 = 307 mesh_arms_b18 = 308 mesh_arms_b19 = 309 mesh_arms_b20 = 310 mesh_arms_b21 = 311 mesh_arms_c01 = 312 mesh_arms_c02 = 313 mesh_arms_c03 = 314 mesh_arms_c04 = 315 mesh_arms_c05 = 316 mesh_arms_c06 = 317 mesh_arms_c07 = 318 mesh_arms_c08 = 319 mesh_arms_c09 = 320 mesh_arms_c10 = 321 mesh_arms_c11 = 322 mesh_arms_c12 = 323 mesh_arms_c13 = 324 mesh_arms_c14 = 325 mesh_arms_c15 = 326 mesh_arms_c16 = 327 mesh_arms_c17 = 328 mesh_arms_c18 = 329 mesh_arms_c19 = 330 mesh_arms_c20 = 331 mesh_arms_c21 = 332 mesh_arms_d01 = 333 mesh_arms_d02 = 334 mesh_arms_d03 = 335 mesh_arms_d04 = 336 mesh_arms_d05 = 337 mesh_arms_d06 = 338 mesh_arms_d07 = 339 mesh_arms_d08 = 340 mesh_arms_d09 = 341 mesh_arms_d10 = 342 mesh_arms_d11 = 343 mesh_arms_d12 = 344 mesh_arms_d13 = 345 mesh_arms_d14 = 346 mesh_arms_d15 = 347 mesh_arms_d16 = 348 mesh_arms_d17 = 349 mesh_arms_d18 = 350 mesh_arms_d19 = 351 mesh_arms_d20 = 352 mesh_arms_d21 = 353 mesh_arms_e01 = 354 mesh_arms_e02 = 355 mesh_arms_e03 = 356 mesh_arms_e04 = 357 mesh_arms_e05 = 358 mesh_arms_e06 = 359 mesh_arms_e07 = 360 mesh_arms_e08 = 361 mesh_arms_e09 = 362 mesh_arms_e10 = 363 mesh_arms_e11 = 364 mesh_arms_e12 = 365 mesh_arms_e13 = 366 mesh_arms_e14 = 367 mesh_arms_e15 = 368 mesh_arms_e16 = 369 mesh_arms_e17 = 370 mesh_arms_e18 = 371 mesh_arms_e19 = 372 mesh_arms_e20 = 373 mesh_arms_e21 = 374 mesh_arms_f01 = 375 mesh_arms_f02 = 376 mesh_arms_f03 = 377 mesh_arms_f04 = 378 mesh_arms_f05 = 379 mesh_arms_f06 = 380 mesh_arms_f07 = 381 mesh_arms_f08 = 382 mesh_arms_f09 = 383 mesh_arms_f10 = 384 mesh_arms_f11 = 385 mesh_arms_f12 = 386 mesh_arms_f13 = 387 mesh_arms_f14 = 388 mesh_arms_f15 = 389 mesh_arms_f16 = 390 mesh_arms_f17 = 391 mesh_arms_f18 = 392 mesh_arms_f19 = 393 mesh_arms_f20 = 394 mesh_arms_f21 = 395 mesh_banners_default_a = 396 mesh_banners_default_b = 397 mesh_banners_default_c = 398 mesh_banners_default_d = 399 mesh_banners_default_e = 400
Python
arf_blend_in_0 = 0x00000001 arf_blend_in_1 = 0x00000002 arf_blend_in_2 = 0x00000003 arf_blend_in_3 = 0x00000004 arf_blend_in_4 = 0x00000005 arf_blend_in_5 = 0x00000006 arf_blend_in_6 = 0x00000007 arf_blend_in_7 = 0x00000008 arf_blend_in_8 = 0x00000009 arf_blend_in_9 = 0x0000000a arf_blend_in_10 = 0x0000000b arf_blend_in_11 = 0x0000000c arf_blend_in_12 = 0x0000000d arf_blend_in_13 = 0x0000000e arf_blend_in_14 = 0x0000000f arf_blend_in_15 = 0x00000010 arf_blend_in_16 = 0x00000011 arf_blend_in_17 = 0x00000012 arf_blend_in_18 = 0x00000013 arf_blend_in_19 = 0x00000014 arf_blend_in_20 = 0x00000015 arf_blend_in_21 = 0x00000016 arf_blend_in_22 = 0x00000017 arf_blend_in_23 = 0x00000018 arf_blend_in_24 = 0x00000019 arf_blend_in_25 = 0x0000001a arf_blend_in_26 = 0x0000001b arf_blend_in_27 = 0x0000001c arf_blend_in_28 = 0x0000001d arf_blend_in_29 = 0x0000001e arf_blend_in_30 = 0x0000001f arf_blend_in_31 = 0x00000020 arf_blend_in_32 = 0x00000021 arf_blend_in_48 = 0x00000031 arf_blend_in_64 = 0x00000041 arf_blend_in_128 = 0x00000081 arf_blend_in_254 = 0x000000ff arf_make_walk_sound = 0x00000100 arf_make_custom_sound = 0x00000200 ##arf_start_pos_0 = 0x00000100 ##arf_end_pos_0 = 0x00000200 ##arf_start_pos_0_25 = 0x00000400 ##arf_end_pos_0_25 = 0x00000800 ##arf_start_pos_0_5 = 0x00001000 ##arf_end_pos_0_5 = 0x00002000 ##arf_start_pos_0_75 = 0x00004000 ##arf_end_pos_0_75 = 0x00008000 ##arf_loop_pos_0 = arf_start_pos_0 | arf_end_pos_0 ##arf_loop_pos_0_25 = arf_start_pos_0_25 | arf_end_pos_0_25 ##arf_loop_pos_0_5 = arf_start_pos_0_5 | arf_end_pos_0_5 ##arf_loop_pos_0_75 = arf_start_pos_0_75 | arf_end_pos_0_75 ##arf_phase_even = 0x00010000 ##arf_phase_odd = 0x00030000 ##arf_phase_inverse_even = 0x00050000 ##arf_phase_inverse_odd = 0x00070000 arf_two_handed_blade = 0x01000000 arf_lancer = 0x02000000 arf_cyclic = 0x10000000 arf_use_walk_progress = 0x20000000 arf_use_stand_progress = 0x40000000 arf_use_inv_walk_progress = 0x80000000 ##arf_walk = arf_phase_even | arf_cyclic #----------------------------------------- acf_synch_with_horse = 0x00000001 acf_align_with_ground = 0x00000002 acf_enforce_lowerbody = 0x00000100 acf_enforce_rightside = 0x00000200 acf_enforce_all = 0x00000400 acf_parallels_for_look_slope = 0x00001000 acf_rotate_body = 0x00002000 acf_displace_position = 0x00004000 acf_ignore_slope = 0x00008000 acf_thrust = 0x00010000 acf_right_cut = 0x00020000 acf_left_cut = 0x00040000 acf_overswing = 0x00080000 acf_lock_camera = 0x00100000 acf_anim_length_mask = 0xff000000 acf_anim_length_bits = 24 def acf_anim_length(x): return (x << acf_anim_length_bits) & acf_anim_length_mask #------------------------------------------ #### Do not edit these lines def get_byte(f): if f == 0.0: return 0 i = int(f * 255.0) if (i< 1): i=1 elif (i > 255): i = 255 return i def pack2f(a,b): ai = get_byte(a) bi = get_byte(b) return ((bi << 8) | ai) def pack4f(a,b,c,d): ai = get_byte(a) bi = get_byte(b) ci = get_byte(c) di = get_byte(d) return ((di << 24) | (ci << 16) | (bi << 8) | ai)
Python
from header_common import * from header_parties import * from ID_troops import * from ID_factions import * from ID_party_templates import * from ID_map_icons import * #################################################################################################################### # Each party record contains the following fields: # 1) Party id: used for referencing parties in other files. # The prefix p_ is automatically added before each party id. # 2) Party name. # 3) Party flags. See header_parties.py for a list of available flags # 4) Menu. ID of the menu to use when this party is met. The value 0 uses the default party encounter system. # 5) Party-template. ID of the party template this party belongs to. Use pt_none as the default value. # 6) Faction. # 7) Personality. See header_parties.py for an explanation of personality flags. # 8) Ai-behavior # 9) Ai-target party # 10) Initial coordinates. # 11) List of stacks. Each stack record is a triple that contains the following fields: # 11.1) Troop-id. # 11.2) Number of troops in this stack. # 11.3) Member flags. Use pmf_is_prisoner to note that this member is a prisoner. # 12) Party direction in degrees [optional] #################################################################################################################### no_menu = 0 #pf_town = pf_is_static|pf_always_visible|pf_hide_defenders|pf_show_faction pf_town = pf_is_static|pf_always_visible|pf_show_faction|pf_label_large pf_castle = pf_is_static|pf_always_visible|pf_show_faction|pf_label_medium pf_village = pf_is_static|pf_always_visible|pf_hide_defenders|pf_label_small #sample_party = [(trp_swadian_knight,1,0), (trp_swadian_peasant,10,0), (trp_swadian_crossbowman,1,0), (trp_swadian_man_at_arms, 1, 0), (trp_swadian_footman, 1, 0), (trp_swadian_militia,1,0)] # NEW TOWNS: # NORMANDY: Rouen, Caen, Bayeux, Coutances, Evreux, Avranches # Brittany: Rennes, Nantes, # Maine: Le Mans # Anjou: Angers parties = [ ("main_party","Main Party",icon_player|pf_limit_members, no_menu, pt_none,fac_player_faction,0,ai_bhvr_hold,0,(17, 52.5),[(trp_player,1,0)]), ("temp_party","temp_party",pf_disabled, no_menu, pt_none, fac_commoners,0,ai_bhvr_hold,0,(0,0),[]), ("camp_bandits","camp_bandits",pf_disabled, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(1,1),[(trp_unarmed_troop,3,0)]), #parties before this point are hardwired. Their order should not be changed. ("temp_party_2","temp_party_2",pf_disabled, no_menu, pt_none, fac_commoners,0,ai_bhvr_hold,0,(0,0),[]), #Used for calculating casulties. ("temp_casualties","casualties",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), ("temp_casualties_2","casualties",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), ("temp_casualties_3","casualties",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), ("temp_wounded","enemies_wounded",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), ("temp_killed", "enemies_killed", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), ("main_party_backup","_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), ("encountered_party_backup","_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), # ("ally_party_backup","_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), ("collective_friends_backup","_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), ("player_casualties","_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), ("enemy_casualties","_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), ("ally_casualties","_", pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), ("collective_enemy","collective_enemy",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), #TODO: remove this and move all to collective ally ("collective_ally","collective_ally",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), ("collective_friends","collective_ally",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), # ("village_reinforcements","village_reinforcements",pf_is_static|pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]), ############################################################### ####################### # Formation vector #("formation_vector", "_", pf_disabled, no_menu, pt_none, fac_neutral, 0, ai_bhvr_hold, 0, (1, 1), []), #("formation_temp_vector", "_", pf_disabled, no_menu, pt_none, fac_neutral, 0, ai_bhvr_hold, 0, (1, 1), []), # Formation vector End ####################### ("zendar","Zendar",pf_disabled|icon_town|pf_is_static|pf_always_visible|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(18,60),[]), ("town_1","Sargoth", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-1.55, 66.45),[], 170), ("town_2","Tihr", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-48.9, 92.6),[], 120), ("town_3","Veluca", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-55,-57),[], 80), ("town_4","Suno", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-23, 33.5),[], 290), ("town_5","Jelkala", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-41, -20.35),[], 90), ("town_6","Praven", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-6.7, -15.6),[], 155), ("town_7","Uxkhal", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(13.8, -41.2),[], 240), ("town_8","Reyvadin", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(52.5, 53.5),[], 175), ("town_9","Khudan", icon_town_snow|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(89, 40.5),[], 90), ("town_10","Tulga", icon_town_steppe|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(70, -67.75),[], 310), ("town_11","Curaw", icon_town_snow|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(83 , 0.7),[], 150), ("town_12","Wercheg", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(43, 84.5),[], 25), ("town_13","Rivacheg",icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(73.7, 74.2),[], 60), ("town_14","Halmar", icon_town_steppe|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(28, -80),[], 135), ("town_15","Yalen", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-64.1, 16.5),[], 135), ("town_16","Dhirim", icon_town|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(20.7, 18.6),[], 135), ("town_17","Ichamur", icon_town_steppe|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(51, -48),[], 135), ("town_18","Narra", icon_town_steppe|pf_town, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-22.6, -82),[], 135), # Aztaq_Castle # Malabadi_Castle ("castle_1","Culmarr_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-69.2, 31.3),[],50), ("castle_2","Malayurg_Castle",icon_castle_b|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(33.6, -45.6),[],75), ("castle_3","Bulugha_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(67, 75),[],100), ("castle_4","Radoghir_Castle",icon_castle_c|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(91.5, 85.3),[],180), ("castle_5","Tehlrog_Castle",icon_castle_c|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-19.7, 50.1),[],90), ("castle_6","Tilbaut_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(23.3, 57.3),[],55), ("castle_7","Sungetche_Castle",icon_castle_snow_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(62, -28.5),[],45), ("castle_8","Jeirbe_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(33.5, 39.6),[],30), ("castle_9","Jamiche_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-46, -68.3),[],100), ("castle_10","Alburq_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(57, 81.5),[],110), ("castle_11","Curin_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-50.30, 81.36),[],75), ("castle_12","Chalbek_Castle",icon_castle_b|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-78.7, 89.5),[],95), ("castle_13","Kelredan_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-5, 36),[],115), ("castle_14","Maras_Castle",icon_castle_c|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-74.8, -34.25 ),[],90), ("castle_15","Ergellon_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-54.5, -15),[],235), ("castle_16","Almerra_Castle",icon_castle_c|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-34.7, -22.6),[],45), ("castle_17","Distar_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-27.65 , -68.3),[],15), ("castle_18","Ismirala_Castle",icon_castle_snow_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(64.7, -3),[],300), ("castle_19","Yruma_Castle",icon_castle_snow_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(71, 44),[],280), ("castle_20","Derchios_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(18.20, 28.82),[],260), ("castle_21","Ibdeles_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-56.8, 4.1),[],260), ("castle_22","Unuzdaq_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(2, -59.25),[],260), ("castle_23","Tevarin_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(7.75, -48),[],80), ("castle_24","Reindi_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-18.5, -18.3),[],260), ("castle_25","Ryibelet_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-41.7, 32.1),[],260), ("castle_26","Senuzgda_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-23.7, -5.4),[],260), ("castle_27","Rindyar_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(47.6, -3.5),[],260), ("castle_28","Grunwalder_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-22.75, -31.2),[],260), ("castle_29","Nelag_Castle",icon_castle_snow_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(96, 28),[],280), ("castle_30","Asugan_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(90, -62),[],260), ("castle_31","Vyincourd_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(46.3, 20),[],260), ("castle_32","Knudarr_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(5.5, 58),[],260), ("castle_33","Etrosq_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-51.8, 17.5),[],80), ("castle_34","Hrus_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-31, 69),[],260), ("castle_35","Haringoth_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(7, 4),[],260), ("castle_36","Jelbegi_Castle",icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-47, 59),[],260), ("castle_37","Dramug_Castle",icon_castle_c|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(57, 50),[],260), ("castle_38","Tulbuk_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(18, -94),[],260), ("castle_39","Slezkh_Castle",icon_castle_snow_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(89.4, 66.4),[],280), ("castle_40","Uhhun_Castle",icon_castle_d|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(50.8, -75),[],260), # Rinimad # Rietal Derchios Gerdus # Tuavus Pamir vezona ("village_1", "Yaragar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-15,0),[], 100), ("village_2", "Burglen", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(12,-20),[], 110), ("village_3", "Azgad", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(24,-3),[], 120), ("village_4", "Nomar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-7.4,31.2),[], 130), ("village_5", "Kulum", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(16, 73.5),[], 170), ("village_6", "Emirin", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-13,-25),[], 100), ("village_7", "Amere", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(20.8, -30.7),[], 110), ("village_8", "Haen", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-49.7, 74),[], 120), ("village_9", "Buvran", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-43,-11),[], 130), ("village_10","Mechin", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(21, 50.2),[], 170), ("village_11","Dusturil", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(32.9, -74),[], 100), ("village_12","Emer", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-45.8, -58.5),[], 110), ("village_13","Nemeja", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(25.1, 7.35),[], 120), ("village_14","Sumbuja", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(40,52),[], 130), ("village_15","Ryibelet", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-37.65,31.9),[], 170), ("village_16","Shapeshte", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(103, 80),[], 170), ("village_17","Mazen", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(80.1, 59),[], 35), ("village_18","Ulburban", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(73.7, 30.1),[], 170), ("village_19","Hanun", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(93.8 , 31),[], 170), ("village_20","Uslum", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(78, 14),[], 170), ("village_21","Bazeck", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(99 , 4),[], 100), ("village_22","Shulus", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(93, -13.5),[], 110), ("village_23","Ilvia", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-50, -42),[], 120), ("village_24","Ruldi", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-62.5, -68.2),[], 130), ("village_25","Dashbigha", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-14.6, -60),[], 170), ("village_26","Pagundur", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-68,-28),[], 170), ("village_27","Glunmar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-77.2 , 16),[], 170), ("village_28","Tash_Kulun", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(33.8, -50.8),[], 170), ("village_29","Buillin", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-77.5,70.5),[], 170), ("village_30","Ruvar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(51, 76),[], 170), ("village_31","Ambean", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-24, 53),[], 100), ("village_32","Tosdhar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0.5, -23.4),[], 110), ("village_33","Ruluns", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-10, 42),[], 120), ("village_34","Ehlerdah", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-28, 1),[], 130), ("village_35","Fearichen", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0, 90),[], 170), ("village_36","Jayek", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(36, 85),[], 170), ("village_37","Ada_Kulun", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-6.5, -88),[], 170), ("village_38","Ibiran", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(13, 22),[], 170), ("village_39","Reveran", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-49, 10),[], 170), ("village_40","Saren", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-24.22, -34.4),[], 170), ("village_41","Dugan", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(95.7, -81.5),[], 100), ("village_42","Dirigh_Aban", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(59.35, -64),[], 110), ("village_43","Zagush", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(36, -89.3),[], 120), ("village_44","Peshmi", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(86, -58.5),[], 130), ("village_45","Bulugur", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-24.8 , -71),[], 170), ("village_46","Fedner", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-73.18, -59.7),[], 170), ("village_47","Epeshe", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-96, 45),[], 170), ("village_48","Veidar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-88.1, -15),[], 170), ("village_49","Tismirr", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(68.7, -23.6),[], 10), ("village_50","Karindi", icon_village_snow_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(75.5, 45),[], 170), ("village_51","Jelbegi", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-50, 60.2),[], 100), ("village_52","Amashke", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(59.1, -47.8),[], 110), ("village_53","Balanli", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(49, 7),[], 120), ("village_54","Chide", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(46.5, -7.3),[], 130), ("village_55","Tadsamesh", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(32.6, 31.3),[], 170), ("village_56","Fenada", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-59.1, 93.3),[], 170), ("village_57","Ushkuru", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(33, 11.5),[], 170), ("village_58","Vezin", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(62, 41),[], 170), ("village_59","Dumar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-53 , 20),[], 170), ("village_60","Tahlberl", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(8.8, 0.5),[], 170), ("village_61","Aldelen", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-89.3, 86),[], 100), ("village_62","Rebache", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(38.4, 64.6),[], 100), ("village_63","Rduna", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(42.5, 21.46),[], 100), ("village_64","Serindiar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-41.5, -35.8),[], 100), ("village_65","Iyindah", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(8.6, -39.5),[], 100), ("village_66","Fisdnar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(69.6, 78.3),[], 100), ("village_67","Tebandra", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(99.9, 91.8),[], 100), ("village_68","Ibdeles", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-61, 2.45),[], 100), ("village_69","Kwynn", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-15.3, 75.4),[], 100), ("village_70","Dirigsene", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-73, -17.7),[], 100), ("village_71","Tshibtin", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0, -34),[], 20), ("village_72","Elberl", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-35.2, 21),[], 60), ("village_73","Chaeza", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-63.2, -51.4),[], 55), ("village_74","Ayyike", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(49, 31),[], 15), ("village_75","Bhulaban", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(95 , 50),[], 10), ("village_76","Kedelke", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0.6, -65.50),[], 35), ("village_77","Rizi", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-33.6, 73.3),[], 160), ("village_78","Sarimish", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-30.5, -14.3),[], 180), ("village_79","Istiniar", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-72.6, 34.1),[], 0), ("village_80","Vayejeg", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-1.5, 56),[], 40), ("village_81","Odasan", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-25, 81.6),[], 20), ("village_82","Yalibe", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-49.7, 43.1),[], 60), ("village_83","Gisim", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-78.1, 62),[], 55), ("village_84","Chelez", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-85.7, 34.5),[], 15), ("village_85","Ismirala", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(69.2, -0.4),[], 10), ("village_86","Slezkh", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(89.8, 61.5),[], 35), ("village_87","Udiniad", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(31.6, 73),[], 160), ("village_88","Tulbuk", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(21.1, -98.1),[], 180), ("village_89","Uhhun", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(50.2, -71.5),[], 0), ("village_90","Jamiche", icon_village_a|pf_village, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-48.7, -71.5),[], 40), ("salt_mine","Salt_Mine",icon_village_a|pf_disabled|pf_is_static|pf_always_visible|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(14.2, -31),[]), ("four_ways_inn","Four_Ways_Inn",icon_village_a|pf_disabled|pf_is_static|pf_always_visible|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(4.8, -39.6),[]), ("test_scene","test_scene",icon_village_a|pf_disabled|pf_is_static|pf_always_visible|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(10.8, -19.6),[]), ("battlefields","battlefields",pf_disabled|icon_village_a|pf_is_static|pf_always_visible|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(10.8, -16.6),[]), ("dhorak_keep","Dhorak_Keep",icon_town|pf_disabled|pf_is_static|pf_always_visible|pf_no_label|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-50,-58),[]), ("training_ground","Training Ground", pf_disabled|icon_training_ground|pf_hide_defenders|pf_is_static|pf_always_visible, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(3, -7),[]), ("training_ground_1", "Training Field", icon_training_ground|icon_training_ground|pf_hide_defenders|pf_is_static|pf_always_visible|pf_label_medium, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(44,61),[], 100), ("training_ground_2", "Training Field", icon_training_ground|icon_training_ground|pf_hide_defenders|pf_is_static|pf_always_visible|pf_label_medium, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-38, 81.7),[], 100), ("training_ground_3", "Training Field", icon_training_ground|icon_training_ground|pf_hide_defenders|pf_is_static|pf_always_visible|pf_label_medium, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(89.2, 16),[], 100), ("training_ground_4", "Training Field", icon_training_ground|icon_training_ground|pf_hide_defenders|pf_is_static|pf_always_visible|pf_label_medium, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(9.5 , -80.5),[], 100), ("training_ground_5", "Training Field", icon_training_ground|icon_training_ground|pf_hide_defenders|pf_is_static|pf_always_visible|pf_label_medium, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-34.75, -30.3),[], 100), # bridge_a ("Bridge_1","1",icon_bridge_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(11.56, 59.89),[], 90), ("Bridge_2","2",icon_bridge_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(2.14, 34.13),[], 64), ("Bridge_3","3",icon_bridge_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-66.92, 72.98),[], 10), ("Bridge_4","4",icon_bridge_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-76.94, 67.25),[], 90), ("Bridge_5","5",icon_bridge_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(82.16, 79.18),[], 135), ("Bridge_6","6",icon_bridge_snow_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(85.60, 64.32),[], 120), ("Bridge_7","7",icon_bridge_snow_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(82.47, 43.28),[], 75), ("Bridge_8","8",icon_bridge_snow_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(79.46, 21.19),[], 55), ("Bridge_9","9",icon_bridge_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(62.13, 48.21),[], 60), ("Bridge_10","10",icon_bridge_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(71.05, 54.55),[], 35), ("Bridge_11","11",icon_bridge_a|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-54.85, -41.40),[], 90), ("Bridge_12","12",icon_bridge_b|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(12.17, 79.57),[], 135), ("Bridge_13","13",icon_bridge_b|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(17.16, 81.16),[], 90), ("Bridge_14","14",icon_bridge_b|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(21.88, 78.80),[], 75), ("Bridge_15","15",icon_bridge_b|pf_is_static|pf_always_visible|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-68.01, -29.60),[], 15), ("looter_spawn_point" ,"looter_sp",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(26, 77),[(trp_looter,15,0)]), ("steppe_bandit_spawn_point" ,"steppe_bandit_sp",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(42, -73.3),[(trp_looter,15,0)]), ## ("black_khergit_spawn_point" ,"black_khergit_sp",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(47.1, -73.3),[(trp_looter,15,0)]), ("forest_bandit_spawn_point" ,"forest_bandit_sp",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(-30, 5.5),[(trp_looter,15,0)]), ("mountain_bandit_spawn_point","mountain_bandit_sp",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(46.4, 22.4),[(trp_looter,15,0)]), ("sea_raider_spawn_point_1" ,"sea_raider_sp",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(-43, 96),[(trp_looter,15,0)]), ("sea_raider_spawn_point_2" ,"sea_raider_sp",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(47, 86),[(trp_looter,15,0)]), # add extra towns before this point ("spawn_points_end" ,"last_spawn_point", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners,0,ai_bhvr_hold,0,(0., 0),[(trp_looter,15,0)]), ]
Python
sf_base_att_str = 0x000 sf_base_att_agi = 0x001 sf_base_att_int = 0x002 sf_base_att_cha = 0x003 sf_effects_party = 0x010 sf_inactive = 0x100 skl_trade = 0 skl_leadership = 1 skl_prisoner_management = 2 skl_reserved_1 = 3 skl_reserved_2 = 4 skl_reserved_3 = 5 skl_reserved_4 = 6 skl_reserved_5 = 7 skl_engineer = 8 skl_first_aid = 9 skl_surgery = 10 skl_wound_treatment = 11 skl_inventory_management = 12 skl_spotting = 13 skl_pathfinding = 14 skl_tactics = 15 skl_tracking = 16 skl_trainer = 17 skl_reserved_6 = 18 skl_reserved_7 = 19 skl_reserved_8 = 20 skl_reserved_9 = 21 skl_reserved_10 = 22 skl_horse_archery = 23 skl_riding = 24 skl_athletics = 25 skl_shield = 26 skl_weapon_master = 27 skl_reserved_11 = 28 skl_reserved_12 = 29 skl_reserved_13 = 30 skl_reserved_14 = 31 skl_reserved_15 = 32 skl_power_draw = 33 skl_power_throw = 34 skl_power_strike = 35 skl_ironflesh = 36 skl_reserved_16 = 37 skl_reserved_17 = 38 skl_reserved_18 = 39 skl_reserved_19 = 40 skl_reserved_20 = 41 knows_trade_1 = 1 knows_trade_2 = 2 knows_trade_3 = 3 knows_trade_4 = 4 knows_trade_5 = 5 knows_trade_6 = 6 knows_trade_7 = 7 knows_trade_8 = 8 knows_trade_9 = 9 knows_trade_10 = 10 knows_leadership_1 = 16 knows_leadership_2 = 32 knows_leadership_3 = 48 knows_leadership_4 = 64 knows_leadership_5 = 80 knows_leadership_6 = 96 knows_leadership_7 = 112 knows_leadership_8 = 128 knows_leadership_9 = 144 knows_leadership_10 = 160 knows_prisoner_management_1 = 256 knows_prisoner_management_2 = 512 knows_prisoner_management_3 = 768 knows_prisoner_management_4 = 1024 knows_prisoner_management_5 = 1280 knows_prisoner_management_6 = 1536 knows_prisoner_management_7 = 1792 knows_prisoner_management_8 = 2048 knows_prisoner_management_9 = 2304 knows_prisoner_management_10 = 2560 knows_reserved_1_1 = 4096 knows_reserved_1_2 = 8192 knows_reserved_1_3 = 12288 knows_reserved_1_4 = 16384 knows_reserved_1_5 = 20480 knows_reserved_1_6 = 24576 knows_reserved_1_7 = 28672 knows_reserved_1_8 = 32768 knows_reserved_1_9 = 36864 knows_reserved_1_10 = 40960 knows_reserved_2_1 = 65536 knows_reserved_2_2 = 131072 knows_reserved_2_3 = 196608 knows_reserved_2_4 = 262144 knows_reserved_2_5 = 327680 knows_reserved_2_6 = 393216 knows_reserved_2_7 = 458752 knows_reserved_2_8 = 524288 knows_reserved_2_9 = 589824 knows_reserved_2_10 = 655360 knows_reserved_3_1 = 1048576 knows_reserved_3_2 = 2097152 knows_reserved_3_3 = 3145728 knows_reserved_3_4 = 4194304 knows_reserved_3_5 = 5242880 knows_reserved_3_6 = 6291456 knows_reserved_3_7 = 7340032 knows_reserved_3_8 = 8388608 knows_reserved_3_9 = 9437184 knows_reserved_3_10 = 10485760 knows_reserved_4_1 = 16777216 knows_reserved_4_2 = 33554432 knows_reserved_4_3 = 50331648 knows_reserved_4_4 = 67108864 knows_reserved_4_5 = 83886080 knows_reserved_4_6 = 100663296 knows_reserved_4_7 = 117440512 knows_reserved_4_8 = 134217728 knows_reserved_4_9 = 150994944 knows_reserved_4_10 = 167772160 knows_reserved_5_1 = 268435456 knows_reserved_5_2 = 536870912 knows_reserved_5_3 = 805306368 knows_reserved_5_4 = 1073741824 knows_reserved_5_5 = 1342177280 knows_reserved_5_6 = 1610612736 knows_reserved_5_7 = 1879048192 knows_reserved_5_8 = 2147483648 knows_reserved_5_9 = 2415919104 knows_reserved_5_10 = 2684354560 knows_engineer_1 = 4294967296 knows_engineer_2 = 8589934592 knows_engineer_3 = 12884901888 knows_engineer_4 = 17179869184 knows_engineer_5 = 21474836480 knows_engineer_6 = 25769803776 knows_engineer_7 = 30064771072 knows_engineer_8 = 34359738368 knows_engineer_9 = 38654705664 knows_engineer_10 = 42949672960 knows_first_aid_1 = 68719476736 knows_first_aid_2 = 137438953472 knows_first_aid_3 = 206158430208 knows_first_aid_4 = 274877906944 knows_first_aid_5 = 343597383680 knows_first_aid_6 = 412316860416 knows_first_aid_7 = 481036337152 knows_first_aid_8 = 549755813888 knows_first_aid_9 = 618475290624 knows_first_aid_10 = 687194767360 knows_surgery_1 = 1099511627776 knows_surgery_2 = 2199023255552 knows_surgery_3 = 3298534883328 knows_surgery_4 = 4398046511104 knows_surgery_5 = 5497558138880 knows_surgery_6 = 6597069766656 knows_surgery_7 = 7696581394432 knows_surgery_8 = 8796093022208 knows_surgery_9 = 9895604649984 knows_surgery_10 = 10995116277760 knows_wound_treatment_1 = 17592186044416 knows_wound_treatment_2 = 35184372088832 knows_wound_treatment_3 = 52776558133248 knows_wound_treatment_4 = 70368744177664 knows_wound_treatment_5 = 87960930222080 knows_wound_treatment_6 = 105553116266496 knows_wound_treatment_7 = 123145302310912 knows_wound_treatment_8 = 140737488355328 knows_wound_treatment_9 = 158329674399744 knows_wound_treatment_10 = 175921860444160 knows_inventory_management_1 = 281474976710656 knows_inventory_management_2 = 562949953421312 knows_inventory_management_3 = 844424930131968 knows_inventory_management_4 = 1125899906842624 knows_inventory_management_5 = 1407374883553280 knows_inventory_management_6 = 1688849860263936 knows_inventory_management_7 = 1970324836974592 knows_inventory_management_8 = 2251799813685248 knows_inventory_management_9 = 2533274790395904 knows_inventory_management_10 = 2814749767106560 knows_spotting_1 = 4503599627370496 knows_spotting_2 = 9007199254740992 knows_spotting_3 = 13510798882111488 knows_spotting_4 = 18014398509481984 knows_spotting_5 = 22517998136852480 knows_spotting_6 = 27021597764222976 knows_spotting_7 = 31525197391593472 knows_spotting_8 = 36028797018963968 knows_spotting_9 = 40532396646334464 knows_spotting_10 = 45035996273704960 knows_pathfinding_1 = 72057594037927936 knows_pathfinding_2 = 144115188075855872 knows_pathfinding_3 = 216172782113783808 knows_pathfinding_4 = 288230376151711744 knows_pathfinding_5 = 360287970189639680 knows_pathfinding_6 = 432345564227567616 knows_pathfinding_7 = 504403158265495552 knows_pathfinding_8 = 576460752303423488 knows_pathfinding_9 = 648518346341351424 knows_pathfinding_10 = 720575940379279360 knows_tactics_1 = 1152921504606846976 knows_tactics_2 = 2305843009213693952 knows_tactics_3 = 3458764513820540928 knows_tactics_4 = 4611686018427387904 knows_tactics_5 = 5764607523034234880 knows_tactics_6 = 6917529027641081856 knows_tactics_7 = 8070450532247928832 knows_tactics_8 = 9223372036854775808 knows_tactics_9 = 10376293541461622784 knows_tactics_10 = 11529215046068469760 knows_tracking_1 = 18446744073709551616 knows_tracking_2 = 36893488147419103232 knows_tracking_3 = 55340232221128654848 knows_tracking_4 = 73786976294838206464 knows_tracking_5 = 92233720368547758080 knows_tracking_6 = 110680464442257309696 knows_tracking_7 = 129127208515966861312 knows_tracking_8 = 147573952589676412928 knows_tracking_9 = 166020696663385964544 knows_tracking_10 = 184467440737095516160 knows_trainer_1 = 295147905179352825856 knows_trainer_2 = 590295810358705651712 knows_trainer_3 = 885443715538058477568 knows_trainer_4 = 1180591620717411303424 knows_trainer_5 = 1475739525896764129280 knows_trainer_6 = 1770887431076116955136 knows_trainer_7 = 2066035336255469780992 knows_trainer_8 = 2361183241434822606848 knows_trainer_9 = 2656331146614175432704 knows_trainer_10 = 2951479051793528258560 knows_reserved_6_1 = 4722366482869645213696 knows_reserved_6_2 = 9444732965739290427392 knows_reserved_6_3 = 14167099448608935641088 knows_reserved_6_4 = 18889465931478580854784 knows_reserved_6_5 = 23611832414348226068480 knows_reserved_6_6 = 28334198897217871282176 knows_reserved_6_7 = 33056565380087516495872 knows_reserved_6_8 = 37778931862957161709568 knows_reserved_6_9 = 42501298345826806923264 knows_reserved_6_10 = 47223664828696452136960 knows_reserved_7_1 = 75557863725914323419136 knows_reserved_7_2 = 151115727451828646838272 knows_reserved_7_3 = 226673591177742970257408 knows_reserved_7_4 = 302231454903657293676544 knows_reserved_7_5 = 377789318629571617095680 knows_reserved_7_6 = 453347182355485940514816 knows_reserved_7_7 = 528905046081400263933952 knows_reserved_7_8 = 604462909807314587353088 knows_reserved_7_9 = 680020773533228910772224 knows_reserved_7_10 = 755578637259143234191360 knows_reserved_8_1 = 1208925819614629174706176 knows_reserved_8_2 = 2417851639229258349412352 knows_reserved_8_3 = 3626777458843887524118528 knows_reserved_8_4 = 4835703278458516698824704 knows_reserved_8_5 = 6044629098073145873530880 knows_reserved_8_6 = 7253554917687775048237056 knows_reserved_8_7 = 8462480737302404222943232 knows_reserved_8_8 = 9671406556917033397649408 knows_reserved_8_9 = 10880332376531662572355584 knows_reserved_8_10 = 12089258196146291747061760 knows_reserved_9_1 = 19342813113834066795298816 knows_reserved_9_2 = 38685626227668133590597632 knows_reserved_9_3 = 58028439341502200385896448 knows_reserved_9_4 = 77371252455336267181195264 knows_reserved_9_5 = 96714065569170333976494080 knows_reserved_9_6 = 116056878683004400771792896 knows_reserved_9_7 = 135399691796838467567091712 knows_reserved_9_8 = 154742504910672534362390528 knows_reserved_9_9 = 174085318024506601157689344 knows_reserved_9_10 = 193428131138340667952988160 knows_reserved_10_1 = 309485009821345068724781056 knows_reserved_10_2 = 618970019642690137449562112 knows_reserved_10_3 = 928455029464035206174343168 knows_reserved_10_4 = 1237940039285380274899124224 knows_reserved_10_5 = 1547425049106725343623905280 knows_reserved_10_6 = 1856910058928070412348686336 knows_reserved_10_7 = 2166395068749415481073467392 knows_reserved_10_8 = 2475880078570760549798248448 knows_reserved_10_9 = 2785365088392105618523029504 knows_reserved_10_10 = 3094850098213450687247810560 knows_horse_archery_1 = 4951760157141521099596496896 knows_horse_archery_2 = 9903520314283042199192993792 knows_horse_archery_3 = 14855280471424563298789490688 knows_horse_archery_4 = 19807040628566084398385987584 knows_horse_archery_5 = 24758800785707605497982484480 knows_horse_archery_6 = 29710560942849126597578981376 knows_horse_archery_7 = 34662321099990647697175478272 knows_horse_archery_8 = 39614081257132168796771975168 knows_horse_archery_9 = 44565841414273689896368472064 knows_horse_archery_10 = 49517601571415210995964968960 knows_riding_1 = 79228162514264337593543950336 knows_riding_2 = 158456325028528675187087900672 knows_riding_3 = 237684487542793012780631851008 knows_riding_4 = 316912650057057350374175801344 knows_riding_5 = 396140812571321687967719751680 knows_riding_6 = 475368975085586025561263702016 knows_riding_7 = 554597137599850363154807652352 knows_riding_8 = 633825300114114700748351602688 knows_riding_9 = 713053462628379038341895553024 knows_riding_10 = 792281625142643375935439503360 knows_athletics_1 = 1267650600228229401496703205376 knows_athletics_2 = 2535301200456458802993406410752 knows_athletics_3 = 3802951800684688204490109616128 knows_athletics_4 = 5070602400912917605986812821504 knows_athletics_5 = 6338253001141147007483516026880 knows_athletics_6 = 7605903601369376408980219232256 knows_athletics_7 = 8873554201597605810476922437632 knows_athletics_8 = 10141204801825835211973625643008 knows_athletics_9 = 11408855402054064613470328848384 knows_athletics_10 = 12676506002282294014967032053760 knows_shield_1 = 20282409603651670423947251286016 knows_shield_2 = 40564819207303340847894502572032 knows_shield_3 = 60847228810955011271841753858048 knows_shield_4 = 81129638414606681695789005144064 knows_shield_5 = 101412048018258352119736256430080 knows_shield_6 = 121694457621910022543683507716096 knows_shield_7 = 141976867225561692967630759002112 knows_shield_8 = 162259276829213363391578010288128 knows_shield_9 = 182541686432865033815525261574144 knows_shield_10 = 202824096036516704239472512860160 knows_weapon_master_1 = 324518553658426726783156020576256 knows_weapon_master_2 = 649037107316853453566312041152512 knows_weapon_master_3 = 973555660975280180349468061728768 knows_weapon_master_4 = 1298074214633706907132624082305024 knows_weapon_master_5 = 1622592768292133633915780102881280 knows_weapon_master_6 = 1947111321950560360698936123457536 knows_weapon_master_7 = 2271629875608987087482092144033792 knows_weapon_master_8 = 2596148429267413814265248164610048 knows_weapon_master_9 = 2920666982925840541048404185186304 knows_weapon_master_10 = 3245185536584267267831560205762560 knows_reserved_11_1 = 5192296858534827628530496329220096 knows_reserved_11_2 = 10384593717069655257060992658440192 knows_reserved_11_3 = 15576890575604482885591488987660288 knows_reserved_11_4 = 20769187434139310514121985316880384 knows_reserved_11_5 = 25961484292674138142652481646100480 knows_reserved_11_6 = 31153781151208965771182977975320576 knows_reserved_11_7 = 36346078009743793399713474304540672 knows_reserved_11_8 = 41538374868278621028243970633760768 knows_reserved_11_9 = 46730671726813448656774466962980864 knows_reserved_11_10 = 51922968585348276285304963292200960 knows_reserved_12_1 = 83076749736557242056487941267521536 knows_reserved_12_2 = 166153499473114484112975882535043072 knows_reserved_12_3 = 249230249209671726169463823802564608 knows_reserved_12_4 = 332306998946228968225951765070086144 knows_reserved_12_5 = 415383748682786210282439706337607680 knows_reserved_12_6 = 498460498419343452338927647605129216 knows_reserved_12_7 = 581537248155900694395415588872650752 knows_reserved_12_8 = 664613997892457936451903530140172288 knows_reserved_12_9 = 747690747629015178508391471407693824 knows_reserved_12_10 = 830767497365572420564879412675215360 knows_reserved_13_1 = 1329227995784915872903807060280344576 knows_reserved_13_2 = 2658455991569831745807614120560689152 knows_reserved_13_3 = 3987683987354747618711421180841033728 knows_reserved_13_4 = 5316911983139663491615228241121378304 knows_reserved_13_5 = 6646139978924579364519035301401722880 knows_reserved_13_6 = 7975367974709495237422842361682067456 knows_reserved_13_7 = 9304595970494411110326649421962412032 knows_reserved_13_8 = 10633823966279326983230456482242756608 knows_reserved_13_9 = 11963051962064242856134263542523101184 knows_reserved_13_10 = 13292279957849158729038070602803445760 knows_reserved_14_1 = 21267647932558653966460912964485513216 knows_reserved_14_2 = 42535295865117307932921825928971026432 knows_reserved_14_3 = 63802943797675961899382738893456539648 knows_reserved_14_4 = 85070591730234615865843651857942052864 knows_reserved_14_5 = 106338239662793269832304564822427566080 knows_reserved_14_6 = 127605887595351923798765477786913079296 knows_reserved_14_7 = 148873535527910577765226390751398592512 knows_reserved_14_8 = 170141183460469231731687303715884105728 knows_reserved_14_9 = 191408831393027885698148216680369618944 knows_reserved_14_10 = 212676479325586539664609129644855132160 knows_reserved_15_1 = 340282366920938463463374607431768211456 knows_reserved_15_2 = 680564733841876926926749214863536422912 knows_reserved_15_3 = 1020847100762815390390123822295304634368 knows_reserved_15_4 = 1361129467683753853853498429727072845824 knows_reserved_15_5 = 1701411834604692317316873037158841057280 knows_reserved_15_6 = 2041694201525630780780247644590609268736 knows_reserved_15_7 = 2381976568446569244243622252022377480192 knows_reserved_15_8 = 2722258935367507707706996859454145691648 knows_reserved_15_9 = 3062541302288446171170371466885913903104 knows_reserved_15_10 = 3402823669209384634633746074317682114560 knows_power_draw_1 = 5444517870735015415413993718908291383296 knows_power_draw_2 = 10889035741470030830827987437816582766592 knows_power_draw_3 = 16333553612205046246241981156724874149888 knows_power_draw_4 = 21778071482940061661655974875633165533184 knows_power_draw_5 = 27222589353675077077069968594541456916480 knows_power_draw_6 = 32667107224410092492483962313449748299776 knows_power_draw_7 = 38111625095145107907897956032358039683072 knows_power_draw_8 = 43556142965880123323311949751266331066368 knows_power_draw_9 = 49000660836615138738725943470174622449664 knows_power_draw_10 = 54445178707350154154139937189082913832960 knows_power_throw_1 = 87112285931760246646623899502532662132736 knows_power_throw_2 = 174224571863520493293247799005065324265472 knows_power_throw_3 = 261336857795280739939871698507597986398208 knows_power_throw_4 = 348449143727040986586495598010130648530944 knows_power_throw_5 = 435561429658801233233119497512663310663680 knows_power_throw_6 = 522673715590561479879743397015195972796416 knows_power_throw_7 = 609786001522321726526367296517728634929152 knows_power_throw_8 = 696898287454081973172991196020261297061888 knows_power_throw_9 = 784010573385842219819615095522793959194624 knows_power_throw_10 = 871122859317602466466238995025326621327360 knows_power_strike_1 = 1393796574908163946345982392040522594123776 knows_power_strike_2 = 2787593149816327892691964784081045188247552 knows_power_strike_3 = 4181389724724491839037947176121567782371328 knows_power_strike_4 = 5575186299632655785383929568162090376495104 knows_power_strike_5 = 6968982874540819731729911960202612970618880 knows_power_strike_6 = 8362779449448983678075894352243135564742656 knows_power_strike_7 = 9756576024357147624421876744283658158866432 knows_power_strike_8 = 11150372599265311570767859136324180752990208 knows_power_strike_9 = 12544169174173475517113841528364703347113984 knows_power_strike_10 = 13937965749081639463459823920405225941237760 knows_ironflesh_1 = 22300745198530623141535718272648361505980416 knows_ironflesh_2 = 44601490397061246283071436545296723011960832 knows_ironflesh_3 = 66902235595591869424607154817945084517941248 knows_ironflesh_4 = 89202980794122492566142873090593446023921664 knows_ironflesh_5 = 111503725992653115707678591363241807529902080 knows_ironflesh_6 = 133804471191183738849214309635890169035882496 knows_ironflesh_7 = 156105216389714361990750027908538530541862912 knows_ironflesh_8 = 178405961588244985132285746181186892047843328 knows_ironflesh_9 = 200706706786775608273821464453835253553823744 knows_ironflesh_10 = 223007451985306231415357182726483615059804160 knows_reserved_16_1 = 356811923176489970264571492362373784095686656 knows_reserved_16_2 = 713623846352979940529142984724747568191373312 knows_reserved_16_3 = 1070435769529469910793714477087121352287059968 knows_reserved_16_4 = 1427247692705959881058285969449495136382746624 knows_reserved_16_5 = 1784059615882449851322857461811868920478433280 knows_reserved_16_6 = 2140871539058939821587428954174242704574119936 knows_reserved_16_7 = 2497683462235429791852000446536616488669806592 knows_reserved_16_8 = 2854495385411919762116571938898990272765493248 knows_reserved_16_9 = 3211307308588409732381143431261364056861179904 knows_reserved_16_10 = 3568119231764899702645714923623737840956866560 knows_reserved_17_1 = 5708990770823839524233143877797980545530986496 knows_reserved_17_2 = 11417981541647679048466287755595961091061972992 knows_reserved_17_3 = 17126972312471518572699431633393941636592959488 knows_reserved_17_4 = 22835963083295358096932575511191922182123945984 knows_reserved_17_5 = 28544953854119197621165719388989902727654932480 knows_reserved_17_6 = 34253944624943037145398863266787883273185918976 knows_reserved_17_7 = 39962935395766876669632007144585863818716905472 knows_reserved_17_8 = 45671926166590716193865151022383844364247891968 knows_reserved_17_9 = 51380916937414555718098294900181824909778878464 knows_reserved_17_10 = 57089907708238395242331438777979805455309864960 knows_reserved_18_1 = 91343852333181432387730302044767688728495783936 knows_reserved_18_2 = 182687704666362864775460604089535377456991567872 knows_reserved_18_3 = 274031556999544297163190906134303066185487351808 knows_reserved_18_4 = 365375409332725729550921208179070754913983135744 knows_reserved_18_5 = 456719261665907161938651510223838443642478919680 knows_reserved_18_6 = 548063113999088594326381812268606132370974703616 knows_reserved_18_7 = 639406966332270026714112114313373821099470487552 knows_reserved_18_8 = 730750818665451459101842416358141509827966271488 knows_reserved_18_9 = 822094670998632891489572718402909198556462055424 knows_reserved_18_10 = 913438523331814323877303020447676887284957839360 knows_reserved_19_1 = 1461501637330902918203684832716283019655932542976 knows_reserved_19_2 = 2923003274661805836407369665432566039311865085952 knows_reserved_19_3 = 4384504911992708754611054498148849058967797628928 knows_reserved_19_4 = 5846006549323611672814739330865132078623730171904 knows_reserved_19_5 = 7307508186654514591018424163581415098279662714880 knows_reserved_19_6 = 8769009823985417509222108996297698117935595257856 knows_reserved_19_7 = 10230511461316320427425793829013981137591527800832 knows_reserved_19_8 = 11692013098647223345629478661730264157247460343808 knows_reserved_19_9 = 13153514735978126263833163494446547176903392886784 knows_reserved_19_10 = 14615016373309029182036848327162830196559325429760 knows_reserved_20_1 = 23384026197294446691258957323460528314494920687616 knows_reserved_20_2 = 46768052394588893382517914646921056628989841375232 knows_reserved_20_3 = 70152078591883340073776871970381584943484762062848 knows_reserved_20_4 = 93536104789177786765035829293842113257979682750464 knows_reserved_20_5 = 116920130986472233456294786617302641572474603438080 knows_reserved_20_6 = 140304157183766680147553743940763169886969524125696 knows_reserved_20_7 = 163688183381061126838812701264223698201464444813312 knows_reserved_20_8 = 187072209578355573530071658587684226515959365500928 knows_reserved_20_9 = 210456235775650020221330615911144754830454286188544 knows_reserved_20_10 = 233840261972944466912589573234605283144949206876160 num_skill_words = 6
Python
import string from module_info import * from module_quests import * from process_common import * def save_quests(): ofile = open(export_dir + "quests.txt","w") ofile.write("questsfile version 1\n") ofile.write("%d\n"%(len(quests))) for i_quest in xrange(len(quests)): quest = quests[i_quest] ofile.write("qst_%s %s %d "%(quest[0],(string.replace(quest[1]," ","_")),quest[2])) ofile.write("%s "%(string.replace(quest[3]," ","_"))) ofile.write("\n") ofile.close() def save_python_header(): ofile = open("./ID_quests.py","w") for i_quest in xrange(len(quests)): ofile.write("qst_%s = %d\n"%(quests[i_quest][0],i_quest)) for i_quest in xrange(len(quests)): ofile.write("qsttag_%s = %d\n"%(quests[i_quest][0],opmask_quest_index|i_quest)) ofile.write("\n\n") ofile.close() print "Exporting quest data..." save_quests() save_python_header()
Python
from module_info import * from module_scenes import * from process_common import * def save_python_header(): ofile = open("./ID_scenes.py","w") for i_scene in xrange(len(scenes)): ofile.write("scn_%s = %d\n"%(convert_to_identifier(scenes[i_scene][0]),i_scene)) ofile.close() print "Exporting scene data..." save_python_header() from process_operations import * from module_troops import * scene_name_pos = 0 passages_pos = 8 scene_outer_terrain_pos = 10 def write_vec(ofile,vec): ofile.write(" %f %f %f "%vec) def write_passage(ofile,scenes,passage): scene_no = 0 found = 0 while (not found) and (scene_no < len(scenes)): if (scenes[scene_no][0] == passage): found = 1 else: scene_no += 1 if (passage == "exit"): scene_no = 100000 elif (passage == ""): scene_no = 0 elif not found: print "Error passage not found:" print passage do_error() ofile.write(" %d "%scene_no) def save_scenes(variables,variable_uses,tag_uses): ofile = open(export_dir + "scenes.txt","w") ofile.write("scenesfile version 1\n") ofile.write(" %d\n"%len(scenes)) for scene in scenes: ofile.write("scn_%s %s %d %s %s %f %f %f %f %f %s "%(convert_to_identifier(scene[0]),replace_spaces(scene[0]),scene[1], scene[2],scene[3],scene[4][0],scene[4][1],scene[5][0],scene[5][1],scene[6],scene[7])) passages = scene[passages_pos] ofile.write("\n %d "%len(passages)) for passage in passages: write_passage(ofile,scenes,passage) chest_troops = scene[9] ofile.write("\n %d "%len(chest_troops)) for chest_troop in chest_troops: troop_no = find_troop(troops,chest_troop) if (troop_no < 0): print "Error unable to find chest-troop: " + chest_troop troop_no = 0 else: add_tag_use(tag_uses,tag_troop,troop_no) ofile.write(" %d "%troop_no) ofile.write("\n") if (len(scene) > scene_outer_terrain_pos): ofile.write(" %s "%scene[scene_outer_terrain_pos]) else: ofile.write(" 0 ") ofile.write("\n") ofile.close() variable_uses = [] variables = load_variables(export_dir, variable_uses) tag_uses = load_tag_uses(export_dir) quick_strings = load_quick_strings(export_dir) save_scenes(variables,variable_uses,tag_uses) save_variables(export_dir,variables,variable_uses) save_tag_uses(export_dir,tag_uses) save_quick_strings(export_dir,quick_strings)
Python
from header_common import * from header_scene_props import * from header_operations import * from header_triggers import * from header_sounds import * from module_constants import * import string #################################################################################################################### # Each scene prop record contains the following fields: # 1) Scene prop id: used for referencing scene props in other files. The prefix spr_ is automatically added before each scene prop id. # 2) Scene prop flags. See header_scene_props.py for a list of available flags # 3) Mesh name: Name of the mesh. # 4) Physics object name: # 5) Triggers: Simple triggers that are associated with the scene prop #################################################################################################################### scene_props = [ ("invalid_object",0,"question_mark","0", []), ("inventory",sokf_type_container|sokf_place_at_origin,"package","bobaggage", []), ("empty", 0, "0", "0", []), ("chest_a",sokf_type_container,"chest_gothic","bochest_gothic", []), ("container_small_chest",sokf_type_container,"package","bobaggage", []), ("container_chest_b",sokf_type_container,"chest_b","bo_chest_b", []), ("container_chest_c",sokf_type_container,"chest_c","bo_chest_c", []), ("player_chest",sokf_type_container,"player_chest","bo_player_chest", []), ("locked_player_chest",0,"player_chest","bo_player_chest", []), ("light_sun",sokf_invisible,"light_sphere","0", [ (ti_on_init_scene_prop, [ (neg|is_currently_night), (store_trigger_param_1, ":prop_instance_no"), (set_fixed_point_multiplier, 100), (prop_instance_get_scale, pos5, ":prop_instance_no"), (position_get_scale_x, ":scale", pos5), (store_time_of_day,reg(12)), (try_begin), (is_between,reg(12),5,20), (store_mul, ":red", 5 * 200, ":scale"), (store_mul, ":green", 5 * 193, ":scale"), (store_mul, ":blue", 5 * 180, ":scale"), (else_try), (store_mul, ":red", 5 * 90, ":scale"), (store_mul, ":green", 5 * 115, ":scale"), (store_mul, ":blue", 5 * 150, ":scale"), (try_end), (val_div, ":red", 100), (val_div, ":green", 100), (val_div, ":blue", 100), (set_current_color,":red", ":green", ":blue"), (set_position_delta,0,0,0), (add_point_light, 0, 0), ]), ]), ("light",sokf_invisible,"light_sphere","0", [ (ti_on_init_scene_prop, [ (store_trigger_param_1, ":prop_instance_no"), (set_fixed_point_multiplier, 100), (prop_instance_get_scale, pos5, ":prop_instance_no"), (position_get_scale_x, ":scale", pos5), (store_mul, ":red", 3 * 200, ":scale"), (store_mul, ":green", 3 * 145, ":scale"), (store_mul, ":blue", 3 * 45, ":scale"), (val_div, ":red", 100), (val_div, ":green", 100), (val_div, ":blue", 100), (set_current_color,":red", ":green", ":blue"), (set_position_delta,0,0,0), (add_point_light, 10, 30), ]), ]), ("light_red",sokf_invisible,"light_sphere","0", [ (ti_on_init_scene_prop, [ (store_trigger_param_1, ":prop_instance_no"), (set_fixed_point_multiplier, 100), (prop_instance_get_scale, pos5, ":prop_instance_no"), (position_get_scale_x, ":scale", pos5), (store_mul, ":red", 2 * 170, ":scale"), (store_mul, ":green", 2 * 100, ":scale"), (store_mul, ":blue", 2 * 30, ":scale"), (val_div, ":red", 100), (val_div, ":green", 100), (val_div, ":blue", 100), (set_current_color,":red", ":green", ":blue"), (set_position_delta,0,0,0), (add_point_light, 20, 30), ]), ]), ("light_night",sokf_invisible,"light_sphere","0", [ (ti_on_init_scene_prop, [ # (store_time_of_day,reg(12)), # (neg|is_between,reg(12),5,20), (is_currently_night, 0), (store_trigger_param_1, ":prop_instance_no"), (set_fixed_point_multiplier, 100), (prop_instance_get_scale, pos5, ":prop_instance_no"), (position_get_scale_x, ":scale", pos5), (store_mul, ":red", 3 * 160, ":scale"), (store_mul, ":green", 3 * 145, ":scale"), (store_mul, ":blue", 3 * 100, ":scale"), (val_div, ":red", 100), (val_div, ":green", 100), (val_div, ":blue", 100), (set_current_color,":red", ":green", ":blue"), (set_position_delta,0,0,0), (add_point_light, 10, 30), ]), ]), ("torch",0,"torch_a","0", [ (ti_on_init_scene_prop, [ (set_position_delta,0,-35,48), (particle_system_add_new, "psys_torch_fire"), (particle_system_add_new, "psys_torch_smoke"), (particle_system_add_new, "psys_torch_fire_sparks"), (play_sound, "snd_torch_loop", 0), (set_position_delta,0,-35,56), (particle_system_add_new, "psys_fire_glow_1"), # (particle_system_emit, "psys_fire_glow_1",9000000), #second method (get_trigger_object_position, pos2), (set_position_delta,0,0,0), (position_move_y, pos2, -35), (position_move_z, pos2, 55), (particle_system_burst, "psys_fire_glow_fixed", pos2, 1), ]), ]), ("torch_night",0,"torch_a","0", [ (ti_on_init_scene_prop, [ # (store_time_of_day,reg(12)), # (neg|is_between,reg(12),5,20), (is_currently_night, 0), (set_position_delta,0,-35,48), (particle_system_add_new, "psys_torch_fire"), (particle_system_add_new, "psys_torch_smoke"), (particle_system_add_new, "psys_torch_fire_sparks"), (set_position_delta,0,-35,56), (particle_system_add_new, "psys_fire_glow_1"), (particle_system_emit, "psys_fire_glow_1",9000000), (play_sound, "snd_torch_loop", 0), ]), ]), # ("Baggage",sokf_place_at_origin|sokf_entity_body,"package","bobaggage"), ("barrier_20m",sokf_invisible|sokf_type_barrier,"barrier_20m","bo_barrier_20m", []), ("barrier_16m",sokf_invisible|sokf_type_barrier,"barrier_16m","bo_barrier_16m", []), ("barrier_8m" ,sokf_invisible|sokf_type_barrier,"barrier_8m" ,"bo_barrier_8m" , []), ("barrier_4m" ,sokf_invisible|sokf_type_barrier,"barrier_4m" ,"bo_barrier_4m" , []), ("barrier_2m" ,sokf_invisible|sokf_type_barrier,"barrier_2m" ,"bo_barrier_2m" , []), ("exit_4m" ,sokf_invisible|sokf_type_barrier_leave,"barrier_4m" ,"bo_barrier_4m" , []), ("exit_8m" ,sokf_invisible|sokf_type_barrier_leave,"barrier_8m" ,"bo_barrier_8m" , []), ("exit_16m" ,sokf_invisible|sokf_type_barrier_leave,"barrier_16m" ,"bo_barrier_16m" , []), ("ai_limiter_2m" ,sokf_invisible|sokf_type_ai_limiter,"barrier_2m" ,"bo_barrier_2m" , []), ("ai_limiter_4m" ,sokf_invisible|sokf_type_ai_limiter,"barrier_4m" ,"bo_barrier_4m" , []), ("ai_limiter_8m" ,sokf_invisible|sokf_type_ai_limiter,"barrier_8m" ,"bo_barrier_8m" , []), ("ai_limiter_16m",sokf_invisible|sokf_type_ai_limiter,"barrier_16m","bo_barrier_16m", []), ("Shield",sokf_dynamic,"0","boshield", []), ("shelves",0,"shelves","boshelves", []), ("table_tavern",0,"table_tavern","botable_tavern", []), ("table_castle_a",0,"table_castle_a","bo_table_castle_a", []), ("chair_castle_a",0,"chair_castle_a","bo_chair_castle_a", []), ("pillow_a",0,"pillow_a","bo_pillow", []), ("pillow_b",0,"pillow_b","bo_pillow", []), ("pillow_c",0,"pillow_c","0", []), ("interior_castle_g_square_keep_b",0,"interior_castle_g_square_keep_b","bo_interior_castle_g_square_keep_b", []), ("carpet_with_pillows_a",0,"carpet_with_pillows_a","bo_carpet_with_pillows", []), ("carpet_with_pillows_b",0,"carpet_with_pillows_b","bo_carpet_with_pillows", []), ("table_round_a",0,"table_round_a","bo_table_round_a", []), ("table_round_b",0,"table_round_b","bo_table_round_b", []), ("fireplace_b",0,"fireplace_b","bo_fireplace_b", []), ("fireplace_c",0,"fireplace_c","bo_fireplace_c", []), ("sofa_a",0,"sofa_a","bo_sofa", []), ("sofa_b",0,"sofa_b","bo_sofa", []), ("ewer_a",0,"ewer_a","bo_ewer_a", []), ("end_table_a",0,"end_table_a","bo_end_table_a", []), ("fake_houses_steppe_a",0,"fake_houses_steppe_a","0", []), ("fake_houses_steppe_b",0,"fake_houses_steppe_b","0", []), ("fake_houses_steppe_c",0,"fake_houses_steppe_c","0", []), ("boat_destroy",0,"boat_destroy","bo_boat_destroy", []), ("destroy_house_a",0,"destroy_house_a","bo_destroy_house_a", []), ("destroy_house_b",0,"destroy_house_b","bo_destroy_house_b", []), ("destroy_house_c",0,"destroy_house_c","bo_destroy_house_c", []), ("destroy_heap",0,"destroy_heap","bo_destroy_heap", []), ("destroy_castle_a",0,"destroy_castle_a","bo_destroy_castle_a", []), ("destroy_castle_b",0,"destroy_castle_b","bo_destroy_castle_b", []), ("destroy_castle_c",0,"destroy_castle_c","bo_destroy_castle_c", []), ("destroy_castle_d",0,"destroy_castle_d","bo_destroy_castle_d", []), ("destroy_windmill",0,"destroy_windmill","bo_destroy_windmill", []), ("destroy_tree_a",0,"destroy_tree_a","bo_destroy_tree_a", []), ("destroy_tree_b",0,"destroy_tree_b","bo_destroy_tree_b", []), ("destroy_bridge_a",0,"destroy_bridge_a","bo_destroy_bridge_a", []), ("destroy_bridge_b",0,"destroy_bridge_b","bo_destroy_bridge_b", []), ("Catapult",0,"Catapult","bo_Catapult", []), ("broom",0,"broom","0", []), ("garlic",0,"garlic","0", []), ("garlic_b",0,"garlic_b","0", []), ("destroy_a",0,"destroy_a","0", []), ("destroy_b",0,"destroy_b","0", []), ("bridge_wooden",0,"bridge_wooden","bo_bridge_wooden", []), ("bridge_wooden_snowy",0,"bridge_wooden_snowy","bo_bridge_wooden", []), ("grave_a",0,"grave_a","bo_grave_a", []), ("village_house_e",0,"village_house_e","bo_village_house_e", []), ("village_house_f",0,"village_house_f","bo_village_house_f", []), ("village_house_g",0,"village_house_g","bo_village_house_g", []), ("village_house_h",0,"village_house_h","bo_village_house_h", []), ("village_house_i",0,"village_house_i","bo_village_house_i", []), ("village_house_j",0,"village_house_j","bo_village_house_j", []), ("village_wall_a",0,"village_wall_a","bo_village_wall_a", []), ("village_wall_b",0,"village_wall_b","bo_village_wall_b", []), ("village_snowy_house_a",0,"village_snowy_house_a","bo_village_snowy_house_a", []), ("village_snowy_house_b",0,"village_snowy_house_b","bo_village_snowy_house_b", []), ("village_snowy_house_c",0,"village_snowy_house_c","bo_village_snowy_house_c", []), ("village_snowy_house_d",0,"village_snowy_house_d","bo_village_snowy_house_d", []), ("village_snowy_house_e",0,"village_snowy_house_e","bo_village_snowy_house_e", []), ("village_snowy_house_f",0,"village_snowy_house_f","bo_village_snowy_house_f", []), ("town_house_steppe_a",0,"town_house_steppe_a","bo_town_house_steppe_a", []), ("town_house_steppe_b",0,"town_house_steppe_b","bo_town_house_steppe_b", []), ("town_house_steppe_c",0,"town_house_steppe_c","bo_town_house_steppe_c", []), ("town_house_steppe_d",0,"town_house_steppe_d","bo_town_house_steppe_d", []), ("town_house_steppe_e",0,"town_house_steppe_e","bo_town_house_steppe_e", []), ("town_house_steppe_f",0,"town_house_steppe_f","bo_town_house_steppe_f", []), ("town_house_steppe_g",0,"town_house_steppe_g","bo_town_house_steppe_g", []), ("town_house_steppe_h",0,"town_house_steppe_h","bo_town_house_steppe_h", []), ("town_house_steppe_i",0,"town_house_steppe_i","bo_town_house_steppe_i", []), ("carpet_a",0,"carpet_a","0", []), ("carpet_b",0,"carpet_b","0", []), ("carpet_c",0,"carpet_c","0", []), ("carpet_d",0,"carpet_d","0", []), ("carpet_e",0,"carpet_e","0", []), ("carpet_f",0,"carpet_f","0", []), ("awning_a",0,"awning_a","bo_awning", []), ("awning_b",0,"awning_b","bo_awning", []), ("awning_c",0,"awning_c","bo_awning", []), ("awning_long",0,"awning_long","bo_awning_long", []), ("awning_long_b",0,"awning_long_b","bo_awning_long", []), ("awning_d",0,"awning_d","bo_awning_d", []), ("snowy_barrel_a",0,"snowy_barrel_a","bo_snowy_barrel_a", []), ("snowy_fence",0,"snowy_fence","bo_snowy_fence", []), ("snowy_wood_heap",0,"snowy_wood_heap","bo_snowy_wood_heap", []), ("village_snowy_stable_a",0,"village_snowy_stable_a","bo_village_snowy_stable_a", []), ("village_straw_house_a",0,"village_straw_house_a","bo_village_straw_house_a", []), ("village_stable_a",0,"village_stable_a","bo_village_stable_a", []), ("village_shed_a",0,"village_shed_a","bo_village_shed_a", []), ("village_shed_b",0,"village_shed_b","bo_village_shed_b", []), ("trunks_snowy",0,"trunks_snowy","0", []), ("dungeon_door_cell_a",0,"dungeon_door_cell_a","bo_dungeon_door_cell_a", []), ("dungeon_door_cell_b",0,"dungeon_door_cell_b","bo_dungeon_door_cell_b", []), ("dungeon_door_entry_a",0,"dungeon_door_entry_a","bo_dungeon_door_entry_a", []), ("dungeon_door_entry_b",0,"dungeon_door_entry_b","bo_dungeon_door_entry_a", []), ("dungeon_door_entry_c",0,"dungeon_door_entry_c","bo_dungeon_door_entry_a", []), ("dungeon_door_direction_a",0,"dungeon_door_direction_a","bo_dungeon_door_direction_a", []), ("dungeon_door_direction_b",0,"dungeon_door_direction_b","bo_dungeon_door_direction_a", []), ("dungeon_door_stairs_a",0,"dungeon_door_stairs_a","bo_dungeon_door_stairs_a", []), ("dungeon_door_stairs_b",0,"dungeon_door_stairs_b","bo_dungeon_door_stairs_a", []), ("dungeon_bed_a",0,"dungeon_bed_a","0", []), ("dungeon_bed_b",0,"dungeon_bed_b","bo_dungeon_bed_b", []), ("torture_tool_a",0,"torture_tool_a","bo_torture_tool_a", []), ("torture_tool_b",0,"torture_tool_b","0", []), ("torture_tool_c",0,"torture_tool_c","bo_torture_tool_c", []), ("skeleton_head",0,"skeleton_head","0", []), ("skeleton_bone",0,"skeleton_bone","0", []), ("skeleton_a",0,"skeleton_a","bo_skeleton_a", []), ("dungeon_stairs_a",0,"dungeon_stairs_a","bo_dungeon_stairs_a", []), ("dungeon_stairs_b",0,"dungeon_stairs_b","bo_dungeon_stairs_a", []), ("dungeon_torture_room_a",0,"dungeon_torture_room_a","bo_dungeon_torture_room_a", []), ("dungeon_entry_a",0,"dungeon_entry_a","bo_dungeon_entry_a", []), ("dungeon_entry_b",0,"dungeon_entry_b","bo_dungeon_entry_b", []), ("dungeon_entry_c",0,"dungeon_entry_c","bo_dungeon_entry_c", []), ("dungeon_cell_a",0,"dungeon_cell_a","bo_dungeon_cell_a", []), ("dungeon_cell_b",0,"dungeon_cell_b","bo_dungeon_cell_b", []), ("dungeon_cell_c",0,"dungeon_cell_c","bo_dungeon_cell_c", []), ("dungeon_corridor_a",0,"dungeon_corridor_a","bo_dungeon_corridor_a", []), ("dungeon_corridor_b",0,"dungeon_corridor_b","bo_dungeon_corridor_b", []), ("dungeon_corridor_c",0,"dungeon_corridor_c","bo_dungeon_corridor_b", []), ("dungeon_corridor_d",0,"dungeon_corridor_d","bo_dungeon_corridor_b", []), ("dungeon_direction_a",0,"dungeon_direction_a","bo_dungeon_direction_a", []), ("dungeon_direction_b",0,"dungeon_direction_b","bo_dungeon_direction_a", []), ("dungeon_room_a",0,"dungeon_room_a","bo_dungeon_room_a", []), ("dungeon_tower_stairs_a",0,"dungeon_tower_stairs_a","bo_dungeon_tower_stairs_a", []), ("dungeon_tower_cell_a",0,"dungeon_tower_cell_a","bo_dungeon_tower_cell_a", []), ("tunnel_a",0,"tunnel_a","bo_tunnel_a", []), ("tunnel_salt",0,"tunnel_salt","bo_tunnel_salt", []), ("salt_a",0,"salt_a","bo_salt_a", []), ("tutorial_door_a",sokf_moveable,"tutorial_door_a","bo_tutorial_door_a", []), ("tutorial_door_b",sokf_moveable,"tutorial_door_b","bo_tutorial_door_b", []), ("tutorial_flag_yellow",sokf_moveable,"tutorial_flag_yellow","0", []), ("tutorial_flag_red",sokf_moveable,"tutorial_flag_red","0", []), ("tutorial_flag_blue",sokf_moveable,"tutorial_flag_blue","0", []), ("interior_prison_a",0,"interior_prison_a","bo_interior_prison_a", []), ("interior_prison_b",0,"interior_prison_b","bo_interior_prison_b", []), ("interior_prison_cell_a",0,"interior_prison_cell_a","bo_interior_prison_cell_a", []), # ("interior_prison_c",0,"interior_prison_c","bo_interior_prison_c", []), ("interior_prison_d",0,"interior_prison_d","bo_interior_prison_d", []), ("arena_archery_target_a",0,"arena_archery_target_a","bo_arena_archery_target_a", []), ("archery_butt_a",0,"archery_butt","bo_archery_butt", [ (ti_on_scene_prop_hit, [ (store_trigger_param_1, ":instance_no"), (prop_instance_get_position, pos2, ":instance_no"), (get_player_agent_no, ":player_agent"), (agent_get_position, pos3, ":player_agent"), (get_distance_between_positions, ":player_distance", pos3, pos2), (position_transform_position_to_local, pos4, pos2, pos1), (position_set_y, pos4, 0), (position_set_x, pos2, 0), (position_set_y, pos2, 0), (position_set_z, pos2, 0), (get_distance_between_positions, ":target_distance", pos4, pos2), (assign, ":point_earned", 43), #Calculating a point between 0-12 (val_sub, ":point_earned", ":target_distance"), (val_mul, ":point_earned", 1299), (val_div, ":point_earned", 4300), (try_begin), (lt, ":point_earned", 0), (assign, ":point_earned", 0), (try_end), (val_div, ":player_distance", 91), #Converting to yards (assign, reg60, ":point_earned"), (assign, reg61, ":player_distance"), (display_message, "str_archery_target_hit"), ]), ]), ("archery_target_with_hit_a",0,"arena_archery_target_a","bo_arena_archery_target_a", [ (ti_on_scene_prop_hit, [ (store_trigger_param_1, ":instance_no"), (prop_instance_get_position, pos2, ":instance_no"), (get_player_agent_no, ":player_agent"), (agent_get_position, pos3, ":player_agent"), (get_distance_between_positions, ":player_distance", pos3, pos2), (position_transform_position_to_local, pos4, pos2, pos1), (position_set_y, pos4, 0), (position_set_x, pos2, 0), (position_set_y, pos2, 0), (position_set_z, pos2, 0), (get_distance_between_positions, ":target_distance", pos4, pos2), (assign, ":point_earned", 43), #Calculating a point between 0-12 (val_sub, ":point_earned", ":target_distance"), (val_mul, ":point_earned", 1299), (val_div, ":point_earned", 4300), (try_begin), (lt, ":point_earned", 0), (assign, ":point_earned", 0), (try_end), (val_div, ":player_distance", 91), #Converting to yards (assign, "$g_last_archery_point_earned", ":point_earned"), (assign, reg60, ":point_earned"), (assign, reg61, ":player_distance"), (display_message, "str_archery_target_hit"), ]), ]), ("dummy_a",sokf_destructible|sokf_moveable,"arena_archery_target_b","bo_arena_archery_target_b", [ (ti_on_scene_prop_destroy, [ (store_trigger_param_1, ":instance_no"), (prop_instance_get_starting_position, pos1, ":instance_no"), (get_player_agent_no, ":player_agent"), (agent_get_position, 2, ":player_agent"), (assign, ":rotate_side", 80), (try_begin), (position_is_behind_position, 2, 1), (val_mul, ":rotate_side", -1), (try_end), (position_rotate_x, 1, ":rotate_side"), (prop_instance_animate_to_position, ":instance_no", 1, 70), #animate to position 1 in 0.7 second (val_add, "$tutorial_num_total_dummies_destroyed", 1), (play_sound, "snd_dummy_destroyed"), ]), (ti_on_scene_prop_hit, [ (store_trigger_param_1, ":instance_no"), (store_trigger_param_2, ":damage"), (assign, reg60, ":damage"), (val_div, ":damage", 8), (prop_instance_get_position, pos2, ":instance_no"), (get_player_agent_no, ":player_agent"), (agent_get_position, pos3, ":player_agent"), (try_begin), (position_is_behind_position, pos3, pos2), (val_mul, ":damage", -1), (try_end), (position_rotate_x, 2, ":damage"), (display_message, "str_delivered_damage"), (prop_instance_animate_to_position, ":instance_no", 2, 30), #animate to position 1 in 0.3 second (play_sound, "snd_dummy_hit"), #(particle_system_burst, "psys_blood_hit_1", pos1, 100), #littles #(particle_system_burst, "psys_blood_hit_2", pos1, 1), #Massive blood part #(particle_system_burst, "psys_blood_hit_3", pos1, 10), #3-4 part of blood #(set_position_delta,0,0,50), #(prop_instance_get_position, pos2, ":instance_no"), (particle_system_burst, "psys_dummy_smoke", pos1, 3), (particle_system_burst, "psys_dummy_straw", pos1, 10), ]), ]), ("band_a",0,"band_a","0", []), ("arena_sign",0,"arena_arms","0", []), ("castle_h_battlement_a",0,"castle_h_battlement_a","bo_castle_h_battlement_a", []), ("castle_h_battlement_b",0,"castle_h_battlement_b","bo_castle_h_battlement_b", []), ("castle_h_battlement_a2",0,"castle_h_battlement_a2","bo_castle_h_battlement_a2", []), ("castle_h_battlement_b2",0,"castle_h_battlement_b2","bo_castle_h_battlement_b2", []), ("castle_h_corner_a",0,"castle_h_corner_a","bo_castle_h_corner_a", []), ("castle_h_stairs_a",0,"castle_h_stairs_a","bo_castle_h_stairs_a", []), ("castle_h_stairs_b",0,"castle_h_stairs_b","bo_castle_h_stairs_b", []), ("castle_h_gatehouse_a",0,"castle_h_gatehouse_a","bo_castle_h_gatehouse_a", []), ("castle_h_keep_a",0,"castle_h_keep_a","bo_castle_h_keep_a", []), ("castle_h_keep_b",0,"castle_h_keep_b","bo_castle_h_keep_b", []), ("castle_h_house_a",0,"castle_h_house_a","bo_castle_h_house_a", []), ("castle_h_house_b",0,"castle_h_house_b","bo_castle_h_house_b", []), ("castle_h_house_c",0,"castle_h_house_c","bo_castle_h_house_b", []), ("castle_h_battlement_barrier",0,"castle_h_battlement_barrier","bo_castle_h_battlement_barrier", []), ("castle_f_keep_a",0,"castle_f_keep_a","bo_castle_f_keep_a", []), ("castle_f_battlement_a",0,"castle_f_battlement_a","bo_castle_f_battlement_a", []), ("castle_f_battlement_a_destroyed",0,"castle_f_battlement_a_destroyed","bo_castle_f_battlement_a_destroyed", []), ("castle_f_battlement_b",0,"castle_f_battlement_b","bo_castle_f_battlement_b", []), ("castle_f_battlement_corner_a",0,"castle_f_battlement_corner_a","bo_castle_f_battlement_corner_a", []), ("castle_f_battlement_corner_b",0,"castle_f_battlement_corner_b","bo_castle_f_battlement_corner_b", []), ("castle_f_stairs_a",0,"castle_f_stairs_a","bo_castle_f_stairs_a", []), ("castle_f_tower_a",0,"castle_f_tower_a","bo_castle_f_tower_a", []), ("castle_f_wall_stairs_a",0,"castle_f_wall_stairs_a","bo_castle_f_wall_stairs_a", []), ("castle_f_wall_stairs_b",0,"castle_f_wall_stairs_b","bo_castle_f_wall_stairs_b", []), ("castle_f_wall_way_a",0,"castle_f_wall_way_a","bo_castle_f_wall_way_a", []), ("castle_f_wall_way_b",0,"castle_f_wall_way_b","bo_castle_f_wall_way_b", []), ("castle_f_gatehouse_a",0,"castle_f_gatehouse_a","bo_castle_f_gatehouse_a", []), ("castle_g_battlement_a",0,"castle_g_battlement_a","bo_castle_g_battlement_a", []), ("castle_g_corner_a",0,"castle_g_corner_a","bo_castle_g_corner_a", []), ("castle_g_tower_a",0,"castle_g_tower_a","bo_castle_g_tower_a", []), ("castle_g_gate_house",0,"castle_g_gate_house","bo_castle_g_gate_house", []), ("castle_g_gate_house_door_a",0,"castle_g_gate_house_door_a","bo_castle_g_gate_house_door_a", []), ("castle_g_gate_house_door_b",0,"castle_g_gate_house_door_b","bo_castle_g_gate_house_door_b", []), ("castle_g_square_keep_a",0,"castle_g_square_keep_a","bo_castle_g_square_keep_a", []), ("mosque_a",0,"mosque_a","bo_mosque_a", []), ("stone_minaret_a",0,"stone_minaret_a","bo_stone_minaret_a", []), ("stone_house_a",0,"stone_house_a","bo_stone_house_a", []), ("stone_house_b",0,"stone_house_b","bo_stone_house_b", []), ("stone_house_c",0,"stone_house_c","bo_stone_house_c", []), ("stone_house_d",0,"stone_house_d","bo_stone_house_d", []), ("stone_house_e",0,"stone_house_e","bo_stone_house_e", []), ("stone_house_f",0,"stone_house_f","bo_stone_house_f", []), ("banner_pole", 0, "banner_pole", "bo_banner_pole", []), ("custom_banner_01",0,"custom_banner_01","0", [ (ti_on_init_scene_prop, [ (party_get_slot, ":leader_troop", "$g_encountered_party", slot_town_lord), (try_begin), (ge, ":leader_troop", 0), (cur_scene_prop_set_tableau_material, "tableau_custom_banner_default", ":leader_troop"), (try_end), ]), ]), ("custom_banner_02",0,"custom_banner_02","0", [ (ti_on_init_scene_prop, [ (party_get_slot, ":leader_troop", "$g_encountered_party", slot_town_lord), (try_begin), (ge, ":leader_troop", 0), (cur_scene_prop_set_tableau_material, "tableau_custom_banner_default", ":leader_troop"), (try_end), ]), ]), ("banner_a",0,"banner_a01","0", []), ("banner_b",0,"banner_a02","0", []), ("banner_c",0,"banner_a03","0", []), ("banner_d",0,"banner_a04","0", []), ("banner_e",0,"banner_a05","0", []), ("banner_f",0,"banner_a06","0", []), ("banner_g",0,"banner_a07","0", []), ("banner_h",0,"banner_a08","0", []), ("banner_i",0,"banner_a09","0", []), ("banner_j",0,"banner_a10","0", []), ("banner_k",0,"banner_a11","0", []), ("banner_l",0,"banner_a12","0", []), ("banner_m",0,"banner_a13","0", []), ("banner_n",0,"banner_a14","0", []), ("banner_o",0,"banner_f21","0", []), ("banner_p",0,"banner_a16","0", []), ("banner_q",0,"banner_a17","0", []), ("banner_r",0,"banner_a18","0", []), ("banner_s",0,"banner_a19","0", []), ("banner_t",0,"banner_a20","0", []), ("banner_u",0,"banner_a21","0", []), ("banner_ba",0,"banner_b01","0", []), ("banner_bb",0,"banner_b02","0", []), ("banner_bc",0,"banner_b03","0", []), ("banner_bd",0,"banner_b04","0", []), ("banner_be",0,"banner_b05","0", []), ("banner_bf",0,"banner_b06","0", []), ("banner_bg",0,"banner_b07","0", []), ("banner_bh",0,"banner_b08","0", []), ("banner_bi",0,"banner_b09","0", []), ("banner_bj",0,"banner_b10","0", []), ("banner_bk",0,"banner_b11","0", []), ("banner_bl",0,"banner_b12","0", []), ("banner_bm",0,"banner_b13","0", []), ("banner_bn",0,"banner_b14","0", []), ("banner_bo",0,"banner_b15","0", []), ("banner_bp",0,"banner_b16","0", []), ("banner_bq",0,"banner_b17","0", []), ("banner_br",0,"banner_b18","0", []), ("banner_bs",0,"banner_b19","0", []), ("banner_bt",0,"banner_b20","0", []), ("banner_bu",0,"banner_b21","0", []), ("banner_ca",0,"banner_c01","0", []), ("banner_cb",0,"banner_c02","0", []), ("banner_cc",0,"banner_c03","0", []), ("banner_cd",0,"banner_c04","0", []), ("banner_ce",0,"banner_c05","0", []), ("banner_cf",0,"banner_c06","0", []), ("banner_cg",0,"banner_c07","0", []), ("banner_ch",0,"banner_c08","0", []), ("banner_ci",0,"banner_c09","0", []), ("banner_cj",0,"banner_c10","0", []), ("banner_ck",0,"banner_c11","0", []), ("banner_cl",0,"banner_c12","0", []), ("banner_cm",0,"banner_c13","0", []), ("banner_cn",0,"banner_c14","0", []), ("banner_co",0,"banner_c15","0", []), ("banner_cp",0,"banner_c16","0", []), ("banner_cq",0,"banner_c17","0", []), ("banner_cr",0,"banner_c18","0", []), ("banner_cs",0,"banner_c19","0", []), ("banner_ct",0,"banner_c20","0", []), ("banner_cu",0,"banner_c21","0", []), ("banner_da",0,"banner_d01","0", []), ("banner_db",0,"banner_d02","0", []), ("banner_dc",0,"banner_d03","0", []), ("banner_dd",0,"banner_d04","0", []), ("banner_de",0,"banner_d05","0", []), ("banner_df",0,"banner_d06","0", []), ("banner_dg",0,"banner_d07","0", []), ("banner_dh",0,"banner_d08","0", []), ("banner_di",0,"banner_d09","0", []), ("banner_dj",0,"banner_d10","0", []), ("banner_dk",0,"banner_d11","0", []), ("banner_dl",0,"banner_d12","0", []), ("banner_dm",0,"banner_d13","0", []), ("banner_dn",0,"banner_d14","0", []), ("banner_do",0,"banner_d15","0", []), ("banner_dp",0,"banner_d16","0", []), ("banner_dq",0,"banner_d17","0", []), ("banner_dr",0,"banner_d18","0", []), ("banner_ds",0,"banner_d19","0", []), ("banner_dt",0,"banner_d20","0", []), ("banner_du",0,"banner_d21","0", []), ("banner_ea",0,"banner_e01","0", []), ("banner_eb",0,"banner_e02","0", []), ("banner_ec",0,"banner_e03","0", []), ("banner_ed",0,"banner_e04","0", []), ("banner_ee",0,"banner_e05","0", []), ("banner_ef",0,"banner_e06","0", []), ("banner_eg",0,"banner_e07","0", []), ("banner_eh",0,"banner_e08","0", []), ("banner_ei",0,"banner_e09","0", []), ("banner_ej",0,"banner_e10","0", []), ("banner_ek",0,"banner_e11","0", []), ("banner_el",0,"banner_e12","0", []), ("banner_em",0,"banner_e13","0", []), ("banner_en",0,"banner_e14","0", []), ("banner_eo",0,"banner_e15","0", []), ("banner_ep",0,"banner_e16","0", []), ("banner_eq",0,"banner_e17","0", []), ("banner_er",0,"banner_e18","0", []), ("banner_es",0,"banner_e19","0", []), ("banner_et",0,"banner_e20","0", []), ("banner_eu",0,"banner_e21","0", []), ("banner_f01", 0, "banner_f01", "0", []), ("banner_f02", 0, "banner_f02", "0", []), ("banner_f03", 0, "banner_f03", "0", []), ("banner_f04", 0, "banner_f04", "0", []), ("banner_f05", 0, "banner_f05", "0", []), ("banner_f06", 0, "banner_f06", "0", []), ("banner_f07", 0, "banner_f07", "0", []), ("banner_f08", 0, "banner_f08", "0", []), ("banner_f09", 0, "banner_f09", "0", []), ("banner_f10", 0, "banner_f10", "0", []), ("banner_f11", 0, "banner_f11", "0", []), ("banner_f12", 0, "banner_f12", "0", []), ("banner_f13", 0, "banner_f13", "0", []), ("banner_f14", 0, "banner_f14", "0", []), ("banner_f15", 0, "banner_f15", "0", []), ("banner_f16", 0, "banner_f16", "0", []), ("banner_f17", 0, "banner_f17", "0", []), ("banner_f18", 0, "banner_f18", "0", []), ("banner_f19", 0, "banner_f19", "0", []), ("banner_f20", 0, "banner_f20", "0", []), ("banner_f21", 0, "banner_a15", "0", []), ("tavern_chair_a",0,"tavern_chair_a","bo_tavern_chair_a", []), ("tavern_chair_b",0,"tavern_chair_b","bo_tavern_chair_b", []), ("tavern_table_a",0,"tavern_table_a","bo_tavern_table_a", []), ("tavern_table_b",0,"tavern_table_b","bo_tavern_table_b", []), ("fireplace_a",0,"fireplace_a","bo_fireplace_a", []), ("barrel",0,"barrel","bobarrel", []), ("bench_tavern",0,"bench_tavern","bobench_tavern", []), ("bench_tavern_b",0,"bench_tavern_b","bo_bench_tavern_b", []), ("bowl_wood",0,"bowl_wood","0", []), ("chandelier_table",0,"chandelier_table","0", []), ("chandelier_tavern",0,"chandelier_tavern","0", []), ("chest_gothic",0,"chest_gothic","bochest_gothic", []), ("chest_b",0,"chest_b","bo_chest_b", []), ("chest_c",0,"chest_c","bo_chest_c", []), ("counter_tavern",0,"counter_tavern","bocounter_tavern", []), ("cup",0,"cup","0", []), ("dish_metal",0,"dish_metal","0", []), ("gothic_chair",0,"gothic_chair","bogothic_chair", []), ("gothic_stool",0,"gothic_stool","bogothic_stool", []), ("grate",0,"grate","bograte", []), ("jug",0,"jug","0", []), ("potlamp",0,"potlamp","0", []), ("weapon_rack",0,"weapon_rack","boweapon_rack", []), ("weapon_rack_big",0,"weapon_rack_big","boweapon_rack_big", []), ("tavern_barrel",0,"barrel","bobarrel", []), ("tavern_barrel_b",0,"tavern_barrel_b","bo_tavern_barrel_b", []), ("merchant_sign",0,"merchant_sign","bo_tavern_sign", []), ("tavern_sign",0,"tavern_sign","bo_tavern_sign", []), ("sack",0,"sack","0", []), ("skull_a",0,"skull_a","0", []), ("skull_b",0,"skull_b","0", []), ("skull_c",0,"skull_c","0", []), ("skull_d",0,"skull_d","0", []), ("skeleton_cow",0,"skeleton_cow","0", []), ("cupboard_a",0,"cupboard_a","bo_cupboard_a", []), ("box_a",0,"box_a","bo_box_a", []), ("bucket_a",0,"bucket_a","bo_bucket_a", []), ("straw_a",0,"straw_a","0", []), ("straw_b",0,"straw_b","0", []), ("straw_c",0,"straw_c","0", []), ("cloth_a",0,"cloth_a","0", []), ("cloth_b",0,"cloth_b","0", []), ("mat_a",0,"mat_a","0", []), ("mat_b",0,"mat_b","0", []), ("mat_c",0,"mat_c","0", []), ("mat_d",0,"mat_d","0", []), ("wood_a",0,"wood_a","bo_wood_a", []), ("wood_b",0,"wood_b","bo_wood_b", []), ("wood_heap",0,"wood_heap_a","bo_wood_heap_a", []), ("wood_heap_b",0,"wood_heap_b","bo_wood_heap_b", []), ("water_well_a",0,"water_well_a","bo_water_well_a", []), ("net_a",0,"net_a","bo_net_a", []), ("net_b",0,"net_b","0", []), ("meat_hook",0,"meat_hook","0", []), ("cooking_pole",0,"cooking_pole","0", []), ("bowl_a",0,"bowl_a","0", []), ("bucket_b",0,"bucket_b","0", []), ("washtub_a",0,"washtub_a","bo_washtub_a", []), ("washtub_b",0,"washtub_b","bo_washtub_b", []), ("table_trunk_a",0,"table_trunk_a","bo_table_trunk_a", []), ("chair_trunk_a",0,"chair_trunk_a","bo_chair_trunk_a", []), ("chair_trunk_b",0,"chair_trunk_b","bo_chair_trunk_b", []), ("chair_trunk_c",0,"chair_trunk_c","bo_chair_trunk_c", []), ("table_trestle_long",0,"table_trestle_long","bo_table_trestle_long", []), ("table_trestle_small",0,"table_trestle_small","bo_table_trestle_small", []), ("chair_trestle",0,"chair_trestle","bo_chair_trestle", []), ("wheel",0,"wheel","bowheel", []), ("ladder",0,"ladder","boladder", []), ("cart",0,"cart","bocart", []), ("village_stand",0,"village_stand","bovillage_stand", []), ("wooden_stand",0,"wooden_stand","bowooden_stand", []), ("table_small",0,"table_small","botable_small", []), ("table_small_b",0,"table_small_b","bo_table_small_b", []), ("small_timber_frame_house_a",0,"small_timber_frame_house_a","bo_small_timber_frame_house_a", []), ("timber_frame_house_b",0,"tf_house_b","bo_tf_house_b", []), ("timber_frame_house_c",0,"tf_house_c","bo_tf_house_c", []), ("timber_frame_extension_a",0,"timber_frame_extension_a","bo_timber_frame_extension_a", []), ("timber_frame_extension_b",0,"timber_frame_extension_b","bo_timber_frame_extension_b", []), ("stone_stairs_a",0,"stone_stairs_a","bo_stone_stairs_a", []), ("stone_stairs_b",0,"stone_stairs_b","bo_stone_stairs_b", []), ("railing_a",0,"railing_a","bo_railing_a", []), ("side_building_a",0,"side_building_a","bo_side_building_a", []), ("battlement_a",0,"battlement_a","bo_battlement_a", []), ("battlement_a_destroyed",0,"battlement_a_destroyed","bo_battlement_a_destroyed", []), ("round_tower_a",0,"round_tower_a","bo_round_tower_a", []), ("small_round_tower_a",0,"small_round_tower_a","bo_small_round_tower_a", []), ("small_round_tower_roof_a",0,"small_round_tower_roof_a","bo_small_round_tower_roof_a", []), ("square_keep_a",0,"square_keep_a","bo_square_keep_a", []), ("square_tower_roof_a",0,"square_tower_roof_a","0", []), ("gate_house_a",0,"gate_house_a","bo_gate_house_a", []), ("gate_house_b",0,"gate_house_b","bo_gate_house_b", []), ("small_wall_a",0,"small_wall_a","bo_small_wall_a", []), ("small_wall_b",0,"small_wall_b","bo_small_wall_b", []), ("small_wall_c",0,"small_wall_c","bo_small_wall_c", []), ("small_wall_c_destroy",0,"small_wall_c_destroy","bo_small_wall_c_destroy", []), ("small_wall_d",0,"small_wall_d","bo_small_wall_d", []), ("small_wall_e",0,"small_wall_e","bo_small_wall_d", []), ("town_house_a",0,"town_house_a","bo_town_house_a", []), ("town_house_b",0,"town_house_b","bo_town_house_b", []), ("town_house_c",0,"town_house_c","bo_town_house_c", []), ("town_house_d",0,"town_house_d","bo_town_house_d", []), ("town_house_e",0,"town_house_e","bo_town_house_e", []), ("town_house_f",0,"town_house_f","bo_town_house_f", []), ("town_house_g",0,"town_house_g","bo_town_house_g", []), ("town_house_h",0,"town_house_h","bo_town_house_h", []), ("town_house_i",0,"town_house_i","bo_town_house_i", []), ("town_house_j",0,"town_house_j","bo_town_house_j", []), ("town_house_l",0,"town_house_l","bo_town_house_l", []), ("town_house_m",0,"town_house_m","bo_town_house_m", []), ("town_house_n",0,"town_house_n","bo_town_house_n", []), ("town_house_o",0,"town_house_o","bo_town_house_o", []), ("town_house_p",0,"town_house_p","bo_town_house_p", []), ("town_house_q",0,"town_house_q","bo_town_house_q", []), ("passage_house_a",0,"passage_house_a","bo_passage_house_a", []), ("passage_house_b",0,"passage_house_b","bo_passage_house_b", []), ("passage_house_c",0,"passage_house_c","bo_passage_house_c", []), ("passage_house_d",0,"passage_house_d","bo_passage_house_d", []), ("passage_house_c_door",0,"passage_house_c_door","bo_passage_house_c_door", []), ("house_extension_a",0,"house_extension_a","bo_house_extension_a", []), ("house_extension_b",0,"house_extension_b","bo_house_extension_b", []), ("house_extension_c",0,"house_extension_c","bo_house_extension_a", []),#reuse ("house_extension_d",0,"house_extension_d","bo_house_extension_d", []), ("house_extension_e",0,"house_extension_e","bo_house_extension_e", []), ("house_extension_f",0,"house_extension_f","bo_house_extension_f", []), ("house_extension_f2",0,"house_extension_f2","bo_house_extension_f", []), ("house_extension_g",0,"house_extension_g","bo_house_extension_g", []), ("house_extension_g2",0,"house_extension_g2","bo_house_extension_g", []), ("house_extension_h",0,"house_extension_h","bo_house_extension_h", []), ("house_roof_door",0,"house_roof_door","bo_house_roof_door", []), ("door_extension_a",0,"door_extension_a","bo_door_extension_a", []), ("stairs_arch_a",0,"stairs_arch_a","bo_stairs_arch_a", []), ("town_house_r",0,"town_house_r","bo_town_house_r", []), ("town_house_s",0,"town_house_s","bo_town_house_s", []), ("town_house_t",0,"town_house_t","bo_town_house_t", []), ("town_house_u",0,"town_house_u","bo_town_house_u", []), ("town_house_v",0,"town_house_v","bo_town_house_v", []), ("town_house_w",0,"town_house_w","bo_town_house_w", []), ("town_house_y",0,"town_house_y","bo_town_house_y", []), ("town_house_z",0,"town_house_z","bo_town_house_z", []), ("town_house_za",0,"town_house_za","bo_town_house_za", []), ("windmill",0,"windmill","bo_windmill", []), ("windmill_fan_turning",sokf_moveable,"windmill_fan_turning","bo_windmill_fan_turning", []), ("windmill_fan",0,"windmill_fan","bo_windmill_fan", []), ("fake_house_a",0,"fake_house_a","bo_fake_house_a", []), ("fake_house_b",0,"fake_house_b","bo_fake_house_b", []), ("fake_house_c",0,"fake_house_c","bo_fake_house_c", []), ("fake_house_d",0,"fake_house_d","bo_fake_house_d", []), ("fake_house_e",0,"fake_house_e","bo_fake_house_e", []), ("fake_house_f",0,"fake_house_f","bo_fake_house_f", []), ("fake_house_snowy_a",0,"fake_house_snowy_a","bo_fake_house_a", []), ("fake_house_snowy_b",0,"fake_house_snowy_b","bo_fake_house_b", []), ("fake_house_snowy_c",0,"fake_house_snowy_c","bo_fake_house_c", []), ("fake_house_snowy_d",0,"fake_house_snowy_d","bo_fake_house_d", []), ("fake_house_far_a",0,"fake_house_far_a","0", []), ("fake_house_far_b",0,"fake_house_far_b","0", []), ("fake_house_far_c",0,"fake_house_far_c","0", []), ("fake_house_far_d",0,"fake_house_far_d","0", []), ("fake_house_far_e",0,"fake_house_far_e","0", []), ("fake_house_far_f",0,"fake_house_far_f","0", []), ("fake_house_far_snowycrude_a",0,"fake_house_far_snowy_a","0", []), ("fake_house_far_snowy_b",0,"fake_house_far_snowy_b","0", []), ("fake_house_far_snowy_c",0,"fake_house_far_snowy_c","0", []), ("fake_house_far_snowy_d",0,"fake_house_far_snowy_d","0", []), ("earth_wall_a",0,"earth_wall_a","bo_earth_wall_a", []), ("earth_wall_a2",0,"earth_wall_a2","bo_earth_wall_a2", []), ("earth_wall_b",0,"earth_wall_b","bo_earth_wall_b", []), ("earth_wall_b2",0,"earth_wall_b2","bo_earth_wall_b2", []), ("earth_stairs_a",0,"earth_stairs_a","bo_earth_stairs_a", []), ("earth_stairs_b",0,"earth_stairs_b","bo_earth_stairs_b", []), ("earth_tower_small_a",0,"earth_tower_small_a","bo_earth_tower_small_a", []), ("earth_gate_house_a",0,"earth_gate_house_a","bo_earth_gate_house_a", []), ("earth_gate_a",0,"earth_gate_a","bo_earth_gate_a", []), ("earth_square_keep_a",0,"earth_square_keep_a","bo_earth_square_keep_a", []), ("earth_house_a",0,"earth_house_a","bo_earth_house_a", []), ("earth_house_b",0,"earth_house_b","bo_earth_house_b", []), ("earth_house_c",0,"earth_house_c","bo_earth_house_c", []), ("earth_house_d",0,"earth_house_d","bo_earth_house_d", []), ("village_steppe_a",0,"village_steppe_a","bo_village_steppe_a", []), ("village_steppe_b",0,"village_steppe_b","bo_village_steppe_b", []), ("village_steppe_c",0,"village_steppe_c","bo_village_steppe_c", []), ("village_steppe_d",0,"village_steppe_d","bo_village_steppe_d", []), ("village_steppe_e",0,"village_steppe_e","bo_village_steppe_e", []), ("village_steppe_f",0,"village_steppe_f","bo_village_steppe_f", []), ("town_house_aa",0,"town_house_aa","bo_town_house_aa", []), ("snowy_house_a",0,"snowy_house_a","bo_snowy_house_a", []), ("snowy_house_b",0,"snowy_house_b","bo_snowy_house_b", []), ("snowy_house_c",0,"snowy_house_c","bo_snowy_house_c", []), ("snowy_house_d",0,"snowy_house_d","bo_snowy_house_d", []), ("snowy_house_e",0,"snowy_house_e","bo_snowy_house_e", []), ("snowy_house_f",0,"snowy_house_f","bo_snowy_house_f", []), ("snowy_house_g",0,"snowy_house_g","bo_snowy_house_g", []), ("snowy_house_h",0,"snowy_house_h","bo_snowy_house_h", []), ("snowy_house_i",0,"snowy_house_i","bo_snowy_house_i", []), ("snowy_wall_a",0,"snowy_wall_a","bo_snowy_wall_a", []), ("snowy_stand",0,"snowy_stand","bo_snowy_stand", []), ("snowy_heap_a",0,"snowy_heap_a","bo_snowy_heap_a", []), ("snowy_trunks_a",0,"snowy_trunks_a","bo_snowy_trunks_a", []), ("snowy_castle_tower_a",0,"snowy_castle_tower_a","bo_snowy_castle_tower_a", []), ("snowy_castle_battlement_a",0,"snowy_castle_battlement_a","bo_snowy_castle_battlement_a", []), ("snowy_castle_battlement_a_destroyed",0,"snowy_castle_battlement_a_destroyed","bo_snowy_castle_battlement_a_destroyed", []), ("snowy_castle_battlement_b",0,"snowy_castle_battlement_b","bo_snowy_castle_battlement_b", []), ("snowy_castle_battlement_corner_a",0,"snowy_castle_battlement_corner_a","bo_snowy_castle_battlement_corner_a", []), ("snowy_castle_battlement_corner_b",0,"snowy_castle_battlement_corner_b","bo_snowy_castle_battlement_corner_b", []), ("snowy_castle_battlement_stairs_a",0,"snowy_castle_battlement_stairs_a","bo_snowy_castle_battlement_stairs_a", []), ("snowy_castle_battlement_stairs_b",0,"snowy_castle_battlement_stairs_b","bo_snowy_castle_battlement_stairs_b", []), ("snowy_castle_gate_house_a",0,"snowy_castle_gate_house_a","bo_snowy_castle_gate_house_a", []), ("snowy_castle_round_tower_a",0,"snowy_castle_round_tower_a","bo_snowy_castle_round_tower_a", []), ("snowy_castle_square_keep_a",0,"snowy_castle_square_keep_a","bo_snowy_castle_square_keep_a", []), ("snowy_castle_stairs_a",0,"snowy_castle_stairs_a","bo_snowy_castle_stairs_a", []), ("square_keep_b",0,"square_keep_b","bo_square_keep_b", []), ("square_keep_c",0,"square_keep_c","bo_square_keep_c", []), ("square_keep_d",0,"square_keep_d","bo_square_keep_d", []), ("square_keep_e",0,"square_keep_e","bo_square_keep_e", []), ("square_keep_f",0,"square_keep_f","bo_square_keep_f", []), ("square_extension_a",0,"square_extension_a","bo_square_extension_a", []), ("square_stairs_a",0,"square_stairs_a","bo_square_stairs_a", []), ("castle_courtyard_house_a",0,"castle_courtyard_house_a","bo_castle_courtyard_house_a", []), ("castle_courtyard_house_b",0,"castle_courtyard_house_b","bo_castle_courtyard_house_b", []), ("castle_courtyard_house_c",0,"castle_courtyard_house_c","bo_castle_courtyard_house_c", []), ("castle_courtyard_a",0,"castle_courtyard_a","bo_castle_courtyard_a", []), ("gatehouse_b",0,"gatehouse_b","bo_gatehouse_b", []), ("castle_gaillard",0,"castle_gaillard","bo_castle_gaillard", []), ("castle_e_battlement_a",0,"castle_e_battlement_a","bo_castle_e_battlement_a", []), ("castle_e_battlement_a_destroyed",0,"castle_e_battlement_a_destroyed","bo_castle_e_battlement_a_destroyed", []), ("castle_e_corner",0,"castle_e_corner","bo_castle_e_corner", []), ("castle_e_stairs_a",0,"castle_e_stairs_a","bo_castle_e_stairs_a", []), ("castle_e_tower",0,"castle_e_tower","bo_castle_e_tower", []), ("castle_e_gate_house_a",0,"castle_e_gate_house_a","bo_castle_e_gate_house_a", []), ("castle_e_keep_a",0,"castle_e_keep_a","bo_castle_e_keep_a", []), ("stand_thatched",0,"stand_thatched","bo_stand_thatched", []), ("stand_cloth",0,"stand_cloth","bo_stand_cloth", []), ("castle_e_house_a",0,"castle_e_house_a","bo_castle_e_house_a", []), ("castle_e_house_b",0,"castle_e_house_b","bo_castle_e_house_b", []), ("castle_e_corner_b",0,"castle_e_corner_b","bo_castle_e_corner_b", []), ("arena_block_a",0,"arena_block_a","bo_arena_block_ab", []), ("arena_block_b",0,"arena_block_b","bo_arena_block_ab", []), ("arena_block_c",0,"arena_block_c","bo_arena_block_c", []), ("arena_block_d",0,"arena_block_d","bo_arena_block_def", []), ("arena_block_e",0,"arena_block_e","bo_arena_block_def", []), ("arena_block_f",0,"arena_block_f","bo_arena_block_def", []), ("arena_block_g",0,"arena_block_g","bo_arena_block_ghi", []), ("arena_block_h",0,"arena_block_h","bo_arena_block_ghi", []), ("arena_block_i",0,"arena_block_i","bo_arena_block_ghi", []), ("arena_block_j",0,"arena_block_j","bo_arena_block_j", []), ("arena_block_j_awning",0,"arena_block_j_awning","bo_arena_block_j_awning", []), ("arena_palisade_a",0,"arena_palisade_a","bo_arena_palisade_a", []), ("arena_wall_a",0,"arena_wall_a","bo_arena_wall_ab", []), ("arena_wall_b",0,"arena_wall_b","bo_arena_wall_ab", []), ("arena_barrier_a",0,"arena_barrier_a","bo_arena_barrier_a", []), ("arena_barrier_b",0,"arena_barrier_b","bo_arena_barrier_bc", []), ("arena_barrier_c",0,"arena_barrier_c","bo_arena_barrier_bc", []), ("arena_tower_a",0,"arena_tower_a","bo_arena_tower_abc", []), ("arena_tower_b",0,"arena_tower_b","bo_arena_tower_abc", []), ("arena_tower_c",0,"arena_tower_c","bo_arena_tower_abc", []), ("arena_spectator_a",0,"arena_spectator_a","0", []), ("arena_spectator_b",0,"arena_spectator_b","0", []), ("arena_spectator_c",0,"arena_spectator_c","0", []), ("arena_spectator_sitting_a",0,"arena_spectator_sitting_a","0", []), ("arena_spectator_sitting_b",0,"arena_spectator_sitting_b","0", []), ("arena_spectator_sitting_c",0,"arena_spectator_sitting_c","0", []), ("courtyard_gate_a",0,"courtyard_entry_a","bo_courtyard_entry_a", []), ("courtyard_gate_b",0,"courtyard_entry_b","bo_courtyard_entry_b", []), ("courtyard_gate_c",0,"courtyard_entry_c","bo_courtyard_entry_c", []), ("courtyard_gate_snowy",0,"courtyard_entry_snowy","bo_courtyard_entry_a", []), ("castle_tower_a",0,"castle_tower_a","bo_castle_tower_a", []), ("castle_battlement_a",0,"castle_battlement_a","bo_castle_battlement_a", []), ("castle_battlement_b",0,"castle_battlement_b","bo_castle_battlement_b", []), ("castle_battlement_a_destroyed",0,"castle_battlement_a_destroyed","bo_castle_battlement_a_destroyed", []), ("castle_battlement_b_destroyed",0,"castle_battlement_b_destroyed","bo_castle_battlement_b_destroyed", []), ("castle_battlement_corner_a",0,"castle_battlement_corner_a","bo_castle_battlement_corner_a", []), ("castle_battlement_corner_b",0,"castle_battlement_corner_b","bo_castle_battlement_corner_b", []), ("castle_battlement_stairs_a",0,"castle_battlement_stairs_a","bo_castle_battlement_stairs_a", []), ("castle_battlement_stairs_b",0,"castle_battlement_stairs_b","bo_castle_battlement_stairs_b", []), ("castle_gate_house_a",0,"castle_gate_house_a","bo_castle_gate_house_a", []), ("castle_round_tower_a",0,"castle_round_tower_a","bo_castle_round_tower_a", []), ("castle_square_keep_a",0,"castle_square_keep_a","bo_castle_square_keep_a", []), ("castle_stairs_a",0,"castle_stairs_a","bo_castle_stairs_a", []), ("castle_drawbridge_open",0,"castle_drawbridges_open","bo_castle_drawbridges_open", []), ("castle_drawbridge_closed",0,"castle_drawbridges_closed","bo_castle_drawbridges_closed", []), ("spike_group_a",0,"spike_group_a","bo_spike_group_a", []), ("spike_a",0,"spike_a","bo_spike_a", []), ("belfry_a",sokf_moveable,"belfry_a","bo_belfry_a", []), ("belfry_old",0,"belfry_a","bo_belfry_a", []), ("belfry_platform_a",sokf_moveable,"belfry_platform_a","bo_belfry_platform_a", []), ("belfry_platform_b",sokf_moveable,"belfry_platform_b","bo_belfry_platform_b", []), ("belfry_platform_old",0,"belfry_platform_b","bo_belfry_platform_b", []), ("belfry_wheel",sokf_moveable,"belfry_wheel",0, []), ("belfry_wheel_old",0,"belfry_wheel",0, []), ("mangonel",0,"mangonel","bo_mangonel", []), ("trebuchet_old",0,"trebuchet_old","bo_trebuchet_old", []), ("trebuchet_new",0,"trebuchet_new","bo_trebuchet_old", []), ("stone_ball",0,"stone_ball","0", []), ("village_house_a",0,"village_house_a","bo_village_house_a", []), ("village_house_b",0,"village_house_b","bo_village_house_b", []), ("village_house_c",0,"village_house_c","bo_village_house_c", []), ("village_house_d",0,"village_house_d","bo_village_house_d", []), ("farm_house_a",0,"farm_house_a","bo_farm_house_a", []), ("farm_house_b",0,"farm_house_b","bo_farm_house_b", []), ("farm_house_c",0,"farm_house_c","bo_farm_house_c", []), ("mountain_house_a",0,"mountain_house_a","bo_mountain_house_a", []), ("mountain_house_b",0,"mountain_house_b","bo_mountain_house_b", []), ("village_hut_a",0,"village_hut_a","bo_village_hut_a", []), ("crude_fence",0,"fence","bo_fence", []), ("crude_fence_small",0,"crude_fence_small","bo_crude_fence_small", []), ("crude_fence_small_b",0,"crude_fence_small_b","bo_crude_fence_small_b", []), ("ramp_12m",0,"ramp_12m","bo_ramp_12m", []), ("ramp_14m",0,"ramp_14m","bo_ramp_14m", []), ("siege_ladder_12m",0,"siege_leadder_12m","bo_siege_leadder_12m", []), ("siege_ladder_14m",0,"siege_leadder_14m","bo_siege_leadder_14m", []), ("portcullis",0,"portcullis_a","bo_portcullis_a", []), ("bed_a",0,"bed_a","bo_bed_a", []), ("bed_b",0,"bed_b","bo_bed_b", []), ("bed_c",0,"bed_c","bo_bed_c", []), ("bed_d",0,"bed_d","bo_bed_d", []), ("bed_e",0,"bed_e","bo_bed_e", []), ("bed_f",0,"bed_f","bo_bed_f", []), ("towngate_door_left",0,"door_g_left","bo_door_left", []), ("towngate_door_right",0,"door_g_right","bo_door_right", []), ("towngate_rectangle_door_left",0,"towngate_rectangle_door_left","bo_towngate_rectangle_door_left", []), ("towngate_rectangle_door_right",0,"towngate_rectangle_door_right","bo_towngate_rectangle_door_right", []), ("door_screen",0,"door_screen","0", []), ("door_a",0,"door_a","bo_door_a", []), ("door_b",0,"door_b","bo_door_a", []), ("door_c",0,"door_c","bo_door_a", []), ("door_d",0,"door_d","bo_door_a", []), ("tavern_door_a",0,"tavern_door_a","bo_tavern_door_a", []), ("tavern_door_b",0,"tavern_door_b","bo_tavern_door_a", []), ("door_e_left",0,"door_e_left","bo_door_left", []), ("door_e_right",0,"door_e_right","bo_door_right", []), ("door_f_left",0,"door_f_left","bo_door_left", []), ("door_f_right",0,"door_f_right","bo_door_right", []), ("door_h_left",0,"door_g_left","bo_door_left", []), ("door_h_right",0,"door_g_right","bo_door_right", []), ("draw_bridge_a",0,"draw_bridge_a","bo_draw_bridge_a", []), ("chain_1m",0,"chain_1m","0", []), ("chain_2m",0,"chain_2m","0", []), ("chain_5m",0,"chain_5m","0", []), ("chain_10m",0,"chain_10m","0", []), ("bridge_modular_a",0,"bridge_modular_a","bo_bridge_modular_a", []), ("bridge_modular_b",0,"bridge_modular_b","bo_bridge_modular_b", []), ("church_a",0,"church_a","bo_church_a", []), ("church_tower_a",0,"church_tower_a","bo_church_tower_a", []), ("stone_step_a",0,"floor_stone_a","bo_floor_stone_a", []), ("stone_step_b",0,"stone_step_b","0", []), ("stone_step_c",0,"stone_step_c","0", []), ("stone_heap",0,"stone_heap","bo_stone_heap", []), ("stone_heap_b",0,"stone_heap_b","bo_stone_heap", []), ("panel_door_a",0,"house_door_a","bo_house_door_a", []), ("panel_door_b",0,"house_door_b","bo_house_door_a", []), ("smoke_stain",0,"soot_a","0", []), ("brazier_with_fire",0,"brazier","bo_brazier", [ (ti_on_scene_prop_init, [ (set_position_delta,0,0,85), (particle_system_add_new, "psys_brazier_fire_1"), (particle_system_add_new, "psys_fire_sparks_1"), (set_position_delta,0,0,100), (particle_system_add_new, "psys_fire_glow_1"), (particle_system_emit, "psys_fire_glow_1",9000000), #(particle_system_add_new, "psys_fire_glow_1"), #(set_position_delta,0,0,95), #(particle_system_add_new, "psys_cooking_smoke"), ]), ]), ("cooking_fire",0,"fire_floor","0", [ (ti_on_scene_prop_init, [ (set_position_delta,0,0,12), (particle_system_add_new, "psys_cooking_fire_1"), (particle_system_add_new, "psys_fire_sparks_1"), (particle_system_add_new, "psys_cooking_smoke"), (set_position_delta,0,0,50), (particle_system_add_new, "psys_fire_glow_1"), (particle_system_emit, "psys_fire_glow_1",9000000), ]), ]), ("cauldron_a",0,"cauldron_a","bo_cauldron_a", []), ("fry_pan_a",0,"fry_pan_a","0", []), ("tripod_cauldron_a",0,"tripod_cauldron_a","bo_tripod_cauldron_a", []), ("tripod_cauldron_b",0,"tripod_cauldron_b","bo_tripod_cauldron_b", []), ("open_stable_a",0,"open_stable_a","bo_open_stable_a", []), ("open_stable_b",0,"open_stable_b","bo_open_stable_b", []), ("plate_a",0,"plate_a","0", []), ("plate_b",0,"plate_b","0", []), ("plate_c",0,"plate_c","0", []), ("lettuce",0,"lettuce","0", []), ("hanger",0,"hanger","0", []), ("knife_eating",0,"knife_eating","0", []), ("colander",0,"colander","0", []), ("ladle",0,"ladle","0", []), ("spoon",0,"spoon","0", []), ("skewer",0,"skewer","0", []), ("grape_a",0,"grape_a","0", []), ("grape_b",0,"grape_b","0", []), ("apple_a",0,"apple_a","0", []), ("apple_b",0,"apple_b","0", []), ("maize_a",0,"maize_a","0", []), ("maize_b",0,"maize_b","0", []), ("cabbage",0,"cabbage","0", []), ("cabbage_b",0,"cabbage_b","0", []), ("bean",0,"bean","0", []), ("basket_a",0,"basket_a","bo_basket_a", []), ("feeding_trough_a",0,"feeding_trough_a","bo_feeding_trough_a", []), ("marrow_a",0,"marrow_a","0", []), ("marrow_b",0,"marrow_b","0", []), ("squash_plant",0,"marrow_c","0", []), ("cheese_a",0,"cheese_a","0", []), ("cheese_b",0,"cheese_b","0", []), ("cheese_slice_a",0,"cheese_slice_a","0", []), ("bread_a",0,"bread_a","0", []), ("bread_b",0,"bread_b","0", []), ("bread_slice_a",0,"bread_slice_a","0", []), ("fish_a",0,"fish_a","0", []), ("fish_roasted_a",0,"fish_roasted_a","0", []), ("chicken_roasted",0,"chicken_roasted","0", []), ("food_steam",0,"0","0", [ (ti_on_scene_prop_init, [ (set_position_delta,0,0,0), (particle_system_add_new, "psys_food_steam"), ]), ]), ######################## ("city_smoke",0,"0","0", [ (ti_on_scene_prop_init, [ (store_time_of_day,reg(12)), (neg|is_between,reg(12),5,20), (set_position_delta,0,0,0), (particle_system_add_new, "psys_night_smoke_1"), ]), ]), ("city_fire_fly_night",0,"0","0", [ (ti_on_scene_prop_init, [ (store_time_of_day,reg(12)), (neg|is_between,reg(12),5,20), (set_position_delta,0,0,0), (particle_system_add_new, "psys_fire_fly_1"), ]), ]), ("city_fly_day",0,"0","0", [ (ti_on_scene_prop_init, [ (particle_system_add_new, "psys_bug_fly_1"), ]), ]), ("flue_smoke_tall",0,"0","0", [ (ti_on_scene_prop_init, [ (particle_system_add_new, "psys_flue_smoke_tall"), ]), ]), ("flue_smoke_short",0,"0","0", [ (ti_on_scene_prop_init, [ (particle_system_add_new, "psys_flue_smoke_short"), ]), ]), ("moon_beam",0,"0","0", [ (ti_on_scene_prop_init, [ (particle_system_add_new, "psys_moon_beam_1"), (particle_system_add_new, "psys_moon_beam_paricle_1"), ]), ]), ("fire_small",0,"0","0", [ (ti_on_scene_prop_init, [ (particle_system_add_new, "psys_fireplace_fire_small"), ]), ]), ("fire_big",0,"0","0", [ (ti_on_scene_prop_init, [ (particle_system_add_new, "psys_fireplace_fire_big"), ]), ]), ("battle_field_smoke",0,"0","0", [ (ti_on_scene_prop_init, [ (particle_system_add_new, "psys_war_smoke_tall"), ]), ]), ("Village_fire_big",0,"0","0", [ (ti_on_scene_prop_init, [ (particle_system_add_new, "psys_village_fire_big"), (set_position_delta,0,0,100), (particle_system_add_new, "psys_village_fire_smoke_big"), ]), ]), ######################### ("candle_a",0,"candle_a","0", [ (ti_on_scene_prop_init, [ (set_position_delta,0,0,27), (particle_system_add_new, "psys_candle_light"), ]), ]), ("candle_b",0,"candle_b","0", [ (ti_on_scene_prop_init, [ (set_position_delta,0,0,25), (particle_system_add_new, "psys_candle_light"), ]), ]), ("candle_c",0,"candle_c","0", [ (ti_on_scene_prop_init, [ (set_position_delta,0,0,10), (particle_system_add_new, "psys_candle_light_small"), ]), ]), ("lamp_a",0,"lamp_a","0", [ (ti_on_scene_prop_init, [ (set_position_delta,66,0,2), (particle_system_add_new, "psys_candle_light"), ]), ]), ("lamp_b",0,"lamp_b","0", [ (ti_on_scene_prop_init, [ (set_position_delta,65,0,-7), (particle_system_add_new, "psys_lamp_fire"), (set_position_delta,70,0,-5), (particle_system_add_new, "psys_fire_glow_1"), (particle_system_emit, "psys_fire_glow_1",9000000), (play_sound, "snd_fire_loop", 0), ]), ]), ("hook_a",0,"hook_a","0", []), ("window_night",0,"window_night","0", []), ("fried_pig",0,"fried_pig","0", []), ("village_oven",0,"village_oven","bo_village_oven", []), ("dungeon_water_drops",0,"0","0", [ (ti_on_scene_prop_init, [ (particle_system_add_new, "psys_dungeon_water_drops"), ]), ]), ("shadow_circle_1",0,"shadow_circle_1","0", []), ("shadow_circle_2",0,"shadow_circle_2","0", []), ("shadow_square_1",0,"shadow_square_1","0", []), ("shadow_square_2",0,"shadow_square_2","0", []), ("wheelbarrow",0,"wheelbarrow","bo_wheelbarrow", []), ("gourd",sokf_destructible|spr_hit_points(1),"gourd","bo_gourd", [ (ti_on_scene_prop_destroy, [ (store_trigger_param_1, ":instance_no"), (val_add, "$g_last_destroyed_gourds", 1), (prop_instance_get_position, pos1, ":instance_no"), (copy_position, pos2, pos1), (position_set_z, pos2, -100000), (particle_system_burst, "psys_gourd_smoke", pos1, 2), (particle_system_burst, "psys_gourd_piece_1", pos1, 1), (particle_system_burst, "psys_gourd_piece_2", pos1, 5), (prop_instance_animate_to_position, ":instance_no", pos2, 1), (play_sound, "snd_gourd_destroyed"), ]), ]), ("gourd_spike",0,"gourd_spike","bo_gourd_spike",[]), ("obstacle_fence_1",0,"fence","bo_fence", []), ("obstacle_fallen_tree_a",0,"destroy_tree_a","bo_destroy_tree_a", []), ("obstacle_fallen_tree_b",0,"destroy_tree_b","bo_destroy_tree_b", []), ]
Python
import string from header_common import * from module_info import * from module_strings import * from process_common import * def save_strings(strings): ofile = open(export_dir + "strings.txt","w") ofile.write("stringsfile version 1\n") ofile.write("%d\n"%len(strings)) for i_string in xrange(len(strings)): str = strings[i_string] ofile.write("str_%s %s\n"%(convert_to_identifier(str[0]),replace_spaces(str[1]))) ofile.close() def save_python_header(): ofile = open("./ID_strings.py","w") for i_string in xrange(len(strings)): ofile.write("str_%s = %d\n"%(convert_to_identifier(strings[i_string][0]),i_string)) ofile.write("\n\n") ofile.close() print "Exporting strings..." save_python_header() save_strings(strings)
Python
from header_factions import * #################################################################################################################### # Each faction record contains the following fields: # 1) Faction id: used for referencing factions in other files. # The prefix fac_ is automatically added before each faction id. # 2) Faction name. # 3) Faction flags. See header_factions.py for a list of available flags # 4) Faction coherence. Relation between members of this faction. # 5) Relations. This is a list of relation records. # Each relation record is a tuple that contains the following fields: # 5.1) Faction. Which other faction this relation is referring to # 5.2) Value: Relation value between the two factions. # Values range between -1 and 1. # 6) Ranks # 7) Faction color (default is gray) #################################################################################################################### default_kingdom_relations = [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.05),("mountain_bandits", -0.02),("forest_bandits", -0.02)] factions = [ ("no_faction","No Faction",0, 0.9, [], []), ("commoners","Commoners",0, 0.1,[("player_faction",0.1)], []), ("outlaws","Outlaws", max_player_rating(-30), 0.5,[("commoners",-0.6),("player_faction",-0.15)], [], 0x888888), # Factions before this point are hardwired into the game end their order should not be changed. ("neutral","Neutral",0, 0.1,[("player_faction",0.0)], [],0xFFFFFF), ("innocents","Innocents", ff_always_hide_label, 0.5,[("outlaws",-0.05)], []), ("merchants","Merchants", ff_always_hide_label, 0.5,[("outlaws",-0.5),], []), ("dark_knights","Dark Knights", 0, 0.5,[("innocents",-0.9),("player_faction",-0.4)], []), ("culture_1", "culture_1", 0, 0.9, [], []), ("culture_2", "culture_2", 0, 0.9, [], []), ("culture_3", "culture_3", 0, 0.9, [], []), ("culture_4", "culture_4", 0, 0.9, [], []), ("culture_5", "culture_5", 0, 0.9, [], []), # ("swadian_caravans","Swadian Caravans", 0, 0.5,[("outlaws",-0.8), ("dark_knights",-0.2)], []), # ("vaegir_caravans","Vaegir Caravans", 0, 0.5,[("outlaws",-0.8), ("dark_knights",-0.2)], []), ("player_faction","Player Faction",0, 0.9, [], []), ("player_supporters_faction","Player Faction",0, 0.9, [("player_faction",1.00),("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], []), ("kingdom_1", "Kingdom of Swadia", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xDD8844), ("kingdom_2", "Kingdom of Vaegirs", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0x33DD33), ("kingdom_3", "Khergit Khanate", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC99FF), ("kingdom_4", "Kingdom of Nords", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xDDDD33), ("kingdom_5", "Kingdom of Rhodoks", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0x33DDDD), ## ("kingdom_1_rebels", "Swadian rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211), ## ("kingdom_2_rebels", "Vaegir rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211), ## ("kingdom_3_rebels", "Khergit rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211), ## ("kingdom_4_rebels", "Nord rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211), ## ("kingdom_5_rebels", "Rhodok rebels", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xCC2211), ("kingdoms_end","kingdoms_end", 0, 0,[], []), ("robber_knights", "robber_knights", 0, 0.1, [], []), ("khergits","Khergits", 0, 0.5,[("player_faction",0.0)], []), ("black_khergits","Black Khergits", 0, 0.5,[("player_faction",-0.3),("kingdom_1",-0.02),("kingdom_2",-0.02)], []), ## ("rebel_peasants","Rebel Peasants", 0, 0.5,[("vaegirs",-0.5),("player_faction",0.0)], []), ("manhunters","Manhunters", 0, 0.5,[("outlaws",-0.6),("player_faction",0.1)], []), ("deserters","Deserters", 0, 0.5,[("manhunters",-0.6),("merchants",-0.5),("player_faction",-0.1)], [], 0x888888), ("mountain_bandits","Mountain Bandits", 0, 0.5,[("commoners",-0.2),("merchants",-0.5),("manhunters",-0.6),("player_faction",-0.15)], [], 0x888888), ("forest_bandits","Forest Bandits", 0, 0.5,[("commoners",-0.2),("merchants",-0.5),("manhunters",-0.6),("player_faction",-0.15)], [], 0x888888), ("undeads","Undeads", max_player_rating(-30), 0.5,[("commoners",-0.7),("player_faction",-0.5)], []), ("slavers","Slavers", 0, 0.1, [], []), ("peasant_rebels","Peasant Rebels", 0, 1.0,[("noble_refugees",-1.0),("player_faction",-0.4)], []), ("noble_refugees","Noble Refugees", 0, 0.5,[], []), ]
Python
from module_info import * from module_factions import * from process_common import * faction_name_pos = 0 faction_flags_pos = 2 faction_coherence_pos = 3 faction_relations_pos = 4 faction_ranks_pos = 5 def compile_relations(): relations = [] for i in xrange(len(factions)): r = [0.0 for j in range(len(factions))] relations.append(r) for i_faction in xrange(len(factions)): relations[i_faction][i_faction] = factions[i_faction][faction_coherence_pos] rels = factions[i_faction][faction_relations_pos] for rel in rels: rel_name = rel[0] other_pos = -1 for j_f in xrange(len(factions)): if factions[j_f][faction_name_pos] == rel_name: other_pos = j_f if other_pos == -1: print "ERROR faction not found: "+ rel_name else: relations[other_pos][i_faction] = rel[1] relations[i_faction][other_pos] = rel[1] return relations def save_factions(relations): file = open(export_dir + "factions.txt","w") file.write("factionsfile version 1\n") file.write("%d\n"%len(factions)) for i_faction in xrange(len(factions)): faction = factions[i_faction] fac_color = 0xAAAAAA if len(faction) == 7: fac_color = faction[6] file.write("fac_%s %s %d %d \n"%(convert_to_identifier(faction[0]), replace_spaces(faction[1]), faction[2], fac_color)) for reln in relations[i_faction]: file.write(" %f "%reln) file.write("\n") ranks = [] if (len(faction) > (faction_ranks_pos)): ranks = faction[faction_ranks_pos] file.write("%d "%(len(ranks))) for rank in ranks: file.write(" %s "%(replace_spaces(rank))) file.close() def two_to_pow(x): result = 1 for i in xrange(x): result = result * 2 return result def save_python_header(): file = open("./ID_factions.py","w") for i_faction in xrange(len(factions)): file.write("fac_%s = %d\n"%(factions[i_faction][0],i_faction)) file.write("\n\n") file.close() print "Exporting faction data..." save_python_header() relations = compile_relations() save_factions(relations)
Python
from header_common import * from header_parties import * from ID_troops import * from ID_factions import * from ID_map_icons import * pmf_is_prisoner = 0x0001 #################################################################################################################### # Each party template record contains the following fields: # 1) Party-template id: used for referencing party-templates in other files. # The prefix pt_ is automatically added before each party-template id. # 2) Party-template name. # 3) Party flags. See header_parties.py for a list of available flags # 4) Menu. ID of the menu to use when this party is met. The value 0 uses the default party encounter system. # 5) Faction # 6) Personality. See header_parties.py for an explanation of personality flags. # 7) List of stacks. Each stack record is a tuple that contains the following fields: # 7.1) Troop-id. # 7.2) Minimum number of troops in the stack. # 7.3) Maximum number of troops in the stack. # 7.4) Member flags(optional). Use pmf_is_prisoner to note that this member is a prisoner. # Note: There can be at most 6 stacks. #################################################################################################################### party_templates = [ ("none","none",icon_gray_knight,0,fac_commoners,merchant_personality,[]), ("rescued_prisoners","Rescued Prisoners",icon_gray_knight,0,fac_commoners,merchant_personality,[]), ("enemy","Enemy",icon_gray_knight,0,fac_undeads,merchant_personality,[]), ("hero_party","Hero Party",icon_gray_knight,0,fac_commoners,merchant_personality,[]), #################################################################################################################### # Party templates before this point are hard-wired into the game and should not be changed. #################################################################################################################### ## ("old_garrison","Old Garrison",icon_vaegir_knight,0,fac_neutral,merchant_personality,[]), ("village_defenders","Village Defenders",icon_peasant,0,fac_commoners,merchant_personality,[(trp_farmer,10,20),(trp_peasant_woman,0,4)]), ("cattle_herd","Cattle Herd",icon_cattle|carries_goods(10),0,fac_neutral,merchant_personality,[(trp_cattle,80,120)]), ## ("vaegir_nobleman","Vaegir Nobleman",icon_vaegir_knight|carries_goods(10)|pf_quest_party,0,fac_commoners,merchant_personality,[(trp_nobleman,1,1),(trp_vaegir_knight,2,6),(trp_vaegir_horseman,4,12)]), ## ("swadian_nobleman","Swadian Nobleman",icon_gray_knight|carries_goods(10)|pf_quest_party,0,fac_commoners,merchant_personality,[(trp_nobleman,1,1),(trp_swadian_knight,2,6),(trp_swadian_man_at_arms,4,12)]), # Ryan BEGIN ("looters","Looters",icon_axeman|carries_goods(8),0,fac_outlaws,bandit_personality,[(trp_looter,4,25)]), # Ryan END ("manhunters","Manhunters",icon_gray_knight,0,fac_manhunters,soldier_personality,[(trp_manhunter,9,40)]), ## ("peasant","Peasant",icon_peasant,0,fac_commoners,merchant_personality,[(trp_farmer,1,6),(trp_peasant_woman,0,7)]), # ("black_khergit_raiders","Black Khergit Raiders",icon_khergit_horseman_b|carries_goods(2),0,fac_black_khergits,bandit_personality,[(trp_black_khergit_guard,1,10),(trp_black_khergit_horseman,5,5)]), ("steppe_bandits","Steppe Bandits",icon_khergit|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_steppe_bandit,5,58)]), ("forest_bandits","Forest Bandits",icon_axeman|carries_goods(2),0,fac_forest_bandits,bandit_personality,[(trp_forest_bandit,5,52)]), ("mountain_bandits","Mountain Bandits",icon_axeman|carries_goods(2),0,fac_mountain_bandits,bandit_personality,[(trp_mountain_bandit,5,60)]), ("sea_raiders","Sea Raiders",icon_axeman|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_sea_raider,5,50)]), ("deserters","Deserters",icon_vaegir_knight|carries_goods(3),0,fac_deserters,bandit_personality,[]), ("merchant_caravan","Merchant Caravan",icon_gray_knight|carries_goods(20)|pf_auto_remove_in_town|pf_quest_party,0,fac_commoners,escorted_merchant_personality,[(trp_caravan_master,1,1),(trp_caravan_guard,5,25)]), ("troublesome_bandits","Troublesome Bandits",icon_axeman|carries_goods(9)|pf_quest_party,0,fac_outlaws,bandit_personality,[(trp_bandit,14,55)]), ("bandits_awaiting_ransom","Bandits Awaiting Ransom",icon_axeman|carries_goods(9)|pf_auto_remove_in_town|pf_quest_party,0,fac_neutral,bandit_personality,[(trp_bandit,24,58),(trp_kidnapped_girl,1,1,pmf_is_prisoner)]), ("kidnapped_girl","Kidnapped Girl",icon_woman|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_kidnapped_girl,1,1)]), ## ("farmers","Farmers",icon_peasant,0,fac_innocents,merchant_personality,[(trp_farmer,11,22),(trp_peasant_woman,16,44)]), ("village_farmers","Village Farmers",icon_peasant,0,fac_innocents,merchant_personality,[(trp_farmer,5,10),(trp_peasant_woman,3,8)]), ## ("refugees","Refugees",icon_woman_b,0,fac_innocents,merchant_personality,[(trp_refugee,19,48)]), ## ("dark_hunters","Dark Hunters",icon_gray_knight,0,fac_dark_knights,soldier_personality,[(trp_dark_knight,4,42),(trp_dark_hunter,13,25)]), ("spy_partners", "Unremarkable Travellers", icon_gray_knight|carries_goods(3)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_spy_partner,1,1),(trp_caravan_guard,5,11)]), ("runaway_serfs","Runaway Serfs",icon_peasant|carries_goods(8)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_farmer,6,7), (trp_peasant_woman,3,3)]), ("spy", "Ordinary Townsman", icon_gray_knight|carries_goods(3)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_spy,1,1)]), ("sacrificed_messenger", "Sacrificed Messenger", icon_gray_knight|carries_goods(3)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[]), ## ("conspirator", "Conspirators", icon_gray_knight|carries_goods(8)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_conspirator,3,4)]), ## ("conspirator_leader", "Conspirator Leader", icon_gray_knight|carries_goods(8)|pf_default_behavior|pf_quest_party,0,fac_neutral,merchant_personality,[(trp_conspirator_leader,1,1)]), ## ("peasant_rebels", "Peasant Rebels", icon_peasant,0,fac_peasant_rebels,bandit_personality,[(trp_peasant_rebel,33,97)]), ## ("noble_refugees", "Noble Refugees", icon_gray_knight|carries_goods(12)|pf_quest_party,0,fac_noble_refugees,merchant_personality,[(trp_noble_refugee,3,5),(trp_noble_refugee_woman,5,7)]), ("forager_party","Foraging Party",icon_gray_knight|carries_goods(5)|pf_show_faction,0,fac_commoners,merchant_personality,[]), ("scout_party","Scouts",icon_gray_knight|carries_goods(1)|pf_show_faction,0,fac_commoners,bandit_personality,[]), ("patrol_party","Patrol",icon_gray_knight|carries_goods(2)|pf_show_faction,0,fac_commoners,soldier_personality,[]), # ("war_party", "War Party",icon_gray_knight|carries_goods(3),0,fac_commoners,soldier_personality,[]), ("messenger_party","Messenger",icon_gray_knight|pf_show_faction,0,fac_commoners,merchant_personality,[]), ("raider_party","Raiders",icon_gray_knight|carries_goods(16)|pf_quest_party,0,fac_commoners,bandit_personality,[]), ("raider_captives","Raider Captives",0,0,fac_commoners,0,[(trp_peasant_woman,6,30,pmf_is_prisoner)]), ("kingdom_caravan_party","Caravan",icon_mule|carries_goods(25)|pf_show_faction,0,fac_commoners,merchant_personality,[(trp_caravan_master,1,1),(trp_caravan_guard,12,40)]), ("prisoner_train_party","Prisoner Train",icon_gray_knight|carries_goods(5)|pf_show_faction,0,fac_commoners,merchant_personality,[]), ("default_prisoners","Default Prisoners",0,0,fac_commoners,0,[(trp_bandit,5,10,pmf_is_prisoner)]), ## ("merchant_party","Merchant",icon_mule|carries_goods(25)|pf_show_faction,0,fac_merchants,merchant_personality,[(trp_caravan_guard,12,40)]), ## ("merchant_party_reinforcement","Merchant Party Reinforcement",icon_mule|carries_goods(25),0,fac_merchants,merchant_personality,[(trp_caravan_guard,6,20)]), # Caravans ("center_reinforcements","Reinforcements",icon_axeman|carries_goods(16),0,fac_commoners,soldier_personality,[(trp_townsman,5,30),(trp_watchman,4,20)]), ("kingdom_hero_party","War Party",icon_flagbearer_a|pf_show_faction|pf_default_behavior,0,fac_commoners,soldier_personality,[]), # Reinforcements # ("default_reinforcements_a","default_reinforcements_a",0,0,fac_commoners,0,[(trp_caravan_guard,1,10),(trp_watchman,3,16),(trp_farmer,9,24)]), # ("default_reinforcements_b","default_reinforcements_b",0,0,fac_commoners,0,[(trp_mercenary,1,7),(trp_caravan_guard,3,10),(trp_watchman,3,15)]), # ("default_reinforcements_c","default_reinforcements_c",0,0,fac_commoners,0,[(trp_hired_blade,1,7),(trp_mercenary,3,10),(trp_caravan_guard,3,15)]), ("kingdom_1_reinforcements_a", "kingdom_1_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_swadian_militia,2,6),(trp_swadian_recruit,4,7)]), ("kingdom_1_reinforcements_b", "kingdom_1_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_swadian_crossbowman,2,6),(trp_swadian_skirmisher,4,7)]), ("kingdom_1_reinforcements_c", "kingdom_1_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_swadian_man_at_arms,3,6)]), ("kingdom_2_reinforcements_a", "kingdom_2_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_vaegir_footman,2,6),(trp_vaegir_recruit,4,7)]), ("kingdom_2_reinforcements_b", "kingdom_2_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_vaegir_archer,2,6),(trp_vaegir_skirmisher,3,5),(trp_vaegir_footman,1,3)]), ("kingdom_2_reinforcements_c", "kingdom_2_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_vaegir_horseman,3,6)]), ("kingdom_3_reinforcements_a", "kingdom_3_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_khergit_skirmisher,2,6),(trp_khergit_tribesman,4,7)]), ("kingdom_3_reinforcements_b", "kingdom_3_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_khergit_horse_archer,2,6),(trp_khergit_skirmisher,4,7)]), ("kingdom_3_reinforcements_c", "kingdom_3_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_khergit_lancer,3,6)]), ("kingdom_4_reinforcements_a", "kingdom_4_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_nord_footman,4,8),(trp_nord_recruit,2,4)]), ("kingdom_4_reinforcements_b", "kingdom_4_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_nord_archer,1,3),(trp_nord_huntsman,3,5),(trp_nord_footman,2,5)]), ("kingdom_4_reinforcements_c", "kingdom_4_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_nord_warrior,3,6)]), ("kingdom_5_reinforcements_a", "kingdom_5_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_rhodok_spearman,3,7),(trp_rhodok_tribesman,3,6)]), ("kingdom_5_reinforcements_b", "kingdom_5_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_rhodok_trained_crossbowman,2,6),(trp_rhodok_crossbowman,4,7)]), ("kingdom_5_reinforcements_c", "kingdom_5_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_rhodok_sergeant,3,6)]), ## ("kingdom_1_reinforcements_a", "kingdom_1_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_swadian_footman,3,7),(trp_swadian_skirmisher,5,10),(trp_swadian_militia,11,26)]), ## ("kingdom_1_reinforcements_b", "kingdom_1_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_swadian_man_at_arms,5,10),(trp_swadian_infantry,5,10),(trp_swadian_crossbowman,3,8)]), ## ("kingdom_1_reinforcements_c", "kingdom_1_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_swadian_knight,2,6),(trp_swadian_sergeant,2,5),(trp_swadian_sharpshooter,2,5)]), ## ## ("kingdom_2_reinforcements_a", "kingdom_2_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_vaegir_veteran,3,7),(trp_vaegir_skirmisher,5,10),(trp_vaegir_footman,11,26)]), ## ("kingdom_2_reinforcements_b", "kingdom_2_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_vaegir_horseman,4,9),(trp_vaegir_infantry,5,10),(trp_vaegir_archer,3,8)]), ## ("kingdom_2_reinforcements_c", "kingdom_2_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_vaegir_knight,3,7),(trp_vaegir_guard,2,5),(trp_vaegir_marksman,2,5)]), ## ## ("kingdom_3_reinforcements_a", "kingdom_3_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_khergit_horseman,3,7),(trp_khergit_skirmisher,5,10),(trp_khergit_tribesman,11,26)]), ## ("kingdom_3_reinforcements_b", "kingdom_3_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_khergit_veteran_horse_archer,4,9),(trp_khergit_horse_archer,5,10),(trp_khergit_horseman,3,8)]), ## ("kingdom_3_reinforcements_c", "kingdom_3_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_khergit_lancer,3,7),(trp_khergit_veteran_horse_archer,2,5),(trp_khergit_horse_archer,2,5)]), ## ## ("kingdom_4_reinforcements_a", "kingdom_4_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_nord_trained_footman,3,7),(trp_nord_footman,5,10),(trp_nord_recruit,11,26)]), ## ("kingdom_4_reinforcements_b", "kingdom_4_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_nord_veteran,4,9),(trp_nord_warrior,5,10),(trp_nord_footman,3,8)]), ## ("kingdom_4_reinforcements_c", "kingdom_4_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_nord_champion,1,3),(trp_nord_veteran,2,5),(trp_nord_warrior,2,5)]), ## ## ("kingdom_5_reinforcements_a", "kingdom_5_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_rhodok_spearman,3,7),(trp_rhodok_crossbowman,5,10),(trp_rhodok_tribesman,11,26)]), ## ("kingdom_5_reinforcements_b", "kingdom_5_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_rhodok_trained_spearman,4,9),(trp_rhodok_spearman,5,10),(trp_rhodok_crossbowman,3,8)]), ## ("kingdom_5_reinforcements_c", "kingdom_5_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_rhodok_sergeant,3,7),(trp_rhodok_veteran_spearman,2,5),(trp_rhodok_veteran_crossbowman,2,5)]), #("array", "Battle array", icon_gray_knight|pf_limit_members, no_menu, fac_player_faction, 0, []), ]
Python
prsnt_game_credits = 0 prsnt_banner_selection = 1 prsnt_custom_banner = 2 prsnt_banner_charge_positioning = 3 prsnt_banner_charge_selection = 4 prsnt_banner_background_selection = 5 prsnt_banner_flag_type_selection = 6 prsnt_banner_flag_map_type_selection = 7 prsnt_color_selection = 8 prsnt_marshall_selection = 9 prsnt_battle = 10 prsnt_sliders = 11 prsnt_arena_training = 12 prsnt_retirement = 13 prsnt_key_config = 14 prsnt_battle_formations = 15
Python
import string from header_common import * from module_info import * from module_skills import * from process_common import * skill_name_pos = 1 skill_attribute_pos = 2 skill_max_level_pos= 3 skill_desc_pos = 4 def save_skills(): ofile = open(export_dir + "skills.txt","w") ofile.write("%d\n"%(len(skills))) for i_skill in xrange(len(skills)): skill = skills[i_skill] ofile.write("skl_%s %s "%(skill[0], replace_spaces(skill[1]))) ofile.write("%d %d %s\n"%(skill[skill_attribute_pos],skill[skill_max_level_pos],(string.replace(skill[skill_desc_pos]," ","_")))) ofile.close() def save_python_header(): ofile = open("./ID_skills.py","w") for i_skill in xrange(len(skills)): ofile.write("skl_%s = %d\n"%(skills[i_skill][0],i_skill)) ofile.write("\n\n") ofile.close() print "Exporting skills..." save_python_header() save_skills()
Python
from module_info import * from module_particle_systems import * from process_common import * id_pos = 0 flags_pos = 1 mesh_name_pos = 2 num_particles_pos = 3 life_pos = 4 damping_pos = 5 gravity_pos = 6 turb_size_pos = 7 turb_wt_pos = 8 alpha_key_pos = 9 red_key_pos = alpha_key_pos + 2 green_key_pos = red_key_pos + 2 blue_key_pos = green_key_pos + 2 scale_key_pos = blue_key_pos + 2 emit_box_size_pos = scale_key_pos + 2 emit_velocity_pos = emit_box_size_pos + 1 emit_rndmness_pos = emit_velocity_pos + 1 angular_speed_pos = emit_rndmness_pos + 1 angular_damping_pos = angular_speed_pos + 1 def save_psys_keys(ofile, keys1, keys2): ofile.write("%f %f %f %f\n"%(keys1[0], keys1[1], keys2[0], keys2[1])) def save_particle_systems(): ofile = open(export_dir + "particle_systems.txt","w") ofile.write("particle_systemsfile version 1\n") ofile.write("%d\n"%len(particle_systems)) for psys in particle_systems: ofile.write("psys_%s %d %s "%(psys[0], psys[1], psys[2])) ofile.write("%d %f %f %f %f %f \n"%(psys[num_particles_pos], psys[life_pos], psys[damping_pos], psys[gravity_pos], psys[turb_size_pos], psys[turb_wt_pos])) save_psys_keys(ofile,psys[alpha_key_pos],psys[alpha_key_pos+1]) save_psys_keys(ofile,psys[red_key_pos],psys[red_key_pos+1]) save_psys_keys(ofile,psys[green_key_pos],psys[green_key_pos+1]) save_psys_keys(ofile,psys[blue_key_pos],psys[blue_key_pos+1]) save_psys_keys(ofile,psys[scale_key_pos],psys[scale_key_pos+1]) ofile.write("%f %f %f "%(psys[emit_box_size_pos][0],psys[emit_box_size_pos][1],psys[emit_box_size_pos][2])) ofile.write("%f %f %f "%(psys[emit_velocity_pos][0],psys[emit_velocity_pos][1],psys[emit_velocity_pos][2])) ofile.write("%f \n"%(psys[emit_rndmness_pos])) if (len(psys) >= (angular_speed_pos + 1)): ofile.write("%f "%(psys[angular_speed_pos])) else: ofile.write("0.0 ") if (len(psys) >= (angular_damping_pos + 1)): ofile.write("%f "%(psys[angular_damping_pos])) else: ofile.write("0.0 ") ofile.write("\n") ofile.close() def save_python_header(): ofile = open("./ID_particle_systems.py","w") for i_particle_system in xrange(len(particle_systems)): ofile.write("psys_%s = %d\n"%(particle_systems[i_particle_system][0],i_particle_system)) ofile.close() print "Exporting particle data..." save_particle_systems() save_python_header()
Python
pt_none = 0 pt_rescued_prisoners = 1 pt_enemy = 2 pt_hero_party = 3 pt_village_defenders = 4 pt_cattle_herd = 5 pt_looters = 6 pt_manhunters = 7 pt_steppe_bandits = 8 pt_forest_bandits = 9 pt_mountain_bandits = 10 pt_sea_raiders = 11 pt_deserters = 12 pt_merchant_caravan = 13 pt_troublesome_bandits = 14 pt_bandits_awaiting_ransom = 15 pt_kidnapped_girl = 16 pt_village_farmers = 17 pt_spy_partners = 18 pt_runaway_serfs = 19 pt_spy = 20 pt_sacrificed_messenger = 21 pt_forager_party = 22 pt_scout_party = 23 pt_patrol_party = 24 pt_messenger_party = 25 pt_raider_party = 26 pt_raider_captives = 27 pt_kingdom_caravan_party = 28 pt_prisoner_train_party = 29 pt_default_prisoners = 30 pt_center_reinforcements = 31 pt_kingdom_hero_party = 32 pt_kingdom_1_reinforcements_a = 33 pt_kingdom_1_reinforcements_b = 34 pt_kingdom_1_reinforcements_c = 35 pt_kingdom_2_reinforcements_a = 36 pt_kingdom_2_reinforcements_b = 37 pt_kingdom_2_reinforcements_c = 38 pt_kingdom_3_reinforcements_a = 39 pt_kingdom_3_reinforcements_b = 40 pt_kingdom_3_reinforcements_c = 41 pt_kingdom_4_reinforcements_a = 42 pt_kingdom_4_reinforcements_b = 43 pt_kingdom_4_reinforcements_c = 44 pt_kingdom_5_reinforcements_a = 45 pt_kingdom_5_reinforcements_b = 46 pt_kingdom_5_reinforcements_c = 47
Python
from header_map_icons import * from module_constants import * from header_operations import * from header_triggers import * from ID_sounds import * #################################################################################################################### # Each map icon record contains the following fields: # 1) Map icon id: used for referencing map icons in other files. # The prefix icon_ is automatically added before each map icon id. # 2) Map icon flags. See header_map icons.py for a list of available flags # 3) Mesh name. # 4) Scale. # 5) Sound. # 6) Offset x position for the flag icon. # 7) Offset y position for the flag icon. # 8) Offset z position for the flag icon. #################################################################################################################### banner_scale = 0.3 avatar_scale = 0.15 map_icons = [ ("player",0,"player", avatar_scale, snd_footstep_grass, 0.15, 0.173, 0), ("player_horseman",0,"player_horseman", avatar_scale, snd_gallop, 0.15, 0.173, 0), ("gray_knight",0,"knight_a", avatar_scale, snd_gallop, 0.15, 0.173, 0), ("vaegir_knight",0,"knight_b", avatar_scale, snd_gallop, 0.15, 0.173, 0), ("flagbearer_a",0,"flagbearer_a", avatar_scale, snd_gallop, 0.15, 0.173, 0), ("flagbearer_b",0,"flagbearer_b", avatar_scale, snd_gallop, 0.15, 0.173, 0), ("peasant",0,"peasant_a", avatar_scale,snd_footstep_grass, 0.15, 0.173, 0), ("khergit",0,"khergit_horseman", avatar_scale,snd_gallop, 0.15, 0.173, 0), ("khergit_horseman_b",0,"khergit_horseman_b", avatar_scale,snd_gallop, 0.15, 0.173, 0), ("axeman",0,"bandit_a", avatar_scale,snd_footstep_grass, 0.15, 0.173, 0), ("woman",0,"woman_a", avatar_scale,snd_footstep_grass, 0.15, 0.173, 0), ("woman_b",0,"woman_b", avatar_scale,snd_footstep_grass, 0.15, 0.173, 0), ("town",mcn_no_shadow,"map_town_a", 0.35,0), ("town_steppe",mcn_no_shadow,"map_town_steppe_a", 0.35,0), ("village_a",mcn_no_shadow,"map_village_a", 0.45, 0), ("village_burnt_a",mcn_no_shadow,"map_village_burnt_a", 0.45, 0), ("village_deserted_a",mcn_no_shadow,"map_village_deserted_a", 0.45, 0), ("camp",mcn_no_shadow,"camp_tent", 0.13, 0), ("ship",mcn_no_shadow,"boat_sail_on", 0.23, snd_footstep_grass, 0.0, 0.05, 0), ("ship_on_land",mcn_no_shadow,"boat_sail_off", 0.23, 0), ("castle_a",mcn_no_shadow,"map_castle_a", 0.35,0), ("castle_b",mcn_no_shadow,"map_castle_b", 0.35,0), ("castle_c",mcn_no_shadow,"map_castle_c", 0.35,0), ("castle_d",mcn_no_shadow,"map_castle_d", 0.35,0), ("town_snow",mcn_no_shadow,"map_town_snow_a", 0.35,0), ("village_snow_a",mcn_no_shadow,"map_village_snow_a", 0.45, 0), ("village_snow_burnt_a",mcn_no_shadow,"map_village_snow_burnt_a", 0.45, 0), ("village_snow_deserted_a",mcn_no_shadow,"map_village_snow_deserted_a", 0.45, 0), ("castle_snow_a",mcn_no_shadow,"map_castle_snow_a", 0.35,0), ("castle_snow_b",mcn_no_shadow,"map_castle_snow_b", 0.35,0), ("mule",0,"icon_mule", 0.2,snd_footstep_grass, 0.15, 0.173, 0), ("cattle",0,"icon_cow", 0.2,snd_footstep_grass, 0.15, 0.173, 0), ("training_ground",mcn_no_shadow,"training", 0.35,0), ("bridge_a",mcn_no_shadow,"map_river_bridge_a", 1.27,0), ("bridge_b",mcn_no_shadow,"map_river_bridge_b", 0.7,0), ("bridge_snow_a",mcn_no_shadow,"map_river_bridge_snow_a", 1.27,0), ("custom_banner_01",0,"custom_map_banner_01", banner_scale, 0, [ (ti_on_init_map_icon, [ (store_trigger_param_1, ":party_no"), (party_get_slot, ":leader_troop", ":party_no", slot_town_lord), (try_begin), (ge, ":leader_troop", 0), (cur_map_icon_set_tableau_material, "tableau_custom_banner_square", ":leader_troop"), (try_end), ]), ]), ("custom_banner_02",0,"custom_map_banner_02", banner_scale, 0, [ (ti_on_init_map_icon, [ (store_trigger_param_1, ":party_no"), (party_get_slot, ":leader_troop", ":party_no", slot_town_lord), (try_begin), (ge, ":leader_troop", 0), (cur_map_icon_set_tableau_material, "tableau_custom_banner_short", ":leader_troop"), (try_end), ]), ]), ("custom_banner_03",0,"custom_map_banner_03", banner_scale, 0, [ (ti_on_init_map_icon, [ (store_trigger_param_1, ":party_no"), (party_get_slot, ":leader_troop", ":party_no", slot_town_lord), (try_begin), (ge, ":leader_troop", 0), (cur_map_icon_set_tableau_material, "tableau_custom_banner_tall", ":leader_troop"), (try_end), ]), ]), # Banners ("banner_01",0,"map_flag_01", banner_scale,0), ("banner_02",0,"map_flag_02", banner_scale,0), ("banner_03",0,"map_flag_03", banner_scale,0), ("banner_04",0,"map_flag_04", banner_scale,0), ("banner_05",0,"map_flag_05", banner_scale,0), ("banner_06",0,"map_flag_06", banner_scale,0), ("banner_07",0,"map_flag_07", banner_scale,0), ("banner_08",0,"map_flag_08", banner_scale,0), ("banner_09",0,"map_flag_09", banner_scale,0), ("banner_10",0,"map_flag_10", banner_scale,0), ("banner_11",0,"map_flag_11", banner_scale,0), ("banner_12",0,"map_flag_12", banner_scale,0), ("banner_13",0,"map_flag_13", banner_scale,0), ("banner_14",0,"map_flag_14", banner_scale,0), ("banner_15",0,"map_flag_f21", banner_scale,0), ("banner_16",0,"map_flag_16", banner_scale,0), ("banner_17",0,"map_flag_17", banner_scale,0), ("banner_18",0,"map_flag_18", banner_scale,0), ("banner_19",0,"map_flag_19", banner_scale,0), ("banner_20",0,"map_flag_20", banner_scale,0), ("banner_21",0,"map_flag_21", banner_scale,0), ("banner_22",0,"map_flag_22", banner_scale,0), ("banner_23",0,"map_flag_23", banner_scale,0), ("banner_24",0,"map_flag_24", banner_scale,0), ("banner_25",0,"map_flag_25", banner_scale,0), ("banner_26",0,"map_flag_26", banner_scale,0), ("banner_27",0,"map_flag_27", banner_scale,0), ("banner_28",0,"map_flag_28", banner_scale,0), ("banner_29",0,"map_flag_29", banner_scale,0), ("banner_30",0,"map_flag_30", banner_scale,0), ("banner_31",0,"map_flag_31", banner_scale,0), ("banner_32",0,"map_flag_32", banner_scale,0), ("banner_33",0,"map_flag_33", banner_scale,0), ("banner_34",0,"map_flag_34", banner_scale,0), ("banner_35",0,"map_flag_35", banner_scale,0), ("banner_36",0,"map_flag_36", banner_scale,0), ("banner_37",0,"map_flag_37", banner_scale,0), ("banner_38",0,"map_flag_38", banner_scale,0), ("banner_39",0,"map_flag_39", banner_scale,0), ("banner_40",0,"map_flag_40", banner_scale,0), ("banner_41",0,"map_flag_41", banner_scale,0), ("banner_42",0,"map_flag_42", banner_scale,0), ("banner_43",0,"map_flag_43", banner_scale,0), ("banner_44",0,"map_flag_44", banner_scale,0), ("banner_45",0,"map_flag_45", banner_scale,0), ("banner_46",0,"map_flag_46", banner_scale,0), ("banner_47",0,"map_flag_47", banner_scale,0), ("banner_48",0,"map_flag_48", banner_scale,0), ("banner_49",0,"map_flag_49", banner_scale,0), ("banner_50",0,"map_flag_50", banner_scale,0), ("banner_51",0,"map_flag_51", banner_scale,0), ("banner_52",0,"map_flag_52", banner_scale,0), ("banner_53",0,"map_flag_53", banner_scale,0), ("banner_54",0,"map_flag_54", banner_scale,0), ("banner_55",0,"map_flag_55", banner_scale,0), ("banner_56",0,"map_flag_56", banner_scale,0), ("banner_57",0,"map_flag_57", banner_scale,0), ("banner_58",0,"map_flag_58", banner_scale,0), ("banner_59",0,"map_flag_59", banner_scale,0), ("banner_60",0,"map_flag_60", banner_scale,0), ("banner_61",0,"map_flag_61", banner_scale,0), ("banner_62",0,"map_flag_62", banner_scale,0), ("banner_63",0,"map_flag_63", banner_scale,0), ("banner_64",0,"map_flag_d01", banner_scale,0), ("banner_65",0,"map_flag_d02", banner_scale,0), ("banner_66",0,"map_flag_d03", banner_scale,0), ("banner_67",0,"map_flag_d04", banner_scale,0), ("banner_68",0,"map_flag_d05", banner_scale,0), ("banner_69",0,"map_flag_d06", banner_scale,0), ("banner_70",0,"map_flag_d07", banner_scale,0), ("banner_71",0,"map_flag_d08", banner_scale,0), ("banner_72",0,"map_flag_d09", banner_scale,0), ("banner_73",0,"map_flag_d10", banner_scale,0), ("banner_74",0,"map_flag_d11", banner_scale,0), ("banner_75",0,"map_flag_d12", banner_scale,0), ("banner_76",0,"map_flag_d13", banner_scale,0), ("banner_77",0,"map_flag_d14", banner_scale,0), ("banner_78",0,"map_flag_d15", banner_scale,0), ("banner_79",0,"map_flag_d16", banner_scale,0), ("banner_80",0,"map_flag_d17", banner_scale,0), ("banner_81",0,"map_flag_d18", banner_scale,0), ("banner_82",0,"map_flag_d19", banner_scale,0), ("banner_83",0,"map_flag_d20", banner_scale,0), ("banner_84",0,"map_flag_d21", banner_scale,0), ("banner_85",0,"map_flag_e01", banner_scale,0), ("banner_86",0,"map_flag_e02", banner_scale,0), ("banner_87",0,"map_flag_e03", banner_scale,0), ("banner_88",0,"map_flag_e04", banner_scale,0), ("banner_89",0,"map_flag_e05", banner_scale,0), ("banner_90",0,"map_flag_e06", banner_scale,0), ("banner_91",0,"map_flag_e07", banner_scale,0), ("banner_92",0,"map_flag_e08", banner_scale,0), ("banner_93",0,"map_flag_e09", banner_scale,0), ("banner_94",0,"map_flag_e10", banner_scale,0), ("banner_95",0,"map_flag_e11", banner_scale,0), ("banner_96",0,"map_flag_e12", banner_scale,0), ("banner_97",0,"map_flag_e13", banner_scale,0), ("banner_98",0,"map_flag_e14", banner_scale,0), ("banner_99",0,"map_flag_e15", banner_scale,0), ("banner_100",0,"map_flag_e16", banner_scale,0), ("banner_101",0,"map_flag_e17", banner_scale,0), ("banner_102",0,"map_flag_e18", banner_scale,0), ("banner_103",0,"map_flag_e19", banner_scale,0), ("banner_104",0,"map_flag_e20", banner_scale,0), ("banner_105",0,"map_flag_e21", banner_scale,0), ("banner_106",0,"map_flag_f01", banner_scale,0), ("banner_107",0,"map_flag_f02", banner_scale,0), ("banner_108",0,"map_flag_f03", banner_scale,0), ("banner_109",0,"map_flag_f04", banner_scale,0), ("banner_110",0,"map_flag_f05", banner_scale,0), ("banner_111",0,"map_flag_f06", banner_scale,0), ("banner_112",0,"map_flag_f07", banner_scale,0), ("banner_113",0,"map_flag_f08", banner_scale,0), ("banner_114",0,"map_flag_f09", banner_scale,0), ("banner_115",0,"map_flag_f10", banner_scale,0), ("banner_116",0,"map_flag_f11", banner_scale,0), ("banner_117",0,"map_flag_f12", banner_scale,0), ("banner_118",0,"map_flag_f13", banner_scale,0), ("banner_119",0,"map_flag_f14", banner_scale,0), ("banner_120",0,"map_flag_f15", banner_scale,0), ("banner_121",0,"map_flag_f16", banner_scale,0), ("banner_122",0,"map_flag_f17", banner_scale,0), ("banner_123",0,"map_flag_f18", banner_scale,0), ("banner_124",0,"map_flag_f19", banner_scale,0), ("banner_125",0,"map_flag_f20", banner_scale,0), ("banner_126",0,"map_flag_15", banner_scale,0), ]
Python
trp_player = 0 trp_temp_troop = 1 trp_game = 2 trp_unarmed_troop = 3 trp_random_town_sequence = 4 trp_tournament_participants = 5 trp_tutorial_maceman = 6 trp_tutorial_archer = 7 trp_tutorial_swordsman = 8 trp_novice_fighter = 9 trp_regular_fighter = 10 trp_veteran_fighter = 11 trp_champion_fighter = 12 trp_arena_training_fighter_1 = 13 trp_arena_training_fighter_2 = 14 trp_arena_training_fighter_3 = 15 trp_arena_training_fighter_4 = 16 trp_arena_training_fighter_5 = 17 trp_arena_training_fighter_6 = 18 trp_arena_training_fighter_7 = 19 trp_arena_training_fighter_8 = 20 trp_arena_training_fighter_9 = 21 trp_arena_training_fighter_10 = 22 trp_cattle = 23 trp_farmer = 24 trp_townsman = 25 trp_watchman = 26 trp_caravan_guard = 27 trp_mercenary_swordsman = 28 trp_hired_blade = 29 trp_mercenary_crossbowman = 30 trp_mercenary_horseman = 31 trp_mercenary_cavalry = 32 trp_mercenaries_end = 33 trp_swadian_recruit = 34 trp_swadian_militia = 35 trp_swadian_footman = 36 trp_swadian_infantry = 37 trp_swadian_sergeant = 38 trp_swadian_skirmisher = 39 trp_swadian_crossbowman = 40 trp_swadian_sharpshooter = 41 trp_swadian_man_at_arms = 42 trp_swadian_knight = 43 trp_swadian_messenger = 44 trp_swadian_deserter = 45 trp_swadian_prison_guard = 46 trp_swadian_castle_guard = 47 trp_vaegir_recruit = 48 trp_vaegir_footman = 49 trp_vaegir_skirmisher = 50 trp_vaegir_archer = 51 trp_vaegir_marksman = 52 trp_vaegir_veteran = 53 trp_vaegir_infantry = 54 trp_vaegir_guard = 55 trp_vaegir_horseman = 56 trp_vaegir_knight = 57 trp_vaegir_messenger = 58 trp_vaegir_deserter = 59 trp_vaegir_prison_guard = 60 trp_vaegir_castle_guard = 61 trp_khergit_tribesman = 62 trp_khergit_skirmisher = 63 trp_khergit_horseman = 64 trp_khergit_horse_archer = 65 trp_khergit_veteran_horse_archer = 66 trp_khergit_lancer = 67 trp_khergit_messenger = 68 trp_khergit_deserter = 69 trp_khergit_prison_guard = 70 trp_khergit_castle_guard = 71 trp_nord_recruit = 72 trp_nord_footman = 73 trp_nord_trained_footman = 74 trp_nord_warrior = 75 trp_nord_veteran = 76 trp_nord_champion = 77 trp_nord_huntsman = 78 trp_nord_archer = 79 trp_nord_veteran_archer = 80 trp_nord_messenger = 81 trp_nord_deserter = 82 trp_nord_prison_guard = 83 trp_nord_castle_guard = 84 trp_rhodok_tribesman = 85 trp_rhodok_spearman = 86 trp_rhodok_trained_spearman = 87 trp_rhodok_veteran_spearman = 88 trp_rhodok_sergeant = 89 trp_rhodok_crossbowman = 90 trp_rhodok_trained_crossbowman = 91 trp_rhodok_veteran_crossbowman = 92 trp_rhodok_sharpshooter = 93 trp_rhodok_messenger = 94 trp_rhodok_deserter = 95 trp_rhodok_prison_guard = 96 trp_rhodok_castle_guard = 97 trp_looter = 98 trp_bandit = 99 trp_brigand = 100 trp_mountain_bandit = 101 trp_forest_bandit = 102 trp_sea_raider = 103 trp_steppe_bandit = 104 trp_black_khergit_horseman = 105 trp_manhunter = 106 trp_slave_driver = 107 trp_slave_hunter = 108 trp_slave_crusher = 109 trp_slaver_chief = 110 trp_follower_woman = 111 trp_hunter_woman = 112 trp_fighter_woman = 113 trp_sword_sister = 114 trp_refugee = 115 trp_peasant_woman = 116 trp_caravan_master = 117 trp_kidnapped_girl = 118 trp_town_walker_1 = 119 trp_town_walker_2 = 120 trp_village_walker_1 = 121 trp_village_walker_2 = 122 trp_spy_walker_1 = 123 trp_spy_walker_2 = 124 trp_tournament_master = 125 trp_trainer = 126 trp_constable_hareck = 127 trp_ramun_the_slave_trader = 128 trp_guide = 129 trp_xerina = 130 trp_dranton = 131 trp_kradus = 132 trp_tutorial_trainer = 133 trp_galeas = 134 trp_farmer_from_bandit_village = 135 trp_trainer_1 = 136 trp_trainer_2 = 137 trp_trainer_3 = 138 trp_trainer_4 = 139 trp_trainer_5 = 140 trp_ransom_broker_1 = 141 trp_ransom_broker_2 = 142 trp_ransom_broker_3 = 143 trp_ransom_broker_4 = 144 trp_ransom_broker_5 = 145 trp_ransom_broker_6 = 146 trp_ransom_broker_7 = 147 trp_ransom_broker_8 = 148 trp_ransom_broker_9 = 149 trp_ransom_broker_10 = 150 trp_tavern_traveler_1 = 151 trp_tavern_traveler_2 = 152 trp_tavern_traveler_3 = 153 trp_tavern_traveler_4 = 154 trp_tavern_traveler_5 = 155 trp_tavern_traveler_6 = 156 trp_tavern_traveler_7 = 157 trp_tavern_traveler_8 = 158 trp_tavern_traveler_9 = 159 trp_tavern_traveler_10 = 160 trp_tavern_bookseller_1 = 161 trp_tavern_bookseller_2 = 162 trp_tavern_minstrel_1 = 163 trp_npc1 = 164 trp_npc2 = 165 trp_npc3 = 166 trp_npc4 = 167 trp_npc5 = 168 trp_npc6 = 169 trp_npc7 = 170 trp_npc8 = 171 trp_npc9 = 172 trp_npc10 = 173 trp_npc11 = 174 trp_npc12 = 175 trp_npc13 = 176 trp_npc14 = 177 trp_npc15 = 178 trp_npc16 = 179 trp_kingdom_heroes_including_player_begin = 180 trp_kingdom_1_lord = 181 trp_kingdom_2_lord = 182 trp_kingdom_3_lord = 183 trp_kingdom_4_lord = 184 trp_kingdom_5_lord = 185 trp_knight_1_1 = 186 trp_knight_1_2 = 187 trp_knight_1_3 = 188 trp_knight_1_4 = 189 trp_knight_1_5 = 190 trp_knight_1_6 = 191 trp_knight_1_7 = 192 trp_knight_1_8 = 193 trp_knight_1_9 = 194 trp_knight_1_10 = 195 trp_knight_1_11 = 196 trp_knight_1_12 = 197 trp_knight_1_13 = 198 trp_knight_1_14 = 199 trp_knight_1_15 = 200 trp_knight_1_16 = 201 trp_knight_1_17 = 202 trp_knight_1_18 = 203 trp_knight_1_19 = 204 trp_knight_1_20 = 205 trp_knight_2_1 = 206 trp_knight_2_2 = 207 trp_knight_2_3 = 208 trp_knight_2_4 = 209 trp_knight_2_5 = 210 trp_knight_2_6 = 211 trp_knight_2_7 = 212 trp_knight_2_8 = 213 trp_knight_2_9 = 214 trp_knight_2_10 = 215 trp_knight_2_11 = 216 trp_knight_2_12 = 217 trp_knight_2_13 = 218 trp_knight_2_14 = 219 trp_knight_2_15 = 220 trp_knight_2_16 = 221 trp_knight_2_17 = 222 trp_knight_2_18 = 223 trp_knight_2_19 = 224 trp_knight_2_20 = 225 trp_knight_3_1 = 226 trp_knight_3_2 = 227 trp_knight_3_3 = 228 trp_knight_3_4 = 229 trp_knight_3_5 = 230 trp_knight_3_6 = 231 trp_knight_3_7 = 232 trp_knight_3_8 = 233 trp_knight_3_9 = 234 trp_knight_3_10 = 235 trp_knight_3_11 = 236 trp_knight_3_12 = 237 trp_knight_3_13 = 238 trp_knight_3_14 = 239 trp_knight_3_15 = 240 trp_knight_3_16 = 241 trp_knight_3_17 = 242 trp_knight_3_18 = 243 trp_knight_3_19 = 244 trp_knight_3_20 = 245 trp_knight_4_1 = 246 trp_knight_4_2 = 247 trp_knight_4_3 = 248 trp_knight_4_4 = 249 trp_knight_4_5 = 250 trp_knight_4_6 = 251 trp_knight_4_7 = 252 trp_knight_4_8 = 253 trp_knight_4_9 = 254 trp_knight_4_10 = 255 trp_knight_4_11 = 256 trp_knight_4_12 = 257 trp_knight_4_13 = 258 trp_knight_4_14 = 259 trp_knight_4_15 = 260 trp_knight_4_16 = 261 trp_knight_4_17 = 262 trp_knight_4_18 = 263 trp_knight_4_19 = 264 trp_knight_4_20 = 265 trp_knight_5_1 = 266 trp_knight_5_2 = 267 trp_knight_5_3 = 268 trp_knight_5_4 = 269 trp_knight_5_5 = 270 trp_knight_5_6 = 271 trp_knight_5_7 = 272 trp_knight_5_8 = 273 trp_knight_5_9 = 274 trp_knight_5_10 = 275 trp_knight_5_11 = 276 trp_knight_5_12 = 277 trp_knight_5_13 = 278 trp_knight_5_14 = 279 trp_knight_5_15 = 280 trp_knight_5_16 = 281 trp_knight_5_17 = 282 trp_knight_5_18 = 283 trp_knight_5_19 = 284 trp_knight_5_20 = 285 trp_kingdom_1_pretender = 286 trp_kingdom_2_pretender = 287 trp_kingdom_3_pretender = 288 trp_kingdom_4_pretender = 289 trp_kingdom_5_pretender = 290 trp_knight_1_1_wife = 291 trp_knight_2_1_wife = 292 trp_knight_3_1_wife = 293 trp_knight_4_1_wife = 294 trp_knight_5_1_wife = 295 trp_knight_1_2_wife = 296 trp_knight_2_2_wife = 297 trp_knight_3_2_wife = 298 trp_knight_4_2_wife = 299 trp_knight_5_2_wife = 300 trp_knight_1_1_daughter = 301 trp_knight_2_1_daughter = 302 trp_knight_3_1_daughter = 303 trp_knight_4_1_daughter = 304 trp_knight_5_1_daughter = 305 trp_knight_1_2_daughter = 306 trp_knight_2_2_daughter = 307 trp_knight_3_2_daughter = 308 trp_knight_4_2_daughter = 309 trp_knight_5_2_daughter = 310 trp_heroes_end = 311 trp_town_1_seneschal = 312 trp_town_2_seneschal = 313 trp_town_3_seneschal = 314 trp_town_4_seneschal = 315 trp_town_5_seneschal = 316 trp_town_6_seneschal = 317 trp_town_7_seneschal = 318 trp_town_8_seneschal = 319 trp_town_9_seneschal = 320 trp_town_10_seneschal = 321 trp_town_11_seneschal = 322 trp_town_12_seneschal = 323 trp_town_13_seneschal = 324 trp_town_14_seneschal = 325 trp_town_15_seneschal = 326 trp_town_16_seneschal = 327 trp_town_17_seneschal = 328 trp_town_18_seneschal = 329 trp_castle_1_seneschal = 330 trp_castle_2_seneschal = 331 trp_castle_3_seneschal = 332 trp_castle_4_seneschal = 333 trp_castle_5_seneschal = 334 trp_castle_6_seneschal = 335 trp_castle_7_seneschal = 336 trp_castle_8_seneschal = 337 trp_castle_9_seneschal = 338 trp_castle_10_seneschal = 339 trp_castle_11_seneschal = 340 trp_castle_12_seneschal = 341 trp_castle_13_seneschal = 342 trp_castle_14_seneschal = 343 trp_castle_15_seneschal = 344 trp_castle_16_seneschal = 345 trp_castle_17_seneschal = 346 trp_castle_18_seneschal = 347 trp_castle_19_seneschal = 348 trp_castle_20_seneschal = 349 trp_castle_21_seneschal = 350 trp_castle_22_seneschal = 351 trp_castle_23_seneschal = 352 trp_castle_24_seneschal = 353 trp_castle_25_seneschal = 354 trp_castle_26_seneschal = 355 trp_castle_27_seneschal = 356 trp_castle_28_seneschal = 357 trp_castle_29_seneschal = 358 trp_castle_30_seneschal = 359 trp_castle_31_seneschal = 360 trp_castle_32_seneschal = 361 trp_castle_33_seneschal = 362 trp_castle_34_seneschal = 363 trp_castle_35_seneschal = 364 trp_castle_36_seneschal = 365 trp_castle_37_seneschal = 366 trp_castle_38_seneschal = 367 trp_castle_39_seneschal = 368 trp_castle_40_seneschal = 369 trp_town_1_arena_master = 370 trp_town_2_arena_master = 371 trp_town_3_arena_master = 372 trp_town_4_arena_master = 373 trp_town_5_arena_master = 374 trp_town_6_arena_master = 375 trp_town_7_arena_master = 376 trp_town_8_arena_master = 377 trp_town_9_arena_master = 378 trp_town_10_arena_master = 379 trp_town_11_arena_master = 380 trp_town_12_arena_master = 381 trp_town_13_arena_master = 382 trp_town_14_arena_master = 383 trp_town_15_arena_master = 384 trp_town_16_arena_master = 385 trp_town_17_arena_master = 386 trp_town_18_arena_master = 387 trp_town_1_armorer = 388 trp_town_2_armorer = 389 trp_town_3_armorer = 390 trp_town_4_armorer = 391 trp_town_5_armorer = 392 trp_town_6_armorer = 393 trp_town_7_armorer = 394 trp_town_8_armorer = 395 trp_town_9_armorer = 396 trp_town_10_armorer = 397 trp_town_11_armorer = 398 trp_town_12_armorer = 399 trp_town_13_armorer = 400 trp_town_14_armorer = 401 trp_town_15_armorer = 402 trp_town_16_armorer = 403 trp_town_17_armorer = 404 trp_town_18_armorer = 405 trp_town_1_weaponsmith = 406 trp_town_2_weaponsmith = 407 trp_town_3_weaponsmith = 408 trp_town_4_weaponsmith = 409 trp_town_5_weaponsmith = 410 trp_town_6_weaponsmith = 411 trp_town_7_weaponsmith = 412 trp_town_8_weaponsmith = 413 trp_town_9_weaponsmith = 414 trp_town_10_weaponsmith = 415 trp_town_11_weaponsmith = 416 trp_town_12_weaponsmith = 417 trp_town_13_weaponsmith = 418 trp_town_14_weaponsmith = 419 trp_town_15_weaponsmith = 420 trp_town_16_weaponsmith = 421 trp_town_17_weaponsmith = 422 trp_town_18_weaponsmith = 423 trp_town_1_tavernkeeper = 424 trp_town_2_tavernkeeper = 425 trp_town_3_tavernkeeper = 426 trp_town_4_tavernkeeper = 427 trp_town_5_tavernkeeper = 428 trp_town_6_tavernkeeper = 429 trp_town_7_tavernkeeper = 430 trp_town_8_tavernkeeper = 431 trp_town_9_tavernkeeper = 432 trp_town_10_tavernkeeper = 433 trp_town_11_tavernkeeper = 434 trp_town_12_tavernkeeper = 435 trp_town_13_tavernkeeper = 436 trp_town_14_tavernkeeper = 437 trp_town_15_tavernkeeper = 438 trp_town_16_tavernkeeper = 439 trp_town_17_tavernkeeper = 440 trp_town_18_tavernkeeper = 441 trp_town_1_merchant = 442 trp_town_2_merchant = 443 trp_town_3_merchant = 444 trp_town_4_merchant = 445 trp_town_5_merchant = 446 trp_town_6_merchant = 447 trp_town_7_merchant = 448 trp_town_8_merchant = 449 trp_town_9_merchant = 450 trp_town_10_merchant = 451 trp_town_11_merchant = 452 trp_town_12_merchant = 453 trp_town_13_merchant = 454 trp_town_14_merchant = 455 trp_town_15_merchant = 456 trp_town_16_merchant = 457 trp_town_17_merchant = 458 trp_town_18_merchant = 459 trp_salt_mine_merchant = 460 trp_town_1_horse_merchant = 461 trp_town_2_horse_merchant = 462 trp_town_3_horse_merchant = 463 trp_town_4_horse_merchant = 464 trp_town_5_horse_merchant = 465 trp_town_6_horse_merchant = 466 trp_town_7_horse_merchant = 467 trp_town_8_horse_merchant = 468 trp_town_9_horse_merchant = 469 trp_town_10_horse_merchant = 470 trp_town_11_horse_merchant = 471 trp_town_12_horse_merchant = 472 trp_town_13_horse_merchant = 473 trp_town_14_horse_merchant = 474 trp_town_15_horse_merchant = 475 trp_town_16_horse_merchant = 476 trp_town_17_horse_merchant = 477 trp_town_18_horse_merchant = 478 trp_town_1_mayor = 479 trp_town_2_mayor = 480 trp_town_3_mayor = 481 trp_town_4_mayor = 482 trp_town_5_mayor = 483 trp_town_6_mayor = 484 trp_town_7_mayor = 485 trp_town_8_mayor = 486 trp_town_9_mayor = 487 trp_town_10_mayor = 488 trp_town_11_mayor = 489 trp_town_12_mayor = 490 trp_town_13_mayor = 491 trp_town_14_mayor = 492 trp_town_15_mayor = 493 trp_town_16_mayor = 494 trp_town_17_mayor = 495 trp_town_18_mayor = 496 trp_village_1_elder = 497 trp_village_2_elder = 498 trp_village_3_elder = 499 trp_village_4_elder = 500 trp_village_5_elder = 501 trp_village_6_elder = 502 trp_village_7_elder = 503 trp_village_8_elder = 504 trp_village_9_elder = 505 trp_village_10_elder = 506 trp_village_11_elder = 507 trp_village_12_elder = 508 trp_village_13_elder = 509 trp_village_14_elder = 510 trp_village_15_elder = 511 trp_village_16_elder = 512 trp_village_17_elder = 513 trp_village_18_elder = 514 trp_village_19_elder = 515 trp_village_20_elder = 516 trp_village_21_elder = 517 trp_village_22_elder = 518 trp_village_23_elder = 519 trp_village_24_elder = 520 trp_village_25_elder = 521 trp_village_26_elder = 522 trp_village_27_elder = 523 trp_village_28_elder = 524 trp_village_29_elder = 525 trp_village_30_elder = 526 trp_village_31_elder = 527 trp_village_32_elder = 528 trp_village_33_elder = 529 trp_village_34_elder = 530 trp_village_35_elder = 531 trp_village_36_elder = 532 trp_village_37_elder = 533 trp_village_38_elder = 534 trp_village_39_elder = 535 trp_village_40_elder = 536 trp_village_41_elder = 537 trp_village_42_elder = 538 trp_village_43_elder = 539 trp_village_44_elder = 540 trp_village_45_elder = 541 trp_village_46_elder = 542 trp_village_47_elder = 543 trp_village_48_elder = 544 trp_village_49_elder = 545 trp_village_50_elder = 546 trp_village_51_elder = 547 trp_village_52_elder = 548 trp_village_53_elder = 549 trp_village_54_elder = 550 trp_village_55_elder = 551 trp_village_56_elder = 552 trp_village_57_elder = 553 trp_village_58_elder = 554 trp_village_59_elder = 555 trp_village_60_elder = 556 trp_village_61_elder = 557 trp_village_62_elder = 558 trp_village_63_elder = 559 trp_village_64_elder = 560 trp_village_65_elder = 561 trp_village_66_elder = 562 trp_village_67_elder = 563 trp_village_68_elder = 564 trp_village_69_elder = 565 trp_village_70_elder = 566 trp_village_71_elder = 567 trp_village_72_elder = 568 trp_village_73_elder = 569 trp_village_74_elder = 570 trp_village_75_elder = 571 trp_village_76_elder = 572 trp_village_77_elder = 573 trp_village_78_elder = 574 trp_village_79_elder = 575 trp_village_80_elder = 576 trp_village_81_elder = 577 trp_village_82_elder = 578 trp_village_83_elder = 579 trp_village_84_elder = 580 trp_village_85_elder = 581 trp_village_86_elder = 582 trp_village_87_elder = 583 trp_village_88_elder = 584 trp_village_89_elder = 585 trp_village_90_elder = 586 trp_merchants_end = 587 trp_zendar_chest = 588 trp_tutorial_chest_1 = 589 trp_tutorial_chest_2 = 590 trp_bonus_chest_1 = 591 trp_bonus_chest_2 = 592 trp_bonus_chest_3 = 593 trp_temp_array_a = 594 trp_temp_array_b = 595 trp_temp_array_c = 596 trp_stack_selection_amounts = 597 trp_stack_selection_ids = 598 trp_notification_menu_types = 599 trp_notification_menu_var1 = 600 trp_notification_menu_var2 = 601 trp_banner_background_color_array = 602 trp_local_merchant = 603 trp_tax_rebel = 604 trp_trainee_peasant = 605 trp_fugitive = 606 trp_spy = 607 trp_spy_partner = 608 trp_quick_battle_6_player = 609 trp_log_array_entry_type = 610 trp_log_array_entry_time = 611 trp_log_array_actor = 612 trp_log_array_center_object = 613 trp_log_array_center_object_lord = 614 trp_log_array_center_object_faction = 615 trp_log_array_troop_object = 616 trp_log_array_troop_object_faction = 617 trp_log_array_faction_object = 618
Python
from header_common import * from ID_animations import * from header_mission_templates import * from header_tableau_materials import * from header_items import * from module_constants import * #################################################################################################################### # Each tableau material contains the following fields: # 1) Tableau id (string): used for referencing tableaux in other files. The prefix tab_ is automatically added before each tableau-id. # 2) Tableau flags (int). See header_tableau_materials.py for a list of available flags # 3) Tableau sample material name (string). # 4) Tableau width (int). # 5) Tableau height (int). # 6) Tableau mesh min x (int): divided by 1000 and used when a mesh is auto-generated using the tableau material # 7) Tableau mesh min y (int): divided by 1000 and used when a mesh is auto-generated using the tableau material # 8) Tableau mesh max x (int): divided by 1000 and used when a mesh is auto-generated using the tableau material # 9) Tableau mesh max y (int): divided by 1000 and used when a mesh is auto-generated using the tableau material # 10) Operations block (list): A list of operations. See header_operations.py for reference. # The operations block is executed when the tableau is activated. # #################################################################################################################### #banner height = 200, width = 85 with wood, 75 without wood tableaus = [ ("game_character_sheet", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 266, 532, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0xFF888888), (cur_tableau_set_ambient_light, 10,11,15), (set_fixed_point_multiplier, 100), (cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000), (init_position, pos1), (position_set_z, pos1, 100), (position_set_x, pos1, -20), (position_set_y, pos1, -20), (cur_tableau_add_tableau_mesh, "tableau_troop_character_color", ":troop_no", pos1, 0, 0), (position_set_z, pos1, 200), (cur_tableau_add_tableau_mesh, "tableau_troop_character_alpha_mask", ":troop_no", pos1, 0, 0), (position_set_z, pos1, 300), ]), ("game_inventory_window", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 180, 270, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0xFF888888), (cur_tableau_set_ambient_light, 10,11,15), (set_fixed_point_multiplier, 100), (cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000), (init_position, pos1), (position_set_z, pos1, 100), (position_set_x, pos1, -20), (position_set_y, pos1, -20), (cur_tableau_add_tableau_mesh, "tableau_troop_inventory_color", ":troop_no", pos1, 0, 0), (position_set_z, pos1, 200), (cur_tableau_add_tableau_mesh, "tableau_troop_inventory_alpha_mask", ":troop_no", pos1, 0, 0), (position_set_z, pos1, 300), ]), ("game_party_window", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 300, 300, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0xFF888888), (cur_tableau_set_ambient_light, 10,11,15), (set_fixed_point_multiplier, 100), (cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000), (init_position, pos1), (position_set_z, pos1, 100), (position_set_x, pos1, -20), (position_set_y, pos1, -20), (cur_tableau_add_tableau_mesh, "tableau_troop_party_color", ":troop_no", pos1, 0, 0), (position_set_z, pos1, 200), (cur_tableau_add_tableau_mesh, "tableau_troop_party_alpha_mask", ":troop_no", pos1, 0, 0), (position_set_z, pos1, 300), ]), ("round_shield_1", 0, "sample_shield_round_1", 512, 256, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -50), (position_set_y, pos1, 125), (cur_tableau_add_mesh, ":banner_mesh", pos1, 120, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_1", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000), ]), ("round_shield_2", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -50), (position_set_y, pos1, 120), (cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_2", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000), ]), ("round_shield_3", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -50), (position_set_y, pos1, 120), (cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_3", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000), ]), ("round_shield_4", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -50), (position_set_y, pos1, 125), (cur_tableau_add_mesh, ":banner_mesh", pos1, 123, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_4", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000), ]), ("round_shield_5", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -50), (position_set_y, pos1, 125), (cur_tableau_add_mesh, ":banner_mesh", pos1, 122, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_5", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000), ]), ("small_round_shield_1", 0, "sample_shield_small_round_1", 512, 256, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -50), (position_set_y, pos1, 130), (cur_tableau_add_mesh, ":banner_mesh", pos1, 127, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_small_round_1", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000), ]), ("small_round_shield_2", 0, "sample_shield_small_round_2", 512, 256, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -50), (position_set_y, pos1, 130), (cur_tableau_add_mesh, ":banner_mesh", pos1, 127, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_small_round_2", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000), ]), ("small_round_shield_3", 0, "sample_shield_matte", 512, 256, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -50), (position_set_y, pos1, 130), (cur_tableau_add_mesh, ":banner_mesh", pos1, 127, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_small_round_3", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000), ]), ("kite_shield_1", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -60), (position_set_y, pos1, 140), (cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_kite_1", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000), ]), ("kite_shield_2", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -57), (position_set_y, pos1, 140), (cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_kite_2", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000), ]), ("kite_shield_3", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -57), (position_set_y, pos1, 140), (cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_kite_3", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000), ]), ("kite_shield_4", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -50), (position_set_y, pos1, 160), (cur_tableau_add_mesh, ":banner_mesh", pos1, 120, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_kite_4", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000), ]), ("heater_shield_1", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -60), (position_set_y, pos1, 151), (cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_heater_1", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000), ]), ("heater_shield_2", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -50), (position_set_y, pos1, 150), (cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_heater_2", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000), ]), ("pavise_shield_1", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -54), (position_set_y, pos1, 120), (cur_tableau_add_mesh, ":banner_mesh", pos1, 118, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_pavise_1", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000), ]), ("pavise_shield_2", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, -54), (position_set_y, pos1, 120), (cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_pavise_2", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000), ]), ("heraldic_armor_a", 0, "sample_heraldic_armor_a", 512, 512, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (store_sub, ":background_slot", ":banner_mesh", arms_meshes_begin), #banner_meshes_begin), (troop_get_slot, ":background_color", "trp_banner_background_color_array", ":background_slot"), (cur_tableau_set_background_color, ":background_color"), (init_position, pos1), (cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color"), # (cur_tableau_add_mesh, "mesh_heraldic_armor_bg", pos1, 200, 0), (init_position, pos1), (position_set_z, pos1, 50), (position_set_x, pos1, -25), (position_set_y, pos1, 130), (cur_tableau_add_mesh, ":banner_mesh", pos1, 103, 0), # (cur_tableau_add_mesh, "mesh_banner_a01", pos1, 116, 0), (init_position, pos1), (position_set_z, pos1, 100), (cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_armor_a", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000), ]), ("heraldic_armor_b", 0, "sample_heraldic_armor_b", 512, 512, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (store_sub, ":background_slot", ":banner_mesh", arms_meshes_begin), (troop_get_slot, ":background_color", "trp_banner_background_color_array", ":background_slot"), (cur_tableau_set_background_color, ":background_color"), (init_position, pos1), (cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color"), (init_position, pos1), (position_set_x, pos1, -5), (position_set_y, pos1, 130), (cur_tableau_add_mesh, ":banner_mesh", pos1, 113, 0), # (cur_tableau_add_mesh, "mesh_banner_a01", pos1, 116, 0), (init_position, pos1), (position_set_z, pos1, 100), (cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_armor_b", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000), ]), ("heraldic_armor_c", 0, "sample_heraldic_armor_c", 512, 512, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (store_sub, ":background_slot", ":banner_mesh", arms_meshes_begin), #banner_meshes_begin), (troop_get_slot, ":background_color", "trp_banner_background_color_array", ":background_slot"), (cur_tableau_set_background_color, ":background_color"), (init_position, pos1), (cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color"), (init_position, pos1), (position_set_x, pos1, -0), (position_set_y, pos1, 130), (cur_tableau_add_mesh, ":banner_mesh", pos1, 115, 0), # (cur_tableau_add_mesh, "mesh_banner_a01", pos1, 116, 0), (init_position, pos1), (position_set_z, pos1, 100), (cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_armor_c", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000), ]), ("heraldic_armor_d", 0, "sample_heraldic_armor_d", 512, 512, 0, 0, 0, 0, [ (store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (store_sub, ":background_slot", ":banner_mesh", arms_meshes_begin), #banner_meshes_begin), (troop_get_slot, ":background_color", "trp_banner_background_color_array", ":background_slot"), (cur_tableau_set_background_color, ":background_color"), (init_position, pos1), (cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color"), (init_position, pos1), (position_set_x, pos1, -0), (position_set_y, pos1, 130), (cur_tableau_add_mesh, ":banner_mesh", pos1, 113, 0), # (cur_tableau_add_mesh, "mesh_banner_a01", pos1, 116, 0), (init_position, pos1), (position_set_z, pos1, 100), (cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_armor_d", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000), ]), ("troop_note_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0x00888888), (cur_tableau_set_ambient_light, 10,11,15), (cur_tableau_render_as_alpha_mask), (call_script, "script_add_troop_to_cur_tableau", ":troop_no"), ]), ("troop_note_color", 0, "mat_troop_portrait_color", 1024, 1024, 0, 0, 400, 400, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0xFFC6BB94), (cur_tableau_set_ambient_light, 10,11,15), (call_script, "script_add_troop_to_cur_tableau", ":troop_no"), ]), ("troop_character_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0x00888888), (cur_tableau_set_ambient_light, 10,11,15), (cur_tableau_render_as_alpha_mask), (call_script, "script_add_troop_to_cur_tableau_for_character", ":troop_no"), ]), ("troop_character_color", 0, "mat_troop_portrait_color", 1024, 1024, 0, 0, 400, 400, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0xFFE0CFB1), (cur_tableau_set_ambient_light, 10,11,15), (call_script, "script_add_troop_to_cur_tableau_for_character", ":troop_no"), ]), ("troop_inventory_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0x00888888), (cur_tableau_set_ambient_light, 10,11,15), (cur_tableau_render_as_alpha_mask), (call_script, "script_add_troop_to_cur_tableau_for_inventory", ":troop_no"), ]), ("troop_inventory_color", 0, "mat_troop_portrait_color", 1024, 1024, 0, 0, 400, 400, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0xFF6A583A), (cur_tableau_set_ambient_light, 10,11,15), (call_script, "script_add_troop_to_cur_tableau_for_inventory", ":troop_no"), ]), ("troop_party_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0x00888888), (cur_tableau_set_ambient_light, 10,11,15), (cur_tableau_render_as_alpha_mask), (call_script, "script_add_troop_to_cur_tableau_for_party", ":troop_no"), ]), ("troop_party_color", 0, "mat_troop_portrait_color", 1024, 1024, 0, 0, 400, 400, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0xFFBE9C72), (cur_tableau_set_ambient_light, 10,11,15), (call_script, "script_add_troop_to_cur_tableau_for_party", ":troop_no"), ]), ("troop_note_mesh", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 350, 350, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0xFF888888), (cur_tableau_set_ambient_light, 10,11,15), (set_fixed_point_multiplier, 100), (cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000), (init_position, pos1), (position_set_z, pos1, 100), (position_set_x, pos1, -20), (position_set_y, pos1, -20), (cur_tableau_add_tableau_mesh, "tableau_troop_note_color", ":troop_no", pos1, 0, 0), (position_set_z, pos1, 200), (cur_tableau_add_tableau_mesh, "tableau_troop_note_alpha_mask", ":troop_no", pos1, 0, 0), (position_set_z, pos1, 300), (cur_tableau_add_mesh, "mesh_portrait_blend_out", pos1, 0, 0), ]), ("center_note_mesh", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 200, 200, [ (store_script_param, ":center_no", 1), (set_fixed_point_multiplier, 100), (cur_tableau_set_background_color, 0x00888888), (cur_tableau_set_ambient_light, 10,11,15), (init_position, pos8), (position_set_x, pos8, -210), (position_set_y, pos8, 200), (position_set_z, pos8, 300), (cur_tableau_add_point_light, pos8, 550,500,450), ## (party_get_slot, ":troop_no", ":center_no", slot_town_lord), ## (try_begin), ## (ge, ":troop_no", 0), ## (troop_get_slot, ":banner_spr", ":troop_no", slot_troop_banner_scene_prop), ## (store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1), ## (is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"), ## (val_sub, ":banner_spr", banner_scene_props_begin), ## (store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin), ## (try_end), ## ## (init_position, pos1), ## (position_set_x, pos1, -60), ## (position_set_y, pos1, -100), ## (position_set_z, pos1, 230), ## (position_rotate_x, pos1, 90), ## (assign, ":banner_scale", 105), (cur_tableau_set_camera_parameters, 1, 10, 10, 10, 10000), ## (position_set_x, pos1, -100), (init_position, pos1), (position_set_z, pos1, 0), (position_set_z, pos1, -500), (init_position, pos1), (position_set_y, pos1, -100), (position_set_x, pos1, -100), (position_set_z, pos1, 100), (position_rotate_z, pos1, 200), ## (cur_tableau_add_mesh, ":banner_mesh", pos1, ":banner_scale", 0), (party_get_icon, ":map_icon", ":center_no"), (try_begin), (ge, ":map_icon", 0), (cur_tableau_add_map_icon, ":map_icon", pos1, 0), (try_end), (init_position, pos5), (position_set_x, pos5, -90), (position_set_z, pos5, 500), (position_set_y, pos5, 480), (position_rotate_x, pos5, -90), (position_rotate_z, pos5, 180), (position_rotate_x, pos5, -35), (cur_tableau_set_camera_position, pos5), ]), ("faction_note_mesh_for_menu", 0, "pic_arms_swadian", 1024, 512, 0, 0, 450, 225, [ (store_script_param, ":faction_no", 1), (cur_tableau_set_background_color, 0xFFFFFFFF), (set_fixed_point_multiplier, 100), (try_begin), (is_between, ":faction_no", "fac_kingdom_1", kingdoms_end), #Excluding player kingdom (store_add, ":banner_mesh", "mesh_pic_arms_swadian", ":faction_no"), (val_sub, ":banner_mesh", "fac_kingdom_1"), (init_position, pos1), (position_set_y, pos1, -5), (position_set_x, pos1, -45), (cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 160, 80, 0, 100000), (try_end), ]), ("faction_note_mesh", 0, "pic_arms_swadian", 1024, 512, 0, 0, 500, 250, [ (store_script_param, ":faction_no", 1), (cur_tableau_set_background_color, 0xFFFFFFFF), (set_fixed_point_multiplier, 100), (try_begin), (is_between, ":faction_no", "fac_kingdom_1", kingdoms_end), #Excluding player kingdom (store_add, ":banner_mesh", "mesh_pic_arms_swadian", ":faction_no"), (val_sub, ":banner_mesh", "fac_kingdom_1"), (init_position, pos1), (position_set_y, pos1, -5), (cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 100, 50, 0, 100000), (try_end), ]), ("faction_note_mesh_banner", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 200, 200, [ (store_script_param, ":faction_no", 1), (set_fixed_point_multiplier, 100), (try_begin), (faction_get_slot, ":leader_troop", ":faction_no", slot_faction_leader), (ge, ":leader_troop", 0), (troop_get_slot, ":banner_spr", ":leader_troop", slot_troop_banner_scene_prop), (store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1), (is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"), (val_sub, ":banner_spr", banner_scene_props_begin), (store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin), (init_position, pos1), (position_set_y, pos1, 100), (cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 210, 210, 0, 100000), (try_end), ]), ("2_factions_mesh", 0, "tableau_with_transparency", 1024, 1024, 0, 0, 200, 200, [ (store_script_param, ":faction_no", 1), (store_mod, ":faction_no_2", ":faction_no", 128), (val_div, ":faction_no", 128), (val_add, ":faction_no", kingdoms_begin), (val_add, ":faction_no_2", kingdoms_begin), (set_fixed_point_multiplier, 100), (try_begin), (faction_get_slot, ":leader_troop", ":faction_no", slot_faction_leader), (ge, ":leader_troop", 0), (troop_get_slot, ":banner_spr", ":leader_troop", slot_troop_banner_scene_prop), (store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1), (is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"), (val_sub, ":banner_spr", banner_scene_props_begin), (store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin), (init_position, pos1), (position_set_x, pos1, -50), (position_set_y, pos1, 100), (cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0), (try_end), (try_begin), (faction_get_slot, ":leader_troop", ":faction_no_2", slot_faction_leader), (ge, ":leader_troop", 0), (troop_get_slot, ":banner_spr", ":leader_troop", slot_troop_banner_scene_prop), (store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1), (is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"), (val_sub, ":banner_spr", banner_scene_props_begin), (store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin), (init_position, pos1), (position_set_x, pos1, 50), (position_set_y, pos1, 100), (cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0), (try_end), (cur_tableau_set_camera_parameters, 0, 210, 210, 0, 100000), ]), ("color_picker", 0, "missiles", 32, 32, 0, 0, 0, 0, [ (store_script_param, ":color", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (cur_tableau_add_mesh, "mesh_color_picker", pos1, 0, 0), (position_move_z, pos1, 1), (position_move_x, pos1, -2), (position_move_y, pos1, -2), (cur_tableau_add_mesh_with_vertex_color, "mesh_white_plane", pos1, 200, 0, ":color"), (cur_tableau_set_camera_parameters, 0, 20, 20, 0, 100000), ]), ("custom_banner_square_no_mesh", 0, "missiles", 512, 512, 0, 0, 300, 300, [ (store_script_param, ":troop_no", 1), (set_fixed_point_multiplier, 100), (call_script, "script_draw_banner_to_region", ":troop_no", 0, 0, 10000, 10000, 9800, 9800, 10000, 10000, 0), (cur_tableau_set_camera_parameters, 0, 100, 100, 0, 100000), ]), ("custom_banner_default", 0, "missiles", 512, 256, 0, 0, 0, 0, [ (store_script_param, ":troop_no", 1), (set_fixed_point_multiplier, 100), (call_script, "script_draw_banner_to_region", ":troop_no", -9, -2, 7450, 19400, 7200, 18000, 9000, 10000, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 100, 200, 0, 100000), ]), ("custom_banner_tall", 0, "missiles", 512, 256, 0, 0, 0, 0, [ (store_script_param, ":troop_no", 1), (set_fixed_point_multiplier, 100), (call_script, "script_draw_banner_to_region", ":troop_no", -9, 12, 8250, 18000, 8000, 21000, 10000, 10000, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 100, 200, 0, 100000), ]), ("custom_banner_square", 0, "missiles", 256, 256, 0, 0, 0, 0, [ (store_script_param, ":troop_no", 1), (set_fixed_point_multiplier, 100), (call_script, "script_draw_banner_to_region", ":troop_no", -11, 10, 7700, 7700, 7500, 7500, 8300, 10000, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner_square", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 100, 100, 0, 100000), ]), ("custom_banner_short", 0, "missiles", 256, 512, 0, 0, 0, 0, [ (store_script_param, ":troop_no", 1), (set_fixed_point_multiplier, 100), (call_script, "script_draw_banner_to_region", ":troop_no", -10, 0, 8050, 5000, 4200, 4800, 6600, 10000, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner_short", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 100, 50, 0, 100000), ]), ## ("custom_banner", 0, "missiles", 256, 512, 0, 0, 0, 0, ## [ ## (store_script_param, ":troop_no", 1), ## ## (set_fixed_point_multiplier, 100), ## (troop_get_slot, ":bg_type", ":troop_no", slot_troop_custom_banner_bg_type), ## (val_add, ":bg_type", custom_banner_backgrounds_begin), ## (troop_get_slot, ":bg_color_1", ":troop_no", slot_troop_custom_banner_bg_color_1), ## (troop_get_slot, ":bg_color_2", ":troop_no", slot_troop_custom_banner_bg_color_2), ## (troop_get_slot, ":num_charges", ":troop_no", slot_troop_custom_banner_num_charges), ## (troop_get_slot, ":positioning", ":troop_no", slot_troop_custom_banner_positioning), ## (call_script, "script_get_troop_custom_banner_num_positionings", ":troop_no"), ## (assign, ":num_positionings", reg0), ## (val_mod, ":positioning", ":num_positionings"), ## ## (init_position, pos1), ## ## (position_move_z, pos1, -10), ## (cur_tableau_add_mesh_with_vertex_color, ":bg_type", pos1, 0, 0, ":bg_color_1"), ## (position_move_z, pos1, -10), ## (cur_tableau_add_mesh_with_vertex_color, "mesh_custom_banner_bg", pos1, 0, 0, ":bg_color_2"), ## (init_position, pos1), ## (position_move_z, pos1, -50), ## (cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner", pos1, 0, 0), ## ## (call_script, "script_get_custom_banner_charge_type_position_scale_color", "trp_player", ":positioning"), ## (try_begin), ## (ge, ":num_charges", 1), ## (cur_tableau_add_mesh_with_vertex_color, reg0, pos0, reg1, 0, reg2), ## (try_end), ## (try_begin), ## (ge, ":num_charges", 2), ## (cur_tableau_add_mesh_with_vertex_color, reg3, pos1, reg4, 0, reg5), ## (try_end), ## (try_begin), ## (ge, ":num_charges", 3), ## (cur_tableau_add_mesh_with_vertex_color, reg6, pos2, reg7, 0, reg8), ## (try_end), ## (try_begin), ## (ge, ":num_charges", 4), ## (cur_tableau_add_mesh_with_vertex_color, reg9, pos3, reg10, 0, reg11), ## (try_end), ## ## (cur_tableau_set_camera_parameters, 0, 100, 200, 0, 100000), ## ]), ("background_selection", 0, "missiles", 512, 512, 0, 0, 100, 100, [ (store_script_param, ":banner_bg", 1), (troop_get_slot, ":old_bg", "trp_player", slot_troop_custom_banner_bg_type), (troop_set_slot, "trp_player", slot_troop_custom_banner_bg_type, ":banner_bg"), (set_fixed_point_multiplier, 100), (call_script, "script_draw_banner_to_region", "trp_player", 0, 0, 10000, 10000, 9800, 9800, 10000, 10000, 0), (cur_tableau_set_camera_parameters, 0, 100, 100, 0, 100000), (troop_set_slot, "trp_player", slot_troop_custom_banner_bg_type, ":old_bg"), ]), ("positioning_selection", 0, "missiles", 512, 512, 0, 0, 100, 100, [ (store_script_param, ":positioning", 1), (troop_get_slot, ":old_positioning", "trp_player", slot_troop_custom_banner_positioning), (troop_set_slot, "trp_player", slot_troop_custom_banner_positioning, ":positioning"), (set_fixed_point_multiplier, 100), (call_script, "script_draw_banner_to_region", "trp_player", 0, 0, 10000, 10000, 9800, 9800, 10000, 10000, 0), (cur_tableau_set_camera_parameters, 0, 100, 100, 0, 100000), (troop_set_slot, "trp_player", slot_troop_custom_banner_positioning, ":old_positioning"), ]), ("retirement_troop", 0, "troop_portrait", 1024, 1024, 0, 0, 600, 600, [ (store_script_param, ":type", 1), (set_fixed_point_multiplier, 100), (cur_tableau_set_background_color, 0x00000000), (cur_tableau_set_ambient_light, 10,11,15), (init_position, pos8), (position_set_x, pos8, -210), (position_set_y, pos8, 200), (position_set_z, pos8, 300), (cur_tableau_add_point_light, pos8, 550,500,450), (cur_tableau_set_override_flags, af_override_all), (try_begin), (eq, ":type", 0), (cur_tableau_add_override_item, "itm_pilgrim_hood"), (cur_tableau_add_override_item, "itm_pilgrim_disguise"), (cur_tableau_add_override_item, "itm_wrapping_boots"), (assign, ":animation", "anim_pose_1"), (else_try), (eq, ":type", 1), (cur_tableau_add_override_item, "itm_black_hood"), (cur_tableau_add_override_item, "itm_shirt"), (cur_tableau_add_override_item, "itm_wrapping_boots"), (assign, ":animation", "anim_pose_1"), (else_try), (eq, ":type", 2), (cur_tableau_add_override_item, "itm_coarse_tunic"), (cur_tableau_add_override_item, "itm_wrapping_boots"), (assign, ":animation", "anim_pose_2"), (else_try), (eq, ":type", 3), (cur_tableau_add_override_item, "itm_linen_tunic"), (cur_tableau_add_override_item, "itm_woolen_hose"), (assign, ":animation", "anim_pose_2"), (else_try), (eq, ":type", 4), (cur_tableau_add_override_item, "itm_leather_apron"), (cur_tableau_add_override_item, "itm_leather_boots"), (assign, ":animation", "anim_pose_3"), (else_try), (eq, ":type", 5), (cur_tableau_add_override_item, "itm_short_tunic"), (cur_tableau_add_override_item, "itm_leather_boots"), (assign, ":animation", "anim_pose_3"), (else_try), (eq, ":type", 6), (cur_tableau_add_override_item, "itm_tabard"), (cur_tableau_add_override_item, "itm_leather_boots"), (assign, ":animation", "anim_pose_4"), (else_try), (eq, ":type", 7), (cur_tableau_add_override_item, "itm_courtly_outfit"), (cur_tableau_add_override_item, "itm_mail_boots"), (assign, ":animation", "anim_pose_4"), (else_try), (eq, ":type", 8), (cur_tableau_add_override_item, "itm_nobleman_outfit"), (cur_tableau_add_override_item, "itm_woolen_hose"), (assign, ":animation", "anim_pose_4"), (else_try), (eq, ":type", 9), (cur_tableau_add_override_item, "itm_heraldic_mail_with_surcoat"), (cur_tableau_add_override_item, "itm_mail_boots"), (assign, ":animation", "anim_pose_5"), (else_try), (cur_tableau_add_override_item, "itm_heraldic_mail_with_tabard"), (cur_tableau_add_override_item, "itm_iron_greaves"), (assign, ":animation", "anim_pose_5"), (try_end), (init_position, pos2), (cur_tableau_set_camera_parameters, 1, 6, 6, 10, 10000), (init_position, pos5), (position_set_z, pos5, 96), (position_set_y, pos5, 350), ## (troop_get_inventory_slot, ":horse_item", "trp_player", ek_horse), ## (try_begin), ## (gt, ":horse_item", 0), ## (position_rotate_z, pos2, -40), ## (cur_tableau_add_horse, ":horse_item", pos2, anim_horse_stand, 0), ## (assign, ":animation", anim_ride_0), ## (position_set_z, pos5, 125), ## (position_set_y, pos5, 480), ## (try_end), (cur_tableau_add_troop, "trp_player", pos2, ":animation" , 0), (position_rotate_x, pos5, -90), (position_rotate_z, pos5, 180), (cur_tableau_set_camera_position, pos5), ]), ("retired_troop_alpha_mask", 0, "mat_troop_portrait_mask", 512, 512, 0, 0, 400, 400, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0x00888888), (cur_tableau_set_ambient_light, 10,11,15), (cur_tableau_render_as_alpha_mask), (call_script, "script_add_troop_to_cur_tableau", ":troop_no"), ]), ("retired_troop_color", 0, "mat_troop_portrait_color", 512, 512, 0, 0, 400, 400, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0xFFe7d399), (cur_tableau_set_ambient_light, 10,11,15), (call_script, "script_add_troop_to_cur_tableau", ":troop_no"), ]), ("retired_troop", 0, "tableau_with_transparency", 512, 512, 0, 0, 400, 400, [ (store_script_param, ":troop_no", 1), (cur_tableau_set_background_color, 0xFF888888), (cur_tableau_set_ambient_light, 10,11,15), (set_fixed_point_multiplier, 100), (cur_tableau_set_camera_parameters, 0, 40, 40, 0, 100000), (init_position, pos1), (position_set_z, pos1, 100), (position_set_x, pos1, -20), (position_set_y, pos1, -20), (cur_tableau_add_tableau_mesh, "tableau_retired_troop_color", ":troop_no", pos1, 0, 0), (position_set_z, pos1, 200), (cur_tableau_add_tableau_mesh, "tableau_retired_troop_alpha_mask", ":troop_no", pos1, 0, 0), ]), ]
Python
import string from module_info import * from module_presentations import * from ID_meshes import * from process_common import * from process_operations import * def save_presentations(variable_list,variable_uses,tag_uses,quick_strings): ofile = open(export_dir + "presentations.txt","w") ofile.write("presentationsfile version 1\n") ofile.write(" %d\n"%(len(presentations))) for presentation in presentations: ofile.write("prsnt_%s %d %d "%(presentation[0], presentation[1], presentation[2])) save_simple_triggers(ofile,presentation[3], variable_list,variable_uses,tag_uses,quick_strings) ofile.write("\n") ofile.close() def save_python_header(): file = open("./ID_presentations.py","w") for i_presentation in xrange(len(presentations)): file.write("prsnt_%s = %d\n"%(presentations[i_presentation][0],i_presentation)) file.close() print "Exporting presentations..." save_python_header() variable_uses = [] variables = load_variables(export_dir,variable_uses) tag_uses = load_tag_uses(export_dir) quick_strings = load_quick_strings(export_dir) save_presentations(variables,variable_uses,tag_uses,quick_strings) save_variables(export_dir,variables,variable_uses) save_tag_uses(export_dir,tag_uses) save_quick_strings(export_dir,quick_strings)
Python
#import string #import types from module_info import * from module_triggers import * from module_dialogs import * from module_simple_triggers import * from module_presentations import * from process_common import * from process_operations import * #------------------------------------------------------- def compile_all_global_vars(variable_list,variable_uses, triggers, sentences, game_menus, mission_templates, scripts, simple_triggers): temp_list = [] list_type = type(temp_list) print "#Triggers begin" for trigger in triggers: try: compile_global_vars(trigger[3], variable_list,variable_uses), compile_global_vars(trigger[4], variable_list,variable_uses), except: print "Error in trigger:" print trigger print "#Triggers end" print "#Dialogs begin" for sentence in sentences: try: compile_global_vars(sentence[2], variable_list,variable_uses), compile_global_vars(sentence[5], variable_list,variable_uses), except: print "Error in dialog line:" print sentence print "#Dialogs end" print "#Game menus begin" for game_menu in game_menus: try: compile_global_vars(game_menu[4], variable_list,variable_uses) menu_items = game_menu[5] for menu_item in menu_items: compile_global_vars(menu_item[1], variable_list,variable_uses) compile_global_vars(menu_item[3], variable_list,variable_uses) except: print "Error in game menu:" print game_menu print "#Game menus end" print "#Mission templates begin" for mission_template in mission_templates: try: mt_triggers = mission_template[5] for mt_trigger in mt_triggers: compile_global_vars(mt_trigger[3], variable_list,variable_uses) compile_global_vars(mt_trigger[4], variable_list,variable_uses) except: print "Error in mission template:" print mission_template print "#Mission templates end" print "#Presentations begin" for presentation in presentations: try: prsnt_triggers = presentation[3] for prsnt_trigger in prsnt_triggers: compile_global_vars(prsnt_trigger[1], variable_list,variable_uses) except: print "Error in presentation:" print presentation print "#Presentations end" print "#Scripts begin" for i_script in xrange(len(scripts)): try: func = scripts[i_script] if (type(func[1]) == list_type): compile_global_vars(func[1], variable_list,variable_uses) else: compile_global_vars(func[2], variable_list,variable_uses) except: print "Error in script:" print func print "#Scripts end" print "#Simple triggers begin" for simple_trigger in simple_triggers: try: compile_global_vars(simple_trigger[1] , variable_list,variable_uses) except: print "Error in simple trigger:" print simple_trigger print "#Simple triggers end" print "Compiling all global variables..." variables = [] variable_uses = [] compile_all_global_vars(variables, variable_uses,triggers, dialogs, game_menus, mission_templates, scripts, simple_triggers) save_variables(export_dir, variables,variable_uses)
Python
# Point export_dir to the folder you will be keeping your module # Make sure you use forward slashes (/) and NOT backward slashes (\) export_dir = "D:/Game/Mount&Blade/Modules/Test/"
Python
import string from header_common import * from module_info import * from module_meshes import * from process_common import * def save_meshes(): ofile = open(export_dir + "meshes.txt","w") ofile.write("%d\n"%len(meshes)) for i_mesh in xrange(len(meshes)): mesh = meshes[i_mesh] ofile.write("mesh_%s %d %s %f %f %f %f %f %f %f %f %f\n"%(mesh[0],mesh[1],replace_spaces(mesh[2]),mesh[3],mesh[4],mesh[5],mesh[6],mesh[7],mesh[8],mesh[9],mesh[10],mesh[11])) ofile.close() def save_python_header(): ofile = open("./ID_meshes.py","w") for i_mesh in xrange(len(meshes)): ofile.write("mesh_%s = %d\n"%(meshes[i_mesh][0],i_mesh)) ofile.write("\n\n") ofile.close() print "Exporting meshes..." save_python_header() save_meshes()
Python
from header_common import * from header_skills import * #################################################################################################################### # Each skill contains the following fields: # 1) Skill id (string): used for referencing skills in other files. The prefix skl_ is automatically added before each skill-id . # 2) Skill name (string). # 3) Skill flags (int). See header_skills.py for a list of available flags # 4) Maximum level of the skill (int). # 5) Skill description (string): used in character window for explaining the skills. # #################################################################################################################### #Hardcoded skills are {names (indexes, beginning with 0)}: # Trade (1) # Leadership (2) # Prisoner Management (3) # First Aid (9) # Surgery (10) # Wound Treatment (11) # Inventory Management (12) # Spotting (13) # Pathfinding (14) # Tactics (15) # Tracking (16) # Trainer (17) # Engineer (18) # Horse Archery (24) # Riding (25) # Athletics (26) # Shield (27) # Weapon Master (28) # Power Draw (34) # Power Throw (35) # Power Strike (36) # Ironflesh (37) # # The effects of these skills can only be removed if the skill is disabled with sf_inactive flag. # If you want to add a new skill, use the reserved skills or use non-hardcoded skills. skills = [ ("trade","Trade",sf_base_att_cha|sf_effects_party,10,"Every level of this skill reduces your trade penalty by 5%%. (Party skill)"), ("leadership","Leadership",sf_base_att_cha,10,"Every point increases maximum number of troops you can command by 5, increases your party morale and reduces troop wages by 5%%. (Leader skill)"), ("prisoner_management", "Prisoner Management",sf_base_att_cha,10,"Every level of this skill increases maximum number of prisoners by %d. (Leader skill)"), ("reserved_1","Reserved Skill 1",sf_base_att_cha|sf_inactive,10,"This is a reserved skill."), ("reserved_2","Reserved Skill 2",sf_base_att_cha|sf_inactive,10,"This is a reserved skill."), ("reserved_3","Reserved Skill 3",sf_base_att_cha|sf_inactive,10,"This is a reserved skill."), ("reserved_4","Reserved Skill 4",sf_base_att_cha|sf_inactive,10,"This is a reserved skill."), ("persuasion","Persuasion", sf_base_att_int,10, "This skill helps you make other people accept your point of view. (Personal skill)"), ("engineer","Engineer",sf_base_att_int|sf_effects_party,10,"This skill allows you to construct siege equipment and fief improvements more efficiently. (Party skill)"), ("first_aid", "First Aid",sf_base_att_int|sf_effects_party,10,"Heroes regain 5%% per skill level of hit-points lost during mission. (Party skill)"), ("surgery","Surgery",sf_base_att_int|sf_effects_party,10,"Each point to this skill gives a 4%% chance that a mortally struck party member will be wounded rather than killed. (Party skill)"), ("wound_treatment","Wound Treatment",sf_base_att_int|sf_effects_party,10,"Party healing speed is increased by 20%% per level of this skill. (Party skill)"), ("inventory_management","Inventory Management",sf_base_att_int,10,"Increases inventory capacity by +6 per skill level. (Leader skill)"), ("spotting","Spotting",sf_base_att_int|sf_effects_party,10,"Party seeing range is increased by 10%% per skill level. (Party skill)"), ("pathfinding","Path-finding",sf_base_att_int|sf_effects_party,10,"Party map speed is increased by 3%% per skill level. (Party skill)"), ("tactics","Tactics",sf_base_att_int|sf_effects_party,10,"Every two levels of this skill increases starting battle advantage by 1. (Party skill)"), ("tracking","Tracking",sf_base_att_int|sf_effects_party,10,"Tracks become more informative. (Party skill)"), ("trainer","Trainer",sf_base_att_int,10,"Every day, each hero with this skill adds some experience to every other member of the party whose level is lower than his/hers. Experience gained goes as: {0,4,10,16,23,30,38,46,55,65,80}. (Personal skill)"), ("reserved_5","Reserved Skill 5",sf_base_att_int|sf_inactive,10,"This is a reserved skill."), ("reserved_6","Reserved Skill 6",sf_base_att_int|sf_inactive,10,"This is a reserved skill."), ("reserved_7","Reserved Skill 7",sf_base_att_int|sf_inactive,10,"This is a reserved skill."), ("reserved_8","Reserved Skill 8",sf_base_att_int|sf_inactive,10,"This is a reserved skill."), ("looting","Looting",sf_base_att_agi|sf_effects_party,10,"This skill increases the amount of loot obtained by 10%% per skill level. (Party skill)"), ("horse_archery","Horse Archery",sf_base_att_agi,10,"Reduces damage and accuracy penalties for archery and throwing from horseback. (Personal skill)"), ("riding","Riding",sf_base_att_agi,10,"Enables you to ride horses of higher difficulty levels and increases your riding speed and manuever. (Personal skill)"), ("athletics","Athletics",sf_base_att_agi,10,"Improves your running speed. (Personal skill)"), ("shield","Shield",sf_base_att_agi,10,"Reduces damage to shields (by 8%% per skill level) and improves shield speed and coverage. (Personal skill)"), ("weapon_master","Weapon Master",sf_base_att_agi,10,"Makes it easier to learn weapon proficiencies and increases the proficiency limits. Limits go as: 60, 100, 140, 180, 220, 260, 300, 340, 380, 420. (Personal skill)"), ("reserved_9","Reserved Skill 9",sf_base_att_agi|sf_inactive,10,"This is a reserved skill."), ("reserved_10","Reserved Skill 10",sf_base_att_agi|sf_inactive,10,"This is a reserved skill."), ("reserved_11","Reserved Skill 11",sf_base_att_agi|sf_inactive,10,"This is a reserved skill."), ("reserved_12","Reserved Skill 12",sf_base_att_agi|sf_inactive,10,"This is a reserved skill."), ("reserved_13","Reserved Skill 13",sf_base_att_agi|sf_inactive,10,"This is a reserved skill."), ("power_draw","Power Draw",sf_base_att_str,10,"Lets character use more powerful bows. Each point to this skill (up to four plus power-draw requirement of the bow) increases bow damage by 14%%. (Personal skill)"), ("power_throw","Power Throw",sf_base_att_str,10,"Each point to this skill increases throwing damage by 10%%. (Personal skill)"), ("power_strike","Power Strike",sf_base_att_str,10,"Each point to this skill increases melee damage by 8%%. (Personal skill)"), ("ironflesh","Ironflesh",sf_base_att_str,10,"Each point to this skill increases hit points by +2. (Personal skill)"), ("reserved_14","Reserved Skill 14",sf_base_att_str|sf_inactive,10,"This is a reserved skill."), ("reserved_15","Reserved Skill 15",sf_base_att_str|sf_inactive,10,"This is a reserved skill."), ("reserved_16","Reserved Skill 16",sf_base_att_str|sf_inactive,10,"This is a reserved skill."), ("reserved_17","Reserved Skill 17",sf_base_att_str|sf_inactive,10,"This is a reserved skill."), ("reserved_18","Reserved Skill 18",sf_base_att_str|sf_inactive,10,"This is a reserved skill."), ]
Python
strings = [ ("no_string", "NO STRING!"), ("empty_string", " "), ("yes", "Yes."), ("no", "No."), # Strings before this point are hardwired. ("blank_string", " "), ("error_string", "ERROR!!!ERROR!!!!ERROR!!!ERROR!!!ERROR!!!ERROR!!!!ERROR!!!ERROR!!!!ERROR!!!ERROR!!!!ERROR!!!ERROR!!!!ERROR!!!ERROR!!!!ERROR!!!ERROR!!!!!"), ## ("none", "none"), ("noone", "no one"), ## ("nothing", "nothing"), ("s0", "{s0}"), ("blank_s1", " {s1}"), ("reg1", "{reg1}"), ("s50_comma_s51", "{s50}, {s51}"), ("s50_and_s51", "{s50} and {s51}"), ("s5_s_party", "{s5}'s Party"), ("given_by_s1_at_s2", "Given by {s1} at {s2}"), ("given_by_s1_in_wilderness", "Given by {s1} whilst in the field"), ("s7_raiders", "{s7} Raiders"), ("bandits_eliminated_by_another", "The troublesome bandits have been eliminated by another party."), ("msg_battle_won","Battle won! Press tab key to leave..."), ("tutorial_map1","You are now viewing the overland map. Left-click on the map to move your party to that location, enter the selected town, or pursue the selected party. Time will pause on the overland map if your party is not moving, waiting or resting. To wait anywhere simply press and hold down the space bar."), ("change_color_1", "Change Color 1"), ("change_color_2", "Change Color 2"), ("change_background", "Change Background Pattern"), ("change_flag_type", "Change Flag Type"), ("change_map_flag_type", "Change Map Flag Type"), ("randomize", "Randomize"), ("sample_banner", "Sample banner:"), ("sample_map_banner", "Sample map banner:"), ("number_of_charges", "Number of charges:"), ("change_charge_1", "Change Charge 1"), ("change_charge_1_color", "Change Charge 1 Color"), ("change_charge_2", "Change Charge 2"), ("change_charge_2_color", "Change Charge 2 Color"), ("change_charge_3", "Change Charge 3"), ("change_charge_3_color", "Change Charge 3 Color"), ("change_charge_4", "Change Charge 4"), ("change_charge_4_color", "Change Charge 4 Color"), ("change_charge_position", "Change Charge Position"), ("choose_position", "Choose position:"), ("choose_charge", "Choose a charge:"), ("choose_background", "Choose background pattern:"), ("choose_flag_type", "Choose flag type:"), ("choose_map_flag_type", "Choose map flag type:"), ("choose_color", "Choose color:"), ("accept", "Accept"), ("charge_no_1", "Charge #1:"), ("charge_no_2", "Charge #2:"), ("charge_no_3", "Charge #3:"), ("charge_no_4", "Charge #4:"), ("change", "Change"), ("plus", "+"), ("minus", "-"), ("color_no_1", "Color #1:"), ("color_no_2", "Color #2:"), ("charge", "Charge"), ("color", "Color"), ("flip_horizontal", "Flip Horizontal"), ("flip_vertical", "Flip Vertical"), ("hold_fire", "Hold Fire"), ("blunt_hold_fire", "Blunt / Hold Fire"), ## ("tutorial_camp1","This is training ground where you can learn the basics of the game. Use A, S, D, W keys to move and the mouse to look around."), ## ("tutorial_camp2","F is the action key. You can open doors, talk to people and pick up objects with F key. If you wish to leave a town or retreat from a battle, press the TAB key."), ## ("tutorial_camp3","Training Ground Master wishes to speak with you about your training. Go near him, look at him and press F when you see the word 'Talk' under his name. "), ## ("tutorial_camp4","To see the in-game menu, press the Escape key. If you select Options, and then Controls from the in-game menu, you can see a complete list of key bindings."), ## ("tutorial_camp6","You've received your first quest! You can take a look at your current quests by pressing the Q key. Do it now and check the details of your quest."), ## ("tutorial_camp7","You've completed your quest! Go near Training Ground Master and speak with him about your reward."), ## ("tutorial_camp8","You've gained some experience and weapon points! Press C key to view your character and increase your weapon proficiencies."), ## ("tutorial_camp9","Congratulations! You've finished the tutorial of Mount&Blade. Press TAB key to leave the training ground."), ## ("tutorial_enter_melee", "You are entering the melee weapon training area. The chest nearby contains various weapons which you can experiment with. If you wish to quit this tutorial, press TAB key."), ## ("tutorial_enter_ranged", "You are entering the ranged weapon training area. The chest nearby contains various ranged weapons which you can experiment with. If you wish to quit this tutorial, press TAB key."), ## ("tutorial_enter_mounted", "You are entering the mounted training area. Here, you can try different kinds of weapons while riding a horse. If you wish to quit this tutorial, press TAB key."), # ("tutorial_usage_sword", "Sword is a very versatile weapon which is very fast in both attack and defense. Usage of one handed swords are affected by your one handed weapon proficiency. Focus on the sword and press F key to pick it up."), # ("tutorial_usage_axe", "Axe is a heavy (and therefore slow) weapon which can deal high damage to the opponent. Usage of one handed axes are affected by your one handed weapon proficiency. Focus on the axe and press F key to pick it up."), # ("tutorial_usage_club", "Club is a blunt weapon which deals less damage to the opponent than any other one handed weapon, but it knocks you opponents unconscious so that you can take them as a prisoner. Usage of clubs are affected by your one handed weapon proficiency. Focus on the club and press F key to pick it up."), # ("tutorial_usage_battle_axe", "Battle axe is a long weapon and it can deal high damage to the opponent. Usage of battle axes are affected by your two handed weapon proficiency. Focus on the battle axe and press F key to pick it up."), # ("tutorial_usage_spear", "Spear is a very long weapon which lets the wielder to strike the opponent earlier. Usage of the spears are affected by your polearm proficiency. Focus on the spear and press F key to pick it up."), # ("tutorial_usage_short_bow", "Short bow is a common ranged weapon which is easy to reload but hard to master at. Usage of short bows are affected by your archery proficiency. Focus on the short bow and arrows and press F key to pick them up."), # ("tutorial_usage_crossbow", "Crossbow is a heavy ranged weapon which is easy to use and deals high amount of damage to the opponent. Usage of crossbows are affected by your crossbow proficiency. Focus on the crossbow and bolts and press F key to pick them up."), # ("tutorial_usage_throwing_daggers", "Throwing daggers are easy to use and throwing them takes a very short time. But they deal light damage to the opponent. Usage of throwing daggers are affected byyour throwing weapon proficiency. Focus on the throwing daggers and press F key to pick it up."), # ("tutorial_usage_mounted", "You can use your weapons while you're mounted. Polearms like the lance here can be used for couched damage against opponents. In order to do that, ride your horse at a good speed and aim at your enemy. But do not press the attack button."), ## ("tutorial_melee_chest", "The chest near you contains some of the melee weapons that can be used throughout the game. Look at the chest now and press F key to view its contents. Click on the weapons and move them to your Arms slots to be able to use them."), ## ("tutorial_ranged_chest", "The chest near you contains some of the ranged weapons that can be used throughout the game. Look at the chest now and press F key to view its contents. Click on the weapons and move them to your Arms slots to be able to use them."), ## ## ("tutorial_item_equipped", "You have equipped a weapon. Move your mouse scroll wheel up to wield your weapon. You can also switch between your weapons using your mouse scroll wheel."), ("tutorial_ammo_refilled", "Ammo refilled."), ("tutorial_failed", "You have been beaten this time, but don't worry. Follow the instructions carefully and you'll do better next time.\ Press the Tab key to return to to the menu where you can retry this tutorial."), ("tutorial_1_msg_1","In this tutorial you will learn the basics of movement and combat.\ In Mount&Blade you use the mouse to control where you are looking, and the WASD keys of your keyboard to move.\ Your first task in the training is to locate the yellow flag in the room and move over it.\ You can press the Tab key at any time to quit this tutorial or to exit any other area in the game.\ Go to the yellow flag now."), ("tutorial_1_msg_2","Well done. Next we will cover attacking with weapons.\ For the purposes of this tutorial you have been equipped with bow and arrows, a sword and a shield.\ You can draw different weapons from your weapon slots by using the scroll wheel of your mouse.\ In the default configuration, scrolling up pulls out your next weapon, and scrolling down pulls out your shield.\ If you are already holding a shield, scrolling down will put your shield away instead.\ Try changing your wielded equipment with the scroll wheel now. When you are ready,\ go to the yellow flag to move on to your next task."), ("tutorial_1_msg_3","Excellent. The next part of this tutorial covers attacking with melee weapons.\ You attack with your currently wielded weapon by using your left mouse button.\ Press and hold the button to ready an attack, then release the button to strike.\ If you hold down the left mouse button for a while before releasing, your attack will be more powerful.\ Now draw your sword and destroy the four dummies in the room."), ("tutorial_1_msg_4","Nice work! You've destroyed all four dummies. You can now move on to the next room."), ("tutorial_1_msg_5","As you see, there is an archery target on the far side of the room.\ Your next task is to use your bow to put three arrows into that target. Press and hold down the left mouse button to notch an arrow.\ You can then fire the arrow by releasing the left mouse button. Note the targeting reticule in the centre of your screen,\ which shows you the accuracy of your shot.\ In order to achieve optimal accuracy, let fly your arrow when the reticule is at its smallest.\ Try to shoot the target now."), ("tutorial_1_msg_6","Well done! You've learned the basics of moving and attacking.\ With a little bit of practice you will soon master them.\ In the second tutorial you can learn more advanced combat skills and face armed opponents.\ You can press the Tab key at any time to return to the tutorial menu."), ("tutorial_2_msg_1","This tutorial will teach you how to defend yourself with a shield and how to battle armed opponents.\ For the moment you are armed with nothing but a shield.\ Your task is not to attack, but to successfully protect yourself from harm with your shield.\ There is an armed opponent waiting for you in the next room.\ He will try his best to knock you unconscious, while you must protect yourself with your shield\ by pressing and holding the right mouse button.\ Go into the next room now to face your opponent.\ Remember that you can press the Tab key at any time to quit this tutorial or to exit any other area in the game."), ("tutorial_2_msg_2","Press and hold down the right mouse button to raise your shield. Try to remain standing for thirty seconds. You have {reg3} seconds to go."), ("tutorial_2_msg_3","Well done, you've succeeded in defending against an armed opponent.\ The next phase of this tutorial will pit you and your shield against a force of enemy archers.\ Move on to the next room when you're ready to face the archers."), ("tutorial_2_msg_4","Defend yourself from arrows by raising your shield with the right mouse button. Try to remain standing for thirty seconds. You have {reg3} seconds to go."), ("tutorial_2_msg_5","Excellent, you've put up a succesful defence against archers.\ There is a reward waiting for you in the next room."), ("tutorial_2_msg_6","In the default configuration,\ the F key on your keyboard is used for non-violent interaction with objects and humans in the gameworld.\ To pick up the sword on the altar, look at it and press F when you see the word 'Equip'."), ("tutorial_2_msg_7","A fine weapon! Now you can use it to deliver a bit of payback.\ Go back through the door and dispose of the archers you faced earlier."), ("tutorial_2_msg_8","Very good. Your last task before finishing this tutorial is to face the maceman.\ Go through the door now and show him your steel!"), ("tutorial_2_msg_9","Congratulations! You have now learned how to defend yourself with a shield and even had your first taste of combat with armed opponents.\ Give it a bit more practice and you'll soon be a renowned swordsman.\ The next tutorial covers directional defence, which is one of the most important elements of Mount&Blade combat.\ You can press the Tab key at any time to return to the tutorial menu."), ("tutorial_3_msg_1","This tutorial is intended to give you an overview of parrying and defence without a shield.\ Parrying attacks with your weapon is a little bit more difficult than blocking them with a shield.\ When you are defending with a weapon, you are only protected from one direction, the direction in which your weapon is set.\ If you are blocking upwards, you will parry any overhead swings coming against you, but you will not stop thrusts or attacks to your sides.\ Either of these attacks would still be able to hit you.\ That's why, in order to survive without a shield, you must learn directional defence.\ Go pick up up the quarterstaff now to begin practice."), ("tutorial_3_msg_2","By default, the direction in which you defend (by clicking and holding your right mouse button) is determined by the attack direction of your closest opponent.\ For example, if your opponent is readying a thrust attack, pressing and holding the right mouse button will parry thrust attacks, but not side or overhead attacks.\ You must watch your opponent carefully and only initiate your parry AFTER the enemy starts to attack.\ If you start BEFORE he readies an attack, you may parry the wrong way altogether!\ Now it's time for you to move on to the next room, where you'll have to defend yourself against an armed opponent.\ Your task is to defend yourself successfully for thirty seconds with no equipment other than a simple quarterstaff.\ Your quarterstaff's attacks are disabled for this tutorial, so don't worry about attacking and focus on your defence instead.\ Move on to the next room when you are ready to initiate the fight."), ("tutorial_3_msg_3","Press and hold down the right mouse button to defend yourself with your staff after your opponent starts his attack.\ Try to remain standing for thirty seconds. You have {reg3} seconds to go."), ("tutorial_3_msg_4","Well done, you've succeeded this trial!\ Now you will be pitted against a more challenging opponent that will make things more difficult for you.\ Move on to the next room when you're ready to face him."), ("tutorial_3_msg_5","Press and hold down the right mouse button to defend yourself with your staff after your opponent starts his attack.\ Try to remain standing for thirty seconds. You have {reg3} seconds to go."), ("tutorial_3_msg_6","Congratulations, you still stand despite the enemy's best efforts.\ The time has now come to attack as well as defend.\ Approach the door and press the F key when you see the word 'Go'."), ("tutorial_3_2_msg_1","Your staff's attacks have been enabled again. Your first opponent is waiting in the next room.\ Defeat him by a combination of attack and defence."), ("tutorial_3_2_msg_2","Defeat your opponent with your quarterstaff."), ("tutorial_3_2_msg_3","Excellent. Now the only thing standing in your way is one last opponent.\ He is in the next room. Move in and knock him down."), ("tutorial_3_2_msg_4","Defeat your opponent with your quarterstaff."), ("tutorial_3_2_msg_5","Well done! In this tutorial you have learned how to fight ably without a shield.\ Train hard and train well, and no one shall be able to lay a stroke on you.\ In the next tutorial you may learn horseback riding and cavalry combat.\ You can press the Tab key at any time to return to the tutorial menu."), ("tutorial_4_msg_1","Welcome to the fourth tutorial.\ In this sequence you'll learn about riding a horse and how to perform various martial exercises on horseback.\ We'll start by getting you mounted up.\ Approach the horse, and press the 'F' key when you see the word 'Mount'."), ("tutorial_4_msg_2","While on horseback, the WASD keys control your horse's movement, not your own.\ Ride your horse and try to follow the yellow flag around the course.\ When you reach the flag, it will move to the next waypoint on the course until you reach the finish."), ("tutorial_4_msg_3","Very good. Next we'll cover attacking enemies from horseback. Approach the yellow flag now."), ("tutorial_4_msg_4","Draw your sword (using the mouse wheel) and destroy the four targets.\ Try hitting the dummies as you pass them at full gallop -- this provides an extra challenge,\ but the additional speed added to your blow will allow you to do more damage.\ The easiest way of doing this is by pressing and holding the left mouse button until the right moment,\ releasing it just before you pass the target."), ("tutorial_4_msg_5","Excellent work. Now let us try some target shooting from horseback. Go near the yellow flag now."), ("tutorial_4_msg_6","Locate the archery target beside the riding course and shoot it three times with your bow.\ Although you are not required to ride while shooting, it's recommended that you try to hit the target at various speeds and angles\ to get a feel for how your horse's speed and course affects your aim."), ("tutorial_4_msg_7","Congratulations, you have finished this tutorial.\ You can press the Tab key at any time to return to the tutorial menu."), # Ryan END ("tutorial_5_msg_1","TODO: Follow order to the flag"), ("tutorial_5_msg_2","TODO: Move to the flag, keep your units at this position"), ("tutorial_5_msg_3","TODO: Move to the flag to get the archers"), ("tutorial_5_msg_4","TODO: Move archers to flag1, infantry to flag2"), ("tutorial_5_msg_5","TODO: Enemy is charging. Fight!"), ("tutorial_5_msg_6","TODO: End of battle."), ("trainer_help_1", "This is a training ground where you can learn the basics of the game. Use A, S, D, W keys to move and the mouse to look around."), ("trainer_help_2", "To speak with the trainer, go near him, look at him and press the 'F' key when you see the word 'Talk' under his name.\ When you wish to leave this or any other area or retreat from a battle, you can press the TAB key."), ("custom_battle_1", "Lord Haringoth of Swadia is travelling with his household knights when he spots a group of raiders preparing to attack a small hamlet.\ Shouting out his warcry, he spurs his horse forward, and leads his loyal men to a fierce battle."), ("custom_battle_2", "Lord Mleza is leading a patrol of horsemen and archers\ in search of a group of bandits who plundered a caravan and ran away to the hills.\ Unfortunately the bandits have recently met two other large groups who want a share of their booty,\ and spotting the new threat, they decide to combine their forces."), ("custom_battle_3", "Lady Brina is leading the defense of her castle against a Swadian army.\ Now, as the besiegers prepare for a final assault on the walls, she must make sure the attack does not succeed."), ("custom_battle_4", "When the scouts inform Lord Grainwad of the presence of an enemy war band,\ he decides to act quickly and use the element of surprise against superior numbers."), ("custom_battle_5", "Lord Haeda has brought his fierce huscarls into the south with the promise of plunder.\ If he can make this castle fall to him today, he will settle in these lands and become the ruler of this valley."), ("finished", "(Finished)"), ("delivered_damage", "Delivered {reg60} damage."), ("archery_target_hit", "Distance: {reg61} yards. Score: {reg60}"), ("use_baggage_for_inventory","Use your baggage to access your inventory during battle (it's at your starting position)."), ## ("cant_leave_now","Can't leave the area now."), ("cant_use_inventory_now","Can't access inventory now."), ("cant_use_inventory_arena","Can't access inventory in the arena."), ("cant_use_inventory_disguised","Can't access inventory while you're disguised."), ("cant_use_inventory_tutorial","Can't access inventory in the training camp."), ("1_denar", "1 denar"), ("reg1_denars", "{reg1} denars"), ("january_reg1_reg2", "January {reg1}, {reg2}"), ("february_reg1_reg2", "February {reg1}, {reg2}"), ("march_reg1_reg2", "March {reg1}, {reg2}"), ("april_reg1_reg2", "April {reg1}, {reg2}"), ("may_reg1_reg2", "May {reg1}, {reg2}"), ("june_reg1_reg2", "June {reg1}, {reg2}"), ("july_reg1_reg2", "July {reg1}, {reg2}"), ("august_reg1_reg2", "August {reg1}, {reg2}"), ("september_reg1_reg2", "September {reg1}, {reg2}"), ("october_reg1_reg2", "October {reg1}, {reg2}"), ("november_reg1_reg2", "November {reg1}, {reg2}"), ("december_reg1_reg2", "December {reg1}, {reg2}"), ## ("you_approach_town","You approach the town of "), ## ("you_are_in_town","You are in the town of "), ## ("you_are_in_castle","You are at the castle of "), ## ("you_sneaked_into_town","You have sneaked into the town of "), ("town_nighttime"," It is late at night and honest folk have abandoned the streets."), ("door_locked","The door is locked."), ("castle_is_abondened","The castle seems to be unoccupied."), ("town_is_abondened","The town has no garrison defending it."), ("place_is_occupied_by_player","The place is held by your own troops."), ("place_is_occupied_by_enemy", "The place is held by hostile troops."), ("place_is_occupied_by_friendly", "The place is held by friendly troops."), ("do_you_want_to_retreat", "Are you sure you want to retreat?"), ("give_up_fight", "Give up the fight?"), ("do_you_wish_to_leave_tutorial", "Do you wish to leave the tutorial?"), ("do_you_wish_to_surrender", "Do you wish to surrender?"), ("can_not_retreat", "Can't retreat, there are enemies nearby!"), ## ("can_not_leave", "Can't leave. There are enemies nearby!"), ("s1_joined_battle_enemy", "{s1} has joined the battle on the enemy side."), ("s1_joined_battle_friend", "{s1} has joined the battle on your side."), # ("entrance_to_town_forbidden","It seems that the town guards have been warned of your presence and you won't be able to enter the town unchallenged."), ("entrance_to_town_forbidden","The town guards are on the lookout for intruders and it seems that you won't be able to pass through the gates unchallenged."), ("sneaking_to_town_impossible","The town guards are alarmed. You wouldn't be able to sneak through that gate no matter how well you disguised yourself."), ("battle_won", "You have won the battle!"), ("battle_lost", "You have lost the battle!"), ("attack_walls_success", "After a bloody fight, your brave soldiers manage to claim the walls from the enemy."), ("attack_walls_failure", "Your soldiers fall in waves as they charge the walls, and the few who remain alive soon rout and run away, never to be seen again."), ("attack_walls_continue", "A bloody battle ensues and both sides fight with equal valour. Despite the efforts of your troops, the castle remains in enemy hands."), ("order_attack_success", "Your men fight bravely and defeat the enemy."), ("order_attack_failure", "You watch the battle in despair as the enemy cuts your soldiers down, then easily drives off the few ragged survivors."), ("order_attack_continue", "Despite an extended skirmish, your troops were unable to win a decisive victory."), ("join_order_attack_success", "Your men fight well alongside your allies, sharing in the glory as your enemies are beaten."), ("join_order_attack_failure", "You watch the battle in despair as the enemy cuts your soldiers down, then easily drives off the few ragged survivors."), ("join_order_attack_continue", "Despite an extended skirmish, neither your troops nor your allies were able to win a decisive victory over the enemy."), ("siege_defender_order_attack_success", "The men of the garrison hold their walls with skill and courage, breaking the enemy assault and skillfully turning the defeat into a full-fledged rout."), ("siege_defender_order_attack_failure", "The assault quickly turns into a bloodbath. Valiant efforts are for naught; the overmatched garrison cannot hold the walls, and the enemy puts every last defender to the sword."), ("siege_defender_order_attack_continue", "Repeated, bloody attempts on the walls fail to gain any ground, but too many enemies remain for the defenders to claim a true victory. The siege continues."), ("hero_taken_prisoner", "{s1} of {s3} has been taken prisoner by {s2}."), ("hero_freed", "{s1} of {s3} has been freed from captivity by {s2}."), ("center_captured", "{s2} have taken {s1} from {s3}."), ("troop_relation_increased", "Your relation with {s1} has increased from {reg1} to {reg2}."), ("troop_relation_detoriated", "Your relation with {s1} has deteriorated from {reg1} to {reg2}."), ("faction_relation_increased", "Your relation with {s1} has increased from {reg1} to {reg2}."), ("faction_relation_detoriated", "Your relation with {s1} has deteriorated from {reg1} to {reg2}."), ("party_gained_morale", "Your party gains {reg1} morale."), ("party_lost_morale", "Your party loses {reg1} morale."), ("qst_follow_spy_noticed_you", "The spy has spotted you! He's making a run for it!"), ("father", "father"), ("husband", "husband"), ("wife", "wife"), ("daughter", "daughter"), ("mother", "mother"), ("son", "son"), ("brother", "brother"), ("sister", "sister"), ("he", "He"), ("she", "She"), ("s3s_s2", "{s3}'s {s2}"), ("s5_is_s51", "{s5} is {s51}."), ("s5_is_the_ruler_of_s51", "{s5} is the ruler of {s51}. "), ("s5_is_a_nobleman_of_s6", "{s5} is a nobleman of {s6}. "), ## ("your_debt_to_s1_is_changed_from_reg1_to_reg2", "Your debt to {s1} is changed from {reg1} to {reg2}."), ("relation_mnus_100", "Vengeful"), # -100..-94 ("relation_mnus_90", "Vengeful"), # -95..-84 ("relation_mnus_80", "Vengeful"), ("relation_mnus_70", "Hateful"), ("relation_mnus_60", "Hateful"), ("relation_mnus_50", " Hostile"), ("relation_mnus_40", " Angry"), ("relation_mnus_30", " Resentful"), ("relation_mnus_20", " Grumbling"), ("relation_mnus_10", " Suspicious"), ("relation_plus_0", " Indifferent"),# -5...4 ("relation_plus_10", " Cooperative"), # 5..14 ("relation_plus_20", " Welcoming"), ("relation_plus_30", " Favorable"), ("relation_plus_40", " Supportive"), ("relation_plus_50", " Friendly"), ("relation_plus_60", " Gracious"), ("relation_plus_70", " Fond"), ("relation_plus_80", " Loyal"), ("relation_plus_90", " Devoted"), ("relation_mnus_100_ns", "{s60} is vengeful towards you."), # -100..-94 ("relation_mnus_90_ns", "{s60} is vengeful towards you."), # -95..-84 ("relation_mnus_80_ns", "{s60} is vengeful towards you."), ("relation_mnus_70_ns", "{s60} is hateful towards you."), ("relation_mnus_60_ns", "{s60} is hateful towards you."), ("relation_mnus_50_ns", "{s60} is hostile towards you."), ("relation_mnus_40_ns", "{s60} is angry towards you."), ("relation_mnus_30_ns", "{s60} is resentful against you."), ("relation_mnus_20_ns", "{s60} is grumbling against you."), ("relation_mnus_10_ns", "{s60} is suspicious towards you."), ("relation_plus_0_ns", "{s60} is indifferent against you."),# -5...4 ("relation_plus_10_ns", "{s60} is cooperative towards you."), # 5..14 ("relation_plus_20_ns", "{s60} is welcoming towards you."), ("relation_plus_30_ns", "{s60} is favorable to you."), ("relation_plus_40_ns", "{s60} is supportive to you."), ("relation_plus_50_ns", "{s60} is friendly to you."), ("relation_plus_60_ns", "{s60} is gracious to you."), ("relation_plus_70_ns", "{s60} is fond of you."), ("relation_plus_80_ns", "{s60} is loyal to you."), ("relation_plus_90_ns", "{s60} is devoted to you."), ("relation_reg1", " Relation: {reg1}"), ("center_relation_mnus_100", "The populace hates you with a passion"), # -100..-94 ("center_relation_mnus_90", "The populace hates you intensely"), # -95..-84 ("center_relation_mnus_80", "The populace hates you strongly"), ("center_relation_mnus_70", "The populace hates you"), ("center_relation_mnus_60", "The populace is hateful to you"), ("center_relation_mnus_50", "The populace is extremely hostile to you"), ("center_relation_mnus_40", "The populace is very hostile to you"), ("center_relation_mnus_30", "The populace is hostile to you"), ("center_relation_mnus_20", "The populace is against you"), ("center_relation_mnus_10", "The populace is opposed to you"), ("center_relation_plus_0", "The populace is indifferent to you"), ("center_relation_plus_10", "The populace is acceptive to you"), ("center_relation_plus_20", "The populace is cooperative to you"), ("center_relation_plus_30", "The populace is somewhat supportive to you"), ("center_relation_plus_40", "The populace is supportive to you"), ("center_relation_plus_50", "The populace is very supportive to you"), ("center_relation_plus_60", "The populace is loyal to you"), ("center_relation_plus_70", "The populace is highly loyal to you"), ("center_relation_plus_80", "The populace is devoted to you"), ("center_relation_plus_90", "The populace is fiercely devoted to you"), ("town_prosperity_0", "The poverty of the town of {s60} is unbearable"), ("town_prosperity_10", "The squalorous town of {s60} is all but deserted."), ("town_prosperity_20", "The town of {s60} looks a wretched, desolate place."), ("town_prosperity_30", "The town of {s60} looks poor and neglected."), ("town_prosperity_40", "The town of {s60} appears to be struggling."), ("town_prosperity_50", "The town of {s60} seems unremarkable."), ("town_prosperity_60", "The town of {s60} seems to be flourishing."), ("town_prosperity_70", "The prosperous town of {s60} is bustling with activity."), ("town_prosperity_80", "The town of {s60} looks rich and well-maintained."), ("town_prosperity_90", "The town of {s60} is opulent and crowded with well-to-do people."), ("town_prosperity_100", "The glittering town of {s60} openly flaunts its great wealth."), ("village_prosperity_0", "The poverty of the village of {s60} is unbearable."), ("village_prosperity_10", "The village of {s60} looks wretchedly poor and miserable."), ("village_prosperity_20", "The village of {s60} looks very poor and desolate."), ("village_prosperity_30", "The village of {s60} looks poor and neglected."), ("village_prosperity_40", "The village of {s60} appears to be somewhat poor and struggling."), ("village_prosperity_50", "The village of {s60} seems unremarkable."), ("village_prosperity_60", "The village of {s60} seems to be flourishing."), ("village_prosperity_70", "The village of {s60} appears to be thriving."), ("village_prosperity_80", "The village of {s60} looks rich and well-maintained."), ("village_prosperity_90", "The village of {s60} looks very rich and prosperous."), ("village_prosperity_100", "The village of {s60}, surrounded by vast, fertile fields, looks immensely rich."), ("war_report_minus_4", "we are about to lose the war"), ("war_report_minus_3", "the situation looks bleak"), ("war_report_minus_2", "things aren't going too well for us"), ("war_report_minus_1", "we can still win the war if we rally"), ("war_report_0", "we are evenly matched with the enemy"), ("war_report_plus_1", "we have a fair chance of winning the war"), ("war_report_plus_2", "things are going quite well"), ("war_report_plus_3", "we should have no difficulty defeating them"), ("war_report_plus_4", "we are about to win the war"), ("persuasion_summary_very_bad", "You try your best to persuade {s50},\ but none of your arguments seem to come out right. Every time you start to make sense,\ you seem to say something entirely wrong that puts you off track.\ By the time you finish speaking you've failed to form a single coherent point in your own favour,\ and you realise that all you've done was dig yourself deeper into a hole.\ Unsurprisingly, {s50} does not look impressed."), ("persuasion_summary_bad", "You try to persuade {s50}, but {reg51?she:he} outmanoeuvres you from the very start.\ Even your best arguments sound hollow to your own ears. {s50}, likewise,\ has not formed a very high opinion of what you had to say."), ("persuasion_summary_average", "{s50} turns out to be a skilled speaker with a keen mind,\ and you can't seem to bring forth anything concrete that {reg51?she:he} cannot counter with a rational point.\ In the end, neither of you manage to gain any ground in this discussion."), ("persuasion_summary_good", "Through quick thinking and smooth argumentation, you manage to state your case well,\ forcing {s50} to concede on several points. However, {reg51?she:he} still expresses doubts about your request."), ("persuasion_summary_very_good","You deliver an impassioned speech that echoes through all listening ears like poetry.\ The world itself seems to quiet down in order to hear you better .\ The inspiring words have moved {s50} deeply, and {reg51?she:he} looks much more well-disposed towards helping you."), # meet_spy_in_enemy_town quest secret sentences ("secret_sign_1", "The armoire dances at midnight..."), ("secret_sign_2", "I am selling these fine Khergit tapestries. Would you like to buy some?"), ("secret_sign_3", "The friend of a friend sent me..."), ("secret_sign_4", "The wind blows hard from the east and the river runs red..."), ("countersign_1", "But does he dance for the dresser or the candlestick?"), ("countersign_2", "Yes I would, do you have any in blue?"), ("countersign_3", "But, my friend, your friend's friend will never have a friend like me."), ("countersign_4", "Have you been sick?"), # Names ("name_1", "Albard"), ("name_2", "Euscarl"), ("name_3", "Sigmar"), ("name_4", "Talesqe"), ("name_5", "Ritmand"), ("name_6", "Aels"), ("name_7", "Raurqe"), ("name_8", "Bragamus"), ("name_9", "Taarl"), ("name_10", "Ramin"), ("name_11", "Shulk"), ("name_12", "Putar"), ("name_13", "Tamus"), ("name_14", "Reichad"), ("name_15", "Walcheas"), ("name_16", "Rulkh"), ("name_17", "Marlund"), ("name_18", "Auguryn"), ("name_19", "Daynad"), ("name_20", "Joayah"), ("name_21", "Ramar"), ("name_22", "Caldaran"), ("name_23", "Brabas"), ("name_24", "Kundrin"), ("name_25", "Pechnak"), # Surname ("surname_1", "{s50} of Uxhal"), ("surname_2", "{s50} of Wercheg"), ("surname_3", "{s50} of Reyvadin"), ("surname_4", "{s50} of Suno"), ("surname_5", "{s50} of Jelkala"), ("surname_6", "{s50} of Veluca"), ("surname_7", "{s50} of Halmar"), ("surname_8", "{s50} of Curaw"), ("surname_9", "{s50} of Sargoth"), ("surname_10", "{s50} of Tihr"), ("surname_11", "{s50} of Zendar"), ("surname_12", "{s50} of Rivacheg"), ("surname_13", "{s50} of Wercheg"), ("surname_14", "{s50} of Ehlerdag"), ("surname_15", "{s50} of Yaragar"), ("surname_16", "{s50} of Burglen"), ("surname_17", "{s50} of Shapeshte"), ("surname_18", "{s50} of Hanun"), ("surname_19", "{s50} of Saren"), ("surname_20", "{s50} of Tosdhar"), ("surname_21", "{s50} the Long"), ("surname_22", "{s50} the Gaunt"), ("surname_23", "{s50} Silkybeard"), ("surname_24", "{s50} the Sparrow"), ("surname_25", "{s50} the Pauper"), ("surname_26", "{s50} the Scarred"), ("surname_27", "{s50} the Fair"), ("surname_28", "{s50} the Grim"), ("surname_29", "{s50} the Red"), ("surname_30", "{s50} the Black"), ("surname_31", "{s50} the Tall"), ("surname_32", "{s50} Star-Eyed"), ("surname_33", "{s50} the Fearless"), ("surname_34", "{s50} the Valorous"), ("surname_35", "{s50} the Cunning"), ("surname_36", "{s50} the Coward"), ("surname_37", "{s50} Bright"), ("surname_38", "{s50} the Quick"), ("surname_39", "{s50} the Minstrel"), ("surname_40", "{s50} the Bold"), ("surname_41", "{s50} Hot-Head"), ("surnames_end", "surnames_end"), ("number_of_troops_killed_reg1", "Number of troops killed: {reg1}"), ("number_of_troops_wounded_reg1", "Number of troops wounded: {reg1}"), ("number_of_own_troops_killed_reg1", "Number of friendly troops killed: {reg1}"), ("number_of_own_troops_wounded_reg1", "Number of friendly troops wounded: {reg1}"), ("retreat", "Retreat!"), ("siege_continues", "Fighting Continues..."), ("casualty_display", "Your casualties: {s10}^Enemy casualties: {s11}{s12}"), ("casualty_display_hp", "^You were wounded for {reg1} hit points."), # Quest log texts ("quest_log_updated", "Quest log has been updated..."), ("banner_selection_text", "You have been awarded the right to carry a banner.\ Your banner will signify your status and bring you honour. Which banner do you want to choose?"), # Retirement Texts: s7=village name; s8=castle name; s9=town name ("retirement_text_1", "Only too late do you realise that your money won't last.\ It doesn't take you long to fritter away what little you bothered to save,\ and you fare poorly in several desperate attempts to start adventuring again.\ You end up a beggar in {s9}, living on alms and the charity of the church."), ("retirement_text_2", "Only too late do you realise that your money won't last.\ It doesn't take you long to fritter away what little you bothered to save.\ Once every denar has evaporated in your hands you are forced to start a life of crime in the backstreets of {s9},\ using your skills to eke out a living robbing coppers from women and poor townsmen."), ("retirement_text_3", "Only too late do you realise that your money won't last.\ It doesn't take you long to fritter away what little you bothered to save,\ and you end up a penniless drifter, going from tavern to tavern\ blagging drinks from indulgent patrons by regaling them with war stories that no one ever believes."), ("retirement_text_4", "The silver you've saved doesn't last long,\ but you manage to put together enough to buy some land near the village of {s7}.\ There you become a free farmer, and you soon begin to attract potential {wives/husbands}.\ In time the villagers come to treat you as their local hero.\ You always receive a place of honour at feasts, and your exploits are told and retold in the pubs and taverns\ so that the children may keep a memory of you for ever and ever."), ("retirement_text_5", "The silver you've saved doesn't last long,\ but it's enough to buy a small tavern in {s9}. Although the locals are wary of you at first,\ they soon accept you into their midst. In time your growing tavern becomes a popular feasthall and meeting place.\ People come for miles to eat or stay there due to your sheer renown and the epic stories you tell of your adventuring days."), ("retirement_text_6", "You've saved wisely throughout your career,\ and now your silver and your intelligence allow you to make some excellent investments to cement your future.\ After buying several shops and warehouses in {s9}, your shrewdness turns you into one of the most prominent merchants in town,\ and you soon become a wealthy {man/woman} known as much for your trading empire as your exploits in battle."), ("retirement_text_7", "As a landed noble, however minor, your future is all but assured.\ You settle in your holdfast at {s7}, administrating the village and fields,\ adjudicating the local courts and fulfilling your obligations to your liege lord.\ Occasionally your liege calls you to muster and command in his campaigns, but these stints are brief,\ and you never truly return to the adventuring of your younger days. You have already made your fortune.\ With your own hall and holdings, you've few wants that your personal wealth and the income of your lands cannot afford you."), ("retirement_text_8", "There is no question that you've done very well for yourself.\ Your extensive holdings and adventuring wealth are enough to guarantee you a rich and easy life for the rest of your days.\ Retiring to your noble seat in {s8}, you exchange adventure for politics,\ and you soon establish yourself as a considerable power in your liege lord's kingdom.\ With intrigue to busy yourself with, your own forests to hunt, a hall to feast in and a hundred fine war stories to tell,\ you have little trouble making the best of the years that follow."), ("retirement_text_9", "As a reward for your competent and loyal service,\ your liege lord decrees that you be given a hereditary title, joining the major nobility of the realm.\ Soon you complete your investitute as baron of {s7}, and you become one of your liege's close advisors\ and adjutants. Your renown garners you much subtle pull and influence as well as overt political power.\ Now you spend your days playing the games of power, administering your great fiefs,\ and recounting the old times of adventure and glory."), ("retirement_text_10", "Though you started from humble beginnings, your liege lord holds you in high esteem,\ and a ripple of shock passes through the realm when he names you to the hereditary title of {count/countess} of {s9}.\ Vast fiefs and fortunes are now yours to rule. You quickly become your liege's most trusted advisor,\ almost his equal and charged with much of the running of his realm,\ and you sit a throne in your own splendourous palace as one of the most powerful figures in Calradia."), #NPC companion changes begin # Objectionable actions # humanitarian ("loot_village", "attack innocent villagers"), ("steal_from_villagers", "steal from poor villagers"), ("rob_caravan", "rob a merchant caravan"), # possibly remove ("sell_slavery", "sell people into slavery"), # egalitarian ("men_hungry", "run out of food"), ##Done - simple triggers ("men_unpaid", "not be able to pay the men"), # ("party_crushed", "get ourselves slaughtered"), ##Done - game menus ("excessive_casualties", "turn every battle into a bloodbath for our side"), # chivalric ("surrender", "surrender to the enemy"), ##Done - game menus ("flee_battle", "run from battle"), ##Done - game menus ("pay_bandits", "pay off common bandits"), # honest ("fail_quest", "fail a quest which we undertook on word of honour"), # quest-related strings ("squander_money", "squander money given to us in trust"), ("murder_merchant", "involve ourselves in cold-blooded murder"), ("round_up_serfs", "round up serfs on behalf of some noble"), # Fates suffered by companions in battle ("battle_fate_1", "We were separated in the heat of battle"), ("battle_fate_2", "I was wounded and left for dead"), ("battle_fate_3", "I was knocked senseless by the enemy"), ("battle_fate_4", "I was taken and held for ransom"), ("battle_fate_5", "I got captured, but later managed to escape"), # strings for opinion ("npc_morale_report", "I'm {s6} your choice of companions, {s7} your style of leadership, and {s8} the general state of affairs"), ("happy", "happy about"), ("content", "content with"), ("concerned", "concerned about"), ("not_happy", "not at all happy about"), ("miserable", "downright appalled at"), ("morale_reg1", " Morale: {reg1}"), ("bar_enthusiastic", " Enthusiastic"), ("bar_content", " Content"), ("bar_weary", " Weary"), ("bar_disgruntled", " Disgruntled"), ("bar_miserable", " Miserable"), #other strings ("here_plus_space", "here "), #NPC strings #npc1 = borcha #npc2 = marnid #npc3 = ymira #npc4 = rolf #npc5 = baheshtur #npc6 = firentis #npc7 = deshavi #npc8 = matheld #npc9 = alayen #npc10 = bunduk #npc11 = katrin #npc12 = jeremus #npc13 = nizar #npc14 = lazalit #npc15 = artimenner #npc16 = klethi ("npc1_intro", "Ho there, traveller. You wouldn't by chance be in the market for a tracker, would you?"), ("npc2_intro", "Hello. Would you be so kind as to have a cup with me? I'm down to my last five denars and I'd rather not drink alone."), ("npc3_intro", "Good day to you!"), ("npc4_intro", "Greetings. I am Rolf, son of Rolf, of the most ancient and puissant House of Rolf."), ("npc5_intro", "Greetings, traveller. Would you join me for a drink?"), ("npc6_intro", "I am lost... Lost..."), ("npc7_intro", "Yes? Keep your distance, by the way."), ("npc8_intro", "What do you want?"), ("npc9_intro", "You there, good {man/woman}, be so kind as to fetch me another drink, eh?"), ("npc10_intro", "Greetings there, {Brother/Sister}! Here's to the doom and downfall of all high-born lords and ladies!"), ("npc11_intro", "Hello there, {laddie/lassie}. Have a drink on me."), ("npc12_intro", "Greetings, fellow traveller. Perhaps you can help me."), ("npc13_intro", "Greetings, traveller. I am Nizar. No doubt you will have heard of me."), ("npc14_intro", "Yes? What is it you wish?"), ("npc15_intro", "Oh! Say, friend, are you by chance heading out of town anytime soon?"), ("npc16_intro", "Hello there. I couldn't help noticing that you came into town at the head of a company of soldiers. Are you by any chance looking for new hands?"), ("npc1_intro_response_1", "Perhaps. What's the urgency?"), ("npc2_intro_response_1", "Your last five denars? What happened to you?"), ("npc3_intro_response_1", "Hello. What's a clearly well-brought up young lady like you doing in a place like this?"), ("npc4_intro_response_1", "Hmm... I have never heard of the House of Rolf."), ("npc5_intro_response_1", "Certainly. With whom do I have the pleasure of drinking?"), ("npc6_intro_response_1", "Why so gloomy, friend?"), ("npc7_intro_response_1", "My apologies. I was merely going to say that you look a bit down on your luck."), ("npc8_intro_response_1", "Merely to pass the time of day, ma'am, if you're not otherwise engaged."), ("npc9_intro_response_1", "You must have me confused with the tavernkeep, sir."), ("npc10_intro_response_1", "Why do you say that, sir?"), ("npc11_intro_response_1", "What's the occasion?"), ("npc12_intro_response_1", "How is that?"), ("npc13_intro_response_1", "Um... I don't think so."), ("npc14_intro_response_1", "To pass the time of day with a fellow traveller, if you permit."), ("npc15_intro_response_1", "I am. What concern is it of your, may I ask?"), ("npc16_intro_response_1", "I could be. What's your story?"), ("npc1_intro_response_2", "Step back, sir, and keep your hand away from my purse."), ("npc2_intro_response_2", "I have better things to do."), ("npc3_intro_response_2", "Run along now, girl. I have work to do."), ("npc4_intro_response_2", "Eh? No thanks, we don't want any."), ("npc5_intro_response_2", "I have no time for that."), ("npc6_intro_response_2", "No doubt. Well, good luck getting found."), ("npc7_intro_response_2", "Right. I'll not bother you, then."), ("npc8_intro_response_2", "Nothing at all, from one so clearly disinclined to pleasantries. Good day to you."), ("npc9_intro_response_2", "Fetch it yourself!"), ("npc10_intro_response_2", "That's rebel talk, and I'll hear none of it. Good day to you."), ("npc11_intro_response_2", "I think not, madame."), ("npc12_intro_response_2", "Sorry, I am afraid that I am otherwise engaged right now."), ("npc13_intro_response_2", "No, and I can't say that I much want to make your acquaintance."), ("npc14_intro_response_2", "Nothing at all. My apologies."), ("npc15_intro_response_2", "I'd be obliged if you minded your own business, sir."), ("npc16_intro_response_2", "Mind your own business, lass."), #backstory intro ("npc1_backstory_a", "Well, {sir/madame}, it's a long story..."), ("npc2_backstory_a", "It's a tragic tale, sir."), ("npc3_backstory_a", "A good question, and I shall tell you!"), ("npc4_backstory_a", "Really? Well, perhaps your ignorance can be forgiven. Our ancestral lands are far away, over the mountains."), ("npc5_backstory_a", "I am Baheshtur, son of Azabei, grandson of Badzan. Were you not a barbarian, you would likely know from my lineage that I am a Roan Horse Khergit of the highlands, of the tribe of Shamir, of the clan of Dulam, of the family of Ubayn, from the Pantash valley, and you might be able to guess why I am so far from home."), ("npc6_backstory_a", "I have commited the greatest of sins, {sir/madame}, and it is to my shame that I must appoint you my confessor, if you should like to hear it."), ("npc7_backstory_a", "My luck? You could say that."), ("npc8_backstory_a", "Ah. Well, if you must know, I shall tell you."), ("npc9_backstory_a", "My most humble apologies. It is sometimes hard to recognize folk amid the smoke and gloom here. I still cannot believe that I must make my home in such a place."), ("npc10_backstory_a", "It's a long story, but if you get yourself a drink, I'll be glad to tell it."), ("npc11_backstory_a", "Why, I managed to sell my wagon and pots, {lad/lass}. For once I've got money to spend and I intend to make the best of it."), ("npc12_backstory_a", "I shall tell you -- but know that it is a tale of gross iniquity. I warn you in advance, lest you are of a choleric temperament, and so become incensed at the injustice done unto me that you do yourself a mischief."), ("npc13_backstory_a", "You have not? Then perhaps you will have heard of my steed, who cuts across the Calradian plains like a beam of moonlight? Or of my sword, a connoisseur of the blood of the highest-born princes of the land?"), ("npc14_backstory_a", "Very well. I do not mind. My name is Lazalet."), ("npc15_backstory_a", "I'm an engineer, specialized in the art of fortification. If you need a wall knocked down, I can do that, given enough time. If you need a wall built back up, I can do that too, although it will take longer and cost you more. And you can't cut costs, either, unless you want your new edifice coming down underneath you, as someone around here has just found out."), ("npc16_backstory_a", "Well, {sir/madame}, as long as I can remember I've had a weakness for pretty things, and it's gotten me into trouble, you see."), #backstory main body ("npc1_backstory_b", "I had a bit of a misunderstanding {s19}in {s20} about a horse that I found tied up outside the inn. It was the spitting image of a beast that threw me a few days back and ran off. Naturally I untied it for a closer look. As it turns out, the horse belonged to a merchant, a pinch-faced old goat who wouldn't accept that it all was a simple misunderstanding, and went off to get the guard."), ("npc2_backstory_b", "A while back, I left Geroia with a caravan of goods. I was hoping to sell it all in Sargoth and make a hefty sum. But, what do you know... we were ambushed by a party of Khergit raiders who rode away with most of the horses and goods. And two days later, my own caravan guards ran away with the rest of what I had."), ("npc3_backstory_b", "My father, a well-known merchant {s19}in {s20}, decided that I should be married to one of his business partners, a man well past the age of 30. I have been an obedient daughter all of my life, but it was a ridiculous and horrid proposition. So I ran away!"), ("npc4_backstory_b", "Like all the men of my family, I have come to a foreign land to make a name for myself in the profession of arms before returning home to take over custodianship of my estates. Unfortunately, the authorities in these lands have little understanding of the warrior code, and have chosen to call me a bandit and brigand, and put a price on my head -- a most unfair libel to throw at a gentleman adventurer, you will surely agree."), ("npc5_backstory_b", "For as long as any one can remember, our people have feuded with the tribe of Humyan, many of whom have settled in the next valley over. Many men have died in this feud, on both sides, including two of my brothers. The Khan himself has ordered us to cease, to save men for the wars in Calradia. But I know my rights, and my brothers' blood cries out for vengeance. I waylaid and killed a Humyan on a track over the mountains, and I rode out of our village the same night, without even having had the chance to bid farewell to my father. I will bide my time in Calradia, for a year or two, then return home when the Khan's men have forgotten. The Humyan will not forget, of course, but such is the price of honour."), ("npc6_backstory_b", "I was a captain of horse in the service of the lord {s19}in {s20}, and my brother served with me. But we were both in love with the same woman, a courtesan -- a temptress, who played upon our jealousies! My brother and I quarreled. I had drunk too much. He slapped me with his glove, and I spit him upon my sword... My own brother! My sword-arm was stained with the blood of my kin!"), ("npc7_backstory_b", "It was my bad luck to be born to a weak father who married me off to a drunken layabout, who beat me. It was my bad luck, when I ran away from my husband, to be taken by a group of bandits. It was my bad luck that the only one among them who was kind to me, who taught me to hunt and to fight, inspired the jealousy of the others, who knifed him and forced me to run away again."), ("npc8_backstory_b", "I am from an old family in the northern lands, the daughter of a thane and also wife to one. I fought by my husband's side, his partner both in war and in peace. But my husband died of the plague, when I was still childless. My husband had decreed that I should inherit his lands, in the absence of an heir. My brother-in-law, cursed be his name, said that it was not our custom that women could inherit a thanedom. That was nonsense, but his gold bought the loyalties of enough of my husband's faithless servants for him to install himself in my hall. So I fled, something I was raised never to do, and something I hope never to do again."), ("npc9_backstory_b", "I was my father's first son, and his heir. But my mother died, and my father remarried. His new wife thought that her son should inherit. She could not move against me openly, but the other day I fed a pot of suet that had been left out for me to one of my hounds, and it keeled over. I accused my stepmother, but my father, befuddled by her witchcraft, refused to believe me and ordered me to leave his sight."), ("npc10_backstory_b", "A sergeant I was, in the garrison {s19} at {s20}. Twenty years I stood guard for the city, taking many a hard knock in many a tough fight, until they appointed a snot-nosed, downy-lipped princeling, barely out of his mother's cradle, as commander of the garrison. He came upon me standing watch atop the tower, with my crossbow unstrung -- on account of the rain, you see... Can't have the cord loosen... But Little Prince Snot-Nose tells me that an unstrung bow is dereliction of duty. Says he'll have me horsewhipped. And something in me snapped. So I walked off my post."), ("npc11_backstory_b", "For 30 years I followed the armies of this land, selling them victuals and drink, watching their games of dice and finding them girls, and nary a denar was left in my purse at the end."), ("npc12_backstory_b", "I am by training a natural philosopher, but condemned by the jealousy of the thick-headed doctors of my university to make my living as an itinerant surgeon. I was hired by a merchant of this city to cure his son, who fell into a coma after a fall from his balcony. I successfully trepanned the patient's skull to reduce the cranial swelling, but the family ignored my advice to treat the ensuing fevers with a tincture of willow bark, and the boy died. The father, rather than reward me for my efforts, charged me with sorcery -- me, a philosopher of nature! Such is the ignorance and ingratitude of mankind."), ("npc13_backstory_b", "I am a warrior by profession. But perhaps you may also have heard of my prowess as a poet, who can move the iciest of maidens to swoon. Or of my prowess in the art of the bedchamber, in which I must confess a modest degree of skill. I confess a modest affection for Calradia, and for the past several years have visited its towns, castles, and villages, making the most of my talents."), ("npc14_backstory_b", "I am the second son of the count of Geroia, of whom you have no doubt heard. Having no inheritance of my own, I came here to seek my fortune in Calradia, training men in the art of battle. Unfortunately, the lords here in {s20} has no taste for the disciplinary methods needed to turn rabble into soldiers. I told him it was wiser to flog them now, then bury them later. But he would not listen, and I was told to take my services elsewhere."), ("npc15_backstory_b", "The castellan {s19}in {s20} wanted a new tower added to the wall. Trouble is, he ran out of cash halfway through the process, before I could complete the supports. I told him that it would collapse, and it did. Unfortunately he was standing on it, at the time. The new castellan didn't feel like honouring his predecessor's debts and implied that I might find myself charged with murder if I push the point."), ("npc16_backstory_b", "I grew up in Malayurg castle as a bonded servant, working alongside my mother in the kitchens. I would amuse myself by hunting mice through the pantries and sculleries. I was so good at it that I put the castle cats out of a job, and eventually the lord realized that I might also be employed to track down bigger game, on certain errands of a type perhaps better left unsaid. Needless to say, I found a number of opportunities to avail myself of trinkets that had formerly belonged to my lord's enemies. So I was able to buy myself out of bondage, and find hire as a free agent. My last job was {s19}in {s20}."), #backstory recruit pitch ("npc1_backstory_c", "But if I was with a larger group who could vouch for me, they might let it pass. I'd be very grateful to you."), ("npc2_backstory_c", "So here I am, no money and no way home."), ("npc3_backstory_c", "I shall marry whom I want, when I want. Moreover, regardless of what my father might think, I am perfectly capable of taking care of myself. I was thinking that I should perhaps join a band of gypsies, or perhaps a troop of mercenaries!"), ("npc4_backstory_c", "But I am anxious to avoid any further trouble, so if you knew of any company of fighting men where I might enlist, I would be most grateful."), ("npc5_backstory_c", "In the meantime, any opportunities to earn a living with my sword would be most welcome."), ("npc6_backstory_c", "Do you believe there is hope for a man like me? Can I find the path of righteousness, or am I doomed to follow the demons that dwell inside of me?"), ("npc7_backstory_c", "But I do not count myself unlucky, stranger, no more than any other woman of Calradia, this fetid backwater, this dungheap among the nations, populated by apes and jackals."), ("npc8_backstory_c", "When I have enough gold to raise an army I shall go back and take what it is mine."), ("npc9_backstory_c", "I hope to offer my sword to some worthy captain, as it is the only honourable profession for a man of my birth apart from owning land, but in the meantime I am condemned to make my bed among thieves, vagabonds, merchants, and the other riff-raff of the road."), ("npc10_backstory_c", "Now I'm here getting drunk, and the Devil take tomorrow."), ("npc11_backstory_c", "It's no kind of life, victualling the armies. You earn a bit here and a bit there as the soldiers spend their money, and then along comes one defeat and you have to start over, endebting yourself to buy a new wagon and new oxen. So I've decided to get out of the business, but army life is all I know."), ("npc12_backstory_c", "The lord of this castle is reluctant to place me under arrest, but I am anxious to move on elsewhere."), ("npc13_backstory_c", "Which reminds me -- somewhere out there in the city is a rather irate husband. I don't suppose you might consider helping me leave town?"), ("npc14_backstory_c", "So, if you know of any commander who believes that his purpose is to win battles, rather than pamper his soldiers, I would be pleased if you directed me to him ."), ("npc15_backstory_c", "More fool me for having taken the contract without an advance, I suppose, but the end of it all is that I'm in a difficult spot, with the roads full of bandits and no money to pay for an escort. So I'd be much obliged if a well-armed party heading out in the next few days could take me along."), ("npc16_backstory_c", "Unfortunately, my last employer's wife had a lovely amulet, of a kind I simply could not resist. She doesn't know it's missing, yet, but she might soon. So tell me, are you looking for helpers?"), ### use these if there is a short period of time between the last meeting ("npc1_backstory_later", "I've been here and about, you know, doing my best to keep out of trouble. I'm desperately in need of work, however."), ("npc2_backstory_later", "I sold my boots and have managed to make a few denars peddling goods from town to town, but it's a hard living."), ("npc3_backstory_later", "I hired myself on as a cook for some passing caravans, and that at least keeps me fed. But it is rough company on the road, and I grow weary of fighting off guards and others who would try to take liberties. I was thinking that if I could find work as a warrior, men would know to leave me alone."), ("npc4_backstory_later", "I went back to my ancestral barony, to inspect my lands. But we had locusts, you see, and bad rains, and other things, so here I am again, looking for work."), ("npc5_backstory_later", "I've been wandering through this war-torn land, looking for a leader who is worth following."), ("npc6_backstory_later", "I have been wandering Calradia, but have yet to find redemption."), ("npc7_backstory_later", "I have been wandering, looking for work as a tracker, but it has not been easy. Calradians are mostly ill-bred, lice-ridden, and ignorant, and it is not easy to work with such people."), ("npc8_backstory_later", "I am still seeking a war leader in whose shield wall I would fight. But I need gold, and fast, and the lords of this land as often as not prefer to stay behind the walls of their fortresses, rather march out to where glory and riches can be won."), ("npc9_backstory_later", "I've offered my sword to a few lords in these parts. But I find as often as not they'll ask me to run messages, or train peasants, or some other job not fit for a gentleman."), ("npc10_backstory_later", "I don't know if I told you or not, but I deserted my unit after I struck a young noble who had ordered me to be horsewhipped without cause. Since then I've been laying low. Thankfully I had the wit to pilfer my captain's purse before heading out, but the money is running low."), ("npc11_backstory_later", "I've been around and about. But it's a rare captain who'll take on an old bag of bones like me as a fighter, even if I could whip half the boys in his outfit."), ("npc12_backstory_later", "I have been here and about, tending to the sick and taking what reward I can. But the people of these parts are ignorant, and have little respect for my craft. The few denars I make are barely enough for me to replenish my stock of medicine. I should be grateful for the chance to find other work."), ("npc13_backstory_later", "I have been wandering through the cities of Calradia, leaving a string of love-sick women and cuckolded husbands in my wake. But I grow weary of such simple challenges, and had been thinking of turning myself to more martial pastimes."), ("npc14_backstory_later", "I have gone from court to court, but I have not yet found a lord who is to my liking."), ("npc15_backstory_later", "I've been going from castle to castle, looking to see if walls or towers need repair. But either the lord's away, or he's got other things on his mind, or I run into his creditors on the street, begging for change, and I realize that here's one job not to take. So if you hear of anything, let me know."), ("npc16_backstory_later", "I do the odd job from time to time. But there's naught like steady employment, and a regular run of corpses to loot."), ("npc1_backstory_response_1", "Perhaps. But how do I know that there won't be a 'misunderstanding' about one of my horses?"), ("npc2_backstory_response_1", "Well, perhaps I could offer you work. Can you fight?"), ("npc3_backstory_response_1", "Well, as it happens I run a company of mercenaries."), ("npc4_backstory_response_1", "I run such a company, and might be able to hire an extra hand."), ("npc5_backstory_response_1", "That's the spirit! I might be able to offer you something."), ("npc6_backstory_response_1", "Hmm. You might consider joining us. Right wrongs, fight oppressors, redeem yourself, that kind of thing."), ("npc7_backstory_response_1", "Hmm... Are you by any chance looking for work?"), ("npc8_backstory_response_1", "I can offer you opportunities to make money through good honest fighting and pillaging."), ("npc9_backstory_response_1", "Perhaps you would like to join my company for a while."), ("npc10_backstory_response_1", "If you're looking for work, I can use experienced fighters."), ("npc11_backstory_response_1", "What will you do now?"), ("npc12_backstory_response_1", "Well, you could travel with us, but you'd have to be able to fight in our battle line."), ("npc13_backstory_response_1", "I might be able to use an extra sword in my company."), ("npc14_backstory_response_1", "I might be able to use you in my company."), ("npc15_backstory_response_1", "Where do you need to go?"), ("npc16_backstory_response_1", "I might be. What can you do?"), ("npc1_backstory_response_2", "I'll do no such thing. I have better things to do then to help thieves avoid justice."), ("npc2_backstory_response_2", "Hard luck, friend. Good day to you."), ("npc3_backstory_response_2", "Go back to your family, lass. Fathers must always be obeyed."), ("npc4_backstory_response_2", "No, sorry, I haven't heard of one."), ("npc5_backstory_response_2", "Sigh.. So long as you hill clans fight tribe against tribe, you will remain a silly, weak people."), ("npc6_backstory_response_2", "Away with you, accursed fraticide!"), ("npc7_backstory_response_2", "Actually, I'm rather fond of the place. Good day to you."), ("npc8_backstory_response_2", "Your brother-in-law was right -- women should not rule. Go back home and tend your hearth."), ("npc9_backstory_response_2", "Some of my best friends are riff-raff. Good day to you, sir."), ("npc10_backstory_response_2", "No doubt you'll wake up with your head in a noose, and you'll deserve it. Good day."), ("npc11_backstory_response_2", "Very interesting, madame, but I have work to do."), ("npc12_backstory_response_2", "Sorry. I can't take on any new hands."), ("npc13_backstory_response_2", "No, sorry. Nothing I can do for you."), ("npc14_backstory_response_2", "I'll let you know if I hear of anything. Good day."), ("npc15_backstory_response_2", "Sorry. I've got all the men that I can manage right now."), ("npc16_backstory_response_2", "Sorry, lass. You sound like you might be trouble."), ("npc1_signup", "{Sir/Madame} -- I'm offended that you would even think such a thing. I'd be most indebted to you, and you'll see that I show my gratitude."), ("npc2_signup", "Well, I will confess that I am not a warrior by trade."), ("npc3_signup", "Do you? Well, I am in no position to be picky! I would be pleased to join you."), ("npc4_signup", "Good! I look forward to vanquishing your enemies."), ("npc5_signup", "Why, that is a most generous offer."), ("npc6_signup", "Yes! You must have been sent by divine providence! Lead me -- lead me away from darkness!"), ("npc7_signup", "I might be. I could certainly use the money."), ("npc8_signup", "Can you? I shall accept your offer."), ("npc9_signup", "I would very much like that, sir"), ("npc10_signup", "Are you, now? Well, that's a sight better than swinging from a gibbet for desertion."), ("npc11_signup", "Why, I'll be a soldier myself! Help my old hands to a bit of loot to comfort me in my retirement. Two boys I bore, both soldiers' brats, and they became soldiers themselves. One had his head split by a Khergit war club, the other died of the pox, but at least they didn't die hungry."), ("npc12_signup", "As I told you, I am a surgeon, not some silk-robed university physician who has never touched a body. I can get my hands dirty."), ("npc13_signup", "Indeed? You would do well to enlist me."), ("npc14_signup", "I would be pleased to ride with you, at least for a little while, for pay and a share of any loot."), ("npc15_signup", "Geroia, eventually, but I'd welcome the opportunity to get a few denars in my pocket, first, so I don't come home empty handed. So if you promise me food and a share of the loot, I'd be happy to fight with you for a while."), ("npc16_signup", "Well, {sir/madame}, let me tell you. I may not know how to read and write, but I know the quickest way to a man's heart is between his fourth and fifth rib, if you understand me. "), ("npc1_signup_2", "I've ridden over a fair amount of rough country in my time, more often than not in a hurry. I'm a good tracker and I've got a good eye for terrain. So what do you say?"), ("npc2_signup_2", "I'm a fast learner. I can ride, and know a fair bit about trade, prices and such."), ("npc3_signup_2", "I think you would find I would be a most valuable addition to your ranks. I am well versed in the classics of literature and can declaim several of the epic poems of my people. I play the lute and am a skilled manager of household servants."), ("npc4_signup_2", "Note however that as a gentleman and the holder of a barony, I expect to be in a position of command, and not be treated as one of the common soldiers."), ("npc5_signup_2", "I shall not betray you -- so long, of course, as you do your duty to me by feeding me, paying me, and not dragging my miserable hide into a battle where there is no chance of winning. Hand me some salt, if you will -- it is the custom of our people to take salt from our captains, as a token of their concern for our well-being."), ("npc6_signup_2", "I am well practiced in the arts of war -- but I beg you, sir, I wish to use my skills to defend the innocent, the pure, and the defenseless, not to be a common brigand and wreak more misery than I have already wrought."), ("npc7_signup_2", "But let your followers know that I do not suffer louts and brutes. Anyone who misbehaves around me will quickly find an arrow in their gullet."), ("npc8_signup_2", "I shall be pleased to fight in your shield wall. But I warn you -- if you ask me to gather the firewood, or cook a meal, you will not like the consequences."), ("npc9_signup_2", "I am a gentleman, and prefer to fight with sword and lance. I recognize that you are of lower birth than I, there is no shame for me to serve under an experienced captain -- presuming, of course, that your followers do not become too familiar with me. I assume that will not be a problem?"), ("npc10_signup_2", "You won't regret taking me on, {Brother/Sister}. I'm a dead eye with a crossbow -- a beautiful weapon, it can right punch through a nobleman's armour and spill his blue blood upon the ground. And I've trained more raw recruits than you've had hot dinners, begging your pardon. I don't toadie to the high-born."), ("npc11_signup_2", "I know how to swing a blade, staunch a wound, and feed an army on the march. It would be a foolish captain who passed up the opportunity to hire an experienced campaigner like me! Say, {laddie/lassie}, don't you command a war party of your own, now?"), ("npc12_signup_2", "I have treated every variety of wound that can be inflicted by the hand of man. Before I was a surgeon, I was a student, so you may be sure that I have inflicted wounds as well as healed them."), ("npc13_signup_2", "Sword, lance, the bow -- my skill in all such martial pursuits is the stuff of epic verse. Together we will perform such feats as will be recounted in festivals and campfires, in filthy taverns and in the halls of kings, for many generations to come."), ("npc14_signup_2", "I am a skilled swordsman, and I can also instruct your men in fighting. But I warn you that I do not care to fight for a leader who is lax in discipline with {his/her} men, for in the long run they will not respect a soft hand. "), ("npc15_signup_2", "Siegework is my speciality, although I reckon can handle myself well enough in an open battle, if need be."), ("npc16_signup_2", "I can throw knives, in addition to stabbing with them, and I'm slippery as quicksilver. You'll find me useful in a fight, I'll warrant."), ("npc1_signup_response_1", "Good. You can be useful to us."), ("npc2_signup_response_1", "That will do."), ("npc3_signup_response_1", "Um, that's a start. We can teach you the rest."), ("npc4_signup_response_1", "Very well. I'll be glad to have you with us, um, 'Baron.'"), ("npc5_signup_response_1", "Certainly. Here, have some salt."), ("npc6_signup_response_1", "Happy to be of service! Get your things together, and we shall be on our way."), ("npc7_signup_response_1", "I will hire you. Try not to shoot anyone on your first day."), ("npc8_signup_response_1", "No fear, ma'am. You're the widow and the daughter of a thane, and you'll be treated as such."), ("npc9_signup_response_1", "Well, it shouldn't be. I'll have a talk with them."), ("npc10_signup_response_1", "Good man. We'll treat you with the respect you deserve."), ("npc11_signup_response_1", "It sounds like you'll be useful. You are hired."), ("npc12_signup_response_1", "Then welcome to our company, doctor"), ("npc13_signup_response_1", "Good. Make yourself ready, and we'll be on our way. "), ("npc14_signup_response_1", "Good. I'll be happy to hire someone like you."), ("npc15_signup_response_1", "That works for me. I will be pleased to hire you."), ("npc16_signup_response_1", "It sounds like you can do the job. I will hire you."), #11 ("npc1_signup_response_2", "I'd prefer not to take the risk. Good day, sir."), ("npc2_signup_response_2", "I'm afraid I'm only looking for men with some experience. Good day to you."), ("npc3_signup_response_2", "Actually, we were looking for a slightly different skill-set."), ("npc4_signup_response_2", "Actually, we are not in the habit of hiring bandits with invented pedigrees. Good day, sir."), ("npc5_signup_response_2", "Actually, on second thought, I prefer to keep more civilized company."), ("npc6_signup_response_2", "On second thought, maybe a mercenary company is not what you need right now."), ("npc7_signup_response_2", "Actually, on second thought, you sound like you might be trouble. Good day to you. "), ("npc8_signup_response_2", "Ah. Actually, if you don't do whatever I order you to do, you'd best seek your fortune elsewhere."), ("npc9_signup_response_2", "You assume wrong, sir. In my company we respect courage and skill, rather than noble birth."), ("npc10_signup_response_2", "On second thought, we value discipline pretty highly in our company. Good day to you."), ("npc11_signup_response_2", "Sorry, madame. We've already got as many in our company as we can handle."), ("npc12_signup_response_2", "A battle is not the same thing as a tavern brawl. Perhaps you should look elsewhere for work."), ("npc13_signup_response_2", "Actually, on second thought, a fighter overeager for glory is dangerous to have in one's company."), ("npc14_signup_response_2", "Actually, I have no wish to provoke a mutiny in my ranks. Good day, sir."), ("npc15_signup_response_2", "Actually, I need a different kind of expertise. My apologies."), ("npc16_signup_response_2", "To be honest, I'd prefer someone who was a little less tempted to larceny."), ("npc1_payment", "I will be very useful to you, {sir/madame}, you can bet on that. Just one more thing before we leave, would you mind lending me {reg3} denars? I am ashamed to say it, but I have made myself a bit of debt here, staying in this tavern over the last few weeks and the tavern owners no longer believe that I am loaded with gold as I used to tell them. You know, things could get ugly here if they see me leaving with you before paying them."), ("npc2_payment", "."), ("npc3_payment", "."), ("npc4_payment", "Excellent. Before we depart, would you be so kind to lend me {reg3} denars? I had to pawn a family heirloom at a pawnbroker here in {s20}, and I would like to retrieve it before we leave."), ("npc5_payment", "Thank you. Now, to seal off our agreement, I ask for {reg3} denars from you. It's an advice my father gave me. He told me 'Baheshtur, never fight for a barbarian before {he/she} pays you your worth of gold first'."), ("npc6_payment", "."), ("npc7_payment", "All right then. I will come with you. But I want a payment of {reg3} denars first. You aren't expecting me to work for free, do you?"), ("npc8_payment", "Then I will fight your enemies for you. But first I want a bounty of {reg3} denars. If you are a worthy captain who can lead {his/her} company to riches and plunder, you should have no trouble paying. I cannot afford to follow a pauper."), ("npc9_payment", "That's very good of you. And before I join, can you lend me {reg3} denars, so that I can buy some proper clothing that befits a gentleman of noble birth such as myself. The coat on me has been worn down badly due to my recent bad fortune, and I cannot let common soldiers mistake me as one of their own."), ("npc10_payment", "That's good news. But I'll ask for one last thing, captain. I have a woman here in {s20}, a tavern wench, and she says she has my child in her belly. I want to give her some money before I leave... for the child, you know. Do you think you can spare {reg3} denars?"), ("npc11_payment", "Hey thank you captain. But before joining up with you, I would ask for a payment of {reg3} denars. I know that in war parties soldiers can go on for weeks without seeing any wages. I am wise enough not to sign anywhere without having myself covered."), ("npc12_payment", "."), ("npc13_payment", "Before I sign up, there is the small matter of some expenses I have incurred while staying here -- {reg3} denars. Do you think that you could cover those for me, as a gesture of friendship?"), ("npc14_payment", "Ah, one last thing. I would ask for an initial bounty of {reg3} denars before I join your command. It's my principle never to enter someone's service without receiving the payment I deserve."), ("npc15_payment", "Good. By the way, as a skilled engineer I would expect a payment for my services. A signing bonus of {reg3} denars would be fair, I think."), ("npc16_payment", "Now, that's good news, captain. So, how about paying me a little something to seal off our agreement? A mere {reg3} would be enough. Please don't take this the wrong way, but I've had some bad luck with employers in the past. "), ("npc1_payment_response", "Very well, here's {reg3} denars. Now, fall in with the rest."), ("npc2_payment_response", "."), ("npc3_payment_response", "."), ("npc4_payment_response", "Certainly. Here's {reg3} denars."), ("npc5_payment_response", "Well... here's {reg3} denars, then. Your first payment."), ("npc6_payment_response", "."), ("npc7_payment_response", "No, of course not. Here's {reg3} denars."), ("npc8_payment_response", "Oh, I am no pauper, madame. Here's {reg3} denars for you."), ("npc9_payment_response", "Very well, here's {reg3} denars."), ("npc10_payment_response", "Of course. Here, {reg3} denars."), ("npc11_payment_response", "Very well, here's {reg3} denars. Make yourself ready. We leave soon."), ("npc12_payment_response", "."), ("npc13_payment_response", "Of course, here's {reg3} denars. Make ready to leave soon."), ("npc14_payment_response", "All right, here's {reg3} denars. You are most welcome in our company."), ("npc15_payment_response", "All right, here's {reg3} denars. Glad to have you with us."), ("npc16_payment_response", "All right, here's {reg3} denars for you. Make yourself ready."), ("npc1_morality_speech", "Oy -- boss. Please don't take this the wrong way, but it's a hard life and it's a bit much that we {s21}. Take a little more care in the future, captain, if you don't mind my saying."), ("npc2_morality_speech", "I hope you don't mind my saying so, but it's a bit hard for me to see us {s21}. Maybe I ought to try to be more of a hardened soldier, but if we could try to exercise a little mercy from time to time, I'd sleep better."), ("npc3_morality_speech", "Perhaps it is not my place to say so, {sir/madame}, but I confess that I am somewhat shocked that we {s21}. Of course I realize that war is cruel, but there is no need to make it more cruel than necessary."), ("npc4_morality_speech", "Your pardon -- just so you know, the men of the House of Rolf do not care to {s21}. I will not be pleased if you continue to take this course."), ("npc5_morality_speech", "Pardon me, captain. It is not good to {s21}. Your first duty is to the men who have taken your salt. The least they can expect is food, pay, the opportunity to loot, and that you not waste their lives needlessly."), ("npc6_morality_speech", "Excuse me, {sir/madame}. As you know, I joined with you to right wrongs, protect the innocent, and make amends for my sin. I did not expect to {s21}."), ("npc7_morality_speech", "Captain -- I do not like to see us {s21}. Such are the actions of a common bandit chief, with no regard for his followers."), ("npc8_morality_speech", "I was not pleased that you decided to {s21}. To fall in battle is an honour, but to fight in a warband led by a coward is a disgrace."), ("npc9_morality_speech", "{Sir/Madame} -- it is not my way to {s21}. Men of my house will accept death but not dishonour. Please do not make me ashamed to serve under you."), ("npc10_morality_speech", "Begging your pardon, captain. I can't say that I'm happy to see us {s21}. Those are just simple people, trying to make a living. If we could try to go easy on the poor wretches, captain, I'd feel much better."), ("npc11_morality_speech", "Excuse me, captain. It's not good that we {s21}. I've followed armies and warbands for 30 years, and the least the soldiers expect of a leader is to feed them, pay them, and do {his/her} best to keep their sorry skins intact as best {he/she} can."), ("npc12_morality_speech", "Captain -- I do not like to see us {s21}. I am prepared to be a warrior, but not a brigand. Pray let us try to show a little more compassion."), ("npc13_morality_speech", "Captain, if we can avoid it, I'd prefer not to {s21}. Calradia is a small place, and one's reputation is precious. I would not care for one of my rivals to include this latest unfortunate incident in a satirical verse."), ("npc14_morality_speech", "I do not care to {s21}. No one with a reputation for cowardice will be properly feared by his men."), ("npc15_morality_speech", "{Sir/Madame} -- just so you know my opinion, any commander with sense will not let his company {s21}.I hope you don't mind me speaking so bluntly."), ("npc16_morality_speech", "Captain. I don't like to {s21}. So many throats left uncut, and so many purses left unexplored..."), ("npc1_2ary_morality_speech", "Boss -- just so you know, I've got no problem if we {s21}. Living to fight another day makes good sense to me."), ("npc2_2ary_morality_speech", "{Sir/Madame} -- I'm not altogether happy that we {s21}. I'm a merchant, and in our business one is bonded by one's word. I don't want a reputation for dishonesty -- that would spell my end as a trader, {sir/madame}."), ("npc3_2ary_morality_speech", "{Sir/Madame} -- I think it was a brave decision you took to {s21}. There is no shame in finding a way to avoid the spilling of blood."), ("npc4_2ary_morality_speech", "Your pardon -- whatever anyone else says, I think nothing of it that you {s21}. You should adopt whatever ruse you need to survive in these troubled times."), ("npc5_2ary_morality_speech", "[No secondary moral code]"), ("npc6_2ary_morality_speech", "{Sir/Madame} -- you may choose to {s21}, but would prefer to have no part in it. Such is not the path to my redemption."), ("npc7_2ary_morality_speech", "[No secondary moral code]"), ("npc8_2ary_morality_speech", "[No secondary moral code]"), ("npc9_2ary_morality_speech", "Captain, I am dismayed that you {s21}. A {gentleman/gentlewoman} such as yourself should exhibit the highest standards of honour at all times."), ("npc10_2ary_morality_speech", "{Brother/Sister} -- I can't say I like to see us {s21}. You should treat your men well, and they'll repay with interest."), ("npc11_2ary_morality_speech", "[No secondary moral code]"), ("npc12_2ary_morality_speech", "[No secondary moral code]"), ("npc13_2ary_morality_speech", "[No secondary moral code]"), ("npc14_2ary_morality_speech", "Captain -- you should not let it bother you that you {s21}. Armies are made to do their leaders' bidding, and hardships are part of a soldier's life."), ("npc15_2ary_morality_speech", "You know, friend {playername}, it's none too reassuring to see how you just {s21}. If you can break your word to them, you can break your word to me, is how I figure it."), ("npc16_2ary_morality_speech", "Captain -- just so you know, it's no problem by me that we {s21}. We do what we need to do to live, and they'd do the same to us if they were in our shoes."), ("npc1_personalityclash_speech", "Captain -- no offense, but I'm a bit tired of {s11}, who puts on airs like she's something better than your humble servant Borcha."), ("npc2_personalityclash_speech", "{Sir/Madame} -- as you recall I was a merchant before I signed on with you. I respect men who make their living peacefully, risking all to bring goods for far away lands."), ("npc3_personalityclash_speech", "Captain -- in my opinion, {s11} is a hard and cruel man. He speaks of nothing but the need to flog, beat, and hang his fellow soldiers."), ("npc4_personalityclash_speech", "{Sir/Madame}. The House of Rolf is one of the most ancient and respected families in this part of the world, with a provenance dating back to the Old Calradic Empire. Yet {s11} openly shows me disrespect, and casts doubt on the provenance of my house."), ("npc5_personalityclash_speech", "A moment of your time, captain. {s11} seems to think me a common bandit, just because I have rewarded myself in the past to the legitimate spoils of war from caravans passing through my family's lands."), ("npc6_personalityclash_speech", "Your pardon, {sir/madame}, but I cannot keep my tongue stilled any longer. That harlot, {s11} -- every time she sees me she points the five fingers of her hand at me -- a peasant's sign to ward off evil."), ("npc7_personalityclash_speech", "Captain, I have done my best to put up with your followers' rude talk and filthy habits. But that one who calls himself {s11} is beyond tolerance."), ("npc8_personalityclash_speech", "Just so you know, I cannot abide that insolent mountebank {s11}. Some minutes ago, I was remarking to our companions how the peasants of this region were more than usually slack-jawed and beetle-browed, and speculated that perhaps they had bred with apes."), ("npc9_personalityclash_speech", "Sir -- {s11} is a base braggart, a man with no respect for the honour of women. I am tired of hearing how he conquered this or that damsel."), ("npc10_personalityclash_speech", "Excuse me, captain. I hate to trouble you with such things, but I just wanted to let you know that I can't abide that fellow Rolf, the one who calls himself a baron."), ("npc11_personalityclash_speech", "Begging your pardon, captain, but I can't keep silent. That man, {s11} -- he killed his own brother."), ("npc12_personalityclash_speech", "My lord. The barbarian woman, {s11}, complained of headaches -- a possible symptom of excess of sanguinity. I thought to apply my leeches."), ("npc13_personalityclash_speech", "Captain, I weary of {s11}, who talks of nothing but chivalry and feats of arms."), ("npc14_personalityclash_speech", "Excuse me, captain. A few minutes ago, I had expressed the opinion that liberal use of the lash and occasional use of the gallows is essential to keep soldiers in line. Men without a healthy fear of their commanders are more likely to run from battle."), ("npc15_personalityclash_speech", "Excuse me. I hope you don't mind me telling you that in my opinion, that girl {s11} is a danger to the party. She's a feral brat, disrespectful of authority and the basic principles of the military art."), ("npc16_personalityclash_speech", "Oy, captain. Just so you know -- there's something funny about {s11}. He makes strange scrawlings in the dirt, and mutters to himself."), ("npc1_personalityclash_speech_b", "She's a common bandit, just like myself, and she has no right to tell me to keep my distance from her, as she did just now."), ("npc2_personalityclash_speech_b", "I don't much care to hear {s11} gloat about the caravans he has looted, or he plans to loot, like he has no respect for good honest trade."), ("npc3_personalityclash_speech_b", "I know that an army is not a nursery, and that strong discipline is important, but I do believe that man enjoys cruelty for cruelty's sake. I hope you do not mind me saying so."), ("npc4_personalityclash_speech_b", "{Sir/madame}, these are indeed sorry days if common folk are allowed to mock their betters. That is all."), ("npc5_personalityclash_speech_b", "I told him that if the warrior's way bothers him so much, that he become a priest or a beggar and so not have to worry about such things. I hope you do not mind that I said such things."), ("npc6_personalityclash_speech_b", "I know the crime I committed was an abomination, but I am seeking repentance, and I deserve better than to be the object of some witch's superstition. I just thought you should know."), ("npc7_personalityclash_speech_b", "I do not care for how he stares at me around the campfire after a meal, as he picks his teeth. I believe I recognize him from my days as a bandit. He is base and ignorant. I do not care to travel with such people."), ("npc8_personalityclash_speech_b", "{s11}, that font of impudence, overheard me, and called me ignorant, and a savage, and other words I do not care to repeat. It was only out of respect for you that I refrained from cutting his throat then and there. I thought it only fit that I should warn you."), ("npc9_personalityclash_speech_b", "If he persists, I shall tell him that he is a base varlot, and if it comes to blows I will not apologize. That is all, {sir/madame}."), ("npc10_personalityclash_speech_b", "He's just a simple brigand, as far as I can tell. House of Rolf, my arse. Genuine blue-bloods are bad enough, but those who pretend to be blue-bloods are bloody intolerable. Anyway, I might have said something a bit sharp to him a minute ago. He seemed to take offense, anyway. I just thought you should know."), ("npc11_personalityclash_speech_b", "He's a kinslayer, cursed by heaven, and he'll bring misfortune and sorrow upon us, that's for certain. I don't like being around him and I don't think he should be with us. That's all. Sorry for troubling you."), ("npc12_personalityclash_speech_b", "But when I tried to afix them, she recoiled and struck me, and accused me of witchcraft. Captain, I am deeply tired of attending to the complaints of such an ungrateful and ignorant lot."), ("npc13_personalityclash_speech_b", "Valorous deeds are all very well, but they are not the only goals worth pursuing in life. Personally, I never trust any man who has not at least once woken up drunk in a ditch, or been beaten by the slipper of his lover."), ("npc14_personalityclash_speech_b", "That chit {s11} saw fit to admonish me for this. I will not have my methods questioned in front of the men, and I will not serve any commander who tolerates such insubordination in his company. Thank you for allowing me to speak my peace."), ("npc15_personalityclash_speech_b", "What's more, I suspect she's a thief. I found her going through my baggage and pawing some of my schematics, and she pulled a knife on me when I thought fit to object. A wise captain would not allow her in his company."), ("npc16_personalityclash_speech_b", "Fearing witchcraft, I asked him about it, and he told me that a chit of a girl like myself should mind her own business. So I had a look in his baggage, and found strange plans and diagrams. I think he's a sorceror, {sir/madame}, and if I catch him trying to hex me he'll have a knife in his throat."), ### set off by behavior after victorious battle ("npc1_personalityclash2_speech", "Oy -- boss, I don't fancy myself a sensitive soul, but I don't particularly like how {s11} went about cutting the throats of the enemy wounded, back there."), ("npc2_personalityclash2_speech", "{Sir/Madame}. If you don't mind, I'd prefer not to be deployed anywhere near {s11}, after what he said to me during that last battle."), ("npc3_personalityclash2_speech", "{Sir/Madame}. Since I have joined your company, I have tried hard to learn how to live like a soldier, and how to honour the warrior's code. If I occasionally make mistakes, I would hope to be forgiven."), ("npc4_personalityclash2_speech", "{Sir/Madame}. I happened to exchange a few words with {s11} as we were dividing up the spoils of battle. Please inform her that when she speaks to me, she should call me 'Baron' or perhaps 'Baron Rolf,' or 'Your Grace,' but certainly not just 'Rolf.'"), ("npc5_personalityclash2_speech", "Captain. {s11} needs to have her tongue cut out."), ("npc6_personalityclash2_speech", "My lord. Did you see {s11} during that last battle? He taunts the fallen foe as they lay stricken and helpless on the battlefield, mocking their parentage, their foolishness for having fought us."), ("npc7_personalityclash2_speech", "Captain -- I have been searching my mind trying to remember where I have seen {s11}, the one who calls himself a baron. As I watched him in action during that last battle, I suddenly remembered. He is a good fighter, but also a vicious one."), ("npc8_personalityclash2_speech", "Captain. {s11} is a most insolent girl. I have tried to be polite, even friendly, only to have her rebuff me."), ("npc9_personalityclash2_speech", "{Sir/My lady}, I hope you do not mind me telling you this, but in my opinion {s11}, the merchant, does not know his place. During that last battle, he cut in front of me to engage a foe whom I had marked for my own."), ("npc10_personalityclash2_speech", "{Brother/Sister} -- a question for you. Are you in charge of this company, or is it {s11}?"), ("npc11_personalityclash2_speech", "Captain. I don't much care for that {s11}. After that last battle, he went around muttering some heathen incantation, as he went through the slain looking for loot."), ("npc12_personalityclash2_speech", "Captain. I can no longer abide the rank ignorance of {s11}. As I was treating the wounded during our last battle, he saw fit to disparage my use of laudanum in relieving the pain while I conducted surgery, and of treating wounds with a poultice of honey."), ("npc13_personalityclash2_speech", "Hello, captain! {s11} is a temperamental one, isn't he? During that last battle, I was merely having a friendly chat with our foes about their mothers as we exchanged swordblows, and it caused him to throw a fit!"), ("npc14_personalityclash2_speech", "Sir. {s11} is incorrigibly indisciplined. During that skirmish, I called out to him that he should hold ranks with the rest of our battle array. He called back to me that I should 'get stuffed.'"), ("npc15_personalityclash2_speech", "Captain -- I must tell you that I question {s11}'s medical credentials. As he was tending to our wounded after that last battle, I saw fit to remind him that the peerless Galerian often advocated administering a distillation of beetroot, to restore the humor imbalance brought by loss of sanguinity."), ("npc16_personalityclash2_speech", "Beg your pardon, sir. {s11} might have been a very good thief, but he's not got the stomach to be a warrior, if you ask me."), ("npc1_personalityclash2_speech_b", "The way she whistles cheerfully as she does it -- it puts a chill down my spine, it does."),#borcha - klethi ("npc2_personalityclash2_speech_b", "The enemy was bearing down on us, and he says, 'Step aside, merchant, this is knight's work.' Next time I will step aside, and let him take a spear in the gut."), #marnid - alayen ("npc3_personalityclash2_speech_b", "After our last victory I was picking through the slain, and availed myself of one of our foe's purses. No sooner had I done so then {s11} came up behind me and struck it from my hands, saying that it was she who had made the kill, and thus she deserved the spoils. My lord, I could not tell in the heat of battle who had struck whom. If {s11} had simply told me that she deserved the purse, I would gladly have given it to her."),#Ymira - matheld ("npc4_personalityclash2_speech_b", "I am of noble blood, and she is of the basest birth. She must remember her place."),#Rolf - deshavi ("npc5_personalityclash2_speech_b", "When the loot was piled up after the last battle, I found among the enemy's baggage a very decent cooking pot. Often I had wished to find such a pot, so I could boil some of the stews that my people use to warm their bellies during the winter months. But {s11} grabs the pot, and tells me that I will not be allowed to 'taint' it with heathen food, and that it should properly belong to her. I yielded the pot to her, but I will not tolerate such disrespect in the future."), #beheshtur- katrin ("npc6_personalityclash2_speech_b", "My lord -- such hubris will not be overlooked by Heaven, and I fear we shall all of us pay the price."), #firentis - nizar ("npc7_personalityclash2_speech_b", "Back when I lived in the ravines, we would sometimes fight with a rival band called the Brethen of the Woods. Captain -- I would not trust any man who hides his origins, and particularly would not trust a common bandit who calls himself a lord."),#deshavi - rolf ("npc8_personalityclash2_speech_b", "As we were cleaning our weapons after that last battle, I remarked that I thought her a handsome girl, and after I regained my lands I would happily find her a match with one of my warriors. I thought it was a very generous offer, as a woman disinherited by her father is hardly going to find herself awash in prospects. But rather than thank me, she simply turned her back without a word. It was only out of respect for your leadership that I did not immediately try to teach her some manners."), #matheld - ymira ("npc9_personalityclash2_speech_b", "I appreciate that he is willing to risk his life in battle, but that alone does not make a gentleman. He is not of noble birth, and his family's wealth comes from commerce and usury. He may fight with us as an auxiliary, but should not attempt to steal glory from his betters."),# alayen - marnid ("npc10_personalityclash2_speech_b", "In that last battle he was shouting at me: 'Go forward, go back, hold the line.' When I told him to mind his own trimming he said he'd have me flogged. Captain, that man is looking for a crossbow bolt in his chest, begging your pardon."), ("npc11_personalityclash2_speech_b", "He said it was a prayer of thanksgiving for victory, but it didn't sound like that to me. Captain, I don't want him raising up the ghosts of the dead to make trouble for us on our travels. I think you had best be rid of him"), ("npc12_personalityclash2_speech_b", "Captain, if that man knew the slightest thing about medical matters, he would know that one should never undermine a patient's confidence in his doctor, particularly not during a complicated operation. If you would be kind enough to dismiss him from this company, you would be doing all of us a great service."), # jeremenus - artimenner ("npc13_personalityclash2_speech_b", "When all the dust settled, {s11} turned on me and told me not to 'tempt the wrath of the Heavens' with my 'hubris.' I responded that at least I hadn't killed my own brother, which I think bothers the Heavens a lot more than battlefield small talk. {s11} turns red like a baboon's arse and would have struck me had I not artfully dodged out of his away. Tell him to lighten up, will you?"), #nizar - firentis ("npc14_personalityclash2_speech_b", "{Sir/Madame}, such defiance of proper authority is a corrosive influence on our company, and I shall have him flogged if he does so again."), #lazalit - bunduk ("npc15_personalityclash2_speech_b", "{s11} responded that Galenian was an 'antiquated know-nothing.' Captain, no true doctor would have such disrespect for the great masters of the past. I do not believe you should employ such an obvious impostor."), #artimenner - jeremus ("npc16_personalityclash2_speech_b", "After our last scrap, I was slicing open the guts of some our foes to check for hidden gold, as a girl who counts her pennies ought. He gagged and muttered that I was an 'animal.' I'll inspect his innards for contraband if he doesn't keep a civil tongue in his head."), #klethi - borcha ("npc1_personalitymatch_speech", "Boss. {s11} back there didn't do badly in that last fight at all. He's a good egg, too."), ("npc2_personalitymatch_speech", "{Sir/Madame}. I just wanted to tell you that {s11} may be a rough sort, and I'll venture a thoroughgoing rogue as well, but I'm proud to call him my companion."), ("npc3_personalitymatch_speech", "Hello, {sir/madame}! I had just wanted to tell you that {s11} is a most gallant knight. Did you see him in our last battle?"), ("npc4_personalitymatch_speech", "Excuse me, {sir/madame}. I just wanted to say a word in praise of {s11}. He did well in that last battle."), ("npc5_personalitymatch_speech", "That was a fine battle, {playername} Bahadur! {s11} is a good man to have by our side in a fight."), ("npc6_personalitymatch_speech", "Captain. Sometimes I am troubled by all this bloodshed, although I know that proud warlords must be humbled, and cruel bandits tamed, if we are to restore peace to Calradia."), ("npc7_personalitymatch_speech", "Captain. I was just talking to {s11}. She may be a bit savage, but I believe that she is a faithful friend."), ("npc8_personalitymatch_speech", "A fine battle that was, captain. And I have to say, I admire the taunts that {s11} hurled at our enemy."), ("npc9_personalitymatch_speech", "Captain. {s11} acquitted herself well in that fight back there. A fine, modest maiden she is, if I dare say so myself."), ("npc10_personalitymatch_speech", "Ahoy, Brother! I wish you joy of your victory! Say, old Mother {s11}'s not bad in a scrap, is she, for a woman of her years? Although I'm getting to be a bit of an old dog myself, now."), ("npc11_personalitymatch_speech", "Ach, captain! A fight like that one sets my old joints a-creaking. Still, we licked them pretty good, didn't we?"), ("npc12_personalitymatch_speech", "A bloody business, captain, a bloody business -- although a necessary one, of course. {s11}, I believe, shares my ambivalence about this constant fighting."), ("npc13_personalitymatch_speech", "You have earned your name today, oh valorous one! And {s11}, too! I like that one. She sings the songs of her people as she goes into battle, which appeals to an artistic soul like my own."), ("npc14_personalityclash_speech", "Captain. It is a pleasure going into battle with men like {s11} by my side."), ("npc15_personalitymatch_speech", "Captain. I was just having a word with {s11} after our last battle, and it strikes me that the man has got a good head on his shoulders."), ("npc16_personalitymatch_speech", "Oy -- captain. I was just having a chat with {s11}, as we picked through the bodies after our last little scrap."), ("npc1_personalitymatch_speech_b", "Without good honest souls like him to bring silver into Calradia, scoundrels like me would have a hard time in life, I'll warrant. I'm glad to have him with us."), ("npc2_personalitymatch_speech_b", "Based on how he did in that last fight, I'd say that I'd trust my back to him any day, although I'd still keep a hand on my purse."), ("npc3_personalitymatch_speech_b", "I also confess that I find him a truly delightful companion, a man of both wit and manners. Perhaps, perhaps... Ah, but I say too much. Good day, {sir/madame}."), ("npc4_personalitymatch_speech_b", "You chose well to enlist him in our company. He knows a thing or two about a fight, and also knows the importance of respecting his comrades-in-arms, unlike some others I might mention."), ("npc5_personalitymatch_speech_b", "As for his other attributes, I doubt that he is any more a Baron than I am, but I have to admire the brazen way he makes that claim."), ("npc6_personalitymatch_speech_b", "I must say that {s11} is a source of great comfort to me. I have told him of my sin, and he said to me that Heaven will forgive my transgression, if I truly repent and truly desire such forgiveness. He is wise, and I am glad that he is with us."), ("npc7_personalitymatch_speech_b", "At some point in the future, if you have no need of our services, she has promised to go back to the ravines with me and find the bandits who murdered my lover, and help me take my revenge. It was a kind offer. I am glad that she is with us."), ("npc8_personalitymatch_speech_b", "He managed to include their geneology, their appearance, and their eating habits in a well-framed Old Calradic quatrain. I personally prefer the saga, but we Nords respect poetic craftwork when we hear it."), ("npc9_personalitymatch_speech_b", "Were she of noble blood, I might ask for her hand. It is a pity that she is a merchant's daughter. But speaking with her is a pleasant way to pass time on the march."), ("npc10_personalitymatch_speech_b", "Heh. It just goes to show that youth ain't everything, that experience also wins battles. I reckon she and I could teach the young puppies of the world a thing or two, couldn't we?"), ("npc11_personalitymatch_speech_b", "Old {s11} in particular showed them a thing or two, I thought. Not bad for the pair of us, I thought, given that between us we've probably seen close to a hundred winters."), ("npc12_personalitymatch_speech_b", "It saddens him deeply to take the lives of his fellow men, however just the cause. He and I have talked together of a brighter future, of the need to unite these petty warring kingdoms of Calradia, so that we may bring this time of troubles to an end."), ("npc13_personalitymatch_speech_b", "Also, although I normally prefer the coy to the Amazonesque, I confess that I have also noticed the femininity she tries to hide beneath her martial demeanour. True, she is a bit aloof on the march and in camp, but perhaps my fair words can melt the Nordic ice around her heart."), ("npc14_personalityclash_speech_b", "He is a professional soldier, and though he may not be as fast on his feet as some others, he knows the wisdom of holding together in a disciplined battle-line. You showed good sense in bringing him into this company."), ("npc15_personalitymatch_speech_b", "War, like any other affair, requires careful planning and preparation, and a firm grasp of strategic principals. All other things being equal, the best trained army will win the battle, an observation that I think our last fight bears out. The men may curse him now, but they'll learn to thank him, I'll warrant."), ("npc16_personalitymatch_speech_b", "Have you heard her story? Can you believe the wrongs done to her? I tell you, it makes my blood boil. I want to cut off all the little bits of those bastards who mistreated her -- and I'll do it, too, if we ever run into them in our travels."), ("npc1_retirement_speech", "I'm a bit tired of marching up and down the land, shedding my blood for someone else's cause. The loot is good, but I think I've got enough of that, now. I'm going to head back to my village, take a wife, settle down, maybe raise horses if I can afford it."), ("npc2_retirement_speech", "I'm getting a bit tired of the warrior's life. I'm going to invest my share of our loot into a cargo of goods -- furs, linens, velvets, probably -- and take them back over the mountains. I would like to thank you again for taking me on, and wish you the best of luck."), ("npc3_retirement_speech", "I am afraid I have something to tell you. I have decided that the warrior's life is not for me. I think it is probably too late for me to find a good marriage -- no one of my people would take a wife who had served with a company of soldiers -- but I may have enough money to start myself up as a merchant. I hope you will not be angry, {sir/madame}."), ("npc4_retirement_speech", "I have fought with you honourably, as befits a son of the House of Rolf, but I am not altogether satisfied with your leadership. I will go home to my ancestral estates, which are much in need of my services."), ("npc5_retirement_speech", "Bahadur -- since I have taken your salt, I have fought for you fiercely, and loyally. But you have not always repayed my service with the kind of leadership that I deserve. So I am going home, in the hope that the Khan's men have forgotten me, to see my father and brothers again."), ("npc6_retirement_speech", "I joined this company in the hope that you would lead me out of darkness, and indeed I have found a measure of peace here. But I have some qualms about your leadership, and have begun to suspect that the path to redemption can be found elsewhere."), ("npc7_retirement_speech", "I am tired of this squalid life of endless warfare, seeing men debased by fear, greed, lust, and a hundred other sins. I have money in my purse. I am going overseas to look for a better land than Calradia. I assume that you will fare well without me."), ("npc8_retirement_speech", "I have fought in your shield wall, and done well by it. But your leadership is not always to my liking, and anyways I have another task. I will take what plunder I have won and raise a warband of my own and sail to Nordland to take back my husband's hall from my treacherous brother-in-law. I wish you well."), ("npc9_retirement_speech", "We have fought well together, and earned ourselves much glory. But I have some reservations about your leadership, and at any rate have my patrimony to reclaim. I will be leaving you. Perhaps we will meet again."), ("npc10_retirement_speech", "I've had enough of tromping up and down the length and breadth of Calradia. I've got enough to buy a small bit of land somewhere, so I think I'll give that a try. So long, and best of luck to you."), ("npc11_retirement_speech", "You did an old woman a great service by taking her into your company. But I'm afraid I'm finding this life no more to my liking than driving a wagon. Too much cold, too much hunger, and at the end all I see in front of me is a hole in the ground. So I'll be off, although I don't know where."), ("npc12_retirement_speech", "I've done all right in your company. I filled my belly, put some gold in my purse, and broadened my knowledge of wounds and injury -- I can't complain about that! But I think right now that service in this company is holding me back. I have a duty to share my findings with other surgeons, and for that I need to hire scribes, who are rare in Calradia. I shall be going home"), ("npc13_retirement_speech", "As the luster of your name grows ever brighter, I fear that my own reputation will seem pale in comparison, as the moon is outshined by the sun. I have decided to strike out on my own. The very best of luck to you!"), ("npc14_retirement_speech", "I would like to inform you that I wish to sever our relationship. I intend to seek alternative employment."), ("npc15_retirement_speech", "I appreciate that you took me on, but I'm not altogether happy about how things have worked out. I'm going to head off elsewhere -- maybe go home, maybe find another job, I haven't quite decided yet."), ("npc16_retirement_speech", "I've had good times in this company, and I've found myself a pretty trinket or two on the battlefield, but right now it isn't working out. I'm leaving you to go offer my talents to someone else."), ("npc1_rehire_speech", "Boss -- it's good to see you again. I know we had our differences in the past, but to tell you the truth, those were some of the best days I've known. And, to tell you the truth, I've had a bit of difficulty finding work. Listen, if you'd be willing to have me back, I'd be willing to sign up with your company again."), ("npc2_rehire_speech", "{Sir/Madame}! It's good to see you again. But I'll confess -- I've been looking for you. I bought a load of goods like I told you I would, loaded them up, and took them back across the steppe -- but wouldn't you know it, I was hit again by Khergits, and lost it all. I guess I'm just destined to fight for my fortune. Also, people tell me that you've done very well for yourself. So tell me, {sir/madame}, would you have me back?"), ("npc3_rehire_speech", "Well, hello {sir/madame}! It is very good to see you again. I have not fared so well since we parted, I am afraid. My mother's family. whom I hoped would give me a start in trading, have not been as welcoming as I have hoped. I receive nothing but lectures from my aunts, on how I have ruined my prospects for marriage by taking service in a mercenary company. Perhaps I am better suited to war than to commerce, to share a meal over a campfire with rough fellows than to drink wine with the burghers of Veluca. {Sir/Madame}, I must ask you -- will you take me back?"), ("npc4_rehire_speech", "Why hello, captain. It's been a while. You've done well for yourself, I hear. For my part, I've been having some difficulties coaxing a living from my estates -- locusts, bad rains, unruly serfs, that sort of thing. I thought I might take up the sword once more. I know there's been some bad blood between us, but I'd be honoured to fight in your ranks once again."), ("npc5_rehire_speech", "{playername} Bahadur! Your fame grows ever greater -- even as far as my homeland, beyond the mountains. I'd returned there, hoping that the Khan's men had forgotten. Well, they had not -- even before I set foot in my valley, I had word from my family that both the Khan and the Humyan were looking for me. So I came back again, hoping you might forget any harsh words I had spoken, to see if I could fight with you once again."), ("npc6_rehire_speech", "It is good to see you, {sir/madame}. Everywhere I go, men are in awe of your deeds. I have not had it so well since I left. Wherever I go, I feel my demons returning. My soul is in turmoil. For reasons that I cannot fully explain, I had found peace in your company, even if I had questions about your leadership. Will you allow me to serve with you once again?"), ("npc7_rehire_speech", "Captain! It is good to see you. Forgive what I may have said when we parted. I took a ship out of Wercheg, bound for the east, but it was taken by pirates and after my ransom I was set ashore back here. There may be better places in the world than Calradia, but I have yet to see them. So I think, if it is my lot to live here, then your company is as good a livelihood as any. Will you have me back?"), ("npc8_rehire_speech", "Greetings to you, {playername}. I was wondering if the harsh words spoken between us in the past could be forgotten. I have been hunting among the Nords here, to see if I could find enough men to take back my husband's hall. But I could not find enough men to crew a longship, and those whom I gathered quickly got bored and wandered off -- not, I will add, before they drank away such gold as I had accumulated. So I thought back to the battles we fought together. Those were good days, and profitable ones too."), ("npc9_rehire_speech", "My dear, dear {man/lady}! So good it is to see you! I have sought service with the lords of this land, but have been most grieviously disappointed. Half of them ask me to collect debts from fellow lords, as though I were a banker's errand boy, or chase down his serfs, as though I were a farm overseer. One even asked me to murder one of his creditors! I have looked for you, to see if you would wish me to join you again."), #Alayen ("npc10_rehire_speech", "Captain! It's good to see you. You see, it turns out I'm not much of a farmer. Too soft on the hired hands, I figure. I let them rob me blind. I guess fighting is what I know best. So tell me, captain, are you still looking for good men?"), ("npc11_rehire_speech", "Captain! So good to see you! People say that you've been making gold hand over foot. I'm a fidgety old bag of bones, I'll admit. I left you because I wasn't satisfied with the warrior's life, but I spend a bit of time in town and I realize that there's worse things in life than a full belly, honest companions, and the joy of seeing the enemy run before you. So, would you be hiring again"), ("npc12_rehire_speech", "Captain! It's a fine thing to see an honest face like yours. This world is full of lies. I went home to publish my findings, hired some scribes and made a handful of codices, and waited for the commissions. But it turns out that the universities don't care about real medical knowledge rather than warmed-over Galerian. And publishers -- let me tell you, you never saw anyone so unscrupulous. They rent the books out chapter to by chapter to students to copy, but half of them aren't returned, and those that are have pages soaked in wine, and there's no longer a complete copy of my work anywhere. I'll keep trying, but first I need a bit of money in my pocket, first. Are you looking for a surgeon?"), ("npc13_rehire_speech", "Well hello there, oh valorous one. I had been hoping to see you again. Everywhere I go, I hear tales and songs of your deeds. I will admit that I felt a twinge of regret that we had parted ways, and, I'll confess, a twinge of jealousy as well at your reputation. I thought that once again I might fight by your side, and thus bask in the reflection of your glory. Perhaps we might ride together again, for a little while?"), ("npc14_rehire_speech", "Captain. It is good to see you. When last we parted, I was ready to swear that I would not serve you again, but perhaps I judged you too harshly. All over Calradia, men sing your praises. I have tried serving in other lords' armies, and believe me, what I have seen of them restores my opinion of your leadership. If you would have me in your company, I would fight for you again."), ("npc15_rehire_speech", "Why hello, {playername}. I can't say I'm entirely displeased to see you. You see, I took on another contract before I left, and sure enough, when it came time to collect the pay, the lord had nothing but talk and excuses and petty little complaints about my handiwork. I can't say I was always happy in your company, but at least I put gold directly into my purse after every battle. You still offering work?"), ("npc16_rehire_speech", "Captain! They say that you've done well for yourself since we last met. I'll come out and admit that I cursed your name when we parted ways, but thinking back on it you weren't all that bad. All these lords, they're glad enough to send me on little side errands, but they don't much care to have me in their main battle-line. Apparently I spook the men. I've heard it muttered that I'm a witch, or that I eat men's hearts after killing them, or other rot. Not that I mind stabbing a man while he's asleep, but it's a lot more gratifying when he's awake and kicking. So I thought I'd try to find you again, see if you'll take me on."), #local color strings ("npc1_home_intro", "Boss -- did you know that I was born around here, in the high steppe? This is where I got my eye for horseflesh, because this is good land for horses, although a hard land for men. I suppose that's why the Khergits like it."), ("npc2_home_intro", "We're approaching Sargoth. That's where I was headed when the Khergits got me."), ("npc3_home_intro", "Can you smell that? Lemon trees, apples and crocus flowers, it's the scent of Veluca. I spent many a happy summer here when I was a girl, playing in the gardens of my mother's family while my father was away trading."), ("npc4_home_intro", "The Woods of Ehlerdah. Bah. This place is thick with bandits and outlaws."), ("npc5_home_intro", "Bahadur, we are nearing Halmar, largest town in the lower steppe. My mother's sister went here to marry a townsman and I thought to seek service with the lord here. That is when I ran into you."), ("npc6_home_intro", "I can see by the vines and terraces on the hillside that I am near home. I have no wish to see my family, so I will linger outside the walls if you go into town. I am sure that you will understand."), ("npc7_home_intro", "Do you smell that? Salt fish, rotting flax and river mud. The smells of my childhood. I want to retch."), ("npc8_home_intro", "Hmf. Do you hear that? It must be the crash of waves on the headland. We must be near Gundig's Point."), ("npc9_home_intro", "Behold the Rock of Rivacheg! The strongest fortress in Calradia. My father was one of those who held the line here against the Nords, when they first tried to push inland from the coast."), ("npc10_home_intro", "D'you smell that fresh air, Brother? This was my home, before I went abroad in search of coin. It's good to be up in the hills again. It's the smell of freedom. This is the cradle of Rhodok liberty, here under Grunwalder Castle"), ("npc11_home_intro", "I see the mountains. We must be getting near home."), ("npc12_home_intro", "We're passing by the site of one of my greatest medical triumphs, if that interests you."), ("npc13_home_intro", "Ah, Castle Ergellon! Such a lovely spot, by the deep lake. Such happy days I spent here, the summer before last."), ("npc14_home_intro", "Do you see that fortress up there, on the spur over the valley? Ismirala? I spent a winter there some years back, trying to train the lord's men."), ("npc15_home_intro", "You see that castle up on the hill? Culmarr Castle, it's called. I did some work there, not long ago. It's not as showy as some of the other castles in this land, but it's the finest stonework you ever saw."), ("npc16_home_intro", "Aye, captain, do you see those? Those are hare tracks in the snow. We must be getting near to my birthplace."), ("npc1_home_description", "Well, Khergits always lived here, even back in the old days, as the Emperor gave them gold and lands to keep out the other tribes. I'm told my grandfather was a Khergit chieftain, although my mother didn't know him, any more than I knew my father. When my mother was a lass, the Khergit started coming over the mountains in larger numbers, and now there's a Khergit Khan in Tulga."), ("npc2_home_description", "People say that the Nords are a bunch of bloodthirsty barbarians, but they have a good head for trade, if you ask me. They make the people up and down the coast grow flax, which they weave here into linen. It can't compete with Jelkala silks and velvets as a luxury fabric, but it makes good summertime wear and you can use it for the sails of ships. More importantly, linen was one of the few goods that someone else in Calradia wasn't already making."), ("npc3_home_description", "Veluca has wet winters and hot summers, but the people here build great cisterns to water their crops. They grow grapes -- Velucan wine is famous, {sir/madame} -- and those who can afford it make walled gardens, where fruit trees grow in abundance, and we sit at night listening to music, or playing chess, or merely sniff the night air."), ("npc4_home_description", "Well, you see, the King of Swadia declared this to be his personal hunting preserve, and said he'd kill any man who as much as strung his bow here. So what happens? Some family goes hungry, and succumbs to the temptation to poach, and the king's sheriff comes along and strings him up and takes his land. His sons, rather than starve, go bandit. And so naturally anyone in the whole valley who feels the need to run away from a debt or a nagging wife or a vengeful noble comes up here to join them, living on wild pigs and berries and the purses of unwary travellers."), ("npc5_home_description", "Khergits had always come here, to trade and raid, and in the last days of the Empire we began to settle. Just like the Vaegirs, Swadians, Rhodoks and Nords, we took the Emperor's coin to keep the other tribes at bay. But when the Great Horde attacked our homeland in my grandfather's day, we moved into this region in force. We pushed the Vaegirs back, and made their fortresses our own."), ("npc6_home_description", "Here in the Vale of Suno, our dialect and customs are closer than anywhere else in Calradia to those of the old Calrad Empire. We grow olives and wine, both crops brought to this land from overseas by the emperors, and also follow the old Calradic ways. We keep our pledges and pay our debts."), ("npc7_home_description", "Before I was married off, and before I was taken by bandits, I lived here. I was born in a hovel and spent my childhood in the fields. Our landlords were Nord, but we never saw them, merely their cursed minions and overseers. My father, coward that he was, cringed before them."), ("npc8_home_description", "You haven't heard the story? When Gundig Hairy-Breeks came to Calradia from Nordland, he planted his banner on the headland and said that it would remain there until he recaptured his 'inheritance.' His 'inheritance', he called it. Gundig believed the skalds who told him that the Emperor had bequeathed Calradia to the Nords, when in fact he just gave us a small strip of land along the coast, so that we would crew his galleys."), ("npc9_home_description", "The Nords would sail up the river in their longships. The townsmen of the coast could have stopped them, but they were cowards then, as they are today, and paid them a yearly stipend, known as the Nordgeld, to be let in peace. But the Vaegir king would not pay. My father decided to come over the mountains, to fight with the Vaegir hosts. Three summers in a row they tried to take the Rock, and each time the Vaegir lords held them back."), ("npc10_home_description", "In my father's day the Swadians would come calling, thinking to make us knuckle our foreheads and call them their overlords. But Grunwalder, an old veteran of the wars from the hills, showed us how to form a battleline with spear and crossbow that could break a Swadian charge. He fell in battle, but the people gave his name to the castle that was built here, where he fell, so that we would remember, and always stand firm against the horsemens' onslaught."), ("npc11_home_description", "I'm from Praven. You know the saying, {sir/madame} -- 'Barley grown in Uxkhal is made into ale in Praven, and we're all the better for it.' Not sure what that means, {sir/madame}, but it's true about the barley. And wheat, and oats. We grow more grain here in the Vale of Uxkhall then all the rest of Calradia put together, and our ale is the best, too. You can see it in the soil here -- rich and black, and smells of good harvests and full bellies."), ("npc12_home_description", "The lord over there in Almerra Castle had the dropsy, and had requested a doctor from Uxkhal to treat him. Like a typical university-educated doctor, he went right to Galerian for a cure. Galerian commends sun-metal for dropsy. Now most of Galerian's writings were useless back in the days of the Calradic emperors when they were first written down, and they're doubly worthless today, but he sometimes he hits upon the right cure by chance: sun-metal does cure some kinds of dropsy in small doses. However, sun-metal in large doses is poison, something that the Galerian-worshippers never grasped."), ("npc13_home_description", "I had come up here with a small Swadian force, but they were caught by the Rhodoks in the woods and their horsemen cut down amid the trees. I fled and found shelter by the lake, in the arms of the comeliest cowherd you ever saw. She took me to a cave near the high pastures, and would bring me cheese and berries, and tell me the tale from the hills. They say the lake is a gateway to the underworld, and sometimes on the fringes you can the noxious fumes beneath bubbling up to the surface. Such rustics they are!"), ("npc14_home_description", "I say 'trying' because in my opinion, Vaegirs don't take well to discipline. Finest archers you ever saw, and good riders too, but they have no stomach for fighting in ranks. Their skills serve them well enough against Khergits and Nords, particularly when they can hide behind walls, but I've seen Swadian knights cut through Vaegirs like a knife through butter. Now, a Rhodok spear-wall is designed to stop a Swadian charge in its tracks, and usually does."), ("npc15_home_description", "Like most castles that last around here, it's got foundations that are old Imperial Calradic. You can't see them any more with all the rebuilding, but the slabs are the size of a house. They must have been real sorcerors back in those days, because I don't see how they moved those things otherwise. Beautiful location, too -- Culmarr sits right in front of the pass leading out of Calradia, which allows the lord to charge a pretty penny in tolls during the three months of the year that it's not snowed in."), ("npc16_home_description", "The snows in these valleys don't melt until late in the year, and the land is hard to plough. You can grow a bit of barley, but not much else. But there's wealth here in the woods: deer, rabbit and lynx, meat and furs, and the mountains have iron, and traders would ship enough saltfish up the river from the coast to keep the people fed for the winter."), ("npc1_home_description_2", "They go easy on us Old Calradians, and don't ask for much in tax -- not that we would be able to pay in any case. The land isn't good enough for most crops. Frankly, it's only good for horse-rearing, and that only for half of the year, in the winter after the rains. In the summer they take their herds back into the mountains. Caravans come over the hills and bring spice to Tulga, but we don't see much of that money down in the villages."), ("npc2_home_description_2", "I had loaded up on saffron, cinnamon, cloves, pepper and other spices and a chest full of denars. I estimated that I could buy linens, furs, velvet, iron and wool, and the extra horses to carry them back, and I'd still make a profit. I just hadn't figured in the Khergits, who apparently don't care for others cutting in on their monopoly."), ("npc3_home_description_2", "The poets call Veluca a paradise, and I think for once that they do not exaggerate."), ("npc4_home_description_2", "How do I know this, you ask? Well... I was taken by them, and held for ransom, but I got away. That's really all there is to tell."), ("npc5_home_description_2", "Of course, you know how things go. My father's generation were hard warriors from the cold lands across the mountains, but this generation all has houses in the town and great estates and spend time as much trading as they do practicing archery. The next generation will grow soft on Velucan wine and will lose their lands to the next batch of illiterate hill-raiders to come over the mountains, just you watch. It's how things always were, and how things always will be."), ("npc6_home_description_2", "We men of Suno also never forget an insult, and avenge any wrong done unto us. Old-fashioned Calradic honour, I dare say, has brought me to my current fallen state. But despite that, I am proud to be from this region. Our lord is a vassal of the Swadian king in Praven, but as far as we are concerned his is just yet another barbarian chieftain, and we are the Empire's true heirs."), ("npc7_home_description_2", "We were allowed to fish the river, raise pigs amid the reedbeds, and grow whatever we could in our private plots, but in the open fields we were only permitted to grow flax, to be taken to Sargoth and woven into linen. So we were always hungry, and weak, and never had the courage to rebel."), ("npc8_home_description_2", "The skalds' tales at least gave Gundig an excuse to raise a warband -- not that we Nords ever need an excuse, mind. He sailed across the sea, rallied the Calradian Nords to his banner, and marched on the Rock of Rivacheg. The Vaegirs killed him, and threw his banner into the surf. But the Nords keep coming, and some day all of Calradia will be ours."), ("npc9_home_description_2", "Just as the Nords can call on their kinfolk overseas, so does the Vaegir king call on his kinfolk from over the mountains. Had my father not disinherited me, I would also have taken an oath of fealty to the lord of Reyvadin. But just as I was shorn of my inheritance, so also was I shown of my obligations, and it is the Vaegir king's loss."), ("npc10_home_description_2", "We grow mulberry trees here for silk and kermes too for the dye. We take it to Jelkala where they weave it into the finest velvet -- not that I have ever had enough denars in my pocket to buy velvet, mind. But the craftsmen of Jelkala also make good crossbows, and for that I'll not begrudge them their little luxuries"), ("npc11_home_description_2", "The Swadian king will tell you that Praven was the biggest city in Calradia back under the Empire, and that's why he should rule the whole land today. Mind you, I don't care much about politics, {sir/madame} -- I've sold provisions to every army that ever marched in Calradia, and I tell you that I wouldn't give a single one of them a single biscuit unless I had the cold, hard denars in my hand first. Why these high and mighty kings and nobles can't pay their bills, I'll never know. But I prattle on a bit, there, don't I?"), ("npc12_home_description_2", "The difference between poison and cure is the dose. You tell that to everyone you meet, and tell them you heard it first from Jeremus the Great. People think that all the wisdom worth knowing was written in Old Calradic, but I say you can learn twice as much from village midwives and careful examination of nature than from the entire imperial corpus. That's why they threw me out of the university, although in retrospect that was a blessing. Anyway, I put that lord back on his feet, and he availed me of a sack of gold and the corpse of a freshly hanged criminal to dissect. Ha! To think of the lengths I had to go to get specimens back in those days."), ("npc13_home_description_2", "Eventually I had to leave, and sometimes I wonder if there is a little herdsboy swaddled on her back, as she takes the cows up to pasture each morning. I'd be tempted to try to find her -- but no, no, one should never look back."), ("npc14_home_description_2", "If anyone were ever to unify this little land of ours, I'd sign up to serve them, free of charge. I'd put together an army of Rhodok spears with Nord footmen on the flanks and Vaegir archers in front, take along some Khergit scouts to find and fix the enemy, and some Swadian lancers to finish them off. I'd take that army over the mountains and make the whole world kneel to Calradia.... Of course, that's what the Emperors thought, and in the end the tribes took away their Empire."), ("npc15_home_description_2", "And here's the funny thing -- when the Rhodok lands first rebelled against the Swadians, they all said they weren't going to have any noble lords ruling over them. You can guess how long that lasted. One Rhodok hill chieftain sets himself up in Culmarr, calls himself 'Count', and the good burghers of Jelkala and Veluca have to lick his boots if they want to sell their wine and velvet outside Calradia. And if you want to keep the counts under control, and the peasants providing the towns with food rather than selling to the highest bidder, then you need a King too, don't you? The Rhodok lands are no different than anyone else, whatever guff they talk about 'ancient liberties' and 'freedom.'"), ("npc16_home_description_2", "Still, it was a thin living, and there were always too many mouths around to feed. The Vaegir king and the Khergit khan don't make life any easier for us, squeezing for tax money the villages they control, and raiding for plunder the villages they don't. Of course, I can't say I'd do any differently do the same if I had a castle and an army all of my own. The mighty do whatever the can, and the humble do whatever they must."), ("npc1_home_recap", "I'm from the high steppe, near {s21}."), ("npc2_home_recap", "I was born over the mountains. I'm a merchant, the son of a merchant, and the grandson of a merchant."), ("npc3_home_recap", "I used to live in my father's house in {s20}, but I spent much of my childhood in {s21}."), ("npc4_home_recap", "Our ancestral barony is over the mountains, across the Culdarr pass."), ("npc5_home_recap", "I was born in the highlands on the other side of the mountains, past Tulga, but I have relatives in {s21}."), ("npc6_home_recap", "My family lives in {s21}, but I cannot bear to face them."), ("npc7_home_recap", "I was born in a hovel in the fens, not far from {s21}."), ("npc8_home_recap", "I was born overseas, in Nordland, and my husband's hall also was in Nordland."), ("npc9_home_recap", "I am from the Vaegir homeland over the mountains, where the Vaegir lords lived before the Emperor brought them in Calradia."), ("npc10_home_recap", "Born and raised in Jelkala, {Brother/Sister}, and I hope some day to buy land there. But I had a mind to see a bit of the world first, so I took my crossbow and went off to the wars."), ("npc11_home_recap", "I was born in the train of an army, and lived all my days in the train of an army. My folk are from Praven, however, so I guess that's as much home to me as anywhere."), ("npc12_home_recap", "I come from overseas. I travel the world in search of medical lore."), ("npc13_home_recap", "Oh, far away from here, my {lord/lady}, else you would already have heard about me, and would not need to ask such things."), ("npc14_home_recap", "I am the younger son of the Count of Geroia."), ("npc15_home_recap", "I'm from over the hills. But Calradia is where the money is to be made, these days, if your trade is siegecraft."), ("npc16_home_recap", "Why, captain, I was born in Uslum village, but my mother lost her land to a scheming relative and had to put herself in bond to a nearby lord."), ("npc1_honorific", "boss"), #Borcha ("npc2_honorific", "{sir/madame}"), #marnid ("npc3_honorific", "{sir/madame}"), ("npc4_honorific", "{sir/madame}"), ("npc5_honorific", "{playername} Bahadur"), #beheshtur ("npc6_honorific", "captain"), #firentis ("npc7_honorific", "captain"), #deshavi ("npc8_honorific", "{playername}"), #matheld ("npc9_honorific", "{my good sir/my good lady}"), #Alayen ("npc10_honorific", "{Brother/Sister}"), #Bunduk ("npc11_honorific", "{laddie/lassie} -- I mean Captain"), #katrin ("npc12_honorific", "captain"), ("npc13_honorific", "oh valorous one"), #nizar ("npc14_honorific", "commander"), #lazalit ("npc15_honorific", "captain"), #artimenner ("npc16_honorific", "captain"), #klethi #NPC companion changes end #Troop Commentaries begin #Tags for comments are = allied/enemy, friendly/unfriendly, and then those related to specific reputations #Also, there are four other tags which refer to groups of two or more reputations (spiteful, benevolent, chivalrous, and coldblooded) #The game will select the first comment in each block which meets all the tag requirements #Beginning of game comments ("comment_intro_liege_affiliated", "I am told that you are pledged to one of the pretenders who disputes my claim to the crown of Calradia. But we may still talk."), ("comment_intro_famous_liege", "Your fame runs before you! Perhaps it is time that you sought a liege worthy of your valor."), ("comment_intro_famous_martial", "Your fame runs before you! Perhaps we shall test each other's valor in a tournament, or on the battlefield!"), ("comment_intro_famous_badtempered", "I've heard of you. Well, I'm not one for bandying words, so if you have anything to say, out with it."), ("comment_intro_famous_pitiless", "I know your name. It strikes fear in men's hearts. That is good. Perhaps we should speak together, some time."), ("comment_intro_famous_cunning", "Ah, yes. At last we meet. You sound like a good {man/woman} to know. Let us speak together, from time to time."), ("comment_intro_famous_sadistic", "I know your name -- and from what I hear, I'll warrant that many a grieving widow knows too. But that is no concern of mine."), ("comment_intro_famous_goodnatured", "I've heard of you! It's very good to finally make your acquaintance."), ("comment_intro_famous_upstanding", "I know your name. They say you are a most valiant warrior. I can only hope that your honour and mercy matches your valor."), ("comment_intro_noble_liege", "I see that you carry a nobleman's banner, although I do not recognize the device. Know that I am always looking for good men to fight for me, once they prove themselves to be worthy of my trust."), ("comment_intro_noble_martial", "I see that you carry a nobleman's banner, but I do not recognize the device. Perhaps one day we shall test each other's valor in a tournament, or on the battlefield!"), ("comment_intro_noble_badtempered", "I don't recognize the device on your banner. No doubt another foreigner come to our lands, as if we didn't have so many here already."), ("comment_intro_noble_pitiless", "I see that you carry a nobleman's banner, but I do not recognize the device. Another vulture come to grow fat on the leftovers of war, no doubt!"), ("comment_intro_noble_cunning", "I see that you carry a nobleman's banner, but I do not recognize the device. Still, it is always worthwhile to make the acquaintance of {men/women} who may one day prove themselves to be great warriors."), ("comment_intro_noble_sadistic", "I see that you carry a nobleman's banner, but I do not recognize the device. Perhaps you are the bastard {son/daughter} of a puffed-up cattle thief? Or perhaps you stole it?"), ("comment_intro_noble_goodnatured", "I see that you carry a nobleman's banner, but I do not recognize the device. Forgive my ignorance, {sir/madame}! It is good to make your acquaitance."), ("comment_intro_noble_upstanding", "I see that you carry a nobleman's banner, but I do not recognize the device. No doubt you have come to Calradia in search of wealth and glory. If this indeed is the case, then I only ask that you show mercy to those poor souls caught in the path of war."), ("comment_intro_common_liege", "You may be of common birth, but know that I am always looking for good men to fight for me, if they can prove themselves to be worthy of my trust."), ("comment_intro_common_martial", "Perhaps you are not of gentle birth, but if you prove yourself a {man/woman} of valor, then I would be pleased to try my strength against yours in the tournament or on the battlefield."), ("comment_intro_common_badtempered", "Speak quickly, if you have anything to say, for I have no time to be bandying words with common soldiers of fortune."), ("comment_intro_common_pitiless", "You have the look of a mercenary, another vulture come to grow fat on the misery of this land."), ("comment_intro_common_cunning", "Well... I have not heard of you, but you have the look of a {man/woman} who might make something of {himself/herself}, some day."), ("comment_intro_common_sadistic", "Normally I cut the throats of impudent commoners who barge into my presence uninvited, but I am in a good mood today."), ("comment_intro_common_goodnatured", "Well, you look like a good enough sort."), ("comment_intro_common_upstanding", "Peace to you, and always remember to temper your valor with mercy, your courage with honour."), #Actions vis-a-vis civilians ("comment_you_raided_my_village_enemy_benevolent", "You have attacked innocent farmers under my protection in the village of {s51}. I will punish you for your misdeeds!"), ("comment_you_raided_my_village_enemy_spiteful", "You have raided my village of {s51}, destroying my property and killing the tenants. I will take my compensation in blood!"), ("comment_you_raided_my_village_enemy_coldblooded", "You have raided my village of {s51}, destroying my property and killing the tenants. I will make you think twice before you disrupt my revenues like that again."), ("comment_you_raided_my_village_enemy", "You have raided my village of {s51}, destroying my property and killing tenants under my protection. You will pay the price for your crime!"), ("comment_you_raided_my_village_unfriendly_spiteful", "You have raided my village of {s51}. Do it again and I'll gut you like a fish."), ("comment_you_raided_my_village_friendly", "You have raided my village of {s51}. This will place a grave strain on our friendship."), ("comment_you_raided_my_village_default", "You have raided my village of {s51}. If you continue to behave this way, we may soon come to blows."), ("comment_you_robbed_my_village_enemy_coldblooded", "You have robbed my tenants in the village of {s51}. I take that as a personal insult."), ("comment_you_robbed_my_village_enemy", "You have robbed innocent farmers under my protection in the village of {s51}. I will punish you for your misdeeds!"), ("comment_you_robbed_my_village_friendly_spiteful", "I have heard that you pinched some food from my tenants at {s51}. Well, I'll not begrudge you a scrap or two, but keep in mind that I'm the one who must listen to their whining afterward."), ("comment_you_robbed_my_village_friendly", "I have heard that you requisitioned supplies from my tenants at {s51}. I am sure that you would not have done so were you not desperately in need."), ("comment_you_robbed_my_village_default", "You have robbed my tenants in the village of {s51}. If you continue to behave this way, we may soon come to blows."), ("comment_you_accosted_my_caravan_enemy", "You have been accosting caravans under my protection. But your trail of brigandage will soon come to an end."), ("comment_you_accosted_my_caravan_default", "You have been accosting caravans under my protection. This sort of behavior must stop."), ("comment_you_helped_villagers_benevolent", "I heard that you gave charity to my tenants in the village of {s51}. I had been neglectful in my duties as lord and protector, and I appreciate what you have done."), ("comment_you_helped_villagers_friendly_cruel", "I heard that you gave charity to my tenants in the village of {s51}. I appreciate that you meant well, but I'd rather you not undercut my authority like that."), ("comment_you_helped_villagers_friendly", "I heard that you gave charity to my tenants in the village of {s51}. Times are hard, and I know that you mean well, so I will not object to you providing them with assistance."), ("comment_you_helped_villagers_unfriendly_spiteful", "I heard that you gave charity to my tenants in the village of {s51}. As amusing as it is to see you grubbing for favor among my vassals, I would ask you to mind your own business."), ("comment_you_helped_villagers_cruel", "I heard that you gave charity to my tenants in the village of {s51}. As the peasants' lord and protector, it is most properly my duty to assist them in times of hardship. You may mean well, but your actions still undercut my authority. I would thank you to leave them alone."), ("comment_you_helped_villagers_default", "I heard that you gave charity to my tenants in the village of {s51}. Times are hard, and I know that you mean well, but try not to make a habit of it. I am their lord and protector, and I would rather not have them go looking to strangers for assistance."), #Combat-related events ("comment_you_captured_a_castle_allied_friendly", "I heard that you have besieged and taken {s51}. That was a great dead, and I am proud to call you my friend!"), ("comment_you_captured_a_castle_allied_spiteful", "I heard that you have besieged and taken {s51}. Good work! Soon, we will have all their fortresses to despoil, their treasuries to ransack, their grieving widows to serve us our wine."), ("comment_you_captured_a_castle_allied_unfriendly_spiteful", "I heard that you have besieged and taken {s51}. Well, every dog has his day, or so they say. Enjoy it while you can, until your betters kick you back out in the cold where you belong."), ("comment_you_captured_a_castle_allied_unfriendly", "I heard that you have besieged and taken {s51}. Whatever our differences in the past, I must offer you my congratulations."), ("comment_you_captured_a_castle_allied", "I heard that you have besieged and taken {s51}. We have them on the run!"), ("comment_you_captured_my_castle_enemy_spiteful", "I hear that you have broken into my home at {s51}. I hope the dungeon is to your liking, as you will be spending much time there in the years to come."), ("comment_you_captured_my_castle_enemy_chivalrous", "You hold {s51}, my rightful fief. I hope you will give me the chance to win it back!"), ("comment_you_captured_my_castle_enemy", "You have something that belongs to me -- {s51}. I will make you relinquish it."), ###Add some variation to these ("comment_we_defeated_a_lord_unfriendly_spiteful", "I suppose you will want to drink to the memory of our victory over {s54}. Well, save your wine -- it will take more than that to wipe out the stain of your earlier disgraces."), ("comment_we_defeated_a_lord_unfriendly", "I will not forget how we fought together against {s54}, but I can also not forget the other matters that lie between us."), ("comment_we_defeated_a_lord_cruel", "That was a great victory over {s54}, wasn't it? We made of his army a feast for the crows!"), ("comment_we_defeated_a_lord_quarrelsome", "I won't forget how we whipped {s54}? I enjoyed that."), ("comment_we_defeated_a_lord_upstanding", "I will not forget our victory over {s54}. Let us once again give thanks to heaven, and pray that we not grow too proud."), ("comment_we_defeated_a_lord_default", "That was a great victory over {s54}, wasn't it? I am honoured to have fought by your side."), ("comment_we_fought_in_siege_unfriendly_spiteful", "I suppose you will want to drink to the memory of our capture of {s51}. Well, save your wine -- it will take more than that to wipe out the stain of your earlier disgraces."), ("comment_we_fought_in_siege_unfriendly", "I will not forget how we together we stormed {s51}, but I can also not forget the other matters that lie between us."), ("comment_we_fought_in_siege_cruel", "I won't forget how we broke through the walls of {s51} and put its defenders to the sword. It is a sweet memory."), ("comment_we_fought_in_siege_quarrelsome", "Remember how the enemy squealed when we came over the walls of {s51}? They had thought they were safe! We wiped the smug smiles of their faces!"), ("comment_we_fought_in_siege_upstanding", "I will not forget our capture of {s51}. Let us once again give thanks to heaven, and pray that we not grow too proud."), ("comment_we_fought_in_siege_default", "I will not forget how together we captured {s51}. I am honoured to have fought by your side."), ("comment_we_fought_in_major_battle_unfriendly_spiteful", "I suppose you will want to drink to the memory of our great victory near {s51}. Well, save your wine -- it will take more than that to wipe out the stain of your earlier disgraces."), ("comment_we_fought_in_major_battle_unfriendly", "I will not forget how we fought together in the great battle near {s51}, but I can also not forget the other matters that lie between us."), ("comment_we_fought_in_major_battle_cruel", "I won't forget the great battle near {s51}, when we broke through the enemy lines and they ran screaming before us. It is a sweet memory."), ("comment_we_fought_in_major_battle_quarrelsome", "That was a fine fight near {s51}, when we made those bastards run!"), ("comment_we_fought_in_major_battle_upstanding", "I will not forget how we fought side by side at the great battle near {s51}. Let us once again give thanks to heaven, and pray that we not grow too proud."), ("comment_we_fought_in_major_battle_default", "I will not forget how we fought side by side at the great battle near {s51}. I am honoured to have fought by your side."), ("comment_you_defeated_a_lord_allied_liege", "So, you crossed swords with that rascal they call {s54}, and emerged victorious. I am very happy to hear that."), ("comment_you_defeated_a_lord_allied_unfriendly_spiteful", "I heard that you fought and defeated {s54}. Every dog has its day, I suppose."), ("comment_you_defeated_a_lord_allied_spiteful", "I heard that you fought and defeated that dog {s54}. Ah, if only I could have heard him whimpering for mercy."), ("comment_you_defeated_a_lord_allied_unfriendly_chivalrous", "I heard that you fought and defeated {s54}. I hope that you did not use dishonourable means to do so."), ("comment_you_defeated_a_lord_allied", "I heard that you fought and defeated {s54}. I wish you joy of your victory."), ("comment_you_defeated_me_enemy_chivalrous", "I will not begrudge you your victory the last time that we met, but I am anxious for another round!"), ("comment_you_defeated_me_enemy_spiteful", "I have been looking forward to meeting you again. Your tricks will not deceive me a second time, and I will relish hearing your cries for mercy."), ("comment_you_defeated_me_enemy", "When last we met, {playername}, you had the better of me. But I assure you that it will not happen again!"), ("comment_I_defeated_you_enemy_spiteful", "Back for more? Make me fight you again, and I'll feed your bowels to my hounds."), ("comment_I_defeated_you_enemy_chivalrous", "Come to test your valor against me again, {playername}?"), ("comment_I_defeated_you_enemy_benevolent", "So once again you come at me? Will you ever learn?"), ("comment_I_defeated_you_enemy_coldblooded", "You are persistent, but a nuisance."), ("comment_I_defeated_you_enemy", "How many times must I chastise you before you learn to keep your distance?"), ("comment_we_were_defeated_unfriendly_spiteful", "Last I saw you, you had been struck down by the men of {s54}. I blame you for that disaster. What a pity to see that you survived."), ("comment_we_were_defeated_unfriendly", "Last I saw you, you had been struck down by the men of {s54}. Well, I see that you survived."), ("comment_we_were_defeated_cruel", "Last I saw you, you had been struck down by the men of {s54}. Don't worry -- we'll find him, and make him choke on his victory."), ("comment_we_were_defeated_default", "Last I saw you, you had been struck down by the men of {s54}. It is good to see you alive and well."), ("comment_you_were_defeated_allied_friendly_spiteful", "I heard that {s54} gave you a hard time. Don't worry, friend -- I'll find him for you, and make you a gift of his head."), ("comment_you_were_defeated_allied_unfriendly_cruel", "I had heard that {s54} slaughtered your men like sheep. But here you are, alive. Such a disappointment!"), ("comment_you_were_defeated_allied_spiteful", "I heard that {s54} crushed you underfoot like an ant. Hah! Children should not play games made for grown-ups, little {boy/girl}!"), ("comment_you_were_defeated_allied_pitiless", "I heard that {s54} defeated you, and scattered your forces. That is most disappointing..."), ("comment_you_were_defeated_allied_unfriendly_upstanding", "I heard that {s54} defeated you. Perhaps you should consider if you have considered any misdeeds, that might cause heaven to rebuke you in this way."), ("comment_you_were_defeated_allied_unfriendly", "I heard that {s54} defeated you. Look, try not to get too many of our men killed, will you?"), ("comment_you_were_defeated_allied", "I heard that {s54} defeated you. But take heart -- the tables will soon be turned!"), ("comment_you_helped_my_ally_unfriendly_chivalrous", "I heard that you saved {s54} from likely defeat. Whatever else I may think of you, I must at least commend you for that."), ("comment_you_helped_my_ally_unfriendly", "[revelance should be zero, and this message should not appear]"), ("comment_you_helped_my_ally_liege", "I heard that you saved my vassal {s54} from likely defeat. "), ("comment_you_helped_my_ally_unfriendly_spiteful", "I heard that you rode to the rescue of our poor {s54}. Did you think him a damsel in distress? No matter -- it's a common mistake."), ("comment_you_helped_my_ally_spiteful", "I heard that you saved {s54} from a whipping. You should have let him learn his lesson, in my opinion."), ("comment_you_helped_my_ally_chivalrous", "I heard that you got {s54} out of a tight spot. That was a noble deed."), ("comment_you_helped_my_ally_default", "I heard that you got {s54} out of a tight spot. Good work!"), ("comment_you_were_defeated_allied_unfriendly", "I heard that {s54} defeated you. Look, try not to get too many of our men killed, will you?"), ("comment_you_were_defeated_allied", "I heard that {s54} defeated you. But take heart -- the tables will soon be turned!"), ("comment_you_abandoned_us_unfriendly_spiteful", "You worm! You left us alone to face {s54}, didn't you? I spit at you."), ("comment_you_abandoned_us_unfriendly_pitiless", "Well... You abandoned me in the middle of a battle with {s54}, didn't you? I'll see you buried in a traitor's grave."), ("comment_you_abandoned_us_spiteful", "You disappeared in the middle of that battle with {s54}... I hope you have a good explanation. Did your bowels give out? Were you shaking too hard with fear to hold your weapon?"), ("comment_you_abandoned_us_chivalrous", "What happened? You disappeared in the middle of that battle against {s54}. I can only hope that you were too badly wounded to stand, for I would be ashamed to have gone into battle alongside a coward."), ("comment_you_abandoned_us_benefitofdoubt", "What happened? You disappeared in the middle of that battle against {s54}. I assume that you must have been wounded, but it did look suspicious."), ("comment_you_abandoned_us_default", "What happened? One moment you were fighting with us against {s54}, the next moment you were nowhere to be found?"), ("comment_you_ran_from_me_enemy_spiteful", "Last time we met, you ran from me like a whipped dog. Have you come back to bark at me again, or to whine for mercy?"), ("comment_you_ran_from_me_enemy_chivalrous", "Last time we met, you fled from me. Learn to stand and fight like a gentleman!"), ("comment_you_ran_from_me_enemy_benevolent", "When I saw you flee the last time that we met, I had hoped that I would not have to fight you again."), ("comment_you_ran_from_me_enemy_coldblooded", "Last time we met, you fled from me. That was a wise decision"), ("comment_you_ran_from_me_enemy", "You may have been able to escape the last time we crossed paths, but the next time I doubt that you be so lucky."), ("comment_you_ran_from_foe_allied_chivalrous", "They say that you fled from {s54}, leaving your men behind. I pray that this is not true, for such conduct does dishonour to us all."), ("comment_you_ran_from_foe_allied_upstanding", "They say that you fled from {s54}, leaving your men behind. I do not always believe such rumors, and I also know that desperate straits call for desperate measures. But I beg you to take more care of your good name, for men will not fight in our armies if they hear that we abandon them on the field of battle."), ("comment_you_ran_from_foe_allied_spiteful", "By the way, they said that you ran away from {s54} like a quaking little rabbit, leaving your men behind to be butchered. Ha! What a sight that would have been to see!"), ("comment_you_defeated_my_friend_enemy_pragmatic", "You may have bested {s54}, but you cannot defeat us all."), ("comment_you_defeated_my_friend_enemy_chivalrous", "I have heard that you defeated {s54}, and ever since have been anxious to cross swords with you."), ("comment_you_defeated_my_friend_enemy_spiteful", "Your fame runs before you, {playername}. {s54} may have fallen for your tricks, but if you fight me, you'll find a me a much more slippery foe."), ("comment_you_defeated_my_friend_enemy", "They say that you have defeated {s54}. But I will be a truer test of your skill at arms."), ("comment_you_captured_a_lord_allied_friendly_spiteful", "I heard that you captured {s54}. I hope that you squeezed him for every denar."), ("comment_you_captured_a_lord_allied_unfriendly_spiteful", "I heard that you captured {s54}. Your coffers must be well-bloated with ransom by now. Such a pity that money cannot transform a low-born cur into a gentleman!"), ("comment_you_captured_a_lord_allied_chivalrous", "I heard that you captured {s54}. Well done. I assume, of course, that he has been been treated with the honours due his rank."), ("comment_you_captured_a_lord_allied", "I heard that you captured {s54}. Well done. His ransom must be worth quite something."), ("comment_you_let_go_a_lord_allied_chivalrous", "I heard that you captured {s54}, but then let him go. Such chivalry does a credit to our cause."), ("comment_you_let_go_a_lord_allied_upstanding", "I heard that you captured {s54}, but then let him go. Well, that was an honourable course of action, if possibly also a dangerous one."), ("comment_you_let_go_a_lord_allied_coldblooded", "I heard that you captured {s54}, but then let him go. That was most chivalrous of you, but chivalry does not win wars."), ("comment_you_let_go_a_lord_allied_unfriendly_spiteful", "I heard that you captured {s54}, but then let him go. How very chivalrous of you! No doubt the widows and orphans he leaves in his wake will want to commend you in person."), ("comment_you_let_go_a_lord_allied", "I heard that you captured {s54}, but then let him go. Well, I will not tell you what to do with your own prisoners."), ("comment_you_let_me_go_spiteful", "When last we met, you had me at your mercy and allowed me to go free. I hope you enjoyed toying with me, like a cat with a mouse, because soon I will have you at my mercy, to slay or humiliate according to my fancy."), ("comment_you_let_me_go_enemy_chivalrous", "When last we met, you had me at your mercy and allowed me to go free. That was most chivalrous of you, and I will not forget. But I also must remember my oath to my liege, and our kingdoms are still at war."), ("comment_you_let_me_go_enemy_coldblooded", "When last we met, you had me at your mercy and allowed me to go free. But we are still enemies, and I cannot promise to repay your mercy in kind."), ("comment_you_let_me_go_enemy", "When last we met, you had me at your mercy and allowed me to go free. That was kind of you. But we are still at war."), ("comment_you_let_me_go_default", "When last we met, you had me at your mercy and allowed me to go free. That was kind of you, and I am glad that our kingdoms are no longer at war."), #Internal faction events ("comment_pledged_allegiance_allied_martial_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. Pray do not disgrace us by behaving in a cowardly fashion."), ("comment_pledged_allegiance_allied_martial", "I heard that you have pledged allegiance to our lord, {s54}. I look forward to fighting alongside you against our foes."), ("comment_pledged_allegiance_allied_quarrelsome_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. Bah. Do yourself a favor, and stay out of my way."), ("comment_pledged_allegiance_allied_quarrelsome", "I heard that you have pledged allegiance to our lord, {s54}. Fight hard against our foes, respect your betters, and don't cross me, and we'll get along fine."), ("comment_pledged_allegiance_allied_selfrighteous_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. If I were he, I would not trust you to clean the sculleries."), ("comment_pledged_allegiance_allied_selfrighteous", "I heard that you have pledged allegiance to our lord, {s54}. Fight bravely and you will be well-rewarded. Betray us, and we shall make of you the kind of example that will not soon be forgotten."), ("comment_pledged_allegiance_allied_cunning_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. I do not pretend to be happy about his decision, but perhaps it is better to have you inside our tent pissing out, than the other way around."), ("comment_pledged_allegiance_allied_cunning", "I heard that you have pledged allegiance to our lord, {s54}. That is good. The more skilled fighters we have with us in these troubled times, the better. I shall be watching your progress."), ("comment_pledged_allegiance_allied_debauched_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. No doubt you will soon betray him, and I will have the pleasure of watching you die a traitor's death."), ("comment_pledged_allegiance_allied_debauched", "I heard that you have pledged allegiance to our lord, {s54}. Excellent... I am sure that you and I will become very good friends. But remember -- if you betray us, it will be the biggest mistake you will ever make."), ("comment_pledged_allegiance_allied_goodnatured_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. Well, I can't say that I would have trusted you, but perhaps you deserve the benefit of the doubt."), ("comment_pledged_allegiance_allied_goodnatured", "I heard that you have pledged allegiance to our lord, {s54}. Good {man/woman}! Our lord is a noble soul, and rewards loyalty and valor with kindness and generosity."), ("comment_pledged_allegiance_allied_upstanding_unfriendly", "I heard that you have pledged allegiance to our lord, {s54}. Alas, from what I know of you I fear that you will disgrace us, but I will be happy if you prove me wrong."), ("comment_pledged_allegiance_allied_upstanding", "I heard that you have pledged allegiance to our lord, {s54}. Fight against our foes with valor, but also with honour and compassion. A good name is as valuable as a sharp sword or a swift horse in affairs of arms."), ("comment_our_king_granted_you_a_fief_allied_friendly_cruel", "I heard that {s54} granted you {s51} as a fief. Don't forget -- spare the whip and spoil the peasant!"), ("comment_our_king_granted_you_a_fief_allied_friendly_cynical", "I heard that {s54} granted you {s51} as a fief. I am glad to see you prosper -- but be careful. Men are vipers, envious and covetous of their neighbours' wealth. Stay close to me, and I'll watch your back."), ("comment_our_king_granted_you_a_fief_allied_friendly", "I heard that {s54} granted you {s51} as a fief. May your new lands prosper."), ("comment_our_king_granted_you_a_fief_allied_unfriendly_upstanding", "I heard that {s54} granted you {s51} as a fief. But keep in mind that pride goes before a fall."), ("comment_our_king_granted_you_a_fief_allied_unfriendly_spiteful", "I heard that {s54} granted you {s51} as a fief. I suspect, however, that fortune is only raising you up so as to humble you even more, when it casts you back into the dung from whence you came."), ("comment_our_king_granted_you_a_fief_allied_spiteful", "I heard that {s54} granted you {s51} as a fief. Let's hope you are indeed deserving of our lord's favor."), ("comment_our_king_granted_you_a_fief_allied", "I heard that {s54} granted you {s51} as a fief. You seem to be doing very well for yourself."), ("comment_you_renounced_your_alliegance_enemy_friendly", "I heard that you renounced your allegiance to our lord, {s54}. It grieves me that we must now meet on the field of battle."), ("comment_you_renounced_your_alliegance_friendly", "I heard that you renounced your allegiance to our lord, {s54}. Let us pray that we may not come to blows."), ("comment_you_renounced_your_alliegance_unfriendly_spiteful", "I always had you figured for a traitor to {s54}, and now it seems I was proven right. I hope you are prepared to die a traitor's death!"), ("comment_you_renounced_your_alliegance_unfriendly_moralizing", "I heard that you renounced your allegiance to our lord, {s54}. I am forced to consider you a traitor."), ("comment_you_renounced_your_alliegance_enemy", "I heard that you renounced your allegiance to our lord, {s54}. Well, it is the way of the world for old comrades to become enemies."), ("comment_you_renounced_your_alliegance_default", "I heard that you renounced your allegiance to our lord, {s54}. Well, that is your decision, but do not expect me to go easy on you when we meet on the battlefield."), ("personality_archetypes", "liege"), ("martial", "martial"), ("quarrelsome", "bad-tempered"), ("selfrighteous", "pitiless"), ("cunning", "cunning"), ("debauched", "sadistic"), ("goodnatured", "good-natured"), ("upstanding", "upstanding"), ("surrender_demand_default", "Yield or die!"), ("surrender_demand_martial", "The odds are not in your favor today. You may fight us, but there is also no shame if you yield now."), ("surrender_demand_quarrelsome", "I've got you cornered. Give up, or I'll ride you down like a dog."), ("surrender_demand_pitiless", "You cannot defeat me, and I'll teach you a painful lesson if you try. Yield!"), ("surrender_demand_cunning", "You are outmatched today. Give up -- if not for your own sake, then think of your men!"), ("surrender_demand_sadistic", "Surrender or I'll gut you like a fish!"), ("surrender_demand_goodnatured", "We have the advantage of you. Yield, and you will be well-treated."), ("surrender_demand_upstanding", "You may fight us, but many of your men will be killed, and you will probably lose. Yield, and spare us both the unnecessary bloodshed."), ("surrender_offer_default", "Stop! I yield!"), ("surrender_offer_martial", "Stop! I yield!"), ("surrender_offer_quarrelsome", "Enough! You win today, you dog! Ach, the shame of it!"), ("surrender_offer_pitiless", "I yield! You have won. Cursed be this day!"), ("surrender_offer_cunning", "Stop! I yield to you!"), ("surrender_offer_sadistic", "I give up! I give up! Call back your dogs!"), ("surrender_offer_goodnatured", "I yield! Congratulations on your victory, {sir/madame}!"), ("surrender_offer_upstanding", "I yield! Grant me the honours of war, and do yourself credit!"), ("prisoner_released_default", "You have my gratitude, {sir/madame}. I shall not forget your kindness."), ("prisoner_released_martial", "You are indeed a {man/woman} of honour, {sir/madame}. I shall not forget this!"), ("prisoner_released_quarrelsome", "I'm free? Well... Good bye, then."), ("prisoner_released_pitiless", "Thank you. When you are finally defeated, I will request for your death to be swift and merciful. Unless, that is, you care to join us... Good bye, for now."), ("prisoner_released_cunning", "Am I? You are a good {man/woman}. I will try to find a way to repay you."), ("prisoner_released_sadistic", "Am I? So refined is your cruelty, that you would rather see me free and humiliated, than in chains. Enjoy your triumph!"), ("prisoner_released_goodnatured", "You are indeed a {man/woman} of honour, {sir/madame}. I shall not forget this!"), ("prisoner_released_upstanding", "You are indeed a {man/woman} of honour, {sir/madame}. I shall not forget this!"), #Post 0907 changes begin ("enemy_meet_default", "Who are you, that comes in arms against me?"), ("enemy_meet_martial", "What is your name, {sir/madame}? If we come to blows, I would know whom I fight."), ("enemy_meet_quarrelsome", "Who the hell are you?"), ("enemy_meet_pitiless", "Who are you? Speak, so that I may know whom I slay."), ("enemy_meet_cunning", "Tell me your name. It is always good to know your enemy."), ("enemy_meet_sadistic", "Who are you? Speak quick, before I cut your tongue out."), ("enemy_meet_goodnatured", "What is your name, {sir/madame}? If we come to blows, I would know whom I fight."), ("enemy_meet_upstanding", "Who are you, who would come in arms to dispute our righteous cause?"), ("battle_won_default", "You have proven yourself a most valued ally, today."), ("battle_won_martial", "There is no greater fortune than the chance to show one's valor on the field of arms!"), ("battle_won_quarrelsome", "Hah! We showed those bastards a thing or two, there, didn't we?"), ("battle_won_pitiless", "Together, we will make the foe learn to fear our names, and to quail at our coming!"), ("battle_won_cunning", "Now, we must be sure to press our advantage, so that the blood shed today is not wasted."), ("battle_won_sadistic", "Now let us strip their dead and leave them for the crows, so that all will know the fate of those who come against us."), ("battle_won_goodnatured", "That was a good scrap! No joy like the joy of victory, eh?"), ("battle_won_upstanding", "Now, let us give thanks to the heavens for our victory, and mourn the many fine men who have fallen today."), ("battle_won_grudging_default", "You helped turn the tide on the field, today. Whatever I may think of you, I cannot fault you for your valor."), ("battle_won_grudging_martial", "{playername} -- you have shown yourself a worthy {man/woman} today, whatever your misdeeds in the past."), ("battle_won_grudging_quarrelsome", "Hmf. Yours is not a face which I normally like to see, but I suppose today I should thank you for your help."), ("battle_won_grudging_pitiless", "Your help was most valuable today. I would not imagine that you came to help me out of kindness, but I nonetheless thank you."), ("battle_won_grudging_cunning", "It would be unwise of me not to thank you for coming to help me in my hour of need. So... You have my gratitude."), ("battle_won_grudging_sadistic", "Well! How touching! {playername} has come to rescue me."), ("battle_won_grudging_goodnatured", "{playername}! I can't say that we've always gotten along in the past, but you fought well today. My thanks to you!"), ("battle_won_grudging_upstanding", "Perhaps I was wrong about you. Your arrival was most timely. You have my gratitude."), ("battle_won_unfriendly_default", "So you're here. Well, better late than never, I suppose."), ("battle_won_unfriendly_martial", "We have hard harsh words in the past, but for now let us simply enjoy our victory."), ("battle_won_unfriendly_quarrelsome", "If you're standing there waiting for thanks, you can keep waiting. Your help wasn't really needed, but I guess you had nothing better to do, right?"), ("battle_won_unfriendly_pitiless", "You have come here, like a jackal to a lion's kill. Very well then, help yourself to the spoils. I shall not stop you."), ("battle_won_unfriendly_cunning", "{playername}... Well, I suppose your arrival didn't hurt, although I won't pretend that I'm happy to see you."), ("battle_won_unfriendly_sadistic", "Back off, carrion fowl! This was my victory, however hard you try to steal the glory for yourself."), ("battle_won_unfriendly_goodnatured", "Oh, it's you. Well, I suppose I should thank you for your help."), ("battle_won_unfriendly_upstanding", "Thank you for coming to my support. Now I will be off, before I say something that I regret."), ("troop_train_request_default", "I need someone like you to knock them into shape."), ("troop_train_request_martial", "They need someone to show them the meaning of valor."), ("troop_train_request_quarrelsome", "Fat lazy bastards. They make me puke."), ("troop_train_request_pitiless", "They are more afraid of the enemy than they are of me, and this will not do."), ("troop_train_request_cunning", "But men, like swords, are tempered and hardened by fire."), ("troop_train_request_sadistic", "They need someone with steel in his back to flog some courage into them, or kill them trying."), ("troop_train_request_goodnatured", "They're good enough lads, but I am afraid that they are not quite ready for a battle just yet."), ("troop_train_request_upstanding", "It would be tantamount to murder for me to lead them into combat in their current state."), ("unprovoked_attack_default", "What? Why do you attack us? Speak, you rascal!"), ("unprovoked_attack_martial", "I have no objection to a trial of arms, but I would ask you for what reason you attack us?"), ("unprovoked_attack_quarrelsome", "You're making a big mistake, {boy/girl}. What do you think you're doing?"), ("unprovoked_attack_pitiless", "Indeed? If you really want to die today, I'd be more than happy to oblige you, but I am curious as to what you hope to accomplish."), ("unprovoked_attack_cunning", "Really? I think that you are acting most unwisely. What do you hope to gain by this?"), ("unprovoked_attack_sadistic", "What's this? Do you enjoy having your eyes put out?"), ("unprovoked_attack_goodnatured", "Why do you do this? We've got no quarrel, {sir/madame}."), ("unprovoked_attack_upstanding", "I consider this an unprovoked assault, and will protest to your king. Why do you do this?"), ("unnecessary_attack_default", "I will not hesitate to cut you down if pressed, but I will offer you the chance to ride away from this."), ("unnecessary_attack_martial", "I am eager to take you up on your challenge, {sir/madame}, although I will give you a minute to reconsider."), ("unnecessary_attack_quarrelsome", "Bah! I'm in no mood for this nonsense today. Get out of my way."), ("unnecessary_attack_pitiless", "I am in a merciful mood today. I will pretend that I did not hear you."), ("unnecessary_attack_cunning", "I don't see what you have to gain by making an enemy of me. Maybe you should just ride away."), ("unnecessary_attack_sadistic", "I have no time to waste on a worm like you. Get out of my way."), ("unnecessary_attack_goodnatured", "I don't see what you have to gain by picking a fight, {sir/madame}. You can still ride away."), ("unnecessary_attack_upstanding", "If a fight is what you wish, {sir/madame}, then you will have one, but I will yet offer you the chance to back down."), ("lord_challenged_default", "As you wish. Prepare to die!"), ("lord_challenged_martial", "So be it. Defend yourself!"), ("lord_challenged_quarrelsome", "You impudent whelp! I'll crush you!"), ("lord_challenged_pitiless", "If you so badly wish to die, then I have no choice but to oblige you."), ("lord_challenged_cunning", "Well, if you leave me no choice..."), ("lord_challenged_sadistic", "You heap of filth! I'll make you wish you'd never been born."), ("lord_challenged_goodnatured", "Very well. I had hoped that we might avoid coming to blows, but I see that have no choice."), ("lord_challenged_upstanding", "So be it. It saddens me that you cannot be made to see reason."), ("lord_mission_failed_default", "Well, I am disappointed, but I am sure that you will have many chances to redeem yourself."), ("lord_mission_failed_martial", "There is no honour in failing a quest which you endeavoured to take, but I will accept your word on it."), ("lord_mission_failed_quarrelsome", "You failed? Bah. I should have expected as much from the likes of you."), ("lord_mission_failed_pitiless", "You failed? Well. You disappoint me. That is a most unwise thing to do."), ("lord_mission_failed_cunning", "Well, I am disappointed, but no one can guarantee that the winds of fortune will always blow their way."), ("lord_mission_failed_sadistic", "Indeed? Those who fail me do not always live to regret it."), ("lord_mission_failed_goodnatured", "Oh well. It was a long shot, anyway. Thank you for making an effort."), ("lord_mission_failed_upstanding", "Very well. I am sure that you gave it your best effort."), ("lord_follow_refusal_default", "Follow you? You forget your station, {sir/madame}."), ("lord_follow_refusal_martial", "Perhaps if you one day prove yourself a valorous and honourable warrior, then I would follow you. But not today."), ("lord_follow_refusal_quarrelsome", "Follow someone like you? I don't think so."), ("lord_follow_refusal_pitiless", "Lords like me do not follow people like you, {sir/madame}."), ("lord_follow_refusal_cunning", "First show me that you are the type of {man/woman} who will not lead me into disaster, and then perhaps I will follow you."), ("lord_follow_refusal_sadistic", "I think not! Rather, you should follow me, as a whipped cur follows {his/her} master."), ("lord_follow_refusal_goodnatured", "Um, I am a bit pressed with errands right now. Perhaps at a later date."), ("lord_follow_refusal_upstanding", "First show me that you are worthy to lead, and then perhaps I will follow."), ("lord_insult_default", "base varlot"), ("lord_insult_martial", "dishonourable knave"), ("lord_insult_quarrelsome", "filth-swilling bastard"), ("lord_insult_pitiless", "low-born worm"), ("lord_insult_cunning", "careless oaf"), ("lord_insult_sadistic", "sniveling cur"), ("lord_insult_goodnatured", "unpleasant fellow"), ("lord_insult_upstanding", "disgraceful scoundrel"), ("rebellion_dilemma_default", "[liege]"), ("rebellion_dilemma_martial", "{s45} was clearly wronged. Although I gave an oath to {s46}, it does not bind me to support him if he usurped his throne illegally."), ("rebellion_dilemma_quarrelsome", "Hmm. {s46} has never given me my due, so I don't figure I owe him much. However, maybe {s45} will be no better, and {s46} has at least shown himself ."), ("rebellion_dilemma_pitiless", "Hmm. {s45} says {reg3?she:he} is the rightful heir to the throne. That is good -- it absolves me of my oath to {s46}. But still I must weight my decision carefully."), ("rebellion_dilemma_cunning", "Hmm. I gave an oath of homage to {s46}, yet the powerful are not bound by their oaths as our ordinary people. Our duty is to our own ability to rule, to impose order and prevent the war of all against all."), ("rebellion_dilemma_sadistic", "Hmm. In this vile world, a wise man must think of himself, for no one else will. So -- what's in it for me?"), ("rebellion_dilemma_goodnatured", "I do not know what to say. I gave an oath to {s46} as the lawful ruler, but if he is not the lawful ruler, I don't know if I am still bound."), ("rebellion_dilemma_upstanding", "This is troublesome. It is a grave thing to declare my homage to {s46} to be null and void, and dissolve the bonds which keep our land from sinking into anarchy. Yet I am also pledged to support the legitimacy of the succession, and {s45} also has a valid claim to the throne."), ("rebellion_dilemma_2_default", "[liege]"), ("rebellion_dilemma_2_martial", "On the other hand, {s46} has led us in war and peace, and I am loathe to renounce my allegiance."), ("rebellion_dilemma_2_quarrelsome", "So tell me, why should I turn my back on the bastard I know, in favor of {reg3?a woman:the bastard} I don't know?"), ("rebellion_dilemma_2_pitiless", "It is a most perilous position to be in, to be asked whom I would make {reg3?ruler:king} of this land. Yet it is also a time of opportunity, for me to reap the rewards that have always been my due!"), ("rebellion_dilemma_2_cunning", "{s46} has been challenged, and thus he will never be able to rule as strongly as one whose claim has never been questioned. Yet if {s45} takes the throne by force, {reg3?she:he} will not be as strong as one who succeeded peacefully."), ("rebellion_dilemma_2_sadistic", "Perhaps if I join {s45} while {reg3?she:he} is still weak {reg3?she:he} will enrich me, but perhaps if I bring {s46} your head he will give me an even greater reward."), ("rebellion_dilemma_2_goodnatured", "{s46} has always treated me decently, yet it's true that he did wrong to {s45}. I hesitate to renounce my homage to {s46}, yet I also don't think it's right to support injustice."), ("rebellion_dilemma_2_upstanding", "I feel that I must do whatever is best for the realm, to avoid it being laid waste by civil war and ravaged by its enemies."), ("rebellion_prior_argument_very_favorable", "I have already heard some arguments for supporting your candidate for the throne, and I tend to agree with them."), ("rebellion_prior_argument_favorable", "I have already heard some arguments for supporting your candidate for the throne, and I tend to agree with them."), ("rebellion_prior_argument_unfavorable", "I have already heard some arguments for supporting your candidate for the throne, but I do not find them convincing."), ("rebellion_prior_argument_very_unfavorable", "I have already heard some arguments for supporting your candidate for the throne, but I disagree with most of them."), ("rebellion_rival_default", "[liege]"), ("rebellion_rival_martial", "{s49} your ally {s44} once questioned my honour and my bravery. It's not often I get the chance to face him in battle, and make him retract his statement."), ("rebellion_rival_quarrelsome", "{s49} you're working with {s44}. He's a crafty weasel, and I don't trust him one bit."), ("rebellion_rival_pitiless", "{s49} you seem to have enlisted the support of {s44} -- who is soft, and weak, and not fit to govern a fief, and whom I have always detested."), ("rebellion_rival_cunning", "{s49} {s44}, who has already joined you, is headstrong and quarrelsome, and a bit of liability."), ("rebellion_rival_sadistic", "{s49} I have no desire to fight alongside your ally {s44}, who puts on such a nauseating display of virtue."), ("rebellion_rival_goodnatured", "{s49} I'd be reluctant to be on the same side as {s44}, who has quite a reputation for cruelty."), ("rebellion_rival_upstanding", "{s49} your ally {s44} is in my opinion a dangerous, unreliable, and highly unprincipled man."), ("rebellion_argument_favorable", "I respect your line of argument"), ("rebellion_argument_neutral", "I find your line of argument only moderately compelling"), ("rebellion_argument_unfavorable", "I do not find your line of argument compelling"), ("rebellion_persuasion_favorable", "you state your case eloquently"), ("rebellion_persuasion_neutral", "you make a reasonable case"), ("rebellion_persuasion_unfavorable", "you make an unconvincing case"), ("rebellion_relation_very_favorable", "I have the greatest respect for you personally."), ("rebellion_relation_favorable", "I know and respect you personally."), ("rebellion_relation_neutral", "I do not know you as well as I might like."), ("rebellion_relation_unfavorable", "I do not trust you."), ("and_comma_3", "Furthermore, "), ("but_comma_3", "However,"), ("and_comma_1", ", and "), ("but_comma_1", ", but "), ("and_comma_2", ". Moreover, "), ("but_comma_2", ". Nonetheless, "), ("rebellion_agree_default", "[liege]"), ("rebellion_agree_martial", "I have decided. I will back {s45} as the rightful heir."), ("rebellion_agree_quarrelsome", "Ahh, I've thought long enough. I never did like {s46} much anyway. Let's go take his throne away from him."), ("rebellion_agree_pitiless", "You are fortunate. I have decided to join you. Pray do not give me cause to regret this decision."), ("rebellion_agree_cunning", "This is a most dangerous decision, but after careful consideration, I have decided that I will join you. Let's hope it is for the best."), ("rebellion_agree_sadistic", "I have decided. I will back your {reg3?woman:man} {s45}. But you'd best make sure that {reg3?she:he} rewards me well!"), ("rebellion_agree_goodnatured", "All right. I think your {reg3?woman:man} will be a good ruler. I'll join you."), ("rebellion_agree_upstanding", "So be it. My first duty is to this realm, and to save it from lawlessness I will back {s45} and renounce my homage to {s46}. May the Heavens forgive me if I do wrong."), ("rebellion_refuse_default", "[liege]"), ("rebellion_refuse_martial", "I am sorry. {s45} has a good claim, but it's not enough for me to turn my back on {s46}. I will remain loyal to my liege."), ("rebellion_refuse_quarrelsome", "Nah. Your whelp {s45} doesn't have what it takes to rule this realm. I'm sticking with {s46}."), ("rebellion_agree_pitiless", "No. I will not join your rebellion. I count it little more than the tantrum of a child, denied a bauble which {reg3?she:he} thinks should be {reg3?hers:his}. I will stick with {s46}, whose ability to rule is well-tested."), ("rebellion_agree_cunning", "I am sorry. You do not give me reason for confidence that you will win. Many will die, but I do not wish to be among them. I will continue to back {s46}."), ("rebellion_agree_sadistic", "No. I won't play your little game. You grasp at a crown, but I think instead you'll get a quick trip to the scaffold, and I'll be there by {s46}'s side to watch the headsman's axe drop."), ("rebellion_agree_goodnatured", "I am sorry. I don't feel right turning my back on {s46}. No hard feelings when me meet on the battlefield."), ("rebellion_agree_upstanding", "I am sorry. {s45}'s claim is not strong enough for me to inflict the curse of civil disorder on the poor wretches of this land. I will continue to back {s46}. May the Heavens forgive me if I do wrong."), ("talk_later_default", "[liege]"), ("talk_later_martial", "Now is not the time to talk politics! I am here today with my fellow lords, armed for battle. You'd better prepare to fight."), ("talk_later_quarrelsome", "Do you expect me to discuss betraying my liege with you, while we are surrounded by his army? What do you take me for, a bloody idiot?"), ("talk_later_pitiless", "Still your tongue! Whatever I have to say on this matter, I will not say it here and now, while we are in the midst of our army."), ("talk_later_cunning", "This is hardly the time or the place for such a discussion. Perhaps we can discuss it at a later time and a different place, but for now we're still foes."), ("talk_later_sadistic", "You should have your mouth sewn shut! Can you imagine what would happen if the other vassals see me talking to you of treason?"), ("talk_later_goodnatured", "So you wish to discuss your rebellion with me? Try that again when we aren't surrounded by my liege's army, and I will hear what you have to say."), ("talk_later_upstanding", "Whatever my thoughts on the legitimacy of the succession, I am not about to discuss them here and now. If we meet again when we can talk in privacy, I will hear what you have to say on the matter. But for now, consider me your enemy."), ("gossip_about_character_default", "They say that {s6} doesn't possess any interesting character traits."), ("gossip_about_character_martial", "They say that {s6} loves nothing more than war."), ("gossip_about_character_quarrelsome", "They say that {s6} almost came to blows with another lord lately, because the man made a joke about his nose."), ("gossip_about_character_selfrighteous", "I heard that {s6} had a squire executed because the unfortunate man killed a deer in his forest."), ("gossip_about_character_cunning", "They say that {s6} is a cunning opponent."), ("gossip_about_character_sadistic", "They say that {s6} likes to torture his enemies. I wouldn't want to get on the bad side of that man."), ("gossip_about_character_goodnatured", "They say that {s6} is a good man and treats people living in his lands decently. That is more than what can be said for most of the nobles."), ("gossip_about_character_upstanding", "People say that it is good to be in the service of {s6}. He is good to his followers, and rewards them if they work well."), ("latest_rumor", "The latest rumor you heard about {s6} was:"), #steve post 0912 changes begin ("swadian_rebellion_pretender_intro", "I am Isolla, rightful Queen of the Swadians."), ("vaegir_rebellion_pretender_intro", "My name is Valdym. Some men call me 'the Bastard.' I am a prince of the Vaegirs, but by all rights I should be their king, instead of my cousin Yaroglek."), ("khergit_rebellion_pretender_intro", "I am Dustum Khan, son of Janakir Khan, and rightful Khan of the Khergits."), ("nord_rebellion_pretender_intro", "I am Lethwin Far-Seeker, son of Hakrim the Old, who should be king of the Nords of Calradia."), ("rhodok_rebellion_pretender_intro", "I am Lord Kastor, the rightful King of the Rhodoks, who will free them from tyranny."), ("swadian_rebellion_pretender_story_1", "I was the only child of my father, King Esterich. Although I am a woman, he loved me like a son and named me his heir -- not once, but several times, before the grandest nobles of the land so that none could doubt his intention. There is no law that bars a woman from ruling -- indeed, we Swadians tell tales of warrior queens who ruled us in our distant past."), ("vaegir_rebellion_pretender_story_1", "My father died when I was young, leaving me in the care of his brother, the regent Burelek. But rather than hold the throne until I came of age, this usurper used his newfound power to accuse my mother of adultery, and to claim that I was not my father's son. She was executed for treason, and I was declared a bastard."), ("khergit_rebellion_pretender_story_1", "Sanjar Khan and I are brothers, sons of the old Janakir Khan, although of different mothers. Although I was the younger brother, all those who knew the old Khan will testify that throughout my father's life, I was his favorite, entrusted with the responsibilities of government. Sanjar busied himself with hunts and feasts to win the affection of the more dissolate of my father's commanders."), ("nord_rebellion_pretender_story_1", "I am called the Far-Seeker because I have travelled great distances, even by the standards of the Nords, in search of knowledge. Before I came of age, my father sent me abroad on a tour of study at the courts and universities in the lands overseas. If the Nords are to call themselves the heirs of the Calradian empire, then they must act the part, and know something of law and letters, and not call themselves content merely to fight, plunder, and drink."), ("rhodok_rebellion_pretender_story_1", "The Rhodoks are a free people, and not slaves to any hereditary monarch. The king must be chosen from one of the leading noble families of the land, by a council drawn by lot from the patricians of the cities of Jelkala, Veluca, and Yalen. The council meets on a field before Jelkala, and no man is allowed to appear in arms during their deliberations, on pain of death."), ("swadian_rebellion_pretender_story_2", "Yet when my father died, his cousin Harlaus convinced the nobles that no Swadian king of sound mind could name a woman as his heir. Harlaus said that his designation of me was the act of a madman, and thus had no legal standing, and that he, as my father's closest male relative, should of take the throne."), ("vaegir_rebellion_pretender_story_2", "I was smuggled abroad by a faithful servant, but now I am of age and have returned to reclaim what is rightfully mine. Burelek died soon after his act of perfidy -- the judgment of heaven, no doubt. His son Yaroglek now calls himself king, but as his claim is tainted, he is no less a usurper than his father, and I will topple him from his throne."), ("khergit_rebellion_pretender_story_2", "According to Khergit custom, when a man dies his herds are split between all his sons, equally. So too it is with the khanate. When I heard of my father's death, I was away inspecting our borders, but I hurried home to Tulga, ready to give Sanjar his due and share the khanate with him. But when I arrived, I found that he rushed his supporters to the court, to have himself proclaimed as the sole khan."), ("nord_rebellion_pretender_story_2", "My father died however before I completed my course of study, and as I hurried home to claim his throne my ship was wrecked by a storm. One of my father's thanes, Ragnar, seized this opportunity and spread rumors that I had died abroad. He summoned a gathering of his supporters to have himself proclaimed king, and has taken the past few years to consolidate his power."), ("rhodok_rebellion_pretender_story_2", "During the last selection, there were but two candidates, myself, and Lord Graveth. While the council was deliberating, Graveth appeared, sword in hand, telling them that a Swadian raiding party was about to descend on the field of deliberation -- which was true, by the way -- and if he were not elected king, then he would leave them to their fate."), ("swadian_rebellion_pretender_story_3", "I will admit that I did my cause no good by cursing Harlaus and all who listened to him as traitors, but I also believe that the magistrates who ruled in his favor were bought. No matter -- I will raise an army of loyal subjects, who would honour their old king's memory and will. And if anyone doubts that a woman can wield power, then I will prove them wrong by taking Harlaus' ill-gotten crown away from him."), ("vaegir_rebellion_pretender_story_3", "Until I have my rights restored in the sight of all the Vaegirs, I will bear the sobriquet, 'the Bastard', to remind me of what I must do."), ("khergit_rebellion_pretender_story_3", "My brother thinks that Khergits will only respect strength: a leader who takes what he wants, when he wants it. But I think that he misreads the spirit of our people.--we admire a resolute leader, but even more we a just one, and we know that a man who does not respect his own brother's rights will not respect the rights of his followers."), ("nord_rebellion_pretender_story_3", "So I remain in exile -- except now I am not looking for sages to tutor me in the wisdom of faraway lands, but warriors, to come with me back to the land of the Nords and regain my throne. If Ragnar doubts my ability to rule, then let him say so face to face, as we stare at each other over the rims of our shields. For a warrior can be a scholar, and a scholar a warrior, and to my mind, only one who combines the two is fit to be king!"), ("rhodok_rebellion_pretender_story_3", "Well, Graveth defeated the Swadians, and for that, as a Rhodok, I am grateful. When I am king, I will myself place the wreath of victory on his head. But after that I will have it separated from his shoulders, for by his actions he has shown himself a traitor to the Rhodok confederacy and its sacred custom."), ("swadian_rebellion_monarch_response_1", "Isolla thinks she should be Queen of the Swadians? Well, King Esterich had a kind heart, and doted on his daughter, but a good-hearted king who doesn't use his head can be a curse to his people. Isolla may tell you stories of warrior queens of old, but you might also recall that all the old legends end in the same way -- with the Swadians crushed underfoot by the armies of the Calradic Emperor."), ("vaegir_rebellion_monarch_response_1", "Were Valdym to come to me in peace, I would laden him with titles and honours, and he would become the greatest of my vassals. But as he comes in war, I will drag him before me in chains and make him acknowledge me as rightful sovereign, then cut his tongue from his mouth so that he cannot recant."), ("khergit_rebellion_monarch_response_1", "My brother Dustum has perhaps told you of his insistence upon splitting the khanate, as though it were a herd of sheep. Let me tell you something. Ever since the Khergits established themselves on this land, the death of every khan has had the same result -- the land was divided, the khan's sons went to war, and the strongest took it all anyway. I simply had the foresight to stave off the civil war in advance."), ("nord_rebellion_monarch_response_1", "Lethwin 'Far-Seeker'? Lethwin Inkfingers, is more like it. Perhaps you have heard the expression, 'Unhappy is the land whose king is a child.' Unhappy too is the land whose king is a student. You want the Nords to be ruled by a beardless youth, whose hand bears no callouses left by a sword's grip, who has never stood in a shield wall? If Lethwin were king, his thanes would laugh at him to his face!"), ("rhodok_rebellion_monarch_response_1", "No doubt Lord Kastor told you that I defiled the hallowed Rhodok custom by interfering with the patricians' election of a king. Well, let me tell you something. The patricians of the towns make longwinded speeches about our ancient liberties, but then choose as their king whichever noble last sat in their villa and sipped a fine wine and promised to overlook their unpaid taxes."), ("swadian_rebellion_monarch_response_2", "Those who weep for the plight of a Swadian princess denied her father's throne should reflect instead on the fate of a Swadian herdswoman seized by a Vaegir raider and taken as chattel to the slave markets. Talk to me of queens and old stories when our warlike neighbors are vanquished, and our land is at peace."), ("vaegir_rebellion_monarch_response_2", "Whatever my father may or may not have done to secure the throne does not matter. I have inherited it, and that is final. If every old claim were to be brought up anew, if every man's inheritance could be called into question at any time, then it would be the end of the institution of kingship, and we would live in a state of constant civil war."), ("khergit_rebellion_monarch_response_2", "Dustum would make a fine assessor of flocks, or adjudicator of land disputes. But can you imagine such a man as khan? We would be run off of our land in no time by our neighbors, and return to our old days of starving and freezing on the steppe."), ("nord_rebellion_monarch_response_2", "Old Hakrim may have had fancy ideas about how to dispose of his kingdom, but it is not just royal blood that makes a King of the Nords. I am king by acclamation of the thanes, and by right of being the strongest. That counts for more than blood, and woe to any man in this land who says otherwise."), ("rhodok_rebellion_monarch_response_2", "The only liberty that concerns them is their liberty to grow fat. Meanwhile, my men sleep out on the steppe, and eat dry bread and salt fish, and scan the horizon for burning villages, and shed our blood to keep the caravan routes open. Here's an idea -- if I ever meet a merchant who limps from a Khergit arrow-wound or a Swadian sword-stroke, then I'll say, 'Here's a man whose counsel is worth taking.'"), #steve post 0912 changes end ########################## # Form Ranks strings begin # Important note: Make sure the order of strings here is consistent with # the formation type assignments' in module_constants.py, # including number of types!!! ("formation_array_1", "Main Battle"), ("formation_array_2", "Vaward Battle"), ("formation_array_3", "Rearward Battle"), ("formation_array_4", "Forth Battle"), ("formation_array_5", "Fifth Battle"), ("formation_array_6", "Sixth Battle"), ("formation_array_7", "Seventh Battle"), ("formation_array_8", "Eighth Battle"), ("formation_array_end", "formation_array_end"), ("formation_order_panel_array_1", "Main"), ("formation_order_panel_array_2", "Vaward"), ("formation_order_panel_array_3", "Rearward"), ("formation_order_panel_array_4", "Forth"), ("formation_order_panel_array_5", "Fifth"), ("formation_order_panel_array_6", "Sixth"), ("formation_order_panel_array_7", "Seventh"), ("formation_order_panel_array_8", "Eighth"), ("formation_order_panel_array_end", "formation_array_end"), ("formation_command_line", "line"), ("formation_command_phalanx", "phalanx"), ("formation_command_wedge", "wedge"), ("formation_command_square", "square"), ("formation_command_line_pl", "lines"), ("formation_command_phalanx_pl", "phalanxes"), ("formation_command_wedge_pl", "wedges"), ("formation_command_square_pl", "squares"), ("formation_command_end", "formation_command_end"), ("formation_advance", "advance"), ("formation_move_back", "move back"), ("formation_move_left", "move left"), ("formation_move_right", "move right"), ("formation_turn_left", "turn left"), ("formation_turn_right", "turn right"), ("formation_halt", "halt"), ("formation_charge", "charge"), ("formation_fall_back", "fall back"), ("formation_stand_closer", "stand closer"), ("formation_spread_out", "spread out"), ("key_array_selection_1", "Main Battle!"), ("key_array_selection_2", "Vaward Battle!"), ("key_array_selection_3", "Rearward Battle!"), ("key_array_selection_4", "Forth Battle!"), ("key_array_selection_5", "Fifth Battle!"), ("key_array_selection_6", "Sixth Battle!"), ("key_array_selection_7", "Seventh Battle!"), ("key_array_selection_8", "Eighth Battle!"), ("key_array_select_all", "All Battles!"), ("key_formation_selection", "Next formation"), ("key_formation_selection_backward", "Previous formation"), ("key_formation_tighten", "Stand closer"), ("key_formation_disperse", "Spread out"), ("key_formation_follow", "Follow me"), ("key_formation_hold_pos", "Hold this position"), ("key_auto_rotation_toggle", "Auto rotation"), ("key_apply_formation", "Apply formation"), ("key_formation_charge", "Charge"), ("key_formation_fall_back", "Fall back"), ("key_formation_halt", "Halt"), ("key_formation_tactical_charge", "Tactical charge"), ("key_formation_move_forward", "Move forward"), ("key_formation_move_backward", "Move backward"), ("key_formation_move_left", "Move left"), ("key_formation_move_right", "Move right"), ("key_formation_turn_left", "Turn left"), ("key_formation_turn_right", "Turn right"), ("key_dismiss_formation", "Dismiss formation"), ("key_formation_view_orders", "View orders"), ("formation_key_names_end", "formation_key_names_end"), # # Form Ranks strings end ########################## ("credits_1", "Mount&Blade Copyright 2001-2008 Taleworlds Entertainment"), ("credits_2", "Game design:^Armagan Yavuz^Steve Negus^Cem Cimenbicer"), ("credits_3", "Programming:^Armagan Yavuz^Cem Cimenbicer"), ("credits_4", "CG Artists:^Ipek Yavuz^Ozgur Saral^Mustafa Ozturk"), ("credits_8", "Animation:^Pinar Cekic^Umit Singil"), ("credits_5", "Concept Artist:^Ganbat Badamkhand"), ("credits_6", "Writing:^Steve Negus^Ryan A. Span^Armagan Yavuz"), ("credits_9", "Original Music:^Jesse Hopkins"), ("credits_7", "Additional Modeling:^Hilmi Aric^Ahmet Sarisakal^Katie Beedham^^^Additional Writing:^Michael Buhler^Patrick Desjardins^^^Voice Talents:^Tassilo Egloffstein^Jade E Henderson^^^\ Original Music Composed by:^Jesse Hopkins^\ Violin Solos Performed by:^Zoriy Zinger^\ Main Theme and Scherzo Performed by:^The Russian State Symphony Cinema Orchestra, Conducted by Sergei Skripka^^^\ Sound Samples:^Audiosparx.com^^^\ Mount&Blade Map Editor:^Matt Stentiford^^^\ Taleworlds Forum Programming:^Brett Flannigan www.fenrisoft.com^^^\ Mount&Blade Tutorial written by:^Edward Spoerl^^^\ Gameplay Videos:^Jemes Muia^^^\ Motion Capture System:^NaturalPoint-Optitrack Arena^^^\ Horse Motion Capture Animation Supplied by:^Richard Widgery & Kinetic Impulse^^^\ Ragdoll Physics:^Newton Game Dynamics^^^\ Sound and Music Program Library:^FMOD Sound System by Firelight Technologies^^^\ Copy Protection:^Themida by Oreans Technologies^^^\ Skybox Textures:^Jay Weston www.hyperfocaldesign.com^^^\ Third Party Art Libraries Used:^Texturemonk^Mayang Textures^cgtextures.com^3d.sk^^\ Unofficial Mount&Blade Editor:^Josh Dahlby^^^\ Many thanks to Marco Tarini for the Mountain shader idea!^^^\ Special Thanks to:^Ibrahim Dogan^Nova Language Works^Selim Kurtulus and UPS Turkey^^^\ Taleworlds.com Forum Administrators and Moderators:^Janus^Archonsod^Narcissus^Nairagorn^Lost Lamb^Deus Ex^Merentha^Volkier^Okin^Instag0\ ^Deniz^ego^Guspav^Hallequin^Invictus^okiN^Raz^rejenorst^Skyrage^ThVaz^^^\ Spanish Translation^^Translators:^Anabel 'Rhaenys' Diaz^Analia 'Immortality' Dobarro^Anoik^^Medieval Consultant:^Enric 'Palafoxx' Clave^^Language Tester:^Theo de Moree^^^\ Mount&Blade Community Suggestions and Feedback:^\ 13 Chain Bloody Spider^\ Aenarion^\ AgentSword^\ Ahadhran^\ Albino^\ Allegro^\ allthesedamnnamesare^\ Amman de Stazia^\ Ancientwanker^\ Anrea 'Skree' Giongiani^\ Aqtai^\ Art Falmingaid^\ bryce777^\ Bugman^\ Buxton^\ Calandale^\ Cartread^\ Chel^\ Chilly5^\ Cirdan^\ Cleaning agent^\ Cymro^\ DaBlade^\ DaLagga^\ Damien^\ danover^\ Dearahn^\ Deathblow^\ Destichado^\ Dryvus^\ dunnno^\ D'Sparil^\ ealabor^\ Ealdormann Hussey^\ EasyCo506^\ El Duke^\ Elias Maluco^\ Eogan^\ ex_ottoyuhr^\ Fisheye^\ Fossi^\ fujiwara^\ Fuzzpilz^\ GandalfTheGrey^\ Gerif^\ Grocat^\ Guspav^\ Halden The Borch shooter^\ Hallequin^\ Handel^\ Hardcode^\ Haupper^\ Hellequin^\ Highelf^\ Highlander^\ Ibrahim Turgut^\ Iesu^\ Ilex^\ Ingolifs^\ Invictus^\ Itchrelief^\ Jlgx50^\ JHermes^\ Jik^\ john259^\ JonathanStrange^\ jpgray^\ kamov23^\ Kayback^\ Khalid Ibn Walid^\ KON_Air^\ Lady Tanith^\ Larry Knight^\ LavaLampMaster^\ Leprechaun^\ Lhorkan^\ Llew2^\ Maelstorm^\ Manitas^\ Maw^\ MAXHARDMAN^\ Merentha^\ Merlkir^\ Michael Elijah 'ironpants' Bell-Rao^\ mihoshi^\ Mirathei^\ mkeller^\ Momaw^\ Morgoth2005^\ MrCrotch^\ mtarini^\ n00854180t^\ Naridill^\ Nicholas Altaman\ okiN^\ oksir^\ Oldtimer^\ Ollieh^\ oRGy^\ Oubliette^\ Patrick 'nox' Gallaty^\ Pavlov^\ Rando^\ Raz^\ rejenorst^\ Rjii^\ Ron Losey^\ Rorthic^\ RR_raptor^\ Scion^\ Seff^\ shenzay^\ Shadowmoses^\ shikamaru 1993^\ Silver^\ silverkatana^\ Sir Prince^\ Sirgigor^\ Skyrage^\ Smoson^\ sneakey pete^\ Stefano^\ Stella^\ Stonewall382^\ Talak^\ Tankai^\ TG^\ thelast^\ The Phoenix^\ The Pope^\ The Yogi^\ Thingy Master^\ Thormac^\ Thus_Spake_Nosferatu^\ ThVaz^\ Toygar Birinci^\ Tuckles^\ Tul^\ Ursca^\ Vaerraent^\ Vilhjalmr^\ Volkier^\ vuk^\ Wanderer^\ WhoCares^\ Winter^\ Worbah^\ Yoshiboy^\ ...and many many other wonderful Mount&Blade players!^^\ (This is only a small sample of all the players who have contributed to the game by providing suggestions and feedback.^\ This list has been compiled by sampling only a few threads in the Taleworlds Forums.^\ Unfortunately compiling an exhaustive list is almost impossible.^\ We apologize sincerely if you contributed your suggestions and feedback but were not listed here, and please know that we are grateful to you all the same...)\ "), ("credits_10", "Paradox Interactive^^President and CEO:^Theodore Bergqvist^^Executive Vice President:^Fredrik Wester\ ^^Chief Financial Officer:^Lena Eriksson^^Finance & Accounting:^Annlouise Larsson^^VP Sales & Marketing US:^Reena M. Miranda\ ^^VP Sales & Marketing EU:^Martin Sirc^^Distribution Manager Nordic:^Erik Helmfridsson^^Director of PR & Marketing:^Susana Meza\ ^^PR & Marketing:^Sofia Forsgren^^Product Manager:^Boel Bermann\ "), ("credits_11", "Logotype:^Jason Brown^^Cover Art:^Piotr Fox Wysocki\ ^^Layout:^Christian Sabe^Melina Grundel^^Poster:^Piotr Fox Wysocki^^Map & Concept Art:^Ganbat Badamkhand\ ^^Manual Editing:^Digital Wordsmithing: Ryan Newman, Nick Stewart^^Web:^Martin Ericsson^^Marketing Assets:^2Coats\ ^^Localization:^S&H Entertainment Localization^^GamersGate:^Ulf Hedblom^Andreas Pousette^Martin Ericson^Christoffer Lindberg\ "), ("credits_12", "Thanks to all of our partners worldwide, in particular long-term partners:\ ^Koch Media (Germany & UK)^Blue Label (Italy & France)^Friendware (Spain)^New Era Interactive Media Co. Ltd. (Asia)\ ^Snowball (Russia)^Pinnacle (UK)^Porto Editora (Portugal)^Hell-Tech (Greece)^CD Projekt (Poland, Czech Republic, Slovakia & Hungary)\ ^Paradox Scandinavian Distribution (Scandinavia)\ "), ]
Python
from header_particle_systems import * #psf_always_emit = 0x0000000002 #psf_global_emit_dir = 0x0000000010 #psf_emit_at_water_level = 0x0000000020 #psf_billboard_2d = 0x0000000100 # up_vec = dir, front rotated towards camera #psf_billboard_3d = 0x0000000200 # front_vec point to camera. #psf_billboard_drop = 0x0000000300 #psf_turn_to_velocity = 0x0000000400 #psf_randomize_rotation = 0x0000001000 #psf_randomize_size = 0x0000002000 #psf_2d_turbulance = 0x0000010000 #################################################################################################################### # Each particle system contains the following fields: # # 1) Particle system id (string): used for referencing particle systems in other files. # The prefix psys_ is automatically added before each particle system id. # 2) Particle system flags (int). See header_particle_systems.py for a list of available flags # 3) mesh-name. #### # 4) Num particles per second: Number of particles emitted per second. # 5) Particle Life: Each particle lives this long (in seconds). # 6) Damping: How much particle's speed is lost due to friction. # 7) Gravity strength: Effect of gravity. (Negative values make the particles float upwards.) # 8) Turbulance size: Size of random turbulance (in meters) # 9) Turbulance strength: How much a particle is affected by turbulance. #### # 10,11) Alpha keys : Each attribute is controlled by two keys and # 12,13) Red keys : each key has two fields: (time, magnitude) # 14,15) Green keys : For example scale key (0.3,0.6) means # 16,17) Blue keys : scale of each particle will be 0.6 at the # 18,19) Scale keys : time 0.3 (where time=0 means creation and time=1 means end of the particle) # # The magnitudes are interpolated in between the two keys and remain constant beyond the keys. # Except the alpha always starts from 0 at time 0. #### # 20) Emit Box Size : The dimension of the box particles are emitted from. # 21) Emit velocity : Particles are initially shot with this velocity. # 22) Emit dir randomness # 23) Particle rotation speed: Particles start to rotate with this (angular) speed (degrees per second). # 24) Particle rotation damping: How quickly particles stop their rotation #################################################################################################################### particle_systems = [ ("game_rain", psf_billboard_2d|psf_global_emit_dir|psf_always_emit, "prtcl_rain", 500, 0.5, 0.33, 1.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (1.0, 0.3), (1, 0.3), #alpha keys (1.0, 1.0), (1, 1.0), #red keys (1.0, 1.0), (1, 1.0), #green keys (1.0, 1.0), (1, 1.0), #blue keys (1.0, 1.0), (1.0, 1.0), #scale keys (8.2, 8.2, 0.2), #emit box size (0, 0, -10.0), #emit velocity 0.0, #emit dir randomness 0, #rotation speed 0.5 #rotation damping ), ("game_snow", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_snow_fall_1", 150, 2, 0.2, 0.1, 30, 20, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.2, 1), (1, 1), #alpha keys (1.0, 1.0), (1, 1.0), #red keys (1.0, 1.0), (1, 1.0), #green keys (1.0, 1.0), (1, 1.0), #blue keys (1.0, 1.0), (1.0, 1.0), #scale keys (10, 10, 0.5), #emit box size (0, 0, -5.0), #emit velocity 1, #emit dir randomness 200, #rotation speed 0.5 #rotation damping ), ## ("game_blood", psf_billboard_3d|psf_randomize_size|psf_randomize_rotation, "prtcl_dust_a", ## 50, 0.65, 0.95, 1.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength ## (0.3, 0.3), (1, 0.2), #alpha keys ## (1.0, 0.4), (1, 0.05), #red keys ## (1.0, 0.05),(1, 0.05), #green keys ## (1.0, 0.05),(1, 0.05), #blue keys ## (0.3, 0.5), (1.0, 2.5), #scale keys ## (0.04, 0.01, 0.01), #emit box size ## (0, 1, 0.0), #emit velocity ## 0.05, #emit dir randomness ## 0, #rotation speed ## 0.5 #rotation damping ## ), ## ("game_blood", psf_billboard_3d |psf_randomize_size|psf_randomize_rotation, "prt_mesh_blood_1", 500, 0.65, 3, 0.5, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.0, 0.7), (0.7, 0.7), #alpha keys (0.1, 0.7), (1, 0.7), #red keys (0.1, 0.7), (1, 0.7), #green keys (0.1, 0.7), (1, 0.7), #blue keys (0.0, 0.015), (1, 0.018), #scale keys (0, 0.05, 0), #emit box size (0, 1.0, 0.3), #emit velocity 0.9, #emit dir randomness 0, #rotation speed 0, #rotation damping ), ("game_blood_2", psf_billboard_3d | psf_randomize_size|psf_randomize_rotation , "prt_mesh_blood_3", 2000, 0.6, 3, 0.3, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.0, 0.25), (0.7, 0.1), #alpha keys (0.1, 0.7), (1, 0.7), #red keys (0.1, 0.7), (1, 0.7), #green keys (0.1, 0.7), (1, 0.7), #blue keys (0.0, 0.15), (1, 0.35), #scale keys (0.01, 0.2, 0.01), #emit box size (0.2, 0.3, 0), #emit velocity 0.3, #emit dir randomness 150, #rotation speed 0, #rotation damping ), # ("game_hoof_dust", psf_billboard_3d|psf_randomize_size|psf_randomize_rotation, "prtcl_dust_a", # 50, 1.0, 0.95, -0.1, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength # (0.0, 0.5), (1, 0.0), #alpha keys # (1.0, 0.9), (1, 0.05), #red keys # (1.0, 0.8),(1, 0.05), #green keys # (1.0, 0.7),(1, 0.05), #blue keys # (0.0, 7.5), (1.0, 15.5), #scale keys # (0.2, 0.3, 0.2), #emit box size # (0, 0, 2.5), #emit velocity # 0.05, #emit dir randomness # 100, #rotation speed # 0.5 #rotation damping # ), ("game_hoof_dust", psf_billboard_3d|psf_randomize_size|psf_randomize_rotation|psf_2d_turbulance, "prt_mesh_dust_1",#prt_mesh_dust_1 5, 2.0, 10, 0.05, 10.0, 39.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.2, 0.5), (1, 0.0), #alpha keys (0, 1), (1, 1), #red keys (0, 0.9),(1, 0.9), #green keys (0, 0.78),(1, 0.78), #blue keys (0.0, 2.0), (1.0, 3.5), #scale keys (0.2, 0.3, 0.2), #emit box size (0, 0, 3.9), #emit velocity 0.5, #emit dir randomness 130, #rotation speed 0.5 #rotation damping ), ("game_hoof_dust_snow", psf_billboard_3d|psf_randomize_size, "prt_mesh_snow_dust_1",#prt_mesh_dust_1 6, 2, 3.5, 1, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.2, 1), (1, 1), #alpha keys (0, 1), (1, 1), #red keys (0, 1),(1, 1), #green keys (0, 1),(1, 1), #blue keys (0.5, 4), (1.0, 5.7), #scale keys (0.2, 1, 0.1), #emit box size (0, 0, 1), #emit velocity 2, #emit dir randomness 0, #rotation speed 0 #rotation damping ), ("game_hoof_dust_mud", psf_billboard_2d|psf_randomize_size|psf_randomize_rotation|psf_2d_turbulance, "prt_mesh_mud_1",#prt_mesh_dust_1 5, .7, 10, 3, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0, 1), (1, 1), #alpha keys (0, .7), (1, .7), #red keys (0, 0.6),(1, 0.6), #green keys (0, 0.4),(1, 0.4), #blue keys (0.0, 0.2), (1.0, 0.22), #scale keys (0.15, 0.5, 0.1), #emit box size (0, 0, 15), #emit velocity 6, #emit dir randomness 200, #rotation speed 0.5 #rotation damping ), ("game_water_splash_1", psf_billboard_3d|psf_randomize_size|psf_randomize_rotation|psf_emit_at_water_level, "prtcl_drop", 20, 0.85, 0.25, 0.9, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.3, 0.5), (1, 0.0), #alpha keys (1.0, 1.0), (1, 1.0), #red keys (1.0, 1.0), (1, 1.0), #green keys (1.0, 1.0), (1, 1.0), #blue keys (0.0, 0.3), (1.0, 0.18), #scale keys (0.3, 0.2, 0.1), #emit box size (0, 1.2, 2.3), #emit velocity 0.3, #emit dir randomness 50, #rotation speed 0.5 #rotation damping ), ("game_water_splash_2", psf_billboard_3d|psf_randomize_size|psf_randomize_rotation|psf_emit_at_water_level, "prtcl_splash_b", 30, 0.4, 0.7, 0.5, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.3, 1.0), (1, 0.3), #alpha keys (1.0, 1.0), (1, 1.0), #red keys (1.0, 1.0), (1, 1.0), #green keys (1.0, 1.0), (1, 1.0), #blue keys (0.0, 0.25), (1.0, 0.7), #scale keys (0.4, 0.3, 0.1), #emit box size (0, 1.3, 1.1), #emit velocity 0.1, #emit dir randomness 50, #rotation speed 0.5 #rotation damping ), ("game_water_splash_3", psf_emit_at_water_level , "prt_mesh_water_wave_1", 5, 2.0, 0, 0.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.03, 0.2), (1, 0.0), #alpha keys (1.0, 1.0), (1, 1.0), #red keys (1.0, 1.0), (1, 1.0), #green keys (1.0, 1.0), (1, 1.0), #blue keys (0.0, 3), (1.0, 10), #scale keys (0.0, 0.0, 0.0), #emit box size (0, 0, 0), #emit velocity 0.0, #emit dir randomness 0, #rotation speed 0.5 #rotation damping ), ("torch_fire", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1", 50, 0.35, 0.2, 0.03, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.5, 0.8), (1, 0), #alpha keys (0.5, 1.0), (1, 0.9), #red keys (0.5, 0.7),(1, 0.3), #green keys (0.5, 0.2), (1, 0.0), #blue keys (0, 0.15), (0.4, 0.3), #scale keys (0.04, 0.04, 0.01), #emit box size (0, 0, 0.5), #emit velocity 0.0, #emit dir randomness 200, #rotation speed 0.5 #rotation damping ), ("fire_glow_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prt_mesh_fire_2", 2, 0.55, 0.2, 0.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.5, 0.9), (1, 0), #alpha keys (0.0, 0.9), (1, 0.9), #red keys (0.0, 0.7),(1, 0.7), #green keys (0.0, 0.4), (1, 0.4), #blue keys (0, 2), (1.0, 2), #scale keys (0.0, 0.0, 0.0), #emit box size (0, 0, 0), #emit velocity 0.0, #emit dir randomness 0, 0 ), ("fire_glow_fixed", psf_billboard_3d|psf_global_emit_dir, "prt_mesh_fire_2", 4, 100.0, 0.2, 0.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (-0.01, 1.0), (1, 1.0), #alpha keys (0.0, 0.9), (1, 0.9), #red keys (0.0, 0.7),(1, 0.7), #green keys (0.0, 0.4), (1, 0.4), #blue keys (0, 2), (1.0, 2), #scale keys (0.0, 0.0, 0.0), #emit box size (0, 0, 0), #emit velocity 0.0, #emit dir randomness 0, 0 ), ("torch_smoke", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prtcl_dust_a", 15, 0.5, 0.2, -0.2, 10.0, 0.1, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.5, 0.25), (1, 0), #alpha keys (0.0, 0.2), (1, 0.1), #red keys (0.0, 0.2),(1, 0.09), #green keys (0.0, 0.2), (1, 0.08), #blue keys (0, 0.5), (0.8, 2.5), #scale keys (0.1, 0.1, 0.1), #emit box size (0, 0, 1.5), #emit velocity 0.1 #emit dir randomness ), ("flue_smoke_short", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prtcl_dust_a", 15, 1.5, 0.1, -0.0, 10.0, 12, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.0, 0.3), (1, 0), #alpha keys (0.0, 0.2), (1, 0.1), #red keys (0.0, 0.2),(1, 0.09), #green keys (0.0, 0.2), (1, 0.08), #blue keys (0, 1.5), (1, 7), #scale keys (0, 0, 0), #emit box size (0, 0, 1.5), #emit velocity 0.1, #emit dir randomness 150, 0.8, ), ("flue_smoke_tall", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prtcl_dust_a", 15, 3, 0.5, -0.0, 15.0, 12,#num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0, 0.35), (1, 0), #alpha keys (0.0, 0.3), (1, 0.1), #red keys (0.0, 0.3),(1, 0.1), #green keys (0.0, 0.3), (1, 0.1), #blue keys (0, 2), (1, 7), #scale keys (0, 0, 0), #emit box size (0, 0, 1.5), #emit velocity 0.1, #emit dir randomness 150, 0.5, ), ("war_smoke_tall", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prt_mesh_smoke_1", 5, 12, 0, 0, 7, 7, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0, 0.25), (1, 0), #alpha keys (0.0, 1), (1, 0.8), #red keys (0.0, 1),(1, 0.8), #green keys (0.0, 1), (1, 0.8), #blue keys (0, 2.2), (1, 15), #scale keys (0, 0, 0), #emit box size (0, 0, 2.2), #emit velocity 0.1, #emit dir randomness 100, 0.2, ), ("torch_fire_sparks", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size, "prt_sparks_mesh_1", 10, 0.7, 0.2, 0, 10.0, 0.02, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.66, 1), (1, 0), #alpha keys (0.1, 0.7), (1, 0.7), #red keys (0.1, 0.5),(1, 0.5), #green keys (0.1, 0.1), (1, 0.1), #blue keys (0.1, 0.05), (1, 0.05), #scale keys (0.1, 0.1, 0.1), #emit box size (0, 0, 0.9), #emit velocity 0.0, #emit dir randomness 0, 0, ), ("fire_sparks_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size, "prt_sparks_mesh_1", 10, 1.5, 0.2, 0, 3, 10, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.6, 1), (1, 1), #alpha keys (0.1, 0.7), (1, 0.7), #red keys (0.1, 0.5),(1, 0.5), #green keys (0.1, 0.1), (1, 0.1), #blue keys (0.1, 0.07), (1, 0.03), #scale keys (0.17, 0.17, 0.01), #emit box size (0, 0, 1), #emit velocity 0.0, #emit dir randomness 0, 0, ), ("pistol_smoke", psf_billboard_3d, "prtcl_dust_a", 90, 2.5, 0.6, -0.2, 60.0, 1.5, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.0, 0.75), (1, 0), #alpha keys (0.0, 0.7), (1, 0.4), #red keys (0.0, 0.7),(1, 0.4), #green keys (0.0, 0.7), (1, 0.4), #blue keys (0, 1.5), (0.5, 11.0), #scale keys (0.1, 0.1, 0.1), #emit box size (2, 2, 0), #emit velocity 0.1 #emit dir randomness ), # ("cooking_fire", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prtcl_fire", # 50, 0.5, 0.2, -0.05, 30.0, 0.3, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength # (0.5, 1), (1, 1), #alpha keys # (0.5, 1.0), (1, 0.9), #red keys # (0.5, 0.4), (1, 0.1), #green keys # (0.5, 0.2), (1, 0.0), #blue keys # (0.3, 0.9), (0.9, 2), #scale keys # (0.07, 0.07, 0.01), #emit box size # (0, 0, 0.1), #emit velocity # 0.1 #emit dir randomness # ), ("brazier_fire_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1", 25, 0.5, 0.1, 0.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.5, 0.4), (1.0, 0), #alpha keys (0.5, 1.0), (1.0, 0.9), #red keys (0.5, 0.7),(1.0, 0.3), #green keys (0.5, 0.2), (1, 0.0), #blue keys (0.1, 0.2), (1.0, 0.5), #scale keys (0.1, 0.1, 0.01), #emit box size (0.0, 0.0, 0.4), #emit velocity 0.0, #emit dir randomness 100, #rotation speed 0.2 #rotation damping ), # ("cooking_smoke", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prt_mesh_steam_1", # 3, 3.5, 0.4, -0.03, 10.0, 10.9, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength # (0.4, 1), (1, 0), #alpha keys # (0.0, 0.6), (1, 0.3), #red keys # (0.0, 0.6),(1, 0.3), #green keys # (0.0, 0.6), (1, 0.3), #blue keys # (0, 2.5), (0.9, 7.5), #scale keys # (0.1, 0.1, 0.06), #emit box size # (0, 0, 1.3), #emit velocity # 0.2, #emit dir randomness # 200, #rotation speed # 0.2, #rotation damping # ), ("cooking_fire_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1", 25, 0.35, 0.1, 0.03, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.5, 0.8), (1, 0), #alpha keys (0.5, 0.5*1.0), (1, 0.3*0.9), #red keys (0.5, 0.5*0.7),(1, 0.3*0.3), #green keys (0.5, 0.5*0.2), (1, 0.0), #blue keys (0.1, 0.5), (1, 1), #scale keys (0.05, 0.05, 0.01), #emit box size (0, 0, 1), #emit velocity 0.0, #emit dir randomness 200, #rotation speed 0.0 #rotation damping ), ("cooking_smoke", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prt_mesh_smoke_1", 4, 4, 0.1, 0, 3, 5, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.2, 0.20), (1.0, 0.0), #alpha keys (0.0, 0.8), (1.0, 1.0), #red keys (0.0, 0.8),(1.0, 1.0), #green keys (0.0, 0.85), (1.0, 1.0), #blue keys (0.0, 0.65), (1.0, 3.0), #scale keys (0.0, 0.0, 0.0), #emit box size (0.0, 0.0, 1.2), #emit velocity 0.0, #emit dir randomness 0, 0, ), ("food_steam", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prt_mesh_steam_1", 3, 1, 0, 0, 8.0, 1, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.5, 0.1), (1, 0), #alpha keys (0.0, 1), (1, 0.1), #red keys (0.0, 1),(1, 0.1), #green keys (0.0, 1), (1, 0.1), #blue keys (0, 0.2), (0.9, 0.5), #scale keys (0.05, 0.05, 0), #emit box size (0, 0, 0.1), #emit velocity 0, #emit dir randomness 100, #rotation speed 0.5, #rotation damping ), ("candle_light", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prt_mesh_candle_fire_1", 7, 1.1, 0.6, -0.0, 10.0, 0.2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.1, 0.5), (1, 0), #alpha keys (0.5, 1.0), (1, 0.9), #red keys (0.5, 0.6), (1, 0.1), #green keys (0.5, 0.2), (1, 0.0), #blue keys (0.3, 0.2), (1, 0.0), #scale keys (0.0, 0.0, 0.0), #emit box size (0, 0, 0.09), #emit velocity 0, #emit dir randomness 0, #rotation speed 0 #rotation damping ), ("candle_light_small", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prt_mesh_candle_fire_1", 4, 1.1, 0.6, -0.0, 10.0, 0.2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.1, 0.8), (1, 0), #alpha keys (0.5, 1.0), (1, 0.9), #red keys (0.5, 0.6), (1, 0.1), #green keys (0.5, 0.2), (1, 0.0), #blue keys (0.3, 0.13), (1, 0.0), #scale keys (0.0, 0.0, 0.0), #emit box size (0, 0, 0.06), #emit velocity 0, #emit dir randomness 0, #rotation speed 0 #rotation damping ), ("lamp_fire", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_rotation|psf_randomize_size, "prt_mesh_fire_1", 10, 0.8, 0.6, -0.0, 10.0, 0.4, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.1, 0.5), (1, 0), #alpha keys (0.5, 1.0), (1, 0.9), #red keys (0.5, 0.8), (1, 0.1), #green keys (0.5, 0.4), (1, 0.0), #blue keys (0.3, 0.35), (0.9, 0.5), #scale keys (0.01, 0.01, 0.0), #emit box size (0, 0, 0.35), #emit velocity 0.03, #emit dir randomness 100, #rotation speed 0.5, #rotation damping ), #*-*-*-*-* D U M M Y *-*-*-*-# ("dummy_smoke", psf_billboard_3d|psf_randomize_size, "prt_mesh_dust_1", 500, 3, 15, -0.05, 10.0, 0.2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.1, 0.5), (1, 0), #alpha keys (0.1, 0.8), (1, 0.8), #red keys (0.1, 0.7),(1, 0.7), #green keys (0.1, 0.6), (1, 0.7), #blue keys (0.0, 0.7), (1, 2.2), #scale keys (0.2, 0.2, 0.5), #emit box size (0, 0, 0.05), #emit velocity 2, #emit dir randomness 10, #rotation speed 0.1, #rotation damping ), ("dummy_straw", psf_randomize_size | psf_randomize_rotation, "prt_mesh_straw_1", 500, 1, 2, 0.9, 10, 2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.1, 1), (1, 1), #alpha keys (0.1, 0.6), (1, 0.6), #red keys (0.1, 0.5),(1, 0.5), #green keys (0.1, 0.4), (1, 0.4), #blue keys (0.0, 0.3), (1, 0.3), #scale keys (0.2, 0.2, 0.5), #emit box size (0, 0, 0), #emit velocity 2.3, #emit dir randomness 200, #rotation speed 0, #rotation damping ), #*-*-*-*-* D U M M Y E N D *-*-*-*-# #*-*-*-*-* GOURD *-*-*-*-# ("gourd_smoke", psf_billboard_3d|psf_randomize_size, "prt_mesh_dust_1", 500, 3, 15, -0.05, 10.0, 0.2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.1, 0.5), (1, 0), #alpha keys (0.1, 0.8), (1, 0.8), #red keys (0.1, 0.7),(1, 0.7), #green keys (0.1, 0.6), (1, 0.7), #blue keys (0.0, 0.5), (1, 1), #scale keys (0.2, 0.2, 0.5), #emit box size (0, 0, 0.05), #emit velocity 2, #emit dir randomness 10, #rotation speed 0.1, #rotation damping ), ("gourd_piece_1", psf_randomize_rotation, "prt_gourd_piece_1", 15, 1, 2, 0.9, 10, 2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.1, 1), (1, 1), #alpha keys (0.1, 0.6), (1, 0.6), #red keys (0.1, 0.5),(1, 0.5), #green keys (0.1, 0.4), (1, 0.4), #blue keys (0.0, 1), (1, 1), #scale keys (0.2, 0.2, 0.5), #emit box size (0, 0, 0), #emit velocity 2.3, #emit dir randomness 200, #rotation speed 0, #rotation damping ), ("gourd_piece_2", psf_randomize_size | psf_randomize_rotation, "prt_gourd_piece_2", 50, 1, 2, 0.9, 10, 2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.1, 1), (1, 1), #alpha keys (0.1, 0.6), (1, 0.6), #red keys (0.1, 0.5),(1, 0.5), #green keys (0.1, 0.4), (1, 0.4), #blue keys (0.0, 1), (1, 1), #scale keys (0.2, 0.2, 0.5), #emit box size (0, 0, 0), #emit velocity 2.3, #emit dir randomness 200, #rotation speed 0, #rotation damping ), ## ("rat_particle", psf_global_emit_dir|psf_2d_turbulance | psf_randomize_size |psf_billboard_3d, "rat_particle", ## 500, 4, 0, 0, 20, 10, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength ## (0.1, 1), (1, 1), #alpha keys ## (0.1, 0.6), (1, 0.6), #red keys ## (0.1, 0.5),(1, 0.5), #green keys ## (0.1, 0.4), (1, 0.4), #blue keys ## (0.1, 1), (1, 1), #scale keys ## (0.1, 0.1, 0.1), #emit box size ## (0, 0, 0), #emit velocity ## 5, #emit dir randomness ## ), #*-*-*-**** BLOOD ****-*-*-*# ##("blood_hit_1", psf_billboard_3d | psf_randomize_size , "prt_mesh_blood_1", ## 5000, 0.5, 6, 0.5, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength ## (0.1, 1), (1, 0), #alpha keys ## (0.1, 0.6), (1, 0.6), #red keys ## (0.1, 0.5),(1, 0.5), #green keys ## (0.1, 0.4), (1, 0.4), #blue keys ## (0.0, 0.05), (1, 0.05), #scale keys ## (0, 0.5, 0), #emit box size ## (0, -1, 0), #emit velocity ## 1.5, #emit dir randomness ## 0, #rotation speed ## 0, #rotation damping ## ), ## #("blood_hit_2", 0 , "prt_mesh_blood_2", ## # 500, 0.3, 0,0, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength ## # (0.1, 1), (1, 0.0), #alpha keys ## # (0.1, 0.6), (1, 0.6), #red keys ## # (0.1, 0.5),(1, 0.5), #green keys ## # (0.1, 0.4), (1, 0.4), #blue keys ## # (0.0, 0.4), (1, 2), #scale keys ## # (0.0, 0.0, 0.0), #emit box size ## # (0, -0.1, 0), #emit velocity ## # 0, #emit dir randomness ## # 0, #rotation speed ## # 0, #rotation damping ## # ), ## ("blood_hit_3", psf_billboard_3d | psf_randomize_size , "prt_mesh_blood_3", ## 500, 0.3, 1,0.0, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength ## (0.1, 1), (1, 0.0), #alpha keys ## (0.1, 0.6), (1, 0.6), #red keys ## (0.1, 0.5),(1, 0.5), #green keys ## (0.1, 0.4), (1, 0.4), #blue keys ## (0.0, 0.2), (1, 0.8), #scale keys ## (0.0, 0.3, 0.0), #emit box size ## (0, 1, 0), #emit velocity ## 1, #emit dir randomness ## 250, #rotation speed ## 0, #rotation damping ## ), #*-*-*-**** BLOOD END ****-*-*-*# #-*-*-*- Fire Fly Deneme *-*-*-*-# ("fire_fly_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prt_sparks_mesh_1", 2, 5, 1.2, 0, 50, 7, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.1, 0.8), (1, 0.2), #alpha keys (0.5, .7), (1, 0.7), #red keys (0.5, 0.8), (1, 0.8), #green keys (0.5, 1), (1, 1), #blue keys (0, 0.1), (1, 0.1), #scale keys (20, 20, 0.5), #emit box size (0, 0, 0), #emit velocity 5, #emit dir randomness 0, #rotation speed 0 #rotation damping ), ("bug_fly_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prt_mesh_snow_dust_1", 5, 5, 1.2, 0, 50, 20, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.1, 1), (1, 1), #alpha keys (0, 0), (1, 0), #red keys (0, 0), (1, 0), #green keys (0, 0), (1, 0), #blue keys (0, 0.05), (1, 0.05), #scale keys (20, 20, 0.5), #emit box size (0, 0, 0), #emit velocity 5, #emit dir randomness 100, #rotation speed 0.5, #rotation damping ), #-*-*-*- Fire Fly End*-*-*-*-# #-*-*-*- Moon Beam *-*-*-*-*-*-*# ("moon_beam_1", psf_billboard_2d|psf_global_emit_dir|psf_always_emit|psf_randomize_size, "prt_mesh_moon_beam",#prt_mesh_moon_beam 2, 4, 1.2, 0, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.5, 1), (1, 0), #alpha keys (0, 0.4), (1, 0.4), #red keys (0, 0.5), (1, 0.5), #green keys (0, 0.6), (1, 0.6), #blue keys (0, 2), (1, 2.2), #scale keys (1, 1, 0.2), #emit box size (0, 0, -2), #emit velocity 0, #emit dir randomness 100, #rotation speed 0.5, #rotation damping ), ("moon_beam_paricle_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size, "prt_sparks_mesh_1", 10, 1.5, 1.5, 0, 10, 10, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.5, 1), (1, 0.0), #alpha keys (0.5, .5), (1, 0.5), #red keys (0.5, 0.7), (1, 0.7), #green keys (0.5, 1), (1, 1), #blue keys (0, 0.1), (1, 0.1), #scale keys (1, 1, 4), #emit box size (0, 0, 0), #emit velocity 0.5, #emit dir randomness 0, #rotation speed 0 #rotation damping ), #-*-*-*- Moon Beam End *-*-*-*-*-*-*# #-*-*-*- Stone Smoke *-*-*-*-*-*-*# ##("stone_hit_1", psf_billboard_3d | psf_randomize_size | psf_randomize_rotation, "prt_mesh_dust_1", ## 5000, 0.5, 6, 0.1, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength ## (0.1, .2), (1, 0), #alpha keys ## (0.5, 0.7), (1, 0.7), #red keys ## (0.5, 0.6), (1, 0.6), #green keys ## (0.5, 0.6), (1, 0.6), #blue keys ## (0.0, .2), (1, 0.7), #scale keys ## (0, 0.3, 0), #emit box size ## (0, 0, 0), #emit velocity ## 1.1, #emit dir randomness ## 200, #rotation speed ## 0.8, #rotation damping ## ), #-*-*-*- Stone Smoke END -*-*-*-*-*# ("night_smoke_1", psf_billboard_3d|psf_global_emit_dir|psf_always_emit, "prt_mesh_dust_1", 5, 10, 1.5, 0, 50, 2, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.3, 0.2), (1, 0), #alpha keys (0.5, 0.5), (1, 0.5), #red keys (0.5, 0.5), (1, 0.5), #green keys (0.5, 0.5), (1, 0.6), #blue keys (0, 10), (1, 10), #scale keys (25, 25, 0.5), #emit box size (0, 1, 0), #emit velocity 2, #emit dir randomness 20, #rotation speed 1 #rotation damping ), #-*-*-*- Fire For Fireplace -*-*-*-# ("fireplace_fire_small", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1", 25, 0.8, 0.2, -0.1, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.5, 0.5), (1, 0), #alpha keys (0.5, 1.0), (1, 0.9), #red keys (0.5, 0.7),(1, 0.3), #green keys (0.5, 0.2), (1, 0.0), #blue keys (0, 0.2), (1, 0.7), #scale keys (0.2, 0.1, 0.01), #emit box size (0, 0, 0.2), #emit velocity 0.1, #emit dir randomness 100, #rotation speed 0.5 #rotation damping ), ("fireplace_fire_big", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1", 35, 0.6, 0.2, -0.2, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.5, 0.5), (1, 0), #alpha keys (0.5, 1.0), (1, 0.9), #red keys (0.5, 0.7),(1, 0.3), #green keys (0.5, 0.2), (1, 0.0), #blue keys (0, 0.4), (1, 1), #scale keys (0.4, 0.2, 0.01), #emit box size (0, 0, 0.4), #emit velocity 0.1, #emit dir randomness 100, #rotation speed 0.5 #rotation damping ), #-*-*-*- Fire For Fireplace -*-*-*-# #-*-*-*- Village Fire *-*-*-*-# ("village_fire_big", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1", 50, 1.0, 0, -1.2, 25.0, 10.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.2, 0.7), (1, 0), #alpha keys (0.2, 1.0), (1, 0.9), #red keys (0.2, 0.7),(1, 0.3), #green keys (0.2, 0.2), (1, 0.0), #blue keys (0, 2), (1, 6), #scale keys (2.2, 2.2, 0.2), #emit box size (0, 0, 0.0), #emit velocity 0.0, #emit dir randomness 250, #rotation speed 0.3 #rotation damping ), ("village_fire_smoke_big", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_smoke_1", 30, 2, 0.3, -1, 50.0, 10.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.5, 0.15), (1, 0), #alpha keys (0.2, 0.4), (1, 0.2), #red keys (0.2, 0.4),(1, 0.2), #green keys (0.2, 0.4), (1, 0.2), #blue keys (0, 6), (1, 8), #scale keys (2, 2, 1), #emit box size (0, 0, 5), #emit velocity 0.0, #emit dir randomness 0, #rotation speed 0.1 #rotation damping ), ("map_village_fire", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1", 20, 1.0, 0, -0.2, 3.0, 3.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.2, 0.7), (1, 0), #alpha keys (0.2, 1.0), (1, 0.9), #red keys (0.2, 0.7),(1, 0.3), #green keys (0.2, 0.2), (1, 0.0), #blue keys (0, 0.15), (1, 0.45), #scale keys (0.2, 0.2, 0.02), #emit box size (0, 0, 0.0), #emit velocity 0.0, #emit dir randomness 250, #rotation speed 0.3 #rotation damping ), ("map_village_fire_smoke", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_smoke_1", 25, 2.5, 0.3, -0.15, 3.0, 3.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.5, 0.15), (1, 0), #alpha keys (0.2, 0.4), (1, 0.3), #red keys (0.2, 0.4),(1, 0.3), #green keys (0.2, 0.4), (1, 0.3), #blue keys (0, 0.6), (1, 0.9), #scale keys (0.2, 0.2, 0.1), #emit box size (0, 0, 0.03), #emit velocity 0.0, #emit dir randomness 0, #rotation speed 0.1 #rotation damping ), ("map_village_looted_smoke", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_smoke_1", 20, 3, 0.3, -0.11, 3.0, 2.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.5, 0.15), (1, 0), #alpha keys (0.2, 0.5), (1, 0.5), #red keys (0.2, 0.5),(1, 0.5), #green keys (0.2, 0.5), (1, 0.5), #blue keys (0, 0.7), (1, 1.3), #scale keys (0.2, 0.2, 0.1), #emit box size (0, 0, 0.015), #emit velocity 0.0, #emit dir randomness 0, #rotation speed 0.1 #rotation damping ), ##### Dungeon Water Drops ##### ("dungeon_water_drops", psf_billboard_2d|psf_global_emit_dir|psf_always_emit, "prtcl_rain", 1, 1, 0.33, 0.8, 0, 0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (1.0, 0.2), (1, 0.2), #alpha keys (1.0, 1.0), (1, 1.0), #red keys (1.0, 1.0), (1, 1.0), #green keys (1.0, 1.0), (1, 1.0), #blue keys (1.0, 0.8), (1.0, 0.8), #scale keys (0.05, 0.05, 0.5), #emit box size (0, 0, -5.0), #emit velocity 0.0, #emit dir randomness 0, #rotation speed 0, #rotation damping ), ##### Dungeon Water Drops END ##### ############################### # Form Ranks kit section # ###command_cursor_minimod_begin### ("fat_arrow", psf_always_emit|psf_billboard_2d|psf_global_emit_dir, "arrow_up_rot", 100, 0.1, 0.0, 0.0, 100.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.0, 0.7), (1.0, 0.7), #alpha keys (0.0, 0.0), (1.0, 0.0), #red keys (0.0, 1.0), (1.0, 1.0), #green keys (0.0, 0.0), (1.0, 0.0), #blue keys (0, 30), (1.0, 30.0), #scale keys (0.0, 0.0, 0.0), #emit box size (0.0, 0.0, 0.0), #emit velocity 0.0, #emit dir randomness 0, 0 ), ("fat_arrow_rising", psf_always_emit|psf_billboard_2d|psf_global_emit_dir, "arrow_up_rot", 100, 3, 0.0, 0.0, 0.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength (0.0, 0.7), (1.0, 0.7), #alpha keys (0.25, 0.0), (1, 1.0), #red keys (0.0, 1.0),(0.5, 0.0), #green keys (0.0, 0.0), (1, 0.0), #blue keys (0, 30), (1.0, 30), #scale keys (0.0, 0.0, 0.0), #emit box size (0.0, 0, 3), #emit velocity 0.0, #emit dir randomness 0, 0 ), ###command_cursor_minimod)end### # # Form Ranks kit section end ############################### ]
Python
p_main_party = 0 p_temp_party = 1 p_camp_bandits = 2 p_temp_party_2 = 3 p_temp_casualties = 4 p_temp_casualties_2 = 5 p_temp_casualties_3 = 6 p_temp_wounded = 7 p_temp_killed = 8 p_main_party_backup = 9 p_encountered_party_backup = 10 p_collective_friends_backup = 11 p_player_casualties = 12 p_enemy_casualties = 13 p_ally_casualties = 14 p_collective_enemy = 15 p_collective_ally = 16 p_collective_friends = 17 p_zendar = 18 p_town_1 = 19 p_town_2 = 20 p_town_3 = 21 p_town_4 = 22 p_town_5 = 23 p_town_6 = 24 p_town_7 = 25 p_town_8 = 26 p_town_9 = 27 p_town_10 = 28 p_town_11 = 29 p_town_12 = 30 p_town_13 = 31 p_town_14 = 32 p_town_15 = 33 p_town_16 = 34 p_town_17 = 35 p_town_18 = 36 p_castle_1 = 37 p_castle_2 = 38 p_castle_3 = 39 p_castle_4 = 40 p_castle_5 = 41 p_castle_6 = 42 p_castle_7 = 43 p_castle_8 = 44 p_castle_9 = 45 p_castle_10 = 46 p_castle_11 = 47 p_castle_12 = 48 p_castle_13 = 49 p_castle_14 = 50 p_castle_15 = 51 p_castle_16 = 52 p_castle_17 = 53 p_castle_18 = 54 p_castle_19 = 55 p_castle_20 = 56 p_castle_21 = 57 p_castle_22 = 58 p_castle_23 = 59 p_castle_24 = 60 p_castle_25 = 61 p_castle_26 = 62 p_castle_27 = 63 p_castle_28 = 64 p_castle_29 = 65 p_castle_30 = 66 p_castle_31 = 67 p_castle_32 = 68 p_castle_33 = 69 p_castle_34 = 70 p_castle_35 = 71 p_castle_36 = 72 p_castle_37 = 73 p_castle_38 = 74 p_castle_39 = 75 p_castle_40 = 76 p_village_1 = 77 p_village_2 = 78 p_village_3 = 79 p_village_4 = 80 p_village_5 = 81 p_village_6 = 82 p_village_7 = 83 p_village_8 = 84 p_village_9 = 85 p_village_10 = 86 p_village_11 = 87 p_village_12 = 88 p_village_13 = 89 p_village_14 = 90 p_village_15 = 91 p_village_16 = 92 p_village_17 = 93 p_village_18 = 94 p_village_19 = 95 p_village_20 = 96 p_village_21 = 97 p_village_22 = 98 p_village_23 = 99 p_village_24 = 100 p_village_25 = 101 p_village_26 = 102 p_village_27 = 103 p_village_28 = 104 p_village_29 = 105 p_village_30 = 106 p_village_31 = 107 p_village_32 = 108 p_village_33 = 109 p_village_34 = 110 p_village_35 = 111 p_village_36 = 112 p_village_37 = 113 p_village_38 = 114 p_village_39 = 115 p_village_40 = 116 p_village_41 = 117 p_village_42 = 118 p_village_43 = 119 p_village_44 = 120 p_village_45 = 121 p_village_46 = 122 p_village_47 = 123 p_village_48 = 124 p_village_49 = 125 p_village_50 = 126 p_village_51 = 127 p_village_52 = 128 p_village_53 = 129 p_village_54 = 130 p_village_55 = 131 p_village_56 = 132 p_village_57 = 133 p_village_58 = 134 p_village_59 = 135 p_village_60 = 136 p_village_61 = 137 p_village_62 = 138 p_village_63 = 139 p_village_64 = 140 p_village_65 = 141 p_village_66 = 142 p_village_67 = 143 p_village_68 = 144 p_village_69 = 145 p_village_70 = 146 p_village_71 = 147 p_village_72 = 148 p_village_73 = 149 p_village_74 = 150 p_village_75 = 151 p_village_76 = 152 p_village_77 = 153 p_village_78 = 154 p_village_79 = 155 p_village_80 = 156 p_village_81 = 157 p_village_82 = 158 p_village_83 = 159 p_village_84 = 160 p_village_85 = 161 p_village_86 = 162 p_village_87 = 163 p_village_88 = 164 p_village_89 = 165 p_village_90 = 166 p_salt_mine = 167 p_four_ways_inn = 168 p_test_scene = 169 p_battlefields = 170 p_dhorak_keep = 171 p_training_ground = 172 p_training_ground_1 = 173 p_training_ground_2 = 174 p_training_ground_3 = 175 p_training_ground_4 = 176 p_training_ground_5 = 177 p_bridge_1 = 178 p_bridge_2 = 179 p_bridge_3 = 180 p_bridge_4 = 181 p_bridge_5 = 182 p_bridge_6 = 183 p_bridge_7 = 184 p_bridge_8 = 185 p_bridge_9 = 186 p_bridge_10 = 187 p_bridge_11 = 188 p_bridge_12 = 189 p_bridge_13 = 190 p_bridge_14 = 191 p_bridge_15 = 192 p_looter_spawn_point = 193 p_steppe_bandit_spawn_point = 194 p_forest_bandit_spawn_point = 195 p_mountain_bandit_spawn_point = 196 p_sea_raider_spawn_point_1 = 197 p_sea_raider_spawn_point_2 = 198 p_spawn_points_end = 199
Python
from header_meshes import * #################################################################################################################### # Each mesh record contains the following fields: # 1) Mesh id: used for referencing meshes in other files. The prefix mesh_ is automatically added before each mesh id. # 2) Mesh flags. See header_meshes.py for a list of available flags # 3) Mesh resource name: Resource name of the mesh # 4) Mesh translation on x axis: Will be done automatically when the mesh is loaded # 5) Mesh translation on y axis: Will be done automatically when the mesh is loaded # 6) Mesh translation on z axis: Will be done automatically when the mesh is loaded # 7) Mesh rotation angle over x axis: Will be done automatically when the mesh is loaded # 8) Mesh rotation angle over y axis: Will be done automatically when the mesh is loaded # 9) Mesh rotation angle over z axis: Will be done automatically when the mesh is loaded # 10) Mesh x scale: Will be done automatically when the mesh is loaded # 11) Mesh y scale: Will be done automatically when the mesh is loaded # 12) Mesh z scale: Will be done automatically when the mesh is loaded #################################################################################################################### meshes = [ ("pic_bandits", 0, "pic_bandits", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_mb_warrior_1", 0, "pic_mb_warrior_1", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_messenger", 0, "pic_messenger", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_prisoner_man", 0, "pic_prisoner_man", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_prisoner_fem", 0, "pic_prisoner_fem", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_prisoner_wilderness", 0, "pic_prisoner_wilderness", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_siege_sighted", 0, "pic_siege_sighted", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_siege_sighted_fem", 0, "pic_siege_sighted_fem", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_camp", 0, "pic_camp", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_payment", 0, "pic_payment", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_escape_1", 0, "pic_escape_1", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_escape_1_fem", 0, "pic_escape_1_fem", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_victory", 0, "pic_victory", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_defeat", 0, "pic_defeat", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_wounded", 0, "pic_wounded", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_wounded_fem", 0, "pic_wounded_fem", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_steppe_bandits", 0, "pic_steppe_bandits", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_mountain_bandits", 0, "pic_mountain_bandits", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_sea_raiders", 0, "pic_sea_raiders", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_deserters", 0, "pic_deserters", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_forest_bandits", 0, "pic_forest_bandits", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_cattle", 0, "pic_cattle", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_looted_village", 0, "pic_looted_village", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_village_p", 0, "pic_village_p", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_village_s", 0, "pic_village_s", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_village_w", 0, "pic_village_w", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_recruits", 0, "pic_recruits", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_arms_swadian", 0, "pic_arms_swadian", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_arms_vaegir", 0, "pic_arms_vaegir", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_arms_khergit", 0, "pic_arms_khergit", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_arms_nord", 0, "pic_arms_nord", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("pic_arms_rhodok", 0, "pic_arms_rhodok", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("portrait_blend_out", 0, "portrait_blend_out", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("load_window", 0, "load_window", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("checkbox_off", render_order_plus_1, "checkbox_off", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("checkbox_on", render_order_plus_1, "checkbox_on", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("white_plane", 0, "white_plane", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("white_dot", 0, "white_dot", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("player_dot", 0, "player_dot", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("flag_infantry", 0, "flag_infantry", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("flag_archers", 0, "flag_archers", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("flag_cavalry", 0, "flag_cavalry", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("color_picker", 0, "color_picker", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("custom_map_banner_01", 0, "custom_map_banner_01", 0, 0, 0, -90, 0, 90, 1, 1, 1), ("custom_map_banner_02", 0, "custom_map_banner_02", 0, 0, 0, -90, 0, 90, 1, 1, 1), ("custom_map_banner_03", 0, "custom_map_banner_03", 0, 0, 0, -90, 0, 90, 1, 1, 1), ("custom_banner_01", 0, "custom_banner_01", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("custom_banner_02", 0, "custom_banner_02", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("custom_banner_bg", 0, "custom_banner_bg", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg01", 0, "custom_banner_fg01", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg02", 0, "custom_banner_fg02", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg03", 0, "custom_banner_fg03", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg04", 0, "custom_banner_fg04", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg05", 0, "custom_banner_fg05", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg06", 0, "custom_banner_fg06", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg07", 0, "custom_banner_fg07", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg08", 0, "custom_banner_fg08", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg09", 0, "custom_banner_fg09", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg10", 0, "custom_banner_fg10", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg11", 0, "custom_banner_fg11", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg12", 0, "custom_banner_fg12", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg13", 0, "custom_banner_fg13", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg14", 0, "custom_banner_fg14", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg15", 0, "custom_banner_fg15", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg16", 0, "custom_banner_fg16", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg17", 0, "custom_banner_fg17", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg18", 0, "custom_banner_fg18", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg19", 0, "custom_banner_fg19", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg20", 0, "custom_banner_fg20", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg21", 0, "custom_banner_fg21", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg22", 0, "custom_banner_fg22", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_fg23", 0, "custom_banner_fg23", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_01", 0, "custom_banner_charge_01", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_02", 0, "custom_banner_charge_02", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_03", 0, "custom_banner_charge_03", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_04", 0, "custom_banner_charge_04", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_05", 0, "custom_banner_charge_05", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_06", 0, "custom_banner_charge_06", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_07", 0, "custom_banner_charge_07", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_08", 0, "custom_banner_charge_08", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_09", 0, "custom_banner_charge_09", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_10", 0, "custom_banner_charge_10", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_11", 0, "custom_banner_charge_11", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_12", 0, "custom_banner_charge_12", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_13", 0, "custom_banner_charge_13", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_14", 0, "custom_banner_charge_14", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_15", 0, "custom_banner_charge_15", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_16", 0, "custom_banner_charge_16", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_17", 0, "custom_banner_charge_17", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_18", 0, "custom_banner_charge_18", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_19", 0, "custom_banner_charge_19", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_20", 0, "custom_banner_charge_20", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_21", 0, "custom_banner_charge_21", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_22", 0, "custom_banner_charge_22", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_23", 0, "custom_banner_charge_23", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_24", 0, "custom_banner_charge_24", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_25", 0, "custom_banner_charge_25", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_26", 0, "custom_banner_charge_26", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_27", 0, "custom_banner_charge_27", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_28", 0, "custom_banner_charge_28", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_29", 0, "custom_banner_charge_29", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_30", 0, "custom_banner_charge_30", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_31", 0, "custom_banner_charge_31", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_32", 0, "custom_banner_charge_32", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_33", 0, "custom_banner_charge_33", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_34", 0, "custom_banner_charge_34", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_35", 0, "custom_banner_charge_35", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_36", 0, "custom_banner_charge_36", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_37", 0, "custom_banner_charge_37", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_38", 0, "custom_banner_charge_38", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_39", 0, "custom_banner_charge_39", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_40", 0, "custom_banner_charge_40", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_41", 0, "custom_banner_charge_41", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_42", 0, "custom_banner_charge_42", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_43", 0, "custom_banner_charge_43", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_44", 0, "custom_banner_charge_44", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_45", 0, "custom_banner_charge_45", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("custom_banner_charge_46", 0, "custom_banner_charge_46", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_custom_banner", 0, "tableau_mesh_custom_banner", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_custom_banner_square", 0, "tableau_mesh_custom_banner_square", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_custom_banner_tall", 0, "tableau_mesh_custom_banner_tall", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_custom_banner_short", 0, "tableau_mesh_custom_banner_short", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_round_1", 0, "tableau_mesh_shield_round_1", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_round_2", 0, "tableau_mesh_shield_round_2", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_round_3", 0, "tableau_mesh_shield_round_3", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_round_4", 0, "tableau_mesh_shield_round_4", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_round_5", 0, "tableau_mesh_shield_round_5", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_small_round_1", 0, "tableau_mesh_shield_small_round_1", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_small_round_2", 0, "tableau_mesh_shield_small_round_2", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_small_round_3", 0, "tableau_mesh_shield_small_round_3", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_kite_1", 0, "tableau_mesh_shield_kite_1", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_kite_2", 0, "tableau_mesh_shield_kite_2", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_kite_3", 0, "tableau_mesh_shield_kite_3", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_kite_4", 0, "tableau_mesh_shield_kite_4", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_heater_1", 0, "tableau_mesh_shield_heater_1", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_heater_2", 0, "tableau_mesh_shield_heater_2", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_pavise_1", 0, "tableau_mesh_shield_pavise_1", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_shield_pavise_2", 0, "tableau_mesh_shield_pavise_2", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("heraldic_armor_bg", 0, "heraldic_armor_bg", 0, 0, 0, 0, 0, 0, 10, 10, 10), ("tableau_mesh_heraldic_armor_a", 0, "tableau_mesh_heraldic_armor_a", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("tableau_mesh_heraldic_armor_b", 0, "tableau_mesh_heraldic_armor_b", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("tableau_mesh_heraldic_armor_c", 0, "tableau_mesh_heraldic_armor_c", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("tableau_mesh_heraldic_armor_d", 0, "tableau_mesh_heraldic_armor_d", 0, 0, 0, 0, 0, 0, 1, 1, 1), ("outer_terrain_plain_1", 0, "ter_border_a", -90, 0, 0, 0, 0, 0, 1, 1, 1), ("banner_a01", 0, "banner_a01", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a02", 0, "banner_a02", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a03", 0, "banner_a03", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a04", 0, "banner_a04", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a05", 0, "banner_a05", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a06", 0, "banner_a06", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a07", 0, "banner_a07", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a08", 0, "banner_a08", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a09", 0, "banner_a09", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a10", 0, "banner_a10", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a11", 0, "banner_a11", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a12", 0, "banner_a12", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a13", 0, "banner_a13", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a14", 0, "banner_a14", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a15", 0, "banner_f21", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a16", 0, "banner_a16", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a17", 0, "banner_a17", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a18", 0, "banner_a18", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a19", 0, "banner_a19", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a20", 0, "banner_a20", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_a21", 0, "banner_a21", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b01", 0, "banner_b01", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b02", 0, "banner_b02", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b03", 0, "banner_b03", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b04", 0, "banner_b04", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b05", 0, "banner_b05", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b06", 0, "banner_b06", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b07", 0, "banner_b07", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b08", 0, "banner_b08", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b09", 0, "banner_b09", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b10", 0, "banner_b10", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b11", 0, "banner_b11", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b12", 0, "banner_b12", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b13", 0, "banner_b13", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b14", 0, "banner_b14", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b15", 0, "banner_b15", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b16", 0, "banner_b16", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b17", 0, "banner_b17", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b18", 0, "banner_b18", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b19", 0, "banner_b19", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b20", 0, "banner_b20", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_b21", 0, "banner_b21", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c01", 0, "banner_c01", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c02", 0, "banner_c02", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c03", 0, "banner_c03", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c04", 0, "banner_c04", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c05", 0, "banner_c05", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c06", 0, "banner_c06", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c07", 0, "banner_c07", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c08", 0, "banner_c08", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c09", 0, "banner_c09", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c10", 0, "banner_c10", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c11", 0, "banner_c11", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c12", 0, "banner_c12", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c13", 0, "banner_c13", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c14", 0, "banner_c14", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c15", 0, "banner_c15", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c16", 0, "banner_c16", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c17", 0, "banner_c17", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c18", 0, "banner_c18", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c19", 0, "banner_c19", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c20", 0, "banner_c20", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_c21", 0, "banner_c21", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d01", 0, "banner_d01", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d02", 0, "banner_d02", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d03", 0, "banner_d03", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d04", 0, "banner_d04", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d05", 0, "banner_d05", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d06", 0, "banner_d06", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d07", 0, "banner_d07", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d08", 0, "banner_d08", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d09", 0, "banner_d09", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d10", 0, "banner_d10", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d11", 0, "banner_d11", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d12", 0, "banner_d12", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d13", 0, "banner_d13", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d14", 0, "banner_d14", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d15", 0, "banner_d15", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d16", 0, "banner_d16", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d17", 0, "banner_d17", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d18", 0, "banner_d18", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d19", 0, "banner_d19", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d20", 0, "banner_d20", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_d21", 0, "banner_d21", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e01", 0, "banner_e01", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e02", 0, "banner_e02", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e03", 0, "banner_e03", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e04", 0, "banner_e04", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e05", 0, "banner_e05", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e06", 0, "banner_e06", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e07", 0, "banner_e07", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e08", 0, "banner_e08", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e09", 0, "banner_e09", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e10", 0, "banner_e10", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e11", 0, "banner_e11", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e12", 0, "banner_e12", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e13", 0, "banner_e13", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e14", 0, "banner_e14", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e15", 0, "banner_e15", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e16", 0, "banner_e16", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e17", 0, "banner_e17", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e18", 0, "banner_e18", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e19", 0, "banner_e19", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e20", 0, "banner_e20", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_e21", 0, "banner_e21", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f01", 0, "banner_f01", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f02", 0, "banner_f02", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f03", 0, "banner_f03", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f04", 0, "banner_f04", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f05", 0, "banner_f05", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f06", 0, "banner_f06", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f07", 0, "banner_f07", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f08", 0, "banner_f08", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f09", 0, "banner_f09", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f10", 0, "banner_f10", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f11", 0, "banner_f11", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f12", 0, "banner_f12", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f13", 0, "banner_f13", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f14", 0, "banner_f14", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f15", 0, "banner_f15", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f16", 0, "banner_f16", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f17", 0, "banner_f17", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f18", 0, "banner_f18", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f19", 0, "banner_f19", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f20", 0, "banner_f20", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banner_f21", 0, "banner_a15", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a01", 0, "arms_a01", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a02", 0, "arms_a02", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a03", 0, "arms_a03", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a04", 0, "arms_a04", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a05", 0, "banner_a05", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a06", 0, "arms_a06", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a07", 0, "banner_a07", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a08", 0, "arms_a08", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a09", 0, "banner_a09", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a10", 0, "banner_a10", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a11", 0, "banner_a11", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a12", 0, "arms_a12", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a13", 0, "arms_a13", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a14", 0, "banner_a14", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a15", 0, "banner_f21", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a16", 0, "arms_a16", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a17", 0, "arms_a17", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a18", 0, "arms_a18", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a19", 0, "arms_a19", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a20", 0, "arms_a20", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_a21", 0, "arms_a21", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b01", 0, "arms_b01", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b02", 0, "arms_b02", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b03", 0, "banner_b03", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b04", 0, "banner_b04", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b05", 0, "arms_b05", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b06", 0, "arms_b06", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b07", 0, "arms_b07", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b08", 0, "arms_b08", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b09", 0, "arms_b09", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b10", 0, "arms_b10", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b11", 0, "banner_b11", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b12", 0, "banner_b12", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b13", 0, "banner_b13", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b14", 0, "arms_b14", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b15", 0, "arms_b15", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b16", 0, "arms_b16", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b17", 0, "banner_b17", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b18", 0, "arms_b18", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b19", 0, "banner_b19", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b20", 0, "arms_b20", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_b21", 0, "banner_b21", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c01", 0, "arms_c01", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c02", 0, "banner_c02", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c03", 0, "banner_c03", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c04", 0, "arms_c04", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c05", 0, "banner_c05", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c06", 0, "arms_c06", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c07", 0, "arms_c07", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c08", 0, "banner_c08", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c09", 0, "banner_c09", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c10", 0, "arms_c10", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c11", 0, "banner_c11", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c12", 0, "arms_c12", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c13", 0, "arms_c13", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c14", 0, "arms_c14", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c15", 0, "banner_c15", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c16", 0, "arms_c16", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c17", 0, "banner_c17", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c18", 0, "banner_c18", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c19", 0, "arms_c19", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c20", 0, "banner_c20", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_c21", 0, "banner_c21", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d01", 0, "banner_d01", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d02", 0, "arms_d02", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d03", 0, "arms_d03", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d04", 0, "arms_d04", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d05", 0, "banner_d05", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d06", 0, "arms_d06", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d07", 0, "arms_d07", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d08", 0, "arms_d08", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d09", 0, "arms_d09", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d10", 0, "banner_d10", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d11", 0, "arms_d11", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d12", 0, "arms_d12", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d13", 0, "arms_d13", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d14", 0, "arms_d14", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d15", 0, "arms_d15", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d16", 0, "arms_d16", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d17", 0, "arms_d17", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d18", 0, "arms_d18", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d19", 0, "arms_d19", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d20", 0, "arms_d20", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_d21", 0, "arms_d21", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e01", 0, "banner_e01", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e02", 0, "arms_e02", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e03", 0, "banner_e03", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e04", 0, "banner_e04", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e05", 0, "banner_e05", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e06", 0, "banner_e06", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e07", 0, "banner_e07", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e08", 0, "banner_e08", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e09", 0, "banner_e09", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e10", 0, "banner_e10", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e11", 0, "banner_e11", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e12", 0, "banner_e12", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e13", 0, "banner_e13", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e14", 0, "banner_e14", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e15", 0, "banner_e15", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e16", 0, "banner_e16", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e17", 0, "banner_e17", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e18", 0, "banner_e18", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e19", 0, "banner_e19", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e20", 0, "banner_e20", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_e21", 0, "banner_e21", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f01", 0, "banner_f01", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f02", 0, "banner_f02", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f03", 0, "banner_f03", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f04", 0, "banner_f04", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f05", 0, "banner_f05", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f06", 0, "banner_f06", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f07", 0, "banner_f07", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f08", 0, "banner_f08", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f09", 0, "banner_f09", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f10", 0, "banner_f10", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f11", 0, "banner_f11", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f12", 0, "banner_f12", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f13", 0, "banner_f13", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f14", 0, "banner_f14", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f15", 0, "banner_f15", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f16", 0, "banner_f16", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f17", 0, "banner_f17", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f18", 0, "banner_f18", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f19", 0, "banner_f19", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f20", 0, "banner_f20", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("arms_f21", 0, "banner_a15", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banners_default_a", 0, "banners_default_a", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banners_default_b", 0, "banners_default_b", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banners_default_c", 0, "banners_default_c", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banners_default_d", 0, "banners_default_d", 0, 0, 0, -90, 0, 0, 1, 1, 1), ("banners_default_e", 0, "banners_default_e", 0, 0, 0, -90, 0, 0, 1, 1, 1), ]
Python
from module_info import * from module_simple_triggers import * from process_common import * from process_operations import * def save_simple_triggers(variable_list,variable_uses,triggers,tag_uses,quick_strings): file = open(export_dir + "simple_triggers.txt","w") file.write("simple_triggers_file version 1\n") file.write("%d\n"%len(simple_triggers)) for i in xrange(len(simple_triggers)): simple_trigger = simple_triggers[i] file.write("%f "%(simple_trigger[0])) save_statement_block(file,0, 1, simple_trigger[1] , variable_list,variable_uses,tag_uses,quick_strings) file.write("\n") file.close() print "exporting simple triggers..." variable_uses = [] variables = load_variables(export_dir,variable_uses) tag_uses = load_tag_uses(export_dir) quick_strings = load_quick_strings(export_dir) save_simple_triggers(variables,variable_uses,simple_triggers,tag_uses,quick_strings) save_variables(export_dir,variables,variable_uses) save_tag_uses(export_dir,tag_uses) save_quick_strings(export_dir,quick_strings) #print "finished."
Python
import string import types from process_common import * from header_common import * from header_operations import * from module_strings import * from module_skills import * from module_music import * from module_meshes import * from module_sounds import * from module_items import * from module_troops import * from module_factions import * from module_quests import * from module_party_templates import * from module_parties import * from module_scenes import * from module_scripts import * from module_mission_templates import * from module_game_menus import * from module_particle_systems import * from module_scene_props import * from module_scene_props import * from module_presentations import * from module_map_icons import * from module_tableau_materials import * from module_animations import * def get_id_value(tag, identifier, tag_uses): tag_type = -1 id_no = -1 if (tag == "str"): id_no = find_object(strings,identifier) tag_type = tag_string elif (tag == "itm"): id_no = find_object(items,identifier) tag_type = tag_item elif (tag == "trp"): id_no = find_object(troops,identifier) tag_type = tag_troop elif (tag == "fac"): id_no = find_object(factions,identifier) tag_type = tag_faction elif (tag == "qst"): id_no = find_object(quests,identifier) tag_type = tag_quest elif (tag == "pt"): id_no = find_object(party_templates,identifier) tag_type = tag_party_tpl elif (tag == "p"): id_no = find_object(parties,identifier) tag_type = tag_party elif (tag == "scn"): id_no = find_object(scenes,identifier) tag_type = tag_scene elif (tag == "mt"): id_no = find_object(mission_templates,identifier) tag_type = tag_mission_tpl elif (tag == "mnu"): id_no = find_object(game_menus,identifier) tag_type = tag_menu elif (tag == "script"): id_no = find_object(scripts,identifier) tag_type = tag_script elif (tag == "psys"): id_no = find_object(particle_systems,identifier) tag_type = tag_particle_sys elif (tag == "spr"): id_no = find_object(scene_props,identifier) tag_type = tag_scene_prop elif (tag == "prsnt"): id_no = find_object(presentations,identifier) tag_type = tag_presentation elif (tag == "snd"): id_no = find_object(sounds,identifier) tag_type = tag_sound elif (tag == "icon"): id_no = find_object(map_icons,identifier) tag_type = tag_map_icon elif (tag == "skl"): id_no = find_object(skills,identifier) tag_type = tag_skill elif (tag == "track"): id_no = find_object(tracks,identifier) tag_type = tag_track elif (tag == "mesh"): id_no = find_object(meshes,identifier) tag_type = tag_mesh elif (tag == "anim"): id_no = find_object(animations,identifier) tag_type = tag_animation elif (tag == "tableau"): id_no = find_object(tableaus,identifier) tag_type = tag_tableau if (tag_type > -1 and id_no > -1): add_tag_use(tag_uses,tag_type,id_no) return (tag_type, id_no) def get_identifier_value(str, tag_uses): underscore_pos = string.find(str, "_") result = -1 if (underscore_pos > 0): tag_str = str[0:underscore_pos] id_str = str[underscore_pos + 1:len(str)] (tag_type, id_no) = get_id_value(tag_str,id_str,tag_uses) if (tag_type > 0): if (id_no < 0): print "Error: Unable to find object:" + str else: result = id_no | (tag_type << op_num_value_bits) else: print "Error: Unrecognized tag:" +tag_str + "in object:" + str else: print "Error: Invalid object:" +str + ".Variables should start with $ sign and references should start with a tag" return result def load_quick_strings(export_dir): quick_strings = [] try: file = open(export_dir + "quick_strings.txt", "r") str_list = file.readlines() file.close() for s in str_list: s = string.strip(s) if s: ssplit = s.split(' ') if len(ssplit) == 2: quick_strings.append(ssplit) except: print "Creating new quick_strings.txt file..." return quick_strings def save_quick_strings(export_dir, quick_strings): file = open(export_dir + "quick_strings.txt", "w") file.write("%d\n"%len(quick_strings)) for i in xrange(len(quick_strings)): file.write("%s %s\n"%(quick_strings[i][0],replace_spaces(quick_strings[i][1]))) file.close() def load_variables(export_dir,variable_uses): variables = [] try: file = open(export_dir + "variables.txt","r") var_list = file.readlines() file.close() for v in var_list: vv = string.strip(v) if vv: variables.append(vv) except: print "variables.txt not found. Creating new variables.txt file" try: file = open(export_dir + "variable_uses.txt","r") var_list = file.readlines() file.close() for v in var_list: vv = string.strip(v) if vv: variable_uses.append(int(vv)) except: print "variable_uses.txt not found. Creating new variable_uses.txt file" return variables def save_variables(export_dir,variables_list,variable_uses,): file = open(export_dir + "variables.txt","w") for i in xrange(len(variables_list)): file.write("%s\n"%variables_list[i]) file.close() file = open(export_dir + "variable_uses.txt","w") for i in xrange(len(variables_list)): file.write("%d\n"%variable_uses[i]) file.close() def ensure_tag_use(tag_uses, tag_no, object_no): if len(tag_uses[tag_no]) <= object_no: num_to_add = object_no + 1 - len(tag_uses[tag_no]) for j in xrange(num_to_add): tag_uses[tag_no].append(0) def add_tag_use(tag_uses, tag_no, object_no): #TODO: Uncomment to make build_module_check_tags work # ensure_tag_use(tag_uses, tag_no, object_no) # tag_uses[tag_no][object_no] = tag_uses[tag_no][object_no] + 1 pass def load_tag_uses(export_dir): tag_uses = [] for i in xrange(tags_end): sub_tag_uses = [] tag_uses.append(sub_tag_uses) try: file = open(export_dir + "tag_uses.txt","r") var_list = file.readlines() file.close() for v in var_list: vv = string.strip(v).split(';') if vv: for v2 in vv: vvv = v2.split(' ') if len(vvv) >= 3: ensure_tag_use(tag_uses,int(vvv[0]),int(vvv[1])) tag_uses[int(vvv[0])][int(vvv[1])] = int(vvv[2]) except: print "Creating new tag_uses.txt file..." return tag_uses def save_tag_uses(export_dir,tag_uses): file = open(export_dir + "tag_uses.txt","w") for i in xrange(len(tag_uses)): for j in xrange(len(tag_uses[i])): file.write("%d %d %d;" % (i, j, tag_uses[i][j])) file.write("\n") file.close() def add_cookie(cookies_list,cookie_string): found = 0 result = -1 for i_t in xrange(len(cookies_list)): if cookie_string == cookies_list[i_t]: found = 1 result = i_t break if not found: cookies_list.append(cookie_string) result = len(cookies_list) - 1 return result def get_cookie(cookies_list,cookie_string): found = 0 result = -1 for i_t in xrange(len(cookies_list)): if cookie_string == cookies_list[i_t]: found = 1 result = i_t break if not found: print "ERROR: input token not found:" + cookie_string cookies_list.append(cookie_string) result = len(cookies_list) - 1 return result def check_varible_not_defined(variable_string,variables_list): for i_t in xrange(len(variables_list)): if variable_string == variables_list[i_t]: print "WARNING: Variable name used for both local and global contexts:" + variable_string break #def add_get_variable(variable_string,variables_list): # found = 0 # result = -1 # for i_t in xrange(len(variables_list)): # if variable_string == variables_list[i_t]: # found = 1 # result = i_t # break # if not found: # variables_list.append(variable_string) # result = len(variables_list) - 1 # return result def add_variable(variable_string,variables_list,variable_uses): found = 0 for i_t in xrange(len(variables_list)): if variable_string == variables_list[i_t]: found = 1 variable_uses[i_t] = variable_uses[i_t] - 1 break if not found: variables_list.append(variable_string) variable_uses.append(-1) # print " (assign, \"$"+variable_string+"\", %d),"%(len(variables_list)) def get_variable(variable_string,variables_list,variable_uses): found = 0 result = -1 var_string = variable_string[1:] for i_t in xrange(len(variables_list)): if var_string == variables_list[i_t]: found = 1 result = i_t variable_uses[result] = variable_uses[result] + 1 break if not found: if (variable_string[0] == '$'): variables_list.append(variable_string) variable_uses.append(0) result = len(variables_list) - 1 print "WARNING: Usage of unassigned global variable: " + variable_string else: print "ERROR: Usage of unassigned local variable: " + variable_string return result def is_lhs_operation(op_code): found = 0 if op_code in lhs_operations: return 1 return 0 def is_lhs_operation_for_global_vars(op_code): found = 0 if op_code in lhs_operations: return 1 if op_code in global_lhs_operations: return 1 return 0 def is_can_fail_operation(op_code): found = 0 if op_code in can_fail_operations: return 1 return 0 def search_quick_string_keys(key, quick_strings): index = -1 for i in xrange(len(quick_strings)): if quick_strings[i][0] == key: index = i return index def insert_quick_string_with_auto_id(sentence,quick_strings): index = 0 text = convert_to_identifier_with_no_lowercase(sentence) sentence = replace_spaces(sentence) done = 0 i = 20 lt = len(text) if (i > lt): i = lt auto_id = "qstr_" + text[0:i] done = 0 index = search_quick_string_keys(auto_id, quick_strings) if index >= 0 and (quick_strings[index][1] == sentence): done = 1 while (i <= lt) and not done: auto_id = "qstr_" + text[0:i] index = search_quick_string_keys(auto_id, quick_strings) if index >= 0: if quick_strings[index][1] == sentence: done = 1 else: i += 1 else: done = 1 index = len(quick_strings) quick_strings.append([auto_id, sentence]) if not done: number = 1 new_auto_id = auto_id + str(number) while quick_strings.has_key(new_auto_id): number += 1 new_auto_id = auto_id + str(number) auto_id = new_auto_id index = len(quick_strings) quick_strings.append([auto_id, sentence]) return index def process_param(param,global_vars_list,global_var_uses, local_vars_list, local_var_uses, tag_uses, quick_strings): result = 0 if (type(param) == types.StringType): if (param[0] == '$'): check_varible_not_defined(param[1:], local_vars_list) result = get_variable(param, global_vars_list,global_var_uses) result |= opmask_variable elif (param[0] == ':'): check_varible_not_defined(param[1:], global_vars_list) result = get_variable(param, local_vars_list,local_var_uses) result |= opmask_local_variable elif (param[0] == '@'): result = insert_quick_string_with_auto_id(param[1:], quick_strings) result |= opmask_quick_string else: result = get_identifier_value(param.lower(), tag_uses) if (result < 0): print "ERROR: Illegal Identifier:" + param else: result = param return result def save_statement(ofile,opcode,no_variables,statement,variable_list,variable_uses,local_vars_list,local_var_uses,tag_uses,quick_strings): if no_variables == 0: lenstatement = len(statement) - 1 if (is_lhs_operation(opcode) == 1): if (lenstatement > 0): param = statement[1] if (type(param) == types.StringType): if (param[0] == ':'): add_variable(param[1:], local_vars_list, local_var_uses) else: lenstatement = 0 ofile.write("%d %d "%(opcode, lenstatement)) for i in xrange(lenstatement): operand = process_param(statement[i + 1],variable_list,variable_uses,local_vars_list,local_var_uses,tag_uses,quick_strings) ofile.write("%d "%operand) def compile_global_vars_in_statement(statement,variable_list, variable_uses): opcode = 0 if ((type(statement) != types.ListType) and (type(statement) != types.TupleType)): opcode = statement else: opcode = statement[0] if (is_lhs_operation_for_global_vars(opcode) == 1): if (len(statement) > 1): param = statement[1] if (type(param) == types.StringType): if (statement[1][0] == '$'): add_variable(statement[1][1:], variable_list, variable_uses) def save_statement_block(ofile,statement_name,can_fail_statement,statement_block,variable_list, variable_uses,tag_uses,quick_strings): local_vars = [] local_var_uses = [] ofile.write(" %d "%(len(statement_block))) store_script_param_1_uses = 0 store_script_param_2_uses = 0 current_depth = 0 can_fail = 0 for i in xrange(len(statement_block)): statement = statement_block[i] if ((type(statement) != types.ListType) and (type(statement) != types.TupleType)): opcode = statement no_variables = 1 else: opcode = statement[0] no_variables = 0 if (opcode in [try_begin, try_for_range, try_for_range_backwards, try_for_parties, try_for_agents]): current_depth = current_depth + 1 elif (opcode == try_end): current_depth = current_depth - 1 elif (opcode == store_script_param_1 or (opcode == store_script_param and statement[2] == 1)): store_script_param_1_uses = store_script_param_1_uses + 1 elif (opcode == store_script_param_2 or (opcode == store_script_param and statement[2] == 2)): store_script_param_2_uses = store_script_param_2_uses + 1 elif (can_fail_statement == 0 and current_depth == 0 and (is_can_fail_operation(opcode) or ((opcode == call_script) and (statement[1].startswith("cf_", 7)))) and (not statement_name.startswith("cf_"))): print "WARNING: Script can fail at operation #" + str(i) + ". Use cf_ at the beginning of its name: " + statement_name save_statement(ofile,opcode,no_variables,statement,variable_list,variable_uses,local_vars, local_var_uses,tag_uses,quick_strings) if (store_script_param_1_uses > 1): print "WARNING: store_script_param_1 is used more than once:" + statement_name if (store_script_param_2_uses > 1): print "WARNING: store_script_param_2 is used more than once:" + statement_name i = 0 while (i < len(local_vars)): if (local_var_uses[i] == 0 and not(local_vars[i].startswith("unused"))): print "WARNING: Local variable never used: " + local_vars[i] i = i + 1 def compile_global_vars(statement_block,variable_list, variable_uses): for statement in statement_block: compile_global_vars_in_statement(statement, variable_list, variable_uses) def save_simple_triggers(ofile,triggers,variable_list, variable_uses,tag_uses,quick_strings): ofile.write("%d\n"%len(triggers)) for trigger in triggers: ofile.write("%f "%(trigger[0])) save_statement_block(ofile,0,1,trigger[1] , variable_list, variable_uses,tag_uses,quick_strings) ofile.write("\n") ofile.write("\n")
Python
skl_trade = 0 skl_leadership = 1 skl_prisoner_management = 2 skl_reserved_1 = 3 skl_reserved_2 = 4 skl_reserved_3 = 5 skl_reserved_4 = 6 skl_persuasion = 7 skl_engineer = 8 skl_first_aid = 9 skl_surgery = 10 skl_wound_treatment = 11 skl_inventory_management = 12 skl_spotting = 13 skl_pathfinding = 14 skl_tactics = 15 skl_tracking = 16 skl_trainer = 17 skl_reserved_5 = 18 skl_reserved_6 = 19 skl_reserved_7 = 20 skl_reserved_8 = 21 skl_looting = 22 skl_horse_archery = 23 skl_riding = 24 skl_athletics = 25 skl_shield = 26 skl_weapon_master = 27 skl_reserved_9 = 28 skl_reserved_10 = 29 skl_reserved_11 = 30 skl_reserved_12 = 31 skl_reserved_13 = 32 skl_power_draw = 33 skl_power_throw = 34 skl_power_strike = 35 skl_ironflesh = 36 skl_reserved_14 = 37 skl_reserved_15 = 38 skl_reserved_16 = 39 skl_reserved_17 = 40 skl_reserved_18 = 41
Python
from header_common import * from header_operations import * from header_triggers import * from header_scenes import * from module_constants import * #################################################################################################################### # Each scene record contains the following fields: # 1) Scene id {string}: used for referencing scenes in other files. The prefix scn_ is automatically added before each scene-id. # 2) Scene flags {int}. See header_scenes.py for a list of available flags # 3) Mesh name {string}: This is used for indoor scenes only. Use the keyword "none" for outdoor scenes. # 4) Body name {string}: This is used for indoor scenes only. Use the keyword "none" for outdoor scenes. # 5) Min-pos {(float,float)}: minimum (x,y) coordinate. Player can't move beyond this limit. # 6) Max-pos {(float,float)}: maximum (x,y) coordinate. Player can't move beyond this limit. # 7) Water-level {float}. # 8) Terrain code {string}: You can obtain the terrain code by copying it from the terrain generator screen # 9) List of other scenes accessible from this scene {list of strings}. # (deprecated. This will probably be removed in future versions of the module system) # (In the new system passages are used to travel between scenes and # the passage's variation-no is used to select the game menu item that the passage leads to.) # 10) List of chest-troops used in this scene {list of strings}. You can access chests by placing them in edit mode. # The chest's variation-no is used with this list for selecting which troop's inventory it will access. # town_1 Sargoth #plain # town_2 Tihr #steppe # town_3 Veluca #steppe # town_4 Suno #plain # town_5 Jelkala #plain # town_6 Praven #plain # town_7 Uxkhal #plain # town_8 Reyvadin #plain # town_9 Khudan #snow # town_10 Tulga #steppe # town_11 Curaw #snow # town_12 Wercheg #plain # town_13 Rivacheg #plain # town_14 Halmar #steppe #################################################################################################################### scenes = [ ("random_scene",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be", [],[]), ("conversation_scene",0,"encounter_spot", "bo_encounter_spot", (-40,-40),(40,40),-100,"0", [],[]), ("random_scene_steppe",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x0000000229602800000691a400003efe00004b34000059be", [],[], "outer_terrain_steppe"), ("random_scene_plain",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x0000000229602800000691a400003efe00004b34000059be", [],[], "outer_terrain_plain"), ("random_scene_snow",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x0000000229602800000691a400003efe00004b34000059be", [],[], "outer_terrain_snow"), ("random_scene_desert",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x0000000229602800000691a400003efe00004b34000059be", [],[], "outer_terrain_steppe"), ("random_scene_steppe_forest",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be", [],[], "outer_terrain_plain"), ("random_scene_plain_forest",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be", [],[], "outer_terrain_plain"), ("random_scene_snow_forest",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be", [],[], "outer_terrain_snow"), ("random_scene_desert_forest",sf_generate|sf_randomize|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be", [],[], "outer_terrain_plain"), ("camp_scene",sf_generate|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be", [],[], "outer_terrain_plain"), ("camp_scene_horse_track",sf_generate|sf_auto_entry_points,"none", "none", (0,0),(240,240),-0.5,"0x300028000003e8fa0000034e00004b34000059be", [],[], "outer_terrain_plain"), ("four_ways_inn",sf_generate,"none", "none", (0,0),(120,120),-100,"0x0230817a00028ca300007f4a0000479400161992", [],[], "outer_terrain_plain"), ("test_scene",sf_generate,"none", "none", (0,0),(120,120),-100,"0x0230817a00028ca300007f4a0000479400161992", [],[], "outer_terrain_plain"), ("quick_battle_1",sf_generate,"none", "none", (0,0),(120,120),-100,"0x30401ee300059966000001bf0000299a0000638f", [],[], "outer_terrain_plain"), ("quick_battle_2",sf_generate,"none", "none", (0,0),(120,120),-100,"0xa0425ccf0004a92a000063d600005a8a00003d9a", [],[], "outer_terrain_steppe"), ("quick_battle_3",sf_generate,"none", "none", (0,0),(120,120),-100,"0x4c6024e3000691a400001b7c0000591500007b52", [],[], "outer_terrain_snow"), ("quick_battle_4",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00001d63c005114300006228000053bf00004eb9", [],[], "outer_terrain_plain"), ("quick_battle_5",sf_generate,"none", "none", (0,0),(120,120),-100,"0x3a078bb2000589630000667200002fb90000179c", [],[], "outer_terrain_plain"), ("quick_battle_6",sf_generate,"none", "none", (0,0),(120,120),-100,"0xa0425ccf0004a92a000063d600005a8a00003d9a", [],[], "outer_terrain_steppe"), ("quick_battle_7",sf_generate,"none", "none", (0,0),(100,100),-100,"0x314d060900036cd70000295300002ec9000025f3", [],[],"outer_terrain_plain"), ("salt_mine",sf_generate,"none", "none", (-200,-200),(200,200),-100,"0x2a07b23200025896000023ee00007f9c000022a8", [],[], "outer_terrain_steppe"), ("novice_ground",sf_indoors,"training_house_a", "bo_training_house_a", (-100,-100),(100,100),-100,"0", [],[]), ("zendar_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c", [],[], "outer_terrain_plain"), ("dhorak_keep",sf_generate,"none", "none", (0,0),(120,120),-100,"0x33a7946000028ca300007f4a0000479400161992", ["exit"],[]), ("reserved4",sf_generate,"none", "none", (0,0),(120,120),-100,"28791", [],[]), ("reserved5",sf_generate,"none", "none", (0,0),(120,120),-100,"117828", [],[]), ("reserved6",sf_generate,"none", "none", (0,0),(100,100),-100,"6849", [],[]), ("reserved7",sf_generate,"none", "none", (0,0),(100,100),-100,"6849", [],[]), ("reserved8",sf_generate,"none", "none", (0,0),(100,100),-100,"13278", [],[]), ("reserved9",sf_indoors,"thirsty_lion", "bo_thirsty_lion", (-100,-100),(100,100),-100,"0", [],[]), ("reserved10",0,"none", "none", (-100,-100),(100,100),-100,"0", [],[]), ("reserved11",0,"none", "none", (-100,-100),(100,100),-100,"0", [],[]), ("reserved12",sf_indoors,"thirsty_lion", "bo_thirsty_lion", (-100,-100),(100,100),-100,"0", [],[]), ("training_ground",sf_generate,"none", "none", (0,0),(120,120),-100,"0x30000500400360d80000189f00002a8380006d91", [],["tutorial_chest_1", "tutorial_chest_2"], "outer_terrain_plain_1"), ("tutorial_1",sf_indoors,"tutorial_1_scene", "bo_tutorial_1_scene", (-100,-100),(100,100),-100,"0", [],[]), ("tutorial_2",sf_indoors,"tutorial_2_scene", "bo_tutorial_2_scene", (-100,-100),(100,100),-100,"0", [],[]), ("tutorial_3",sf_indoors,"tutorial_3_scene", "bo_tutorial_3_scene", (-100,-100),(100,100),-100,"0", [],[]), ("tutorial_4",sf_generate,"none", "none", (0,0),(120,120),-100,"0x30000500400360d80000189f00002a8380006d91", [],[], "outer_terrain_plain"), ("tutorial_5",sf_generate,"none", "none", (0,0),(120,120),-100,"0x3a06dca80005715c0000537400001377000011fe", [],[], "outer_terrain_plain"), ("training_ground_horse_track_1",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00000000337553240004d53700000c0500002a0f80006267", [],[], "outer_terrain_plain"), ("training_ground_horse_track_2",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00000000301553240004d5370000466000002a0f800073f1", [],[], "outer_terrain_plain"), #Kar ("training_ground_horse_track_3",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00000000400c12b2000515470000216b0000485e00006928", [],[], "outer_terrain_snow"), #Steppe ("training_ground_horse_track_4",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00000000200b60320004a5290000180d0000452f00000e90", [],[], "outer_terrain_steppe"), #Plain ("training_ground_horse_track_5",sf_generate,"none", "none", (0,0),(120,120),-100,"0x000000003008208e0006419000000f730000440f00003c86", [],[], "outer_terrain_plain"), ("training_ground_ranged_melee_1",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00000001350455c20005194a000041cb00005ae800000ff5", [],[], "outer_terrain_plain"), ("training_ground_ranged_melee_2",sf_generate,"none", "none", (0,0),(120,120),-100,"0x0000000532c8dccb0005194a000041cb00005ae800001bdd", [],[], "outer_terrain_plain"), #Kar ("training_ground_ranged_melee_3",sf_generate,"none", "none", (0,0),(120,120),-100,"0x000000054327dcba0005194a00001b1d00005ae800004d63", [],[], "outer_terrain_snow"), #Steppe ("training_ground_ranged_melee_4",sf_generate,"none", "none", (0,0),(120,120),-100,"0x000000012247dcba0005194a000041ef00005ae8000050af", [],[], "outer_terrain_steppe"), #Plain ("training_ground_ranged_melee_5",sf_generate,"none", "none", (0,0),(120,120),-100,"0x00000001324a9cba0005194a000041ef00005ae800003c55", [],[], "outer_terrain_plain"), ("zendar_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932", ["the_happy_boar","","zendar_merchant"],[], "outer_terrain_plain_1"), # ("zendar_center",0,"sargoth_square", "bo_sargoth_square", (-24,-22),(21,13),-100,"0", # ["the_happy_boar","","zendar_merchant"],[]), ("the_happy_boar",sf_indoors,"interior_town_house_f", "bo_interior_town_house_f", (-100,-100),(100,100),-100,"0", ["zendar_center"],["zendar_chest"]), ("zendar_merchant",sf_indoors,"interior_town_house_i", "bo_interior_town_house_i", (-100,-100),(100,100),-100,"0", [],[]), # Tvern names: #the shy monkey #the singing pumpkin #three swords #red stag #the bard's corner #interior_tavern_a # town_1 Sargoth #plain # town_2 Tihr #plain # town_3 Veluca #steppe # town_4 Suno #plain # town_5 Jelkala #plain # town_6 Praven #plain # town_7 Uxkhal #plain # town_8 Reyvadin #plain # town_9 Khudan #snow # town_10 Tulga #steppe # town_11 Curaw #snow # town_12 Wercheg #plain # town_13 Rivacheg #plain # town_14 Halmar #steppe ("town_1_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x20008a110002589600006af30000356b00002c27", [],[],"outer_terrain_plain"), ("town_2_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa009c7070002589600002b6300001ef60000122e", [],["bonus_chest_3"],"outer_terrain_town_thir_1"), ("town_3_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x000000002005591e00040506000059a100002cd500005052", [],[],"outer_terrain_steppe"), ("town_4_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x30001d9300031ccb0000156f000048ba0000361c", [],[],"outer_terrain_plain"), ("town_5_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x00000000300798b2000380e3000037960000573900003f48", [],["bonus_chest_2"],"outer_terrain_plain"), ("town_6_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x3000148000025896000074e600006c260000125a", [],[],"outer_terrain_plain"), ("town_7_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x30050d0d0002d4b300000e2f000027d200005f66", [],[],"outer_terrain_plain"), ("town_8_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x3000148000025896000074e600006c260000125a", [],[],"outer_terrain_plain"), ("town_9_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x400790b20002c8b0000050d500006f8c00006dbd", [],[],"outer_terrain_snow"), ("town_10_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x00000000200016da000364d9000060f500007591000064e7", [],[],"outer_terrain_steppe"), ("town_11_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x400790b20002c8b0000050d500006f8c00006dbd", [],[],"outer_terrain_snow"), ("town_12_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x3002cd340002b4ac00002ccd800026dc00000c1d", [],[],"outer_terrain_town_thir"), ("town_13_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x300416a600035cd600007ee80000012100003fbc", [],["bonus_chest_1"]), ("town_14_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x00000000200016da000364d9000060f500007591000064e7", [],[],"outer_terrain_steppe"), ("town_15_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x2007956000025896000037e800000e860000674b", [],[],"outer_terrain_steppe"), ("town_16_center",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130001887000334d0000073ed00004f1a00007a35", [],[],"outer_terrain_steppe"), ("town_17_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x0000000020045abc000308c4000029d9000033bd000009b9", [],[],"outer_terrain_steppe"), ("town_18_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x0000000020049cbd00025896000048e90000164400002b3f", [],[],"outer_terrain_steppe"), ("town_1_castle",sf_indoors,"interior_castle_y", "bo_interior_castle_y", (-100,-100),(100,100),-100,"0", [],["town_1_seneschal"]), ("town_2_castle",sf_indoors,"interior_castle_t", "bo_interior_castle_t", (-100,-100),(100,100),-100,"0", ["exit"],["town_2_seneschal"]), ("town_3_castle",sf_indoors,"interior_castle_a", "bo_interior_castle_a", (-100,-100),(100,100),-100,"0", ["exit"],["town_3_seneschal"]), ("town_4_castle",sf_indoors, "interior_castle_q", "bo_interior_castle_q", (-100,-100),(100,100),-100,"0", ["exit"],["town_4_seneschal"]), ("town_5_castle",sf_indoors, "interior_castle_c", "bo_interior_castle_c", (-100,-100),(100,100),-100,"0", ["exit"],["town_5_seneschal"]), ("town_6_castle",sf_indoors, "interior_castle_z", "bo_interior_castle_z", (-100,-100),(100,100),-100,"0", ["exit"],["town_6_seneschal"]), ("town_7_castle",sf_indoors, "interior_castle_v", "bo_interior_castle_v", (-100,-100),(100,100),-100,"0", ["exit"],["town_7_seneschal"]), ("town_8_castle",sf_indoors, "interior_castle_w", "bo_interior_castle_w", (-100,-100),(100,100),-100,"0", ["exit"],["town_8_seneschal"]), ("town_9_castle",sf_indoors, "interior_castle_g", "bo_interior_castle_g", (-100,-100),(100,100),-100,"0", ["exit"],["town_9_seneschal"]), ("town_10_castle",sf_generate, "none", "none", (-100,-100),(100,100),-100,"0x00000007300005000002308c00004a840000624700004fda", ["exit"],["town_10_seneschal"]), ("town_11_castle",sf_indoors, "interior_castle_i", "bo_interior_castle_i", (-100,-100),(100,100),-100,"0", ["exit"],["town_11_seneschal"]), ("town_12_castle",sf_indoors, "interior_castle_x", "bo_interior_castle_x", (-100,-100),(100,100),-100,"0", ["exit"],["town_12_seneschal"]), ("town_13_castle",sf_indoors, "interior_castle_b", "bo_interior_castle_b", (-100,-100),(100,100),-100,"0", ["exit"],["town_13_seneschal"]), ("town_14_castle",sf_indoors, "interior_castle_g_square_keep", "bo_interior_castle_g_square_keep", (-100,-100),(100,100),-100,"0", ["exit"],["town_14_seneschal"]), ("town_15_castle",sf_indoors, "interior_castle_e", "bo_interior_castle_e", (-100,-100),(100,100),-100,"0", ["exit"],["town_15_seneschal"]), ("town_16_castle",sf_indoors, "interior_castle_n", "bo_interior_castle_n", (-100,-100),(100,100),-100,"0", ["exit"],["town_16_seneschal"]), ("town_17_castle",sf_indoors, "interior_castle_g_square_keep", "bo_interior_castle_g_square_keep", (-100,-100),(100,100),-100,"0", ["exit"],["town_17_seneschal"]), ("town_18_castle",sf_generate, "none", "none", (-100,-100),(100,100),-100,"0x00000007300005000002308c00004a840000624700004fda", ["exit"],["town_18_seneschal"]), ("town_1_tavern",sf_indoors,"interior_town_house_f", "bo_interior_town_house_f", (-100,-100),(100,100),-100,"0", [],[]), ("town_2_tavern",sf_indoors,"interior_tavern_e", "bo_interior_tavern_e", (-100,-100),(100,100),-100,"0", ["exit"],[],"outer_terrain_town_thir_1"), ("town_3_tavern",sf_indoors,"interior_town_house_d", "bo_interior_town_house_d", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_4_tavern",sf_indoors, "interior_tavern_f", "bo_interior_tavern_f", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_5_tavern",sf_indoors, "interior_tavern_h", "bo_interior_tavern_h", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_6_tavern",sf_indoors, "interior_tavern_g", "bo_interior_tavern_g", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_7_tavern",sf_indoors, "interior_town_house_f", "bo_interior_town_house_f", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_8_tavern",sf_indoors, "interior_tavern_h", "bo_interior_tavern_h", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_9_tavern",sf_indoors, "interior_tavern_g", "bo_interior_tavern_g", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_10_tavern",sf_indoors, "interior_town_house_steppe_c", "bo_interior_town_house_steppe_c", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_11_tavern",sf_indoors, "interior_tavern_c", "bo_interior_tavern_c", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_12_tavern",sf_indoors, "interior_town_house_aa", "bo_interior_town_house_aa", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_13_tavern",sf_indoors, "interior_tavern_g", "bo_interior_tavern_g", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_14_tavern",sf_indoors, "interior_town_house_steppe_g", "bo_interior_town_house_steppe_g", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_15_tavern",sf_indoors, "interior_tavern_d", "bo_interior_tavern_d", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_16_tavern",sf_indoors, "interior_tavern_b", "bo_interior_tavern_b", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_17_tavern",sf_indoors, "interior_town_house_steppe_g", "bo_interior_town_house_steppe_g", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_18_tavern",sf_indoors, "interior_town_house_steppe_c", "bo_interior_town_house_steppe_c", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_1_store",sf_indoors,"interior_town_house_i", "bo_interior_town_house_i", (-100,-100),(100,100),-100,"0", [],[]), ("town_2_store",sf_indoors,"interior_town_house_j", "bo_interior_town_house_j", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_3_store",sf_indoors,"interior_town_house_e", "bo_interior_town_house_e", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_4_store",sf_indoors, "interior_town_house_a", "bo_interior_town_house_a", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_5_store",sf_indoors, "interior_town_house_d", "bo_interior_town_house_d", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_6_store",sf_indoors, "interior_town_house_j", "bo_interior_town_house_j", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_7_store",sf_indoors, "interior_house_a", "bo_interior_house_a", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_8_store",sf_indoors, "interior_house_b", "bo_interior_house_b", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_9_store",sf_indoors, "interior_tavern_a", "bo_interior_tavern_a", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_10_store",sf_indoors, "interior_town_house_steppe_d", "bo_interior_town_house_steppe_d", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_11_store",sf_indoors, "interior_town_house_j", "bo_interior_town_house_j", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_12_store",sf_indoors, "interior_house_a", "bo_interior_house_a", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_13_store",sf_indoors, "interior_town_house_j", "bo_interior_town_house_j", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_14_store",sf_indoors, "interior_house_extension_h", "bo_interior_house_extension_h", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_15_store",sf_indoors, "interior_town_house_c", "bo_interior_town_house_c", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_16_store",sf_indoors, "interior_town_house_i", "bo_interior_town_house_i", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_17_store",sf_indoors, "interior_town_house_steppe_g", "bo_interior_town_house_steppe_g", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_18_store",sf_indoors, "interior_town_house_steppe_d", "bo_interior_town_house_steppe_d", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_1_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c", [],[],"outer_terrain_plain"), ("town_2_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c", [],[],"outer_terrain_town_thir_1"), ("town_3_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c", [],[]), ("town_4_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c", [],[],"outer_terrain_plain"), ("town_5_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c", [],[],"outer_terrain_plain"), ("town_6_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c", [],[],"outer_terrain_plain"), ("town_7_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c", [],[],"outer_terrain_plain"), ("town_8_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c", [],[],"outer_terrain_plain"), ("town_9_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0x40001d9300031ccb0000156f000048ba0000361c", [],[],"outer_terrain_snow"), ("town_10_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200005000005f57b00005885000046bd00006d9c", [],[],"outer_terrain_steppe"), ("town_11_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0x40001d9300031ccb0000156f000048ba0000361c", [],[],"outer_terrain_snow"), ("town_12_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c", [],[],"outer_terrain_town_thir_1"), ("town_13_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c", [],[]), ("town_14_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200005000005f57b00005885000046bd00006d9c", [],[],"outer_terrain_steppe"), ("town_15_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c", [],[],"outer_terrain_plain"), ("town_16_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0001d9300031ccb0000156f000048ba0000361c", [],[],"outer_terrain_plain"), ("town_17_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200005000005f57b00005885000046bd00006d9c", [],[],"outer_terrain_steppe"), ("town_18_arena",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200005000005f57b00005885000046bd00006d9c", [],[],"outer_terrain_steppe"), ("town_1_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0", [],[]), ("town_2_prison",sf_indoors,"interior_prison_b", "bo_interior_prison_b", (-100,-100),(100,100),-100,"0", [],[]), ("town_3_prison",sf_indoors,"interior_prison_f", "bo_interior_prison_f", (-100,-100),(100,100),-100,"0", [],[]), ("town_4_prison",sf_indoors,"interior_prison_g", "bo_interior_prison_g", (-100,-100),(100,100),-100,"0", [],[]), ("town_5_prison",sf_indoors,"interior_prison_h", "bo_interior_prison_h", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_6_prison",sf_indoors,"interior_prison_e", "bo_interior_prison_e", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_7_prison",sf_indoors,"interior_prison_i", "bo_interior_prison_i", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_8_prison",sf_indoors,"dungeon_cell_b", "bo_dungeon_cell_b", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_9_prison",sf_indoors,"interior_prison_j", "bo_interior_prison_j", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_10_prison",sf_indoors,"interior_prison_o", "bo_interior_prison_o", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_11_prison",sf_indoors,"dungeon_a", "bo_dungeon_a", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_12_prison",sf_indoors,"interior_prison_d", "bo_interior_prison_d", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_13_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_14_prison",sf_indoors,"interior_prison_n", "bo_interior_prison_n", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_15_prison",sf_indoors,"interior_prison_f", "bo_interior_prison_f", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_16_prison",sf_indoors,"interior_prison_k", "bo_interior_prison_k", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_17_prison",sf_indoors,"interior_prison_n", "bo_interior_prison_n", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_18_prison",sf_indoors,"interior_prison_o", "bo_interior_prison_o", (-100,-100),(100,100),-100,"0", ["exit"],[]), ("town_1_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013002491600055157000000d20000152a0000611a", [],[],"outer_terrain_plain"), ("town_2_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013002491600055157000000d20000152a0000611a", [],[],"outer_terrain_plain"), ("town_3_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000120044ecf0005955e0000119b0000290000001f11", [],[],"outer_terrain_steppe"), ("town_4_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300010c800054d5c00004af000005d3f00002ca0", [],[],"outer_terrain_plain"), ("town_5_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130028e320005e17b00004a14000006d70000019d", [],[],"outer_terrain_plain"), ("town_6_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300010c800054d5c00004af000005d3f00002ca0", [],[],"outer_terrain_plain"), ("town_7_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013002491600055157000000d20000152a0000611a", [],[],"outer_terrain_plain"), ("town_8_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013002491600055157000000d20000152a0000611a", [],[],"outer_terrain_plain"), ("town_9_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000140015033000651900000159f0000619800006af6", [],[],"outer_terrain_snow"), ("town_10_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200011af00065192000067110000688300003435", [],[],"outer_terrain_steppe"), ("town_11_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000140015033000651900000159f0000619800006af6", [],[],"outer_terrain_snow"), ("town_12_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300010c800054d5c00004af000005d3f00002ca0", [],[],"outer_terrain_plain"), ("town_13_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130028e320005e17b00004a14000006d70000019d", [],[],"outer_terrain_plain"), ("town_14_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200011af00065192000067110000688300003435", [],[],"outer_terrain_steppe"), ("town_15_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000530040ece0005b56d000072a70000240a00001534", [],[],"outer_terrain_steppe"), ("town_16_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013001c98d0005b56d000072a70000240a00001e09", [],[],"outer_terrain_steppe"), ("town_17_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200011af00065192000067110000688300003435", [],[],"outer_terrain_steppe"), ("town_18_walls",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200011af00065192000067110000688300003435", [],[],"outer_terrain_steppe"), ("town_1_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932", [],[],"outer_terrain_plain"), ("town_2_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932", [],[],"outer_terrain_town_thir"), ("town_3_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932", [],[]), ("town_4_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932", [],[],"outer_terrain_plain"), ("town_5_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932", [],[],"outer_terrain_plain"), ("town_6_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932", [],[],"outer_terrain_plain"), ("town_7_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x20008a110002589600006af30000356b00002c27", [],[],"outer_terrain_plain"), ("town_8_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932", [],[],"outer_terrain_plain"), ("town_9_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x400211130001e07800002ad400001172000035c4", [],[],"outer_terrain_snow"), ("town_10_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000420000500000334ce00001d1100003d0600000d27", [],[],"outer_terrain_steppe"), ("town_11_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x400211130001e07800002ad400001172000035c4", [],[],"outer_terrain_snow"), ("town_12_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932", [],[],"outer_terrain_town_thir"), ("town_13_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932", [],[]), ("town_14_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000420000500000334ce00001d1100003d0600000d27", [],[],"outer_terrain_steppe"), ("town_15_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932", [],[],"outer_terrain_steppe"), ("town_16_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x300bc5430001e0780000448a0000049f00007932", [],[],"outer_terrain_steppe"), ("town_17_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000420000500000334ce00001d1100003d0600000d27", [],[],"outer_terrain_steppe"), ("town_18_alley",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000420000500000334ce00001d1100003d0600000d27", [],[],"outer_terrain_steppe"), #0x30054d228004050000005a768000688400002e3b #0x30054da28004050000005a76800022aa00002e3b #Castles: # 1 Steppe ("castle_1_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x30054da28004050000005a76800022aa00002e3b", [],[],"outer_terrain_steppe"), ("castle_1_interior",sf_indoors, "dungeon_entry_a", "bo_dungeon_entry_a", (-100,-100),(100,100),-100,"0", ["exit"],["castle_1_seneschal"]), ("castle_1_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0", [],[]), # 2 Plain ("castle_2_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa00363638005c16d00003c82000037e000002303", [],[],"outer_terrain_plain"), ("castle_2_interior",sf_indoors, "interior_castle_u", "bo_interior_castle_u", (-100,-100),(100,100),-100,"0", ["exit"],["castle_2_seneschal"]), ("castle_2_prison",sf_indoors,"interior_prison_d", "bo_interior_prison_d", (-100,-100),(100,100),-100,"0",#### B bkullanilmayacak [],[]), # 3 Plain ("castle_3_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000030044e900003dd02000077b20000400100005697", [],[],"outer_terrain_plain"), ("castle_3_interior",sf_indoors, "interior_castle_m", "bo_interior_castle_m", (-100,-100),(100,100),-100,"0", ["exit"],["castle_3_seneschal"]), ("castle_3_prison",sf_indoors,"interior_prison_e", "bo_interior_prison_e", (-100,-100),(100,100),-100,"0", [],[]), # 4 Plain ("castle_4_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000030044e900003dd02000077b20000400100005697", [],[],"outer_terrain_plain"), ("castle_4_interior",sf_indoors, "interior_castle_k", "bo_interior_castle_k", (-100,-100),(100,100),-100,"0", ["exit"],["castle_4_seneschal"]), ("castle_4_prison",sf_indoors,"interior_prison_l", "bo_interior_prison_l", (-100,-100),(100,100),-100,"0", [],[]), # 5 Plain ("castle_5_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x3189dc1a000429090000619700007cbd00005ab7", [],[],"outer_terrain_plain"), ("castle_5_interior",sf_indoors, "interior_castle_j", "bo_interior_castle_j", (-100,-100),(100,100),-100,"0", ["exit"],["castle_5_seneschal"]), ("castle_5_prison",sf_indoors,"interior_prison_l", "bo_interior_prison_l", (-100,-100),(100,100),-100,"0", [],[]), # 6 Plain ("castle_6_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000000b009723200059d6800005f4f0000757f000069cd", [],[],"outer_terrain_plain"), ("castle_6_interior",sf_indoors, "interior_castle_p", "bo_interior_castle_p", (-100,-100),(100,100),-100,"0", ["exit"],["castle_6_seneschal"]), ("castle_6_prison",sf_indoors,"interior_prison_j", "bo_interior_prison_j", (-100,-100),(100,100),-100,"0", [],[]), # 7 Snow ("castle_7_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000000c007a56300047d1e00006c9100002859000028bc", [],[],"outer_terrain_snow"), ("castle_7_interior",sf_indoors, "interior_castle_o", "bo_interior_castle_o", (-100,-100),(100,100),-100,"0", ["exit"],["castle_7_seneschal"]), ("castle_7_prison",sf_indoors,"interior_prison_i", "bo_interior_prison_i", (-100,-100),(100,100),-100,"0", [],[]), # 8 Plain ("castle_8_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x314d060900036cd70000295300002ec9000025f3", [],[],"outer_terrain_plain"), ("castle_8_interior",sf_indoors, "interior_castle_t", "bo_interior_castle_t", (-100,-100),(100,100),-100,"0", ["exit"],["castle_8_seneschal"]), ("castle_8_prison",sf_indoors,"interior_prison_e", "bo_interior_prison_e", (-100,-100),(100,100),-100,"0", [],[]), # 9 Steppe ("castle_9_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0048e000004d93700004f91000065980000229b", [],[],"outer_terrain_castle_9"), ("castle_9_interior",sf_indoors, "interior_castle_l", "bo_interior_castle_l", (-100,-100),(100,100),-100,"0", ["exit"],["castle_9_seneschal"]), ("castle_9_prison",sf_indoors,"interior_prison_d", "bo_interior_prison_d", (-100,-100),(100,100),-100,"0", [],[]), # 10 Steppe ("castle_10_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0xa0045f200004751b000051cf00007f7a00002cd9", [],[],"outer_terrain_steppe"), ("castle_10_interior",sf_indoors, "interior_castle_n", "bo_interior_castle_n", (-100,-100),(100,100),-100,"0", ["exit"],["castle_10_seneschal"]), ("castle_10_prison",sf_indoors,"interior_prison_k", "bo_interior_prison_k", (-100,-100),(100,100),-100,"0", [],[]), # 11 Plain ("castle_11_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000030044e900003dd02000077b20000400100005697", [],[],"outer_terrain_plain"), ("castle_11_interior",sf_indoors, "interior_castle_a", "bo_interior_castle_a", (-100,-100),(100,100),-100,"0", ["exit"],["castle_11_seneschal"]), ("castle_11_prison",sf_indoors,"interior_prison_k", "bo_interior_prison_k", (-100,-100),(100,100),-100,"0", [],[]), # Plain ("castle_12_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230054f630005fd820000222a00003de000005f00", [],[],"outer_terrain_town_thir_1"), ("castle_12_interior",sf_indoors, "interior_castle_y", "bo_interior_castle_y", (-100,-100),(100,100),-100,"0", ["exit"],["castle_12_seneschal"]), ("castle_12_prison",sf_indoors,"interior_prison_i", "bo_interior_prison_i", (-100,-100),(100,100),-100,"0", [],[]), # Plain ("castle_13_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230054f630005fd820000222a00003de000005f00", [],[],"outer_terrain_plain"), ("castle_13_interior",sf_indoors, "interior_castle_v", "bo_interior_castle_v", (-100,-100),(100,100),-100,"0", ["exit"],["castle_13_seneschal"]), ("castle_13_prison",sf_indoors,"interior_prison_j", "bo_interior_prison_j", (-100,-100),(100,100),-100,"0", [],[]), # Plain ("castle_14_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023007a3b20005795e0000706d0000381800000bbc", [],[],"outer_terrain_plain"), ("castle_14_interior",sf_indoors, "interior_castle_j", "bo_interior_castle_j" , (-100,-100),(100,100),-100,"0", ["exit"],["castle_14_seneschal"]), ("castle_14_prison",sf_indoors,"interior_prison_m", "bo_interior_prison_m", (-100,-100),(100,100),-100,"0", [],[]), # Plain ("castle_15_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023007941f0005415000007e650000225f00003b3e", [],[],"outer_terrain_plain"), ("castle_15_interior",sf_indoors, "interior_castle_p", "bo_interior_castle_p", (-100,-100),(100,100),-100,"0", ["exit"],["castle_15_seneschal"]), ("castle_15_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0", [],[]), # Plain ("castle_16_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023007a3b20005795e0000706d0000381800000bbc", [],[],"outer_terrain_plain"), ("castle_16_interior",sf_indoors, "interior_castle_k", "bo_interior_castle_k", (-100,-100),(100,100),-100,"0", ["exit"],["castle_16_seneschal"]), ("castle_16_prison",sf_indoors,"interior_prison_l", "bo_interior_prison_l", (-100,-100),(100,100),-100,"0", [],[]), # Steppe ("castle_17_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000220045d9b0005d9760000034a00002a3e00006fbd", [],[],"outer_terrain_steppe"), ("castle_17_interior",sf_indoors, "interior_castle_l", "bo_interior_castle_l", (-100,-100),(100,100),-100,"0", ["exit"],["castle_17_seneschal"]), ("castle_17_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0", [],[]), # Snow ("castle_18_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000240079f9e0005695a0000035f00003ef400004aa8", [],[],"outer_terrain_snow"), ("castle_18_interior",sf_indoors, "interior_castle_n", "bo_interior_castle_n", (-100,-100),(100,100),-100,"0", ["exit"],["castle_18_seneschal"]), ("castle_18_prison",sf_indoors,"interior_prison_k", "bo_interior_prison_k", (-100,-100),(100,100),-100,"0", [],[]), # Snow ("castle_19_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000014004d81100057963000062ce0000255800004c09", [],[],"outer_terrain_snow"), ("castle_19_interior",sf_indoors, "interior_castle_c", "bo_interior_castle_c", (-100,-100),(100,100),-100,"0", ["exit"],["castle_19_seneschal"]), ("castle_19_prison",sf_indoors,"interior_prison_e", "bo_interior_prison_e", (-100,-100),(100,100),-100,"0", [],[]), # Plain ("castle_20_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013006199a0004e5370000494f000028fc00006cf6", [],[],"outer_terrain_plain"), ("castle_20_interior",sf_indoors, "interior_castle_a", "bo_interior_castle_a", (-100,-100),(100,100),-100,"0", ["exit"],["castle_20_seneschal"]), ("castle_20_prison",sf_indoors,"interior_prison_d", "bo_interior_prison_d", (-100,-100),(100,100),-100,"0", [],[]), ("castle_21_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000030011ab20005d57800003a2600004b7a000071ef", [],[],"outer_terrain_plain"), ("castle_21_interior",sf_indoors, "interior_castle_c", "bo_interior_castle_c", (-100,-100),(100,100),-100,"0", ["exit"],["castle_21_seneschal"]), ("castle_21_prison",sf_indoors,"interior_prison_d", "bo_interior_prison_d", (-100,-100),(100,100),-100,"0", [],[]), ("castle_22_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000003000ad340004d537000024650000253c00000461", [],[],"outer_terrain_plain"), ("castle_22_interior",sf_indoors, "interior_castle_a", "bo_interior_castle_a", (-100,-100),(100,100),-100,"0", ["exit"],["castle_22_seneschal"]), ("castle_22_prison",sf_indoors,"interior_prison_i", "bo_interior_prison_i", (-100,-100),(100,100),-100,"0", [],[]), ("castle_23_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300658bc0007bded000025520000093800006114", [],[], "outer_terrain_plain"), ("castle_23_interior",sf_indoors, "interior_castle_y", "bo_interior_castle_y", (-100,-100),(100,100),-100,"0", ["exit"],["castle_23_seneschal"]), ("castle_23_prison",sf_indoors,"interior_prison_b", "bo_interior_prison_b", (-100,-100),(100,100),-100,"0", [],[]), ("castle_24_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130021f63000721ca000055be000079d90000156d", [],[],"outer_terrain_plain"), ("castle_24_interior",sf_indoors, "castle_h_interior_b", "bo_castle_h_interior_b", (-100,-100),(100,100),-100,"0", ["exit"],["castle_24_seneschal"]), ("castle_24_prison",sf_indoors,"interior_prison_f", "bo_interior_prison_f", (-100,-100),(100,100),-100,"0", [],[]), ("castle_25_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013004e0a600061989000053d50000749800005f64", [],[],"outer_terrain_plain"), ("castle_25_interior",sf_indoors, "castle_h_interior_b", "bo_castle_h_interior_b", (-100,-100),(100,100),-100,"0", ["exit"],["castle_25_seneschal"]), ("castle_25_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0", [],[]), ("castle_26_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013005213200077dda0000733300002edf000052ba", [],[],"outer_terrain_plain"), ("castle_26_interior",sf_indoors, "castle_h_interior_a", "bo_castle_h_interior_a", (-100,-100),(100,100),-100,"0", ["exit"],["castle_26_seneschal"]), ("castle_26_prison",sf_indoors,"interior_prison_h", "bo_interior_prison_h", (-100,-100),(100,100),-100,"0", [],[]), ("castle_27_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007b23200070dbc000041de00000c4900003cfc", [],[],"outer_terrain_plain"), ("castle_27_interior",sf_indoors, "castle_h_interior_a", "bo_castle_h_interior_a", (-100,-100),(100,100),-100,"0", ["exit"],["castle_27_seneschal"]), ("castle_27_prison",sf_indoors,"interior_prison_i", "bo_interior_prison_i", (-100,-100),(100,100),-100,"0", [],[]), ("castle_28_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007b232000715c50000084c00001b5b000018ec", [],[],"outer_terrain_plain"), ("castle_28_interior",sf_indoors, "castle_h_interior_a", "bo_castle_h_interior_a", (-100,-100),(100,100),-100,"0", ["exit"],["castle_28_seneschal"]), ("castle_28_prison",sf_indoors,"interior_prison_j", "bo_interior_prison_j", (-100,-100),(100,100),-100,"0", [],[]), ("castle_29_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000006400796b20005053e000042ed0000199b000037cd", [],[],"outer_terrain_snow"), ("castle_29_interior",sf_indoors, "interior_castle_n", "bo_interior_castle_n", (-100,-100),(100,100),-100,"0", ["exit"],["castle_29_seneschal"]), ("castle_29_prison",sf_indoors,"interior_prison_a", "bo_interior_prison_a", (-100,-100),(100,100),-100,"0", [],[]), ("castle_30_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000620035e32000611840000147f00003dac00000660", [],[],"outer_terrain_plain"), ("castle_30_interior",sf_indoors, "interior_castle_g_square_keep", "bo_interior_castle_g_square_keep", (-100,-100),(100,100),-100,"0", ["exit"],["castle_30_seneschal"]), ("castle_30_prison",sf_indoors,"interior_prison_n", "bo_interior_prison_n", (-100,-100),(100,100),-100,"0", [],[]), ("castle_31_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230025b8d0006459400006a3700002adb00007091", [],[],"outer_terrain_plain"), ("castle_31_interior",sf_indoors, "interior_castle_y", "bo_interior_castle_y", (-100,-100),(100,100),-100,"0", ["exit"],["castle_31_seneschal"]), ("castle_31_prison",sf_indoors,"interior_prison_i", "bo_interior_prison_i", (-100,-100),(100,100),-100,"0", [],[]), ("castle_32_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230041fb20005fd7d00002692000029b700007d12", [],[],"outer_terrain_plain"), ("castle_32_interior",sf_indoors, "castle_h_interior_a", "bo_castle_h_interior_a", (-100,-100),(100,100),-100,"0", ["exit"],["castle_32_seneschal"]), ("castle_32_prison",sf_indoors,"interior_prison_j", "bo_interior_prison_j", (-100,-100),(100,100),-100,"0", [],[]), ("castle_33_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230029cb2000709c200003c9500004b9b00002f4d", [],[],"outer_terrain_plain"), ("castle_33_interior",sf_indoors, "interior_castle_v", "bo_interior_castle_v", (-100,-100),(100,100),-100,"0", ["exit"],["castle_33_seneschal"]), ("castle_33_prison",sf_indoors,"interior_prison_d", "bo_interior_prison_d", (-100,-100),(100,100),-100,"0", [],[]), ("castle_34_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002b007b232000715c50000084c00001b5b00006580", [],[],"outer_terrain_plain"), ("castle_34_interior",sf_indoors, "interior_castle_c", "bo_interior_castle_c", (-100,-100),(100,100),-100,"0", ["exit"],["castle_34_seneschal"]), ("castle_34_prison",sf_indoors,"interior_prison_f", "bo_interior_prison_f", (-100,-100),(100,100),-100,"0", [],[]), ("castle_35_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130031be30006f9bc00000aae00000fb80000243f", [],[],"outer_terrain_plain"), ("castle_35_interior",sf_indoors, "castle_h_interior_a", "bo_castle_h_interior_a", (-100,-100),(100,100),-100,"0", ["exit"],["castle_35_seneschal"]), ("castle_35_prison",sf_indoors,"interior_prison_f", "bo_interior_prison_f", (-100,-100),(100,100),-100,"0", [],[]), ("castle_36_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007b2630005695c00001ebe0000028e00007e37", [],[],"outer_terrain_plain"), ("castle_36_interior",sf_indoors, "castle_h_interior_b", "bo_castle_h_interior_b", (-100,-100),(100,100),-100,"0", ["exit"],["castle_36_seneschal"]), ("castle_36_prison",sf_indoors,"interior_prison_h", "bo_interior_prison_h", (-100,-100),(100,100),-100,"0", [],[]), ("castle_37_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130025cb20006097f00005b1400000e2f00005fd9", [],[],"outer_terrain_plain"), ("castle_37_interior",sf_indoors, "interior_castle_k", "bo_interior_castle_k", (-100,-100),(100,100),-100,"0", ["exit"],["castle_37_seneschal"]), ("castle_37_prison",sf_indoors,"interior_prison_l", "bo_interior_prison_l", (-100,-100),(100,100),-100,"0", [],[]), ("castle_38_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000012007985300055550000064d500005c060000759e", [],[],"outer_terrain_steppe"), ("castle_38_interior",sf_generate, "none", "none", (-100,-100),(100,100),-100,"0x00000007300005000002308c00004a840000624700004fda", ["exit"],["castle_38_seneschal"]), ("castle_38_prison",sf_indoors,"interior_prison_o", "bo_interior_prison_o", (-100,-100),(100,100),-100,"0", [],[]), ("castle_39_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000014007a0320005695f0000601c00007a8800001a17", [],[],"outer_terrain_snow"), ("castle_39_interior",sf_indoors, "interior_castle_n", "bo_interior_castle_n", (-100,-100),(100,100),-100,"0", ["exit"],["castle_39_seneschal"]), ("castle_39_prison",sf_indoors,"interior_prison_k", "bo_interior_prison_k", (-100,-100),(100,100),-100,"0", [],[]), ("castle_40_exterior",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000012007985300055550000064d500005c060000759e", [],[],"outer_terrain_plain"), ("castle_40_interior",sf_indoors, "interior_castle_g_square_keep", "bo_interior_castle_g_square_keep", (-100,-100),(100,100),-100,"0", ["exit"],["castle_40_seneschal"]), ("castle_40_prison",sf_indoors,"interior_prison_n", "bo_interior_prison_n", (-100,-100),(100,100),-100,"0", [],[]), #!!Villages !!# ("village_1",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000030081763000589620000338e00004f2c00005cfb", [],[],"outer_terrain_plain"), ("village_2",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000003007a21c0003ecfe000001f0000073b100000fd2", [],[],"outer_terrain_plain"), ("village_3",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023003dc4e0006118b000029f8000034670000105f", [],[],"outer_terrain_plain"), ("village_4",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230079732000651a00000044c0000177200000234", [],[],"outer_terrain_plain"), ("village_5",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000003001ce100006097d0000134c000016d8000042a2", [],[],"outer_terrain_plain"), ("village_6",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230035598000761df000058ea000006f3000005e7", [],[],"outer_terrain_plain"), ("village_7",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000031059a0d0004792000005c3a00004df500000dbc", [],[],"outer_terrain_plain"), ("village_8",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300798320006499200002acc000040d70000421d", [],[],"outer_terrain_plain"), ("village_9",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000004300005008005b57000004e31800017d80000754b", [],[],"outer_terrain_plain"), ("village_10",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013005dad40005f57b0000543e0000279d000052b4", [],[],"outer_terrain_plain"), ("village_11",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000220029c4400077de100002dcc00002edf00003925", [],[],"outer_terrain_steppe"), ("village_12",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200213e300077ddf000019d3000034520000626e", [],[],"outer_terrain_steppe"), ("village_13",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000000300265e3400691a400005e4d80006dfa00003bc8", [],[], "outer_terrain_plain"), ("village_14",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230029ce30004912400002acc000040d7000077db", [],[], "outer_terrain_plain"), ("village_15",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300029d4000691a4000015148000335800004190", [],[],"outer_terrain_plain"), ("village_16",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000240031a0f0006b9ae00006e1b00006e9000007281", [],[],"outer_terrain_snow"), ("village_17",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002c003131700066da00000484c000008630000613d", [],[],), ("village_18",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000024003561a00070dbe000016f8000010ca000069f8", [],[],"outer_terrain_snow"), ("village_19",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000024003991e0006f1bc000055cc0000085600001563", [],[],"outer_terrain_snow"), ("village_20",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000024003d7d20007d1f40000374100001e120000097b", [],[],"outer_terrain_snow"), ("village_21",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000240024d3800074dcc0000488b0000016100002047", [],[],"outer_terrain_snow"), ("village_22",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000024003d7d20007d1f40000374100001e120000097b", [],[],"outer_terrain_snow"), ("village_23",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300415380007b5e600005f7b00000a9200001615", [],[],), ("village_24",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023002e1ad00048924000031e70000677500002a0c", [],[],"outer_terrain_plain"), ("village_25",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002d0021ede000775dd000032670000173700007c40", [],[],"outer_terrain_steppe"), ("village_26",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230020a008005294c000063fc0000771c0000216f", [],[],"outer_terrain_plain"), ("village_27",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013001b2320004a52900004d390000518c00001ab1", [],[],"outer_terrain_plain"), ("village_28",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000022002de4c00077ddd00007e1300000af400006de1", [],[],"outer_terrain_steppe"), ("village_29",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023007b2320004f93c000023ed000053e500002949", [],[],"outer_terrain_plain"), ("village_30",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230025e0a0004dd3700004822000032ea0000011b", [],[],"outer_terrain_plain"), ("village_31",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300619e38003a8ec00004c8380005c6600001cb5", ##0x00000001300619e30003a8ec00004c8380007de100001cb5", [],[],"outer_terrain_plain"), ("village_32",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300619e30003a8ec00004c8380007de100001cb5", [],[],"outer_terrain_plain"), ("village_33",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130001700000649920000423900007768000062c3", [],[],"outer_terrain_plain"), ("village_34",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300323e3000611860000392d00005c05000067e1", [],[],"outer_terrain_plain"), ("village_35",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230079cb20005394e00001ef90000753000000731", [],[],"outer_terrain_town_thir_1"), ("village_36",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013003a1560006118d00003ce300004123000043b2", [],[],"outer_terrain_plain"), ("village_37",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000022004d36300077dd600002e08000036ab00004651", [],[],"outer_terrain_steppe"), ("village_38",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013003e21e0005fd7f000028920000650500005c53", [],[],"outer_terrain_plain"), ("village_39",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013003e5990005fd78000069670000446c00007476", [],[],"outer_terrain_plain"), ("village_40",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000220031f6300076dda000056f100004f6d000070b3", [],[],"outer_terrain_steppe"), ("village_41",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000022000a3e300062d8d0000444e0000276e00006eb1", [],[],"outer_terrain_steppe"), ("village_42",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000022007b23200062d8d000060b900003b8b00006c93", [],[],"outer_terrain_castle_9"), ("village_43",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000022000320e0005856300001d770000792700002aa1", [],[],"outer_terrain_steppe"), ("village_44",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002200020200005c574000075480000002d00004be7", [],[],"outer_terrain_steppe"), ("village_45",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000012007a3df0004e52b0000167700005180000051ea", [],[],"outer_terrain_steppe"), ("village_46",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007a03200061184000058d20000717a00001af0", [],[],"outer_terrain_plain"), ("village_47",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000000300621b100051d47000034e300007926000048d3", [],[],"outer_terrain_plain"), ("village_48",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001b0051ebc00062d8b0000570d00005b3900001ae1", [],[],"outer_terrain_plain"), ("village_49",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000140029bbc0006799b000009cb0000720000006555", [],[],"outer_terrain_snow"), ("village_50",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000140029bbc0006799b000009cb0000720000006555", [],[],"outer_terrain_snow"), ("village_51",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023002b0e30006a5a90000722700002f5200005e2b", [],[],"outer_terrain_plain"), ("village_52",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000220011de30005655900002c2300003b2400000d47", [],[],"outer_terrain_steppe"), ("village_53",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023002dd19000691a40000566a000012a000001037", [],[],"outer_terrain_plain"), ("village_54",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300032300005c5740000243e000056aa00003a7a", [],[],"outer_terrain_plain"), ("village_55",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300019500006c1b4000065c700002bea0000154e", [],[],"outer_terrain_plain"), ("village_56",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300296320006b5aa00006f3200003a5000004fed", [],[],"outer_terrain_town_thir_1"), ("village_57",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300027b200065d9700004dcf0000212800001bf0", [],[],"outer_terrain_plain"), ("village_58",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300018e38005e58300000376000027e70000015c", [],[],"outer_terrain_plain"), ("village_59",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300022a60005314c0000428100007e0100002e97", [],[],"outer_terrain_plain"), ("village_60",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230079c3200060d860000428100007e01000071b4", [],[],"outer_terrain_plain"), ("village_61",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300325350006659e0000603500006b0200005676", [],[],"outer_terrain_plain"), ("village_62",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130038cbc00062d8b00006cb100002b9f00002ca6", [],[],"outer_terrain_steppe"), ("village_63",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007a6b20006258b00006bb8000074df00002f18", [],[],"outer_terrain_plain"), ("village_64",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001300410320005a96800006b5300004edc00000d11", [],[],"outer_terrain_plain"), ("village_65",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013004d8320006358b00006d2b000005d5000023e5", [],[],"outer_terrain_plain"), ("village_66",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007a2b20006097f00001342000050d900003545", [],[],"outer_terrain_town_thir_1"), ("village_67",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013003e02d0005ed7800002c2e0000688800005fe4", [],[],"outer_terrain_plain"), ("village_68",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130079a3200062d8b0000297c00000def000067b7", [],[],"outer_terrain_plain"), ("village_69",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300022a60005314c0000428100007e0100002e97", [],[],"outer_terrain_plain"), ("village_70",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230079c3200060d860000428100007e01000071b4", [],[],"outer_terrain_plain"), ("village_71",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000630079ab20005fd7f0000687300007190000006df", [],[],"outer_terrain_plain"), ("village_72",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000006300654ac00062d910000635800007c9600005d35", [],[],"outer_terrain_plain"), ("village_73",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230079db200050d4500001b4b00007cf400001973", [],[],"outer_terrain_plain"), ("village_74",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300794320005f17c00003187000051540000350a", [],[],"outer_terrain_plain"), ("village_75",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002400798b20005ed7b000019160000650f000072d2", [],[],"outer_terrain_snow"), ("village_76",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000022007a7b200045d19000004920000076d00003b0a", [],[],"outer_terrain_steppe"), ("village_77",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023009629a0005615800005564000023590000579e", [],[],"outer_terrain_plain"), ("village_78",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000023004561e00069da700000f490000256b000058b5", [],[],"outer_terrain_plain"), ("village_79",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230084fac00057d5f00002ba900004a7a000060be", [],[],"outer_terrain_plain"), ("village_80",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013001b21e0004f13e000042b2000058e400007fce", [],[],"outer_terrain_plain"), #################### Yeni koyler ###################### ("village_81",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000230079ab20005fd7f0000621700007190000006df", [],[],"outer_terrain_plain"), ("village_82",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013002541c00062d8b00000a01000068cb00006d9b", [],[],"outer_terrain_plain"), ("village_83",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013007b2320005956300001e640000462c00003a51", [],[],"outer_terrain_plain"), ("village_84",sf_generate,"none", "none", (0,0),(100,100),-100,"0x0000000130069b270004dd390000689b00002d3b00001876", [],[],"outer_terrain_plain"), ("village_85",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000014007b26300059563000051e000001aa4000034ee", [],[],"outer_terrain_snow"), ("village_86",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000014007b26300059563000051e000001aa4000034ee", [],[],"outer_terrain_snow"), ("village_87",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000013001c98a0004dd3000001a5e00005c6200001ec9", [],[],"outer_terrain_plain"), ("village_88",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000012007a83200049924000049bd00001f7a00006c57", [],[],"outer_terrain_steppe"), ("village_89",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000001200513940005314c00001f6d00006d7700006698", [],[],"outer_terrain_steppe"), ("village_90",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000012002cd900005314c00001f6d00006d7700003493", [],[],"outer_terrain_steppe"), ("field_1",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000033a059a5a0009525600002005000060e300001175", [],[],"outer_terrain_plain"), ("field_2",sf_generate,"none", "none", (0,0),(100,100),-100,"0x000000033a079a3f000a3a8000006dfd000030a100006522", [],[],"outer_terrain_steppe"), ("field_3",sf_generate,"none", "none", (0,0),(100,100),-100,"0x30054da28004050000005a76800022aa00002e3b", [],[],"outer_terrain_steppe"), ("field_4",sf_generate,"none", "none", (0,0),(100,100),-100,"0x30054da28004050000005a76800022aa00002e3b", [],[],"outer_terrain_steppe"), ("field_5",sf_generate,"none", "none", (0,0),(100,100),-100,"0x30054da28004050000005a76800022aa00002e3b", [],[],"outer_terrain_steppe"), ]
Python
from module_info import * from module_party_templates import * #from process_operations import * from process_common import * def save_party_template_troop(file,troop): if troop: # add_tag_use(tag_uses,tag_troop,troop[0]) file.write("%d %d %d "%(troop[0],troop[1],troop[2])) if (len(troop) > 3): file.write("%d "%troop[3]) else: file.write("0 ") else: file.write("-1 ") def save_party_templates(): file = open(export_dir + "party_templates.txt","w") file.write("partytemplatesfile version 1\n") file.write("%d\n"%(len(party_templates))) for party_template in party_templates: # add_tag_use(tag_uses,tag_faction,party_template[4]) file.write("pt_%s %s %d %d %d %d "%(convert_to_identifier(party_template[0]),replace_spaces(party_template[1]),party_template[2],party_template[3], party_template[4], party_template[5])) members = party_template[6] if (len(members) > 6): print "Error! NUMBER OF TEMPLATE MEMBERS EXCEEDS 6 " + party_template[0] members = members[0:6] for party_template_member in members: save_party_template_troop(file,party_template_member) for i in xrange(6 - len(members)): save_party_template_troop(file,0) file.write("\n") file.close() def save_python_header(): file = open("./ID_party_templates.py","w") for i_party_template in xrange(len(party_templates)): file.write("pt_%s = %d\n"%(convert_to_identifier(party_templates[i_party_template][0]),i_party_template)) file.close() print "Exporting party_template data..." #tag_uses = load_tag_uses(export_dir) save_python_header() save_party_templates() #save_tag_uses(export_dir, tag_uses)
Python
from header_common import * from header_operations import * from header_parties import * from header_items import * from header_skills import * from header_triggers import * from header_troops import * from module_constants import * #################################################################################################################### # Each trigger contains the following fields: # 1) Check interval: How frequently this trigger will be checked # 2) Delay interval: Time to wait before applying the consequences of the trigger # After its conditions have been evaluated as true. # 3) Re-arm interval. How much time must pass after applying the consequences of the trigger for the trigger to become active again. # You can put the constant ti_once here to make sure that the trigger never becomes active again after it fires once. # 4) Conditions block (list). This must be a valid operation block. See header_operations.py for reference. # Every time the trigger is checked, the conditions block will be executed. # If the conditions block returns true, the consequences block will be executed. # If the conditions block is empty, it is assumed that it always evaluates to true. # 5) Consequences block (list). This must be a valid operation block. See header_operations.py for reference. #################################################################################################################### # Some constants for use below merchant_inventory_space = 30 num_merchandise_goods = 36 triggers = [ # Tutorial: (0.1, 0, ti_once, [(map_free,0)], [(dialog_box,"str_tutorial_map1"), # Here's something tricky, making global variables compatible with native, don't touch or modify. (eq, 0, 1), # make sure the following are never reached ############################################## # Native global variables decleration ############################################## #Triggers begin (assign, "$caravan_escort_state", 0), (assign, "$qst_bring_back_runaway_serfs_num_parties_fleed", 0), (assign, "$qst_bring_back_runaway_serfs_num_parties_returned", 0), (assign, "$qst_follow_spy_run_away", 0), (assign, "$qst_follow_spy_meeting_state", 0), (assign, "$qst_follow_spy_meeting_counter", 0), (assign, "$qst_follow_spy_spy_back_in_town", 0), (assign, "$qst_follow_spy_partner_back_in_town", 0), (assign, "$qst_follow_spy_no_active_parties", 0), (assign, "$debt_to_merchants_guild", 0), (assign, "$npc_with_personality_clash", 0), (assign, "$personality_clash_after_24_hrs", 0), (assign, "$npc_is_quitting", 0), #Triggers end #Dialogs begin (assign, "$g_talk_troop", 0), (assign, "$g_talk_agent", 0), (assign, "$g_talk_troop_faction", 0), (assign, "$g_talk_troop_relation", 0), (assign, "$g_talk_troop_faction_relation", 0), (assign, "$g_talk_troop_party", 0), (assign, "$g_current_hours", 0), (assign, "$g_talk_troop_last_talk_time", 0), (assign, "$g_time_since_last_talk", 0), (assign, "$g_talk_troop_met", 0), (assign, "$g_enemy_strength", 0), (assign, "$g_ally_strength", 0), (assign, "$g_strength_ratio", 0), (assign, "$g_comment_found", 0), (assign, "$g_leave_encounter", 0), (assign, "$g_move_heroes", 0), (assign, "$supported_pretender", 0), (assign, "$npc_quit_morale", 0), (assign, "$player_can_refuse_npc_quitting", 0), (assign, "$player_can_persuade_npc", 0), (assign, "$temp", 0), (assign, "$g_center_taken_by_player_faction", 0), (assign, "$map_talk_troop", 0), (assign, "$npc_with_grievance", 0), (assign, "$npc_with_personality_clash_2", 0), (assign, "$npc_with_personality_match", 0), (assign, "$disable_local_histories", 0), (assign, "$g_enemy_surrenders", 0), (assign, "$g_castle_left_to_player", 0), (assign, "$g_player_surrenders", 0), (assign, "$pretender_told_story", 0), (assign, "$town_to_rebel", 0), (assign, "$town_to_approach", 0), (assign, "$player_made_legitimacy_claim", 0), (assign, "$player_made_benefit_claim", 0), (assign, "$player_made_strength_claim", 0), (assign, "$g_invite_offered_center", 0), (assign, "$g_player_follow_army_warnings", 0), (assign, "$prisoner_lord_to_buy", 0), (assign, "$g_ransom_offer_rejected", 0), (assign, "$g_convince_quest", 0), (assign, "$auto_menu", 0), (assign, "$capturer_party", 0), (assign, "$players_oath_renounced_given_center", 0), (assign, "$players_oath_renounced_terms_state", 0), (assign, "$player_has_homage", 0), (assign, "$g_leave_town_outside", 0), (assign, "$mercenary_service_accumulated_pay", 0), (assign, "$temp_2", 0), (assign, "$g_recalculate_ais", 0), (assign, "$hero_requested_to_learn_location", 0), (assign, "$faction_requested_to_learn_more_details_about_the_war_against", 0), (assign, "$encountered_party_hostile", 0), (assign, "$g_rebellion_suggest_friends_stronger", 0), (assign, "$rival_lord", 0), (assign, "$rebellion_chance", 0), (assign, "$prior_argument_value", 0), (assign, "$current_argument", 0), (assign, "$current_argument_value", 0), (assign, "$player_made_ruler_claim", 0), (assign, "$rebellion_check", 0), (assign, "$g_invite_faction", 0), (assign, "$g_invite_faction_lord", 0), (assign, "$supported_pretender_old_faction", 0), (assign, "$g_player_banner_granted", 0), (assign, "$town_suggested_to_go_to", 0), (assign, "$suggested_to_attack_party", 0), (assign, "$suggested_to_attack_center", 0), (assign, "$mercenary_service_next_pay_time", 0), (assign, "$mercenary_service_next_renew_day", 0), (assign, "$random_quest_no", 0), (assign, "$g_leave_town", 0), (assign, "$qst_kill_local_merchant_center", 0), (assign, "$qst_follow_spy_spy_partners_party", 0), (assign, "$qst_follow_spy_spy_party", 0), (assign, "$qst_bring_back_runaway_serfs_party_1", 0), (assign, "$qst_bring_back_runaway_serfs_party_2", 0), (assign, "$qst_bring_back_runaway_serfs_party_3", 0), (assign, "$auto_enter_town", 0), (assign, "$lord_requested_to_talk_to", 0), (assign, "$troop_to_restore_relations_with", 0), (assign, "$lady_restore_cost_1", 0), (assign, "$lady_restore_cost_2", 0), (assign, "$lady_restore_cost_3", 0), (assign, "$convince_value", 0), (assign, "$convince_relation_penalty", 0), (assign, "$persuasion_strength", 0), (assign, "$hero_requested_to_learn_relations", 0), (assign, "$caravan_distance_to_target", 0), (assign, "$caravan_escort_offer", 0), (assign, "$caravan_escort_destination_town", 0), (assign, "$caravan_escort_party_id", 0), (assign, "$caravan_escort_agreed_reward", 0), (assign, "$g_permitted_to_center", 0), (assign, "$deserter_tribute", 0), (assign, "$buy_drinks_last_time", 0), (assign, "$ransom_broker_families_told", 0), (assign, "$ransom_broker_prices_told", 0), (assign, "$ransom_broker_ransom_me_told", 0), (assign, "$traveler_land_asked", 0), (assign, "$last_lost_companion", 0), (assign, "$traveller_claimants_mentioned", 0), (assign, "$num_opponents_to_beat_in_a_row", 0), (assign, "$waiting_for_training_fight_result", 0), (assign, "$novicemaster_opponent_troop", 0), (assign, "$training_system_explained", 0), (assign, "$novice_training_difficulty", 0), (assign, "$training_fight_won", 0), (assign, "$merchant_quest_last_offerer", 0), (assign, "$merchant_offered_quest", 0), (assign, "$g_force_peace_faction_1", 0), (assign, "$g_force_peace_faction_2", 0), (assign, "$random_merchant_quest_no", 0), (assign, "$mayor_info_lord_told", 0), (assign, "$escort_merchant_caravan_mode", 0), (assign, "$qst_troublesome_bandits_eliminated", 0), (assign, "$qst_troublesome_bandits_eliminated_by_player", 0), (assign, "$arena_reward_asked", 0), (assign, "$arena_tournaments_asked", 0), (assign, "$arena_master_first_talk", 0), (assign, "$last_training_fight_town", 0), (assign, "$training_fight_time", 0), (assign, "$g_mt_mode", 0), (assign, "$g_player_entry_point", 0), (assign, "$bandit_tribute", 0), (assign, "$welfare_inquired", 0), (assign, "$rumors_inquired", 0), (assign, "$info_inquired", 0), #Dialogs end #Game menus begin (assign, "$character_gender", 0), (assign, "$cheat_mode", 0), (assign, "$g_custom_battle_scenario", 0), (assign, "$g_battle_result", 0), (assign, "$g_player_troop", 0), (assign, "$g_custom_battle_scene", 0), (assign, "$background_type", 0), (assign, "$background_answer_2", 0), (assign, "$background_answer_3", 0), (assign, "$background_answer_4", 0), (assign, "$current_string_reg", 0), (assign, "$g_cheat_selected_faction", 0), (assign, "$g_player_reading_book", 0), (assign, "$g_player_icon_state", 0), (assign, "$g_camp_mode", 0), (assign, "$g_prisoner_recruit_troop_id", 0), (assign, "$g_prisoner_recruit_size", 0), (assign, "$g_prisoner_recruit_last_time", 0), (assign, "$g_player_debt_to_party_members", 0), (assign, "$g_enemy_party", 0), (assign, "$g_ally_party", 0), (assign, "$new_encounter", 0), (assign, "$g_encounter_is_in_village", 0), (assign, "$g_encounter_type", 0), (assign, "$encountered_party_friendly", 0), (assign, "$cant_leave_encounter", 0), (assign, "$talk_context", 0), (assign, "$g_next_menu", 0), (assign, "$g_engaged_enemy", 0), (assign, "$g_village_raid_evil", 0), (assign, "$no_soldiers_left", 0), (assign, "$playerparty_postbattle_regulars", 0), (assign, "$thanked_by_ally_leader", 0), (assign, "$g_relation_boost", 0), (assign, "$last_defeated_hero", 0), (assign, "$last_freed_hero", 0), (assign, "$capture_screen_shown", 0), (assign, "$pin_number", 0), (assign, "$loot_screen_shown", 0), (assign, "$g_total_victories", 0), (assign, "$g_total_defeats", 0), (assign, "$g_siege_final_menu", 0), (assign, "$g_siege_battle_state", 0), (assign, "$all_doors_locked", 0), (assign, "$current_town", 0), (assign, "$entry_to_town_forbidden", 0), (assign, "$sneaked_into_town", 0), (assign, "$town_entered", 0), (assign, "$g_player_besiege_town", 0), (assign, "$cant_sneak_into_town", 0), (assign, "$castle_undefended", 0), (assign, "$g_town_visit_after_rest", 0), (assign, "$g_last_defeated_bandits_town", 0), (assign, "$num_castle_meeting_troops", 0), (assign, "$castle_meeting_selected_troop", 0), (assign, "$g_siege_force_wait", 0), (assign, "$g_siege_method", 0), (assign, "$g_siege_sallied_out_once", 0), (assign, "$cant_talk_to_enemy", 0), (assign, "$auto_besiege_town", 0), (assign, "$g_siege_method_finish_hours", 0), (assign, "$g_castle_requested_by_player", 0), (assign, "$players_oath_renounced_against_kingdom", 0), (assign, "$players_oath_renounced_begin_time", 0), (assign, "$g_battle_simulation_cancel_for_party", 0), (assign, "$g_battle_simulation_auto_enter_town_after_battle", 0), (assign, "$g_siege_first_encounter", 0), (assign, "$g_siege_join", 0), (assign, "$g_defending_against_siege", 0), (assign, "$qst_collect_taxes_currently_collecting", 0), (assign, "$qst_train_peasants_against_bandits_currently_training", 0), (assign, "$auto_enter_menu_in_center", 0), (assign, "$g_player_raiding_village", 0), (assign, "$qst_eliminate_bandits_infesting_village_num_bandits", 0), (assign, "$qst_eliminate_bandits_infesting_village_num_villagers", 0), (assign, "$g_player_raid_complete", 0), (assign, "$town_nighttime", 0), (assign, "$g_last_rest_center", 0), (assign, "$g_strength_contribution_of_player", 0), (assign, "$g_improvement_type", 0), (assign, "$quest_auto_menu", 0), (assign, "$g_town_assess_trade_goods_after_rest", 0), (assign, "$g_tournament_cur_tier", 0), (assign, "$g_tournament_player_team_won", 0), (assign, "$g_tournament_bet_placed", 0), (assign, "$g_tournament_bet_win_amount", 0), (assign, "$g_tournament_last_bet_tier", 0), (assign, "$g_tournament_next_num_teams", 0), (assign, "$g_tournament_next_team_size", 0), (assign, "$g_last_rest_payment_until", 0), (assign, "$g_main_ship_party", 0), (assign, "$g_tournament_num_participants_for_fight", 0), (assign, "$qst_collect_taxes_total_hours", 0), (assign, "$qst_collect_taxes_hourly_income", 0), (assign, "$qst_collect_taxes_menu_counter", 0), (assign, "$qst_collect_taxes_unrest_counter", 0), (assign, "$qst_collect_taxes_halve_taxes", 0), (assign, "$g_train_peasants_against_bandits_num_peasants", 0), (assign, "$g_encountered_party", 0), (assign, "$last_sneak_attempt_town", 0), (assign, "$last_sneak_attempt_time", 0), (assign, "$g_training_ground_melee_training_scene", 0), (assign, "$g_training_ground_training_count", 0), (assign, "$temp_3", 0), (assign, "$g_presentation_marshall_selection_max_renown_2", 0), (assign, "$g_presentation_marshall_selection_max_renown_2_troop", 0), (assign, "$g_presentation_marshall_selection_max_renown_1", 0), (assign, "$g_presentation_marshall_selection_max_renown_1_troop", 0), (assign, "$g_player_is_captive", 0), (assign, "$player_ransom_amount", 0), (assign, "$players_kingdom", 0), #Game menus end #Mission templates begin (assign, "$g_train_peasants_against_bandits_training_succeeded", 0), (assign, "$pin_player_fallen", 0), (assign, "$battle_won", 0), (assign, "$defender_reinforcement_stage", 0), (assign, "$attacker_reinforcement_stage", 0), (assign, "$g_presentation_battle_active", 0), # (assign, "$formation_vector", 0), # (assign, "$formation_temp_vector", 0), # (assign, "$formation_selected", 0), # (assign, "$formation_array_selected", 0), # (assign, "$formation_max_array_no", 0), # (assign, "$formation_auto_rotation", 0), (assign, "$defender_team", 0), (assign, "$attacker_team", 0), (assign, "$defender_team_2", 0), (assign, "$attacker_team_2", 0), (assign, "$belfry_positioned", 0), (assign, "$trainer_help_message", 0), (assign, "$g_last_destroyed_gourds", 0), (assign, "$g_training_ground_training_success_ratio", 0), (assign, "$scene_num_total_gourds_destroyed", 0), (assign, "$g_arena_training_num_agents_spawned", 0), (assign, "$g_arena_training_kills", 0), (assign, "$g_arena_training_max_opponents", 0), (assign, "$g_arena_training_won", 0), (assign, "$g_arena_training_next_spawn_time", 0), (assign, "$tutorial_1_state", 0), (assign, "$tutorial_1_msg_1_displayed", 0), (assign, "$tutorial_1_msg_2_displayed", 0), (assign, "$tutorial_1_msg_3_displayed", 0), (assign, "$tutorial_1_msg_4_displayed", 0), (assign, "$tutorial_1_msg_5_displayed", 0), (assign, "$tutorial_1_msg_6_displayed", 0), (assign, "$tutorial_num_total_dummies_destroyed", 0), (assign, "$tutorial_time", 0), (assign, "$g_last_archery_point_earned", 0), (assign, "$tutorial_num_arrows_hit", 0), (assign, "$tutorial_1_finished", 0), (assign, "$tutorial_2_state", 0), (assign, "$tutorial_2_msg_1_displayed", 0), (assign, "$tutorial_2_msg_2_displayed", 0), (assign, "$tutorial_2_msg_3_displayed", 0), (assign, "$tutorial_2_msg_4_displayed", 0), (assign, "$tutorial_2_msg_5_displayed", 0), (assign, "$tutorial_2_msg_6_displayed", 0), (assign, "$tutorial_2_msg_7_displayed", 0), (assign, "$tutorial_2_msg_8_displayed", 0), (assign, "$tutorial_2_msg_9_displayed", 0), (assign, "$tutorial_2_melee_agent_state", 0), (assign, "$tutorial_2_finished", 0), (assign, "$tutorial_3_state", 0), (assign, "$tutorial_3_msg_1_displayed", 0), (assign, "$tutorial_3_msg_2_displayed", 0), (assign, "$tutorial_3_msg_3_displayed", 0), (assign, "$tutorial_3_msg_4_displayed", 0), (assign, "$tutorial_3_msg_5_displayed", 0), (assign, "$tutorial_3_msg_6_displayed", 0), (assign, "$tutorial_3_finished", 0), (assign, "$tutorial_4_state", 0), (assign, "$tutorial_4_msg_1_displayed", 0), (assign, "$tutorial_4_msg_2_displayed", 0), (assign, "$tutorial_4_msg_3_displayed", 0), (assign, "$tutorial_4_msg_4_displayed", 0), (assign, "$tutorial_4_msg_5_displayed", 0), (assign, "$tutorial_4_msg_6_displayed", 0), (assign, "$tutorial_4_msg_7_displayed", 0), (assign, "$tutorial_4_finished", 0), (assign, "$tutorial_5_state", 0), (assign, "$tutorial_5_msg_1_displayed", 0), (assign, "$tutorial_5_msg_2_displayed", 0), (assign, "$tutorial_5_msg_3_displayed", 0), (assign, "$tutorial_5_msg_4_displayed", 0), (assign, "$tutorial_5_msg_5_displayed", 0), (assign, "$tutorial_5_msg_6_displayed", 0), (assign, "$tutorial_5_finished", 0), #Mission templates end #Presentations begin (assign, "$g_presentation_credits_obj_1", 0), (assign, "$g_presentation_credits_obj_2", 0), (assign, "$g_presentation_credits_obj_3", 0), (assign, "$g_presentation_credits_obj_4", 0), (assign, "$g_presentation_credits_obj_5", 0), (assign, "$g_presentation_credits_obj_6", 0), (assign, "$g_presentation_credits_obj_7", 0), (assign, "$g_presentation_credits_obj_8", 0), (assign, "$g_presentation_credits_obj_9", 0), (assign, "$g_presentation_credits_obj_10", 0), (assign, "$g_presentation_credits_obj_11", 0), (assign, "$g_presentation_credits_obj_12", 0), (assign, "$g_presentation_credits_obj_1_alpha", 0), (assign, "$g_presentation_credits_obj_2_alpha", 0), (assign, "$g_presentation_credits_obj_3_alpha", 0), (assign, "$g_presentation_credits_obj_4_alpha", 0), (assign, "$g_presentation_credits_obj_5_alpha", 0), (assign, "$g_presentation_credits_obj_6_alpha", 0), (assign, "$g_presentation_credits_obj_7_alpha", 0), (assign, "$g_presentation_credits_obj_8_alpha", 0), (assign, "$g_presentation_credits_obj_9_alpha", 0), (assign, "$g_presentation_obj_1", 0), (assign, "$g_presentation_banner_start", 0), (assign, "$g_presentation_page_no", 0), (assign, "$g_presentation_obj_22", 0), (assign, "$g_presentation_obj_23", 0), (assign, "$g_presentation_obj_2", 0), (assign, "$g_presentation_obj_3", 0), (assign, "$g_presentation_obj_4", 0), (assign, "$g_presentation_obj_5", 0), (assign, "$g_presentation_obj_19", 0), (assign, "$g_presentation_obj_20", 0), (assign, "$g_presentation_obj_16", 0), (assign, "$g_presentation_obj_17", 0), (assign, "$g_presentation_obj_18", 0), (assign, "$g_presentation_obj_15", 0), (assign, "$g_presentation_obj_21", 0), (assign, "$g_presentation_obj_14", 0), (assign, "$g_presentation_obj_6", 0), (assign, "$g_presentation_obj_7", 0), (assign, "$g_presentation_obj_24", 0), (assign, "$g_presentation_obj_28", 0), (assign, "$g_presentation_obj_32", 0), (assign, "$g_presentation_obj_33", 0), (assign, "$g_presentation_obj_8", 0), (assign, "$g_presentation_obj_9", 0), (assign, "$g_presentation_obj_25", 0), (assign, "$g_presentation_obj_29", 0), (assign, "$g_presentation_obj_34", 0), (assign, "$g_presentation_obj_35", 0), (assign, "$g_presentation_obj_10", 0), (assign, "$g_presentation_obj_11", 0), (assign, "$g_presentation_obj_26", 0), (assign, "$g_presentation_obj_30", 0), (assign, "$g_presentation_obj_36", 0), (assign, "$g_presentation_obj_37", 0), (assign, "$g_presentation_obj_12", 0), (assign, "$g_presentation_obj_13", 0), (assign, "$g_presentation_obj_27", 0), (assign, "$g_presentation_obj_31", 0), (assign, "$g_presentation_obj_38", 0), (assign, "$g_presentation_obj_39", 0), (assign, "$g_presentation_next_presentation", 0), (assign, "$g_presentation_output_slot", 0), (assign, "$g_presentation_input", 0), (assign, "$g_presentation_marshall_selection_1_vote", 0), (assign, "$g_presentation_marshall_selection_2_vote", 0), (assign, "$g_presentation_marshall_selection_ended", 0), (assign, "$g_formation_infantry_selected", 0), (assign, "$g_formation_archers_selected", 0), (assign, "$g_formation_cavalry_selected", 0), (assign, "$g_presentation_infantry_movement", 0), (assign, "$g_presentation_infantry_riding", 0), (assign, "$g_presentation_infantry_weapon_usage", 0), (assign, "$g_presentation_archers_movement", 0), (assign, "$g_presentation_archers_riding", 0), (assign, "$g_presentation_archers_weapon_usage", 0), (assign, "$g_presentation_cavalry_movement", 0), (assign, "$g_presentation_cavalry_riding", 0), (assign, "$g_presentation_cavalry_weapon_usage", 0), (assign, "$g_battle_us_ready", 0), (assign, "$g_battle_us_wounded", 0), (assign, "$g_battle_us_dead", 0), (assign, "$g_battle_enemies_ready", 0), (assign, "$g_battle_enemies_wounded", 0), (assign, "$g_battle_enemies_dead", 0), (assign, "$g_battle_allies_ready", 0), (assign, "$g_battle_allies_wounded", 0), (assign, "$g_battle_allies_dead", 0), (assign, "$g_battle_map_width", 0), (assign, "$g_battle_map_scale", 0), (assign, "$g_battle_map_height", 0), (assign, "$g_battle_map_plane", 0), (assign, "$g_battle_map_infantry_order_flag", 0), (assign, "$g_battle_map_archers_order_flag", 0), (assign, "$g_battle_map_cavalry_order_flag", 0), (assign, "$g_presentation_obj_1_val", 0), (assign, "$g_presentation_obj_2_val", 0), (assign, "$g_presentation_obj_3_val", 0), (assign, "$g_presentation_obj_4_val", 0), #Presentations end #Scripts begin (assign, "$g_player_luck", 0), (assign, "$g_election_date", 0), (assign, "$g_player_party_icon", 0), (assign, "$disable_npc_complaints", 0), (assign, "$g_encountered_party_2", 0), (assign, "$g_encountered_party_faction", 0), (assign, "$g_encountered_party_relation", 0), (assign, "$g_encountered_party_type", 0), (assign, "$g_encountered_party_template", 0), (assign, "$playerparty_prebattle_regulars", 0), (assign, "$g_training_ground_used_weapon_proficiency", 0), (assign, "$g_training_ground_training_scene", 0), (assign, "$g_training_ground_training_num_enemies", 0), (assign, "$g_training_ground_training_hardness", 0), (assign, "$g_training_ground_training_num_gourds_to_destroy", 0), (assign, "$g_training_ground_ranged_distance", 0), (assign, "$qst_deliver_wine_debt", 0), (assign, "$incriminate_quest_sacrificed_troop", 0), (assign, "$pout_party", 0), (assign, "$player_honor", 0), (assign, "$g_player_party_morale_modifier_party_size", 0), (assign, "$g_player_party_morale_modifier_leadership", 0), (assign, "$g_player_party_morale_modifier_food", 0), (assign, "$g_player_party_morale_modifier_no_food", 0), (assign, "$g_player_party_morale_modifier_debt", 0), (assign, "$party_relative_strength", 0), (assign, "$ratio_of_prisoners", 0), (assign, "$ai_team_1_battle_tactic", 0), (assign, "$ai_team_1", 0), (assign, "$ai_team_2", 0), (assign, "$ai_team_2_battle_tactic", 0), (assign, "$g_player_current_own_troop_kills", 0), (assign, "$g_last_mission_player_damage", 0), (assign, "$g_friend_fit_for_battle", 0), (assign, "$g_enemy_fit_for_battle", 0), (assign, "$g_starting_strength_main_party", 0), (assign, "$g_starting_strength_enemy_party", 0), (assign, "$g_starting_strength_friends", 0), (assign, "$battle_renown_value", 0), (assign, "$spy_item_worn", 0), (assign, "$spy_quest_troop", 0), (assign, "$num_center_bandits", 0), (assign, "$cur_belfry_pos", 0), (assign, "$belfry_rotating_objects_begin", 0), (assign, "$last_belfry_object_pos", 0), (assign, "$belfry_num_slots_positioned", 0), (assign, "$belfry_num_men_pushing", 0), (assign, "$g_total_quests_completed", 0), (assign, "$any_allies_at_the_last_battle", 0), (assign, "$number_of_npc_slots", 0), (assign, "$npc_grievance_string", 0), (assign, "$npc_grievance_slot", 0), (assign, "$npc_praise_not_complaint", 0), (assign, "$npc_map_talk_context", 0), (assign, "$g_ransom_offer_troop", 0), (assign, "$g_ransom_offer_party", 0), (assign, "$g_check_autos_at_hour", 0), (assign, "$g_average_center_value_per_faction", 0), (assign, "$num_log_entries", 0), (assign, "$log_comment_relation_change", 0), (assign, "$g_custom_battle_team1_death_count", 0), (assign, "$g_custom_battle_team2_death_count", 0), #Scripts end #Simple triggers begin (assign, "$g_notification_menu_var1", 0), (assign, "$g_notification_menu_var2", 0), (assign, "$g_cur_week_half_daily_wage_payments", 0), (assign, "$g_last_half_payment_check_day", 0), (assign, "$g_half_payment_checkpoint", 0), (assign, "$g_presentation_marshall_selection_max_renown_3", 0), (assign, "$g_presentation_marshall_selection_max_renown_3_troop", 0), (assign, "$g_center_to_give_to_player", 0), (assign, "$g_random_army_quest", 0), (assign, "$qst_scout_waypoints_wp_1", 0), (assign, "$qst_scout_waypoints_wp_2", 0), (assign, "$qst_scout_waypoints_wp_3", 0), (assign, "$qst_scout_waypoints_wp_1_visited", 0), (assign, "$qst_scout_waypoints_wp_2_visited", 0), (assign, "$qst_scout_waypoints_wp_3_visited", 0), (assign, "$qst_train_peasants_against_bandits_num_hours_trained", 0), #Simple triggers end ########################################## # Native global variables decleration end ########################################## ]), # (1.0, 0, ti_once, [(map_free,0)], [(start_map_conversation,"trp_guide")]), # Refresh Merchants (0.0, 0, 24.0, [], [ (reset_item_probabilities,100), (set_merchandise_modifier_quality,150), (reset_item_probabilities,100),(set_item_probability_in_merchandise,"itm_salt",700), (troop_add_merchandise,"trp_salt_mine_merchant",itp_type_goods,num_merchandise_goods), # Add trade goods to merchant inventories # (store_sub, ":item_to_production_slot", slot_town_trade_good_productions_begin, trade_goods_begin), (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin), (try_for_range,":cur_center",towns_begin,towns_end), (party_get_slot,":cur_merchant",":cur_center",slot_town_merchant), (reset_item_probabilities,100), (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end), # (store_add, ":cur_production_slot", ":cur_goods", ":item_to_production_slot"), (store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"), # (party_get_slot, ":cur_production", ":cur_center", ":cur_production_slot"), (party_get_slot, ":cur_price", ":cur_center", ":cur_price_slot"), ## (assign, ":cur_probability", 100), ## (store_add, ":cur_production", 100, ":cur_production"), ## (val_mul, ":cur_probability", ":cur_production"), ## (val_div, ":cur_probability", 100), ## (try_begin), ## (gt, ":cur_probability", 100), ## (store_sub, ":temp_dif", ":cur_probability", 100), ## (val_mul, ":temp_dif", 4), ## (val_add, ":cur_probability", ":temp_dif"), ## (try_end), ## (store_sub, ":temp_dif", average_price_factor, ":cur_price"), ## (val_div, ":temp_dif", 2), ## (val_add, ":cur_price", ":temp_dif"), (assign, ":cur_probability", 100), (val_mul, ":cur_probability", average_price_factor), (val_div, ":cur_probability", ":cur_price"), (val_mul, ":cur_probability", average_price_factor), (val_div, ":cur_probability", ":cur_price"), (val_mul, ":cur_probability", average_price_factor), (val_div, ":cur_probability", ":cur_price"), (val_mul, ":cur_probability", average_price_factor), (val_div, ":cur_probability", ":cur_price"), (set_item_probability_in_merchandise,":cur_goods",":cur_probability"), (try_end), (troop_add_merchandise,":cur_merchant",itp_type_goods,num_merchandise_goods), (troop_ensure_inventory_space,":cur_merchant",merchant_inventory_space), (troop_sort_inventory, ":cur_merchant"), (store_troop_gold, ":cur_gold",":cur_merchant"), (lt,":cur_gold",1500), (store_random_in_range,":new_gold",500,1000), (call_script, "script_troop_add_gold",":cur_merchant",":new_gold"), (try_end), ]), # Refresh Armor sellers (0.0, 0, 24.0, [], [ (reset_item_probabilities,100), (set_merchandise_modifier_quality,150), (try_for_range,reg(2),armor_merchants_begin,armor_merchants_end), (troop_add_merchandise,reg(2),itp_type_body_armor,16), (troop_add_merchandise,reg(2),itp_type_head_armor,16), (troop_add_merchandise,reg(2),itp_type_foot_armor,8), (troop_add_merchandise,reg(2),itp_type_hand_armor,4), (troop_ensure_inventory_space,reg(2),merchant_inventory_space), (troop_sort_inventory, reg(2)), (store_troop_gold, reg(6),reg(2)), (lt,reg(6),900), (store_random_in_range,":new_gold",200,400), (call_script, "script_troop_add_gold",reg(2),":new_gold"), (end_try,0), ]), # Refresh Weapon sellers (0.0, 0, 24.0, [], [ (reset_item_probabilities,100), (set_merchandise_modifier_quality,150), (try_for_range,reg(2),weapon_merchants_begin,weapon_merchants_end), (troop_add_merchandise,reg(2),itp_type_one_handed_wpn,5), (troop_add_merchandise,reg(2),itp_type_two_handed_wpn,5), (troop_add_merchandise,reg(2),itp_type_polearm,5), (troop_add_merchandise,reg(2),itp_type_shield,6), (troop_add_merchandise,reg(2),itp_type_bow,4), (troop_add_merchandise,reg(2),itp_type_crossbow,3), (troop_add_merchandise,reg(2),itp_type_thrown,5), (troop_add_merchandise,reg(2),itp_type_arrows,2), (troop_add_merchandise,reg(2),itp_type_bolts,2), (troop_ensure_inventory_space,reg(2),merchant_inventory_space), (troop_sort_inventory, reg(2)), (store_troop_gold, reg(6),reg(2)), (lt,reg(6),900), (store_random_in_range,":new_gold",200,400), (call_script, "script_troop_add_gold",reg(2),":new_gold"), (end_try,0), ]), # Refresh Horse sellers (0.0, 0, 24.0, [], [ (reset_item_probabilities,100), (set_merchandise_modifier_quality,150), (try_for_range,":cur_merchant",horse_merchants_begin,horse_merchants_end), (troop_add_merchandise,":cur_merchant",itp_type_horse,5), (troop_ensure_inventory_space,":cur_merchant",65), (troop_sort_inventory, ":cur_merchant"), (store_troop_gold, ":cur_gold",":cur_merchant"), (lt,":cur_gold",600), (store_random_in_range,":new_gold",200,400), (call_script, "script_troop_add_gold",":cur_merchant",":new_gold"), (try_end), ]), ############# #Captivity: # (1.0, 0, 0.0, [], # [ # (ge,"$captivity_mode",1), # (store_current_hours,reg(1)), # (val_sub,reg(1),"$captivity_end_time"), # (ge,reg(1),0), # (display_message,"str_nobleman_reached_destination"), # (jump_to_menu,"$captivity_end_menu"), # ]), (5.7, 0, 0.0, [(store_num_parties_created,reg(3),"pt_manhunters"), (lt,reg(3),num_max_zendar_manhunters), (store_num_parties_of_template, reg(2), "pt_manhunters"), (lt,reg(2),3)], [(set_spawn_radius,1),(spawn_around_party,"p_zendar","pt_manhunters")]), # (5.2, 0, 0.0, [(store_num_parties_created,reg(3),"pt_peasant"),(lt,reg(3),num_max_zendar_peasants), # (store_num_parties_of_template, reg(2), "pt_peasant"), (lt,reg(2),3)], # [(set_spawn_radius,1),(spawn_around_party,"p_zendar","pt_peasant")]), #Tax Collectors # Prisoner Trains # (4.1, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_swadians"), # (assign, "$pin_party_template", "pt_swadian_prisoner_train"), # (assign, "$pin_limit", peak_prisoner_trains), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # (party_set_ai_behavior,"$pout_party",ai_bhvr_travel_to_party), # (party_set_ai_object,"$pout_party","$pout_town"), # ]), # # (4.1, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_vaegirs"), # (assign, "$pin_party_template", "pt_vaegir_prisoner_train"), # (assign, "$pin_limit", peak_prisoner_trains), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # (party_set_ai_behavior,"$pout_party",ai_bhvr_travel_to_party), # (party_set_ai_object,"$pout_party","$pout_town"), # ]), (2.0, 0, 0, [(store_random_party_of_template, reg(2), "pt_prisoner_train_party"), (party_is_in_any_town,reg(2)), ], [(store_faction_of_party, ":faction_no", reg(2)), (call_script,"script_cf_select_random_walled_center_with_faction", ":faction_no", -1), (party_set_ai_behavior,reg(2),ai_bhvr_travel_to_party), (party_set_ai_object,reg(2),reg0), (party_set_flags, reg(2), pf_default_behavior, 0), ]), ##Caravans # (4.2, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_swadians"), # (assign, "$pin_party_template", "pt_swadian_caravan"), # (assign, "$pin_limit", peak_kingdom_caravans), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # (party_set_ai_behavior,"$pout_party",ai_bhvr_travel_to_party), # (party_set_ai_object,"$pout_party","$pout_town"), # ]), # (4.2, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_vaegirs"), # (assign, "$pin_party_template", "pt_vaegir_caravan"), # (assign, "$pin_limit", peak_kingdom_caravans), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # (party_set_ai_behavior,"$pout_party",ai_bhvr_travel_to_party), # (party_set_ai_object,"$pout_party","$pout_town"), # ]), ## (2.0, 0, 0, [(store_random_party_of_template, reg(2), "pt_kingdom_caravan_party"), ## (party_is_in_any_town,reg(2)), ## ], ## [(store_faction_of_party, ":faction_no", reg(2)), ## (call_script,"script_cf_select_random_town_with_faction", ":faction_no"), ## (party_set_ai_behavior,reg(2),ai_bhvr_travel_to_party), ## (party_set_ai_object,reg(2),reg0), ## (party_set_flags, reg(2), pf_default_behavior, 0), ## ]), (4.0, 0, 0.0, [(eq, "$caravan_escort_state", 1), #cancel caravan_escort_state if caravan leaves the destination (get_party_ai_object,reg(1),"$caravan_escort_party_id"), (neq,reg(1),"$caravan_escort_destination_town"), ], [(assign,"$caravan_escort_state",0), # (add_xp_as_reward,100), ]), #Messengers # (4.2, 0, 0.0, [], # [(assign, "$pin_faction", "fac_swadians"), # (assign, "$pin_party_template", "pt_swadian_messenger"), # (assign, "$pin_limit", peak_kingdom_messengers), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # (party_set_ai_behavior,"$pout_party",ai_bhvr_travel_to_party), # (party_set_ai_object,"$pout_party","$pout_town"), # ]), # (4.2, 0, 0.0, [], # [(assign, "$pin_faction", "fac_vaegirs"), # (assign, "$pin_party_template", "pt_vaegir_messenger"), # (assign, "$pin_limit", peak_kingdom_caravans), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # (party_set_ai_behavior,"$pout_party",ai_bhvr_travel_to_party), # (party_set_ai_object,"$pout_party","$pout_town"), # ]), (1.5, 0, 0, [(store_random_party_of_template, reg(2), "pt_messenger_party"), (party_is_in_any_town,reg(2)), ], [(store_faction_of_party, ":faction_no", reg(2)), (call_script,"script_cf_select_random_walled_center_with_faction", ":faction_no", -1), (party_set_ai_behavior,reg(2),ai_bhvr_travel_to_party), (party_set_ai_object,reg(2),reg0), (party_set_flags, reg(2), pf_default_behavior, 0), ]), #Deserters # (10.2, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_swadians"), # (assign, "$pin_party_template", "pt_swadian_deserters"), # (assign, "$pin_limit", 4), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # ]), # (10.2, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_vaegirs"), # (assign, "$pin_party_template", "pt_vaegir_deserters"), # (assign, "$pin_limit", 4), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # ]), #Kingdom Parties (1.0, 0, 0.0, [], [(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active), (neq, ":cur_kingdom", "fac_player_supporters_faction"), ## (try_begin), ## (store_random_in_range, ":random_no", 0, 100), ## (lt, ":random_no", 10), ## (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_forager), ## (try_end), ## (try_begin), ## (store_random_in_range, ":random_no", 0, 100), ## (lt, ":random_no", 10), ## (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_scout), ## (try_end), ## (try_begin), ## (store_random_in_range, ":random_no", 0, 100), ## (lt, ":random_no", 10), ## (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_patrol), ## (try_end), ## (try_begin), ## (store_random_in_range, ":random_no", 0, 100), ## (lt, ":random_no", 10), ## (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_messenger), ## (try_end), (try_begin), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 10), (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_kingdom_caravan), (try_end), ## (try_begin), ## (store_random_in_range, ":random_no", 0, 100), ## (lt, ":random_no", 10), ## (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_prisoner_train), ## (try_end), (try_end), ]), #Swadians # (0.0, 0.0, ti_once, [], [(assign,"$peak_swadian_foragers",4)]), # (0.0, 0.0, ti_once, [], [(assign,"$peak_swadian_scouts",4)]), # (0.0, 0.0, ti_once, [], [(assign,"$peak_swadian_harassers",3)]), # (0.0, 0.0, ti_once, [], [(assign,"$peak_swadian_war_parties",2)]), # (10.2, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_swadians"), # (assign, "$pin_party_template", "pt_swadian_foragers"), # (assign, "$pin_limit", "$peak_swadian_foragers"), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # ]), # (10.2, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_swadians"), # (assign, "$pin_party_template", "pt_swadian_scouts"), # (assign, "$pin_limit", "$peak_swadian_scouts"), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # ]), # (10.2, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_swadians"), # (assign, "$pin_party_template", "pt_swadian_patrol"), # (assign, "$pin_limit", "$peak_swadian_harassers"), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # ]), # (10.2, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_swadians"), # (assign, "$pin_party_template", "pt_swadian_war_party"), # (assign, "$pin_limit", "$peak_swadian_war_parties"), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # ]), #Vaegirs # (0.0, 0.0, ti_once, [], [(assign,"$peak_vaegir_foragers",4)]), # (0.0, 0.0, ti_once, [], [(assign,"$peak_vaegir_scouts",4)]), # (0.0, 0.0, ti_once, [], [(assign,"$peak_vaegir_harassers",3)]), # (0.0, 0.0, ti_once, [], [(assign,"$peak_vaegir_war_parties",2)]), # (10.2, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_vaegirs"), # (assign, "$pin_party_template", "pt_vaegir_foragers"), # (assign, "$pin_limit", "$peak_vaegir_foragers"), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # ]), # (10.2, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_vaegirs"), # (assign, "$pin_party_template", "pt_vaegir_scouts"), # (assign, "$pin_limit", "$peak_vaegir_scouts"), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # ]), # (10.2, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_vaegirs"), # (assign, "$pin_party_template", "pt_vaegir_patrol"), # (assign, "$pin_limit", "$peak_vaegir_harassers"), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # ]), # (10.2, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_vaegirs"), # (assign, "$pin_party_template", "pt_vaegir_war_party"), # (assign, "$pin_limit", "$peak_vaegir_war_parties"), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # ]), #Villains etc. # (14.2, 0, 0.0, [], # [ # (assign, "$pin_faction", "fac_sea_raiders"), # (assign, "$pin_party_template", "pt_sea_raiders"), # (assign, "$pin_limit", 5), # (call_script,"script_cf_spawn_party_at_faction_town_if_below_limit"), # ]), # ## (10.1, 0, 0.0, [], ## [ ## (assign, "$pin_party_template", "pt_refugees"), ## (assign, "$pin_limit", 5), ## (call_script,"script_cf_spawn_party_at_random_town_if_below_limit"), ## ]), ## ## (10.1, 0, 0.0, [], ## [ ## (assign, "$pin_party_template", "pt_farmers"), ## (assign, "$pin_limit", 6), ## (call_script,"script_cf_spawn_party_at_random_town_if_below_limit"), ## ]), # [1.0, 96.0, ti_once, [], [[assign,"$peak_dark_hunters",3]]], ## (10.1, 0, 0.0, [], ## [ ## (assign, "$pin_party_template", "pt_dark_hunters"), ## (assign, "$pin_limit", "$peak_dark_hunters"), ## (call_script,"script_cf_spawn_party_at_random_town_if_below_limit"), ## ]), #Companion quests ## (0, 0, ti_once, ## [ ## (entering_town,"p_town_1"), ## (main_party_has_troop,"trp_borcha"), ## (eq,"$borcha_freed",0) ## ], ## ## [ ## (assign,"$borcha_arrive_sargoth_as_prisoner",1), ## (start_map_conversation,"trp_borcha") ## ] ## ), ## ## (1, 0, ti_once, ## [ ## (map_free,0), ## (eq,"$borcha_asked_for_freedom",0), ## (main_party_has_troop,"trp_borcha") ## ], ## [ ## (start_map_conversation,"trp_borcha") ## ] ## ), ## ## (2, 0, ti_once, ## [ ## (map_free, 0), ## (neq,"$borcha_asked_for_freedom",0), ## (eq,"$borcha_freed",0), ## (main_party_has_troop,"trp_borcha") ## ], ## [ ## (start_map_conversation,"trp_borcha"), ## ] ## ), ##### TODO: QUESTS COMMENT OUT BEGIN ########################################################################### ### Random Governer Quest triggers ########################################################################### # Incriminate Loyal Advisor quest (0.2, 0.0, 0.0, [ (check_quest_active, "qst_incriminate_loyal_commander"), (neg|check_quest_concluded, "qst_incriminate_loyal_commander"), (quest_slot_eq, "qst_incriminate_loyal_commander", slot_quest_current_state, 2), (quest_get_slot, ":quest_target_center", "qst_incriminate_loyal_commander", slot_quest_target_center), (quest_get_slot, ":quest_target_party", "qst_incriminate_loyal_commander", slot_quest_target_party), (try_begin), (neg|party_is_active, ":quest_target_party"), (quest_set_slot, "qst_incriminate_loyal_commander", slot_quest_current_state, 3), (call_script, "script_fail_quest", "qst_incriminate_loyal_commander"), (else_try), (party_is_in_town, ":quest_target_party", ":quest_target_center"), (remove_party, ":quest_target_party"), (quest_set_slot, "qst_incriminate_loyal_commander", slot_quest_current_state, 3), (quest_get_slot, ":quest_object_troop", "qst_incriminate_loyal_commander", slot_quest_object_troop), (assign, ":num_available_factions", 0), (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active), (neq, ":faction_no", "fac_player_supporters_faction"), (neg|quest_slot_eq, "qst_incriminate_loyal_commander", slot_quest_target_faction, ":faction_no"), (val_add, ":num_available_factions", 1), (try_end), (try_begin), (gt, ":num_available_factions", 0), (store_random_in_range, ":random_faction", 0, ":num_available_factions"), (assign, ":target_faction", -1), (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end), (eq, ":target_faction", -1), (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active), (neq, ":faction_no", "fac_player_supporters_faction"), (neg|quest_slot_eq, "qst_incriminate_loyal_commander", slot_quest_target_faction, ":faction_no"), (val_sub, ":random_faction", 1), (lt, ":random_faction", 0), (assign, ":target_faction", ":faction_no"), (try_end), (try_end), (try_begin), (gt, ":target_faction", 0), (call_script, "script_change_troop_faction", ":quest_object_troop", ":target_faction"), (else_try), (call_script, "script_change_troop_faction", ":quest_object_troop", "fac_robber_knights"), (try_end), (call_script, "script_succeed_quest", "qst_incriminate_loyal_commander"), (try_end), ], [] ), # Runaway Peasants quest (0.2, 0.0, 0.0, [ (check_quest_active, "qst_bring_back_runaway_serfs"), (neg|check_quest_concluded, "qst_bring_back_runaway_serfs"), (quest_get_slot, ":quest_object_center", "qst_bring_back_runaway_serfs", slot_quest_object_center), (quest_get_slot, ":quest_target_center", "qst_bring_back_runaway_serfs", slot_quest_target_center), (try_begin), (party_is_active, "$qst_bring_back_runaway_serfs_party_1"), (try_begin), (party_is_in_town, "$qst_bring_back_runaway_serfs_party_1", ":quest_target_center"), (remove_party, "$qst_bring_back_runaway_serfs_party_1"), (val_add, "$qst_bring_back_runaway_serfs_num_parties_fleed", 1), (else_try), (party_is_in_town, "$qst_bring_back_runaway_serfs_party_1", ":quest_object_center"), (remove_party, "$qst_bring_back_runaway_serfs_party_1"), (val_add, "$qst_bring_back_runaway_serfs_num_parties_returned", 1), (else_try), (store_distance_to_party_from_party, ":cur_distance", "p_main_party", "$qst_bring_back_runaway_serfs_party_1"), (gt, ":cur_distance", 3), (party_set_ai_object, "$qst_bring_back_runaway_serfs_party_1", ":quest_target_center"), (try_end), (try_end), (try_begin), (party_is_active, "$qst_bring_back_runaway_serfs_party_2"), (try_begin), (party_is_in_town, "$qst_bring_back_runaway_serfs_party_2", ":quest_target_center"), (remove_party, "$qst_bring_back_runaway_serfs_party_2"), (val_add, "$qst_bring_back_runaway_serfs_num_parties_fleed", 1), (else_try), (party_is_in_town, "$qst_bring_back_runaway_serfs_party_2", ":quest_object_center"), (remove_party, "$qst_bring_back_runaway_serfs_party_2"), (val_add, "$qst_bring_back_runaway_serfs_num_parties_returned", 1), (else_try), (store_distance_to_party_from_party, ":cur_distance", "p_main_party", "$qst_bring_back_runaway_serfs_party_2"), (gt, ":cur_distance", 3), (party_set_ai_object, "$qst_bring_back_runaway_serfs_party_2", ":quest_target_center"), (try_end), (try_end), (try_begin), (party_is_active, "$qst_bring_back_runaway_serfs_party_3"), (try_begin), (party_is_in_town, "$qst_bring_back_runaway_serfs_party_3", ":quest_target_center"), (remove_party, "$qst_bring_back_runaway_serfs_party_3"), (val_add, "$qst_bring_back_runaway_serfs_num_parties_fleed", 1), (else_try), (party_is_in_town, "$qst_bring_back_runaway_serfs_party_3", ":quest_object_center"), (remove_party, "$qst_bring_back_runaway_serfs_party_3"), (val_add, "$qst_bring_back_runaway_serfs_num_parties_returned", 1), (else_try), (store_distance_to_party_from_party, ":cur_distance", "p_main_party", "$qst_bring_back_runaway_serfs_party_3"), (gt, ":cur_distance", 3), (party_set_ai_object, "$qst_bring_back_runaway_serfs_party_3", ":quest_target_center"), (try_end), (try_end), (assign, ":sum_removed", "$qst_bring_back_runaway_serfs_num_parties_returned"), (val_add, ":sum_removed", "$qst_bring_back_runaway_serfs_num_parties_fleed"), (ge, ":sum_removed", 3), (try_begin), (ge, "$qst_bring_back_runaway_serfs_num_parties_returned", 3), (call_script, "script_succeed_quest", "qst_bring_back_runaway_serfs"), (else_try), (eq, "$qst_bring_back_runaway_serfs_num_parties_returned", 0), (call_script, "script_fail_quest", "qst_bring_back_runaway_serfs"), (else_try), (call_script, "script_conclude_quest", "qst_bring_back_runaway_serfs"), (try_end), ], [] ), ### Defend Nobles Against Peasants quest ## (0.2, 0.0, 0.0, ## [ ## (check_quest_active, "qst_defend_nobles_against_peasants"), ## (neg|check_quest_succeeded, "qst_defend_nobles_against_peasants"), ## (neg|check_quest_failed, "qst_defend_nobles_against_peasants"), ## (quest_get_slot, ":quest_target_center", "qst_defend_nobles_against_peasants", slot_quest_target_center), ## (assign, ":num_active_parties", 0), ## (try_begin), ## (gt, "$qst_defend_nobles_against_peasants_noble_party_1", 0), ## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_1"), ## (val_add, ":num_active_parties", 1), ## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_1", ":quest_target_center"), ## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_1"), ## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_1"), ## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"), ## (try_end), ## (try_begin), ## (gt, "$qst_defend_nobles_against_peasants_noble_party_2", 0), ## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_2"), ## (val_add, ":num_active_parties", 1), ## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_2", ":quest_target_center"), ## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_2"), ## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_2"), ## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"), ## (try_end), ## (try_begin), ## (gt, "$qst_defend_nobles_against_peasants_noble_party_3", 0), ## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_3"), ## (val_add, ":num_active_parties", 1), ## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_3", ":quest_target_center"), ## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_3"), ## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_3"), ## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"), ## (try_end), ## (try_begin), ## (gt, "$qst_defend_nobles_against_peasants_noble_party_4", 0), ## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_4"), ## (val_add, ":num_active_parties", 1), ## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_4", ":quest_target_center"), ## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_4"), ## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_4"), ## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"), ## (try_end), ## (try_begin), ## (gt, "$qst_defend_nobles_against_peasants_noble_party_5", 0), ## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_5"), ## (val_add, ":num_active_parties", 1), ## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_5", ":quest_target_center"), ## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_5"), ## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_5"), ## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"), ## (try_end), ## (try_begin), ## (gt, "$qst_defend_nobles_against_peasants_noble_party_6", 0), ## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_6"), ## (val_add, ":num_active_parties", 1), ## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_6", ":quest_target_center"), ## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_6"), ## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_6"), ## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"), ## (try_end), ## (try_begin), ## (gt, "$qst_defend_nobles_against_peasants_noble_party_7", 0), ## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_7"), ## (val_add, ":num_active_parties", 1), ## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_7", ":quest_target_center"), ## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_7"), ## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_7"), ## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"), ## (try_end), ## (try_begin), ## (gt, "$qst_defend_nobles_against_peasants_noble_party_8", 0), ## (party_is_active, "$qst_defend_nobles_against_peasants_noble_party_8"), ## (val_add, ":num_active_parties", 1), ## (party_is_in_town, "$qst_defend_nobles_against_peasants_noble_party_8", ":quest_target_center"), ## (remove_party, "$qst_defend_nobles_against_peasants_noble_party_8"), ## (party_get_num_companions, ":num_companions", "$qst_defend_nobles_against_peasants_noble_party_8"), ## (val_add, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":num_companions"), ## (try_end), ## (eq, ":num_active_parties", 0), ## (try_begin), ## (store_div, ":limit", "$qst_defend_nobles_against_peasants_num_nobles_to_save", 2), ## (ge, "$qst_defend_nobles_against_peasants_num_nobles_saved", ":limit"), ## (call_script, "script_succeed_quest", "qst_defend_nobles_against_peasants"), ## (else_try), ## (call_script, "script_fail_quest", "qst_defend_nobles_against_peasants"), ## (try_end), ## ], ## [] ## ), ### Capture Conspirators quest ## (0.15, 0.0, 0.0, ## [ ## (check_quest_active, "qst_capture_conspirators"), ## (neg|check_quest_succeeded, "qst_capture_conspirators"), ## (neg|check_quest_failed, "qst_capture_conspirators"), ## (quest_get_slot, ":quest_target_center", "qst_capture_conspirators", slot_quest_target_center), ## (quest_get_slot, ":faction_no", "qst_capture_conspirators", slot_quest_target_faction), ## (try_begin), ## (gt, "$qst_capture_conspirators_num_parties_to_spawn", "$qst_capture_conspirators_num_parties_spawned"), ## (store_random_in_range, ":random_no", 0, 100), ## (lt, ":random_no", 20), ## (set_spawn_radius, 3), ## (spawn_around_party,":quest_target_center","pt_conspirator"), ## (val_add, "$qst_capture_conspirators_num_parties_spawned", 1), ## (party_get_num_companions, ":num_companions", reg0), ## (val_add, "$qst_capture_conspirators_num_troops_to_capture", ":num_companions"), ## (party_set_ai_behavior, reg0, ai_bhvr_travel_to_party), ## (party_set_ai_object, reg0, "$qst_capture_conspirators_party_1"), ## (party_set_flags, reg0, pf_default_behavior, 0), ## (try_begin), ## (le, "$qst_capture_conspirators_party_2", 0), ## (assign, "$qst_capture_conspirators_party_2", reg0), ## (else_try), ## (le, "$qst_capture_conspirators_party_3", 0), ## (assign, "$qst_capture_conspirators_party_3", reg0), ## (else_try), ## (le, "$qst_capture_conspirators_party_4", 0), ## (assign, "$qst_capture_conspirators_party_4", reg0), ## (else_try), ## (le, "$qst_capture_conspirators_party_5", 0), ## (assign, "$qst_capture_conspirators_party_5", reg0), ## (else_try), ## (le, "$qst_capture_conspirators_party_6", 0), ## (assign, "$qst_capture_conspirators_party_6", reg0), ## (else_try), ## (le, "$qst_capture_conspirators_party_7", 0), ## (assign, "$qst_capture_conspirators_party_7", reg0), ## (try_end), ## (try_end), ## ## (assign, ":num_active_parties", 0), ## ## (try_begin), ## (gt, "$qst_capture_conspirators_party_1", 0), ## (party_is_active, "$qst_capture_conspirators_party_1"), ## (val_add, ":num_active_parties", 1), ## (try_begin), ## (party_is_in_any_town, "$qst_capture_conspirators_party_1"), ## (remove_party, "$qst_capture_conspirators_party_1"), ## (else_try), ## (party_get_num_attached_parties, ":num_attachments", "$qst_capture_conspirators_party_1"), ## (gt, ":num_attachments", 0), ## (assign, ":leave_meeting", 0), ## (try_begin), ## (store_sub, ":required_attachments", "$qst_capture_conspirators_num_parties_to_spawn", 1), ## (eq, ":num_attachments", ":required_attachments"), ## (val_add, "$qst_capture_conspirators_leave_meeting_counter", 1), ## (ge, "$qst_capture_conspirators_leave_meeting_counter", 15), ## (assign, ":leave_meeting", 1), ## (try_end), ## (try_begin), ## (eq, "$qst_capture_conspirators_num_parties_to_spawn", "$qst_capture_conspirators_num_parties_spawned"), ## (store_distance_to_party_from_party, ":cur_distance", "p_main_party", "$qst_capture_conspirators_party_1"), ## (assign, ":min_distance", 3), ## (try_begin), ## (is_currently_night), ## (assign, ":min_distance", 2), ## (try_end), ## (lt, ":cur_distance", ":min_distance"), ## (assign, "$qst_capture_conspirators_leave_meeting_counter", 15), ## (assign, ":leave_meeting", 1), ## (try_end), ## (eq, ":leave_meeting", 1), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_1", ai_bhvr_travel_to_point), ## (party_set_flags, "$qst_capture_conspirators_party_1", pf_default_behavior, 0), ## (party_get_position, pos1, "$qst_capture_conspirators_party_1"), ## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17), ## (party_set_ai_target_position, "$qst_capture_conspirators_party_1", pos2), ## (try_begin), ## (gt, "$qst_capture_conspirators_party_2", 0), ## (party_detach, "$qst_capture_conspirators_party_2"), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_2", ai_bhvr_travel_to_point), ## (party_set_flags, "$qst_capture_conspirators_party_2", pf_default_behavior, 0), ## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17), ## (party_set_ai_target_position, "$qst_capture_conspirators_party_2", pos2), ## (try_end), ## (try_begin), ## (gt, "$qst_capture_conspirators_party_3", 0), ## (party_detach, "$qst_capture_conspirators_party_3"), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_3", ai_bhvr_travel_to_point), ## (party_set_flags, "$qst_capture_conspirators_party_3", pf_default_behavior, 0), ## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17), ## (party_set_ai_target_position, "$qst_capture_conspirators_party_3", pos2), ## (try_end), ## (try_begin), ## (gt, "$qst_capture_conspirators_party_4", 0), ## (party_detach, "$qst_capture_conspirators_party_4"), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_4", ai_bhvr_travel_to_point), ## (party_set_flags, "$qst_capture_conspirators_party_4", pf_default_behavior, 0), ## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17), ## (party_set_ai_target_position, "$qst_capture_conspirators_party_4", pos2), ## (try_end), ## (try_begin), ## (gt, "$qst_capture_conspirators_party_5", 0), ## (party_detach, "$qst_capture_conspirators_party_5"), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_5", ai_bhvr_travel_to_point), ## (party_set_flags, "$qst_capture_conspirators_party_5", pf_default_behavior, 0), ## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17), ## (party_set_ai_target_position, "$qst_capture_conspirators_party_5", pos2), ## (try_end), ## (try_begin), ## (gt, "$qst_capture_conspirators_party_6", 0), ## (party_detach, "$qst_capture_conspirators_party_6"), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_6", ai_bhvr_travel_to_point), ## (party_set_flags, "$qst_capture_conspirators_party_6", pf_default_behavior, 0), ## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17), ## (party_set_ai_target_position, "$qst_capture_conspirators_party_6", pos2), ## (try_end), ## (try_begin), ## (gt, "$qst_capture_conspirators_party_7", 0), ## (party_detach, "$qst_capture_conspirators_party_7"), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_7", ai_bhvr_travel_to_point), ## (party_set_flags, "$qst_capture_conspirators_party_7", pf_default_behavior, 0), ## (call_script, "script_map_get_random_position_around_position_within_range", 15, 17), ## (party_set_ai_target_position, "$qst_capture_conspirators_party_7", pos2), ## (try_end), ## (try_end), ## (try_begin), ## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_1"), ## (eq, ":ai_behavior", ai_bhvr_travel_to_point), ## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_1"), ## (party_get_position, pos1, "$qst_capture_conspirators_party_1"), ## (get_distance_between_positions, ":distance", pos2, pos1), ## (lt, ":distance", 200), ## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_1", ":faction_no"),#Can fail ## (ge, reg0, 0), ## (party_set_ai_object, "$qst_capture_conspirators_party_1", reg0), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_1", ai_bhvr_travel_to_party), ## (party_set_flags, "$qst_capture_conspirators_party_1", pf_default_behavior, 0), ## (try_end), ## (try_end), ## (try_begin), ## (gt, "$qst_capture_conspirators_party_2", 0), ## (party_is_active, "$qst_capture_conspirators_party_2"), ## (val_add, ":num_active_parties", 1), ## (try_begin), ## (party_is_in_any_town, "$qst_capture_conspirators_party_2"), ## (try_begin), ## (neg|party_is_in_town, "$qst_capture_conspirators_party_2", "$qst_capture_conspirators_party_1"), ## (remove_party, "$qst_capture_conspirators_party_2"), ## (else_try), ## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_2"), ## (neq, ":ai_behavior", ai_bhvr_hold), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_2", ai_bhvr_hold), ## (party_attach_to_party, "$qst_capture_conspirators_party_2", "$qst_capture_conspirators_party_1"), ## (party_set_flags, "$qst_capture_conspirators_party_2", pf_default_behavior, 0), ## (try_end), ## (try_end), ## (try_begin), ## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_2"), ## (eq, ":ai_behavior", ai_bhvr_travel_to_point), ## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_2"), ## (party_get_position, pos1, "$qst_capture_conspirators_party_2"), ## (get_distance_between_positions, ":distance", pos2, pos1), ## (lt, ":distance", 200), ## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_2", ":faction_no"),#Can fail ## (ge, reg0, 0), ## (party_set_ai_object, "$qst_capture_conspirators_party_2", reg0), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_2", ai_bhvr_travel_to_party), ## (party_set_flags, "$qst_capture_conspirators_party_2", pf_default_behavior, 0), ## (try_end), ## (try_end), ## (try_begin), ## (gt, "$qst_capture_conspirators_party_3", 0), ## (party_is_active, "$qst_capture_conspirators_party_3"), ## (val_add, ":num_active_parties", 1), ## (try_begin), ## (party_is_in_any_town, "$qst_capture_conspirators_party_3"), ## (try_begin), ## (neg|party_is_in_town, "$qst_capture_conspirators_party_3", "$qst_capture_conspirators_party_1"), ## (remove_party, "$qst_capture_conspirators_party_3"), ## (else_try), ## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_3"), ## (neq, ":ai_behavior", ai_bhvr_hold), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_3", ai_bhvr_hold), ## (party_attach_to_party, "$qst_capture_conspirators_party_3", "$qst_capture_conspirators_party_1"), ## (party_set_flags, "$qst_capture_conspirators_party_3", pf_default_behavior, 0), ## (try_end), ## (try_end), ## (try_begin), ## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_3"), ## (eq, ":ai_behavior", ai_bhvr_travel_to_point), ## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_3"), ## (party_get_position, pos1, "$qst_capture_conspirators_party_3"), ## (get_distance_between_positions, ":distance", pos2, pos1), ## (lt, ":distance", 200), ## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_3", ":faction_no"),#Can fail ## (ge, reg0, 0), ## (party_set_ai_object, "$qst_capture_conspirators_party_3", reg0), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_3", ai_bhvr_travel_to_party), ## (party_set_flags, "$qst_capture_conspirators_party_3", pf_default_behavior, 0), ## (try_end), ## (try_end), ## (try_begin), ## (gt, "$qst_capture_conspirators_party_4", 0), ## (party_is_active, "$qst_capture_conspirators_party_4"), ## (val_add, ":num_active_parties", 1), ## (try_begin), ## (party_is_in_any_town, "$qst_capture_conspirators_party_4"), ## (try_begin), ## (neg|party_is_in_town, "$qst_capture_conspirators_party_4", "$qst_capture_conspirators_party_1"), ## (remove_party, "$qst_capture_conspirators_party_4"), ## (else_try), ## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_4"), ## (neq, ":ai_behavior", ai_bhvr_hold), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_4", ai_bhvr_hold), ## (party_set_flags, "$qst_capture_conspirators_party_4", pf_default_behavior, 0), ## (party_attach_to_party, "$qst_capture_conspirators_party_4", "$qst_capture_conspirators_party_1"), ## (try_end), ## (try_end), ## (try_begin), ## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_4"), ## (eq, ":ai_behavior", ai_bhvr_travel_to_point), ## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_4"), ## (party_get_position, pos1, "$qst_capture_conspirators_party_4"), ## (get_distance_between_positions, ":distance", pos2, pos1), ## (lt, ":distance", 200), ## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_4", ":faction_no"),#Can fail ## (ge, reg0, 0), ## (party_set_ai_object, "$qst_capture_conspirators_party_4", reg0), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_4", ai_bhvr_travel_to_party), ## (party_set_flags, "$qst_capture_conspirators_party_4", pf_default_behavior, 0), ## (try_end), ## (try_end), ## (try_begin), ## (gt, "$qst_capture_conspirators_party_5", 0), ## (party_is_active, "$qst_capture_conspirators_party_5"), ## (val_add, ":num_active_parties", 1), ## (try_begin), ## (party_is_in_any_town, "$qst_capture_conspirators_party_5"), ## (try_begin), ## (neg|party_is_in_town, "$qst_capture_conspirators_party_5", "$qst_capture_conspirators_party_1"), ## (remove_party, "$qst_capture_conspirators_party_5"), ## (else_try), ## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_5"), ## (neq, ":ai_behavior", ai_bhvr_hold), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_5", ai_bhvr_hold), ## (party_set_flags, "$qst_capture_conspirators_party_5", pf_default_behavior, 0), ## (party_attach_to_party, "$qst_capture_conspirators_party_5", "$qst_capture_conspirators_party_1"), ## (try_end), ## (try_end), ## (try_begin), ## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_5"), ## (eq, ":ai_behavior", ai_bhvr_travel_to_point), ## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_5"), ## (party_get_position, pos1, "$qst_capture_conspirators_party_5"), ## (get_distance_between_positions, ":distance", pos2, pos1), ## (lt, ":distance", 200), ## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_5", ":faction_no"),#Can fail ## (ge, reg0, 0), ## (party_set_ai_object, "$qst_capture_conspirators_party_5", reg0), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_5", ai_bhvr_travel_to_party), ## (party_set_flags, "$qst_capture_conspirators_party_5", pf_default_behavior, 0), ## (try_end), ## (try_end), ## (try_begin), ## (gt, "$qst_capture_conspirators_party_6", 0), ## (party_is_active, "$qst_capture_conspirators_party_6"), ## (val_add, ":num_active_parties", 1), ## (try_begin), ## (party_is_in_any_town, "$qst_capture_conspirators_party_6"), ## (try_begin), ## (neg|party_is_in_town, "$qst_capture_conspirators_party_6", "$qst_capture_conspirators_party_1"), ## (remove_party, "$qst_capture_conspirators_party_6"), ## (else_try), ## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_6"), ## (neq, ":ai_behavior", ai_bhvr_hold), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_6", ai_bhvr_hold), ## (party_set_flags, "$qst_capture_conspirators_party_6", pf_default_behavior, 0), ## (party_attach_to_party, "$qst_capture_conspirators_party_6", "$qst_capture_conspirators_party_1"), ## (try_end), ## (try_end), ## (try_begin), ## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_6"), ## (eq, ":ai_behavior", ai_bhvr_travel_to_point), ## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_6"), ## (party_get_position, pos1, "$qst_capture_conspirators_party_6"), ## (get_distance_between_positions, ":distance", pos2, pos1), ## (lt, ":distance", 200), ## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_6", ":faction_no"),#Can fail ## (ge, reg0, 0), ## (party_set_ai_object, "$qst_capture_conspirators_party_6", reg0), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_6", ai_bhvr_travel_to_party), ## (party_set_flags, "$qst_capture_conspirators_party_6", pf_default_behavior, 0), ## (try_end), ## (try_end), ## (try_begin), ## (gt, "$qst_capture_conspirators_party_7", 0), ## (party_is_active, "$qst_capture_conspirators_party_7"), ## (val_add, ":num_active_parties", 1), ## (try_begin), ## (party_is_in_any_town, "$qst_capture_conspirators_party_7"), ## (try_begin), ## (neg|party_is_in_town, "$qst_capture_conspirators_party_7", "$qst_capture_conspirators_party_1"), ## (remove_party, "$qst_capture_conspirators_party_7"), ## (else_try), ## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_7"), ## (neq, ":ai_behavior", ai_bhvr_hold), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_7", ai_bhvr_hold), ## (party_set_flags, "$qst_capture_conspirators_party_7", pf_default_behavior, 0), ## (party_attach_to_party, "$qst_capture_conspirators_party_7", "$qst_capture_conspirators_party_1"), ## (try_end), ## (try_end), ## (try_begin), ## (get_party_ai_behavior, ":ai_behavior", "$qst_capture_conspirators_party_7"), ## (eq, ":ai_behavior", ai_bhvr_travel_to_point), ## (party_get_ai_target_position, pos2, "$qst_capture_conspirators_party_7"), ## (party_get_position, pos1, "$qst_capture_conspirators_party_7"), ## (get_distance_between_positions, ":distance", pos2, pos1), ## (lt, ":distance", 200), ## (call_script, "script_get_closest_walled_center_of_faction", "$qst_capture_conspirators_party_7", ":faction_no"),#Can fail ## (ge, reg0, 0), ## (party_set_ai_object, "$qst_capture_conspirators_party_7", reg0), ## (party_set_ai_behavior, "$qst_capture_conspirators_party_7", ai_bhvr_travel_to_party), ## (party_set_flags, "$qst_capture_conspirators_party_7", pf_default_behavior, 0), ## (try_end), ## (try_end), ## ## (eq, ":num_active_parties", 0), ## (party_count_prisoners_of_type, ":count_captured_conspirators", "p_main_party", "trp_conspirator"), ## (party_count_prisoners_of_type, ":count_captured_conspirator_leaders", "p_main_party", "trp_conspirator_leader"), ## (val_add, ":count_captured_conspirators", ":count_captured_conspirator_leaders"), ## (try_begin), ## (store_div, ":limit", "$qst_capture_conspirators_num_troops_to_capture", 2), ## (gt, ":count_captured_conspirators", ":limit"), ## (call_script, "script_succeed_quest", "qst_capture_conspirators"), ## (else_try), ## (call_script, "script_fail_quest", "qst_capture_conspirators"), ## (try_end), ## ], ## [] ## ), # Follow Spy quest (0.5, 0.0, 0.0, [ (check_quest_active, "qst_follow_spy"), (eq, "$qst_follow_spy_no_active_parties", 0), (quest_get_slot, ":quest_giver_center", "qst_follow_spy", slot_quest_giver_center), (quest_get_slot, ":quest_object_center", "qst_follow_spy", slot_quest_object_center), (assign, ":abort_meeting", 0), (try_begin), (this_or_next|eq, "$qst_follow_spy_run_away", 1), (this_or_next|neg|party_is_active, "$qst_follow_spy_spy_party"), (neg|party_is_active, "$qst_follow_spy_spy_partners_party"), (else_try), (eq, "$qst_follow_spy_meeting_state", 0), (store_distance_to_party_from_party, ":cur_distance", "p_main_party", "$qst_follow_spy_spy_party"), (try_begin), (assign, ":min_distance", 3), (try_begin), (is_currently_night), (assign, ":min_distance", 1), (try_end), (le, ":cur_distance", ":min_distance"), (store_distance_to_party_from_party, ":player_distance_to_quest_giver_center", "p_main_party", ":quest_giver_center"), (gt, ":player_distance_to_quest_giver_center", 1), (assign, ":abort_meeting", 1), (assign, "$qst_follow_spy_run_away", 1), (display_message, "str_qst_follow_spy_noticed_you"), (else_try), (store_distance_to_party_from_party, ":cur_distance", "$qst_follow_spy_spy_partners_party", "$qst_follow_spy_spy_party"), (le, ":cur_distance", 1), (party_attach_to_party, "$qst_follow_spy_spy_party", "$qst_follow_spy_spy_partners_party"), (assign, "$qst_follow_spy_meeting_state", 1), (assign, "$qst_follow_spy_meeting_counter", 0), (try_end), (else_try), (eq, "$qst_follow_spy_meeting_state", 1), (store_distance_to_party_from_party, ":cur_distance", "p_main_party", "$qst_follow_spy_spy_partners_party"), (try_begin), (le, ":cur_distance", 1), (party_detach, "$qst_follow_spy_spy_party"), (assign, ":abort_meeting", 1), (assign, "$qst_follow_spy_run_away", 1), (display_message, "str_qst_follow_spy_noticed_you"), (else_try), (val_add, "$qst_follow_spy_meeting_counter", 1), (gt, "$qst_follow_spy_meeting_counter", 4), (party_detach, "$qst_follow_spy_spy_party"), (assign, ":abort_meeting", 0), (assign, "$qst_follow_spy_meeting_state", 2), (try_end), (try_end), (try_begin), (eq, ":abort_meeting", 1), (party_set_ai_object, "$qst_follow_spy_spy_party", ":quest_giver_center"), (party_set_ai_object, "$qst_follow_spy_spy_partners_party", ":quest_object_center"), (party_set_ai_behavior, "$qst_follow_spy_spy_party", ai_bhvr_travel_to_party), (party_set_ai_behavior, "$qst_follow_spy_spy_partners_party", ai_bhvr_travel_to_party), (party_set_flags, "$qst_follow_spy_spy_party", pf_default_behavior, 0), (party_set_flags, "$qst_follow_spy_spy_partners_party", pf_default_behavior, 0), (try_end), (assign, ":num_active", 0), (try_begin), (party_is_active, "$qst_follow_spy_spy_party"), (val_add, ":num_active", 1), (party_is_in_town, "$qst_follow_spy_spy_party", ":quest_giver_center"), (remove_party, "$qst_follow_spy_spy_party"), (assign, "$qst_follow_spy_spy_back_in_town", 1), (val_sub, ":num_active", 1), (try_end), (try_begin), (party_is_active, "$qst_follow_spy_spy_partners_party"), (val_add, ":num_active", 1), (party_is_in_town, "$qst_follow_spy_spy_partners_party", ":quest_object_center"), (remove_party, "$qst_follow_spy_spy_partners_party"), (assign, "$qst_follow_spy_partner_back_in_town", 1), (val_sub, ":num_active", 1), (try_end), (try_begin), (eq, "$qst_follow_spy_partner_back_in_town",1), (eq, "$qst_follow_spy_spy_back_in_town",1), (call_script, "script_fail_quest", "qst_follow_spy"), (try_end), (try_begin), (eq, ":num_active", 0), (assign, "$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), (call_script, "script_succeed_quest", "qst_follow_spy"), (try_end), ], [] ), ### Raiders quest ## (0.95, 0.0, 0.2, ## [ ## (check_quest_active, "qst_hunt_down_raiders"), ## (neg|check_quest_succeeded, "qst_hunt_down_raiders"), ## (neg|check_quest_failed, "qst_hunt_down_raiders"), ## ], ## [ ## (quest_get_slot, ":quest_target_party", "qst_hunt_down_raiders", slot_quest_target_party), ## (party_set_ai_behavior, ":quest_target_party", ai_bhvr_hold), ## (party_set_flags, ":quest_target_party", pf_default_behavior, 0), ## ] ## ), ## ## (0.7, 0, 0.2, ## [ ## (check_quest_active, "qst_hunt_down_raiders"), ## (neg|check_quest_succeeded, "qst_hunt_down_raiders"), ## (neg|check_quest_failed, "qst_hunt_down_raiders"), ## ], ## [ ## (quest_get_slot, ":quest_target_party", "qst_hunt_down_raiders", slot_quest_target_party), ## (party_set_ai_behavior,":quest_target_party",ai_bhvr_travel_to_party), ## (party_set_flags, ":quest_target_party", pf_default_behavior, 0), ## ] ## ), ## ## (0.1, 0.0, 0.0, ## [ ## (check_quest_active, "qst_hunt_down_raiders"), ## (neg|check_quest_succeeded, "qst_hunt_down_raiders"), ## (neg|check_quest_failed, "qst_hunt_down_raiders"), ## (quest_get_slot, ":quest_target_party", "qst_hunt_down_raiders", slot_quest_target_party), ## (neg|party_is_active, ":quest_target_party") ## ], ## [ ## (call_script, "script_succeed_quest", "qst_hunt_down_raiders"), ## ] ## ), ## ## (1.3, 0, 0.0, ## [ ## (check_quest_active, "qst_hunt_down_raiders"), ## (neg|check_quest_succeeded, "qst_hunt_down_raiders"), ## (neg|check_quest_failed, "qst_hunt_down_raiders"), ## (quest_get_slot, ":quest_target_party", "qst_hunt_down_raiders", slot_quest_target_party), ## (quest_get_slot, ":quest_target_center", "qst_hunt_down_raiders", slot_quest_target_center), ## (party_is_in_town,":quest_target_party",":quest_target_center") ## ], ## [ ## (call_script, "script_fail_quest", "qst_hunt_down_raiders"), ## (display_message, "str_raiders_reached_base"), ## (quest_get_slot, ":quest_target_party", "qst_hunt_down_raiders", slot_quest_target_party), ## (remove_party, ":quest_target_party"), ## ] ## ), ##### TODO: QUESTS COMMENT OUT END ######################################################################### # Random MERCHANT quest triggers #################################### # Apply interest to merchants guild debt 1% per week (24.0 * 7, 0.0, 0.0, [], [ (val_mul,"$debt_to_merchants_guild",101), (val_div,"$debt_to_merchants_guild",100) ] ), # Escort merchant caravan: (0.1, 0.0, 0.1, [(check_quest_active, "qst_escort_merchant_caravan"), (eq, "$escort_merchant_caravan_mode", 1) ], [(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party), (try_begin), (party_is_active, ":quest_target_party"), (party_set_ai_behavior, ":quest_target_party", ai_bhvr_hold), (party_set_flags, ":quest_target_party", pf_default_behavior, 0), (try_end), ]), (0.1, 0.0, 0.1, [(check_quest_active, "qst_escort_merchant_caravan"), (eq, "$escort_merchant_caravan_mode", 0), ], [(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party), (try_begin), (party_is_active, ":quest_target_party"), (party_set_ai_behavior, ":quest_target_party", ai_bhvr_escort_party), (party_set_flags, ":quest_target_party", pf_default_behavior, 0), (party_set_ai_object, ":quest_target_party", "p_main_party"), (try_end), ]), (0.1, 0, 0.0, [(check_quest_active, "qst_escort_merchant_caravan"), (quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party), (neg|party_is_active,":quest_target_party"), ], [(call_script, "script_abort_quest", "qst_escort_merchant_caravan", 2), ]), # Troublesome bandits (0.3, 0.0, 1.1, [(check_quest_active, "qst_troublesome_bandits"), (neg|check_quest_failed, "qst_troublesome_bandits"), (store_num_parties_destroyed, ":cur_eliminated", "pt_troublesome_bandits"), (lt, "$qst_troublesome_bandits_eliminated", ":cur_eliminated"), (store_num_parties_destroyed_by_player, ":cur_eliminated_by_player", "pt_troublesome_bandits"), (eq, ":cur_eliminated_by_player", "$qst_troublesome_bandits_eliminated_by_player"), ], [(display_message, "str_bandits_eliminated_by_another"), (call_script, "script_abort_quest", "qst_troublesome_bandits", 2), ]), (0.3, 0.0, 1.1, [(check_quest_active, "qst_troublesome_bandits"), (neg|check_quest_succeeded, "qst_troublesome_bandits"), (store_num_parties_destroyed, ":cur_eliminated", "pt_troublesome_bandits"), (lt, "$qst_troublesome_bandits_eliminated", ":cur_eliminated"), (store_num_parties_destroyed_by_player, ":cur_eliminated_by_player", "pt_troublesome_bandits"), (neq, ":cur_eliminated_by_player", "$qst_troublesome_bandits_eliminated_by_player"), ], [(call_script, "script_succeed_quest", "qst_troublesome_bandits"),]), # Kidnapped girl: (1, 0, 0, [(check_quest_active, "qst_kidnapped_girl"), (quest_get_slot, ":quest_target_party", "qst_kidnapped_girl", slot_quest_target_party), (party_is_active, ":quest_target_party"), (party_is_in_any_town, ":quest_target_party"), (remove_party, ":quest_target_party"), ], [] ), #Rebellion changes begin #move (0, 0, 24 * 14, [ (try_for_range, ":pretender", pretenders_begin, pretenders_end), (troop_set_slot, ":pretender", slot_troop_cur_center, 0), (neq, ":pretender", "$supported_pretender"), (troop_get_slot, ":target_faction", ":pretender", slot_troop_original_faction), (faction_slot_eq, ":target_faction", slot_faction_state, sfs_active), (faction_slot_eq, ":target_faction", slot_faction_has_rebellion_chance, 1), (neg|troop_slot_eq, ":pretender", slot_troop_occupation, slto_kingdom_hero), (try_for_range, ":unused", 0, 30), (troop_slot_eq, ":pretender", slot_troop_cur_center, 0), (store_random_in_range, ":town", towns_begin, towns_end), (store_faction_of_party, ":town_faction", ":town"), (store_relation, ":relation", ":town_faction", ":target_faction"), (le, ":relation", 0), #fail if nothing qualifies (troop_set_slot, ":pretender", slot_troop_cur_center, ":town"), (try_begin), (eq, "$cheat_mode", 1), (str_store_troop_name, 4, ":pretender"), (str_store_party_name, 5, ":town"), (display_message, "@{s4} is in {s5}"), (try_end), (try_end), # (try_for_range, ":rebel_faction", rebel_factions_begin, rebel_factions_end), # (faction_get_slot, ":rebellion_status", ":rebel_faction", slot_faction_state), # (eq, ":rebellion_status", sfs_inactive_rebellion), # (faction_get_slot, ":pretender", ":rebel_faction", slot_faction_leader), # (faction_get_slot, ":target_faction", ":rebel_faction", slot_faction_rebellion_target),# # (store_random_in_range, ":town", towns_begin, towns_end), # (store_faction_of_party, ":town_faction", ":town"), # (store_relation, ":relation", ":town_faction", ":target_faction"), # (le, ":relation", 0), #fail if nothing qualifies # (faction_set_slot, ":rebel_faction", slot_faction_inactive_leader_location, ":town"), (try_end), ], [] ), #Rebellion changes end #NPC system changes begin #Move unemployed NPCs around taverns (24 * 15, 0, 0, [ (call_script, "script_update_companion_candidates_in_taverns"), ], [] ), #Process morale and determine personality clashes (0, 0, 24, [], [ #Count NPCs in party and get the "grievance divisor", which determines how fast grievances go away #Set their relation to the player (assign, ":npcs_in_party", 0), (assign, ":grievance_divisor", 100), (try_for_range, ":npc1", companions_begin, companions_end), (main_party_has_troop, ":npc1"), (val_add, ":npcs_in_party", 1), (try_end), (val_sub, ":grievance_divisor", ":npcs_in_party"), (store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"), (val_add, ":grievance_divisor", ":persuasion_level"), (assign, reg7, ":grievance_divisor"), # (display_message, "@Process NPC changes. GD: {reg7}"), ##Activate personality clash from 24 hours ago (try_begin), #scheduled personality clashes require at least 24hrs together (gt, "$personality_clash_after_24_hrs", 0), (eq, "$disable_npc_complaints", 0), (try_begin), (troop_get_slot, ":other_npc", "$personality_clash_after_24_hrs", slot_troop_personalityclash_object), (main_party_has_troop, "$personality_clash_after_24_hrs"), (main_party_has_troop, ":other_npc"), (assign, "$npc_with_personality_clash", "$personality_clash_after_24_hrs"), (try_end), (assign, "$personality_clash_after_24_hrs", 0), (try_end), # (try_for_range, ":npc", companions_begin, companions_end), ###Reset meeting variables (troop_set_slot, ":npc", slot_troop_turned_down_twice, 0), (try_begin), (troop_slot_eq, ":npc", slot_troop_met, 1), (troop_set_slot, ":npc", slot_troop_met_previously, 1), (try_end), ###Check for coming out of retirement (troop_get_slot, ":occupation", ":npc", slot_troop_occupation), (try_begin), (eq, ":occupation", slto_retirement), (troop_get_slot, ":renown_min", ":npc", slot_troop_return_renown), (str_store_troop_name, s31, ":npc"), (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown), (assign, reg4, ":player_renown"), (assign, reg5, ":renown_min"), # (display_message, "@Test {s31} for retirement return {reg4}, {reg5}."), (gt, ":player_renown", ":renown_min"), (troop_set_slot, ":npc", slot_troop_personalityclash_penalties, 0), (troop_set_slot, ":npc", slot_troop_morality_penalties, 0), (troop_set_slot, ":npc", slot_troop_occupation, 0), (try_end), (try_begin), (main_party_has_troop, ":npc"), #Check for quitting (call_script, "script_npc_morale", ":npc"), (assign, ":npc_morale", reg0), (try_begin), (lt, ":npc_morale", 20), (store_random_in_range, ":random", 0, 100), (val_add, ":npc_morale", ":random"), (lt, ":npc_morale", 20), (assign, "$npc_is_quitting", ":npc"), (try_end), #Reduce grievance over time (or augment, if party is overcrowded (troop_get_slot, ":grievance", ":npc", slot_troop_personalityclash_penalties), (val_mul, ":grievance", 90), (val_div, ":grievance", ":grievance_divisor"), (troop_set_slot, ":npc", slot_troop_personalityclash_penalties, ":grievance"), (troop_get_slot, ":grievance", ":npc", slot_troop_morality_penalties), (val_mul, ":grievance", 90), (val_div, ":grievance", ":grievance_divisor"), (troop_set_slot, ":npc", slot_troop_morality_penalties, ":grievance"), #Change personality grievance levels (try_begin), (this_or_next|troop_slot_ge, ":npc", slot_troop_personalityclash_state, 1), (eq, "$disable_npc_complaints", 1), (troop_get_slot, ":object", ":npc", slot_troop_personalityclash_object), (main_party_has_troop, ":object"), (call_script, "script_reduce_companion_morale_for_clash", ":npc", ":object", slot_troop_personalityclash_state), (try_end), (try_begin), (this_or_next|troop_slot_ge, ":npc", slot_troop_personalityclash2_state, 1), (eq, "$disable_npc_complaints", 1), (troop_get_slot, ":object", ":npc", slot_troop_personalityclash2_object), (main_party_has_troop, ":object"), (call_script, "script_reduce_companion_morale_for_clash", ":npc", ":object", slot_troop_personalityclash2_state), (try_end), (try_begin), (this_or_next|troop_slot_ge, ":npc", slot_troop_personalitymatch_state, 1), (eq, "$disable_npc_complaints", 1), (troop_get_slot, ":object", ":npc", slot_troop_personalitymatch_object), (main_party_has_troop, ":object"), (troop_get_slot, ":grievance", ":npc", slot_troop_personalityclash_penalties), (val_mul, ":grievance", 9), (val_div, ":grievance", 10), (troop_set_slot, ":npc", slot_troop_personalityclash_penalties, ":grievance"), (try_end), #Check for new personality clashes #Active personality clash 1 if at least 24 hours have passed (try_begin), (eq, "$disable_npc_complaints", 0), (eq, "$npc_with_personality_clash", 0), (eq, "$npc_with_personality_clash_2", 0), (eq, "$personality_clash_after_24_hrs", 0), (troop_slot_eq, ":npc", slot_troop_personalityclash_state, 0), (troop_get_slot, ":other_npc", ":npc", slot_troop_personalityclash_object), (main_party_has_troop, ":other_npc"), (assign, "$personality_clash_after_24_hrs", ":npc"), (try_end), #Personality clash 2 and personality match is triggered by battles (try_end), (try_end), ]), #NPC system changes end #################################### # Formation section # # refresh array parties (not sure if it's useful, and might become buggy when the savegame is during siege) #(0, 0, ti_once, [ # ], [ # (party_get_num_attached_parties, ":array_num", "p_main_party"), # (try_for_range, ":array", 0, ":array_num"), # (party_get_attached_party_with_rank, ":array_party", "p_main_party", ":array"), # (store_add, ":slot", slot_party_array_parties_begin+1, ":array"), # (party_set_slot, "p_main_party", ":slot", ":array_party"), # (try_end), # (val_add, ":array_num", 1), # (party_set_slot, "p_main_party", slot_party_array_parties_begin, ":array_num"), # ] # ), # # Formation section end #################################### ]
Python
from header_music import * #################################################################################################################### # Each track record contains the following fields: # 1) Track id: used for referencing tracks. # 2) Track file: filename of the track # 3) Track flags. See header_music.py for a list of available flags # 4) Continue Track flags: Shows in which situations or cultures the track can continue playing. See header_music.py for a list of available flags #################################################################################################################### # WARNING: You MUST add mtf_module_track flag to the flags of the tracks located under module directory tracks = [ ## ("losing_battle", "alosingbattle.mp3", sit_calm|sit_action), ## ("reluctant_hero", "reluctanthero.mp3", sit_action), ## ("the_great_hall", "thegreathall.mp3", sit_calm), ## ("requiem", "requiem.mp3", sit_calm), ## ("silent_intruder", "silentintruder.mp3", sit_calm|sit_action), ## ("the_pilgrimage", "thepilgrimage.mp3", sit_calm), ## ("ambushed", "ambushed.mp3", sit_action), ## ("triumph", "triumph.mp3", sit_action), ## ("losing_battle", "alosingbattle.mp3", mtf_sit_map_travel|mtf_sit_attack), ## ("reluctant_hero", "reluctanthero.mp3", mtf_sit_attack), ## ("the_great_hall", "thegreathall.mp3", mtf_sit_map_travel), ## ("requiem", "requiem.mp3", mtf_sit_map_travel), ## ("silent_intruder", "silentintruder.mp3", mtf_sit_map_travel|mtf_sit_attack), ## ("the_pilgrimage", "thepilgrimage.mp3", mtf_sit_map_travel), ## ("ambushed", "ambushed.mp3", mtf_sit_attack), ## ("triumph", "triumph.mp3", mtf_sit_attack), ("bogus", "cant_find_this.ogg", 0, 0), ("mount_and_blade_title_screen", "mount_and_blade_title_screen.ogg", mtf_sit_main_title|mtf_start_immediately, 0), ("ambushed_by_neutral", "ambushed_by_neutral.ogg", mtf_sit_ambushed|mtf_sit_siege, mtf_sit_fight), ("ambushed_by_khergit", "ambushed_by_khergit.ogg", mtf_culture_3|mtf_sit_ambushed|mtf_sit_siege, mtf_sit_fight|mtf_culture_all), ("ambushed_by_nord", "ambushed_by_nord.ogg", mtf_culture_4|mtf_sit_ambushed|mtf_sit_siege, mtf_sit_fight|mtf_culture_all), ("ambushed_by_rhodok", "ambushed_by_rhodok.ogg", mtf_culture_5|mtf_sit_ambushed|mtf_sit_siege, mtf_sit_fight|mtf_culture_all), ("ambushed_by_swadian", "ambushed_by_swadian.ogg", mtf_culture_1|mtf_sit_ambushed|mtf_sit_siege, mtf_sit_fight|mtf_culture_all), ("ambushed_by_vaegir", "ambushed_by_vaegir.ogg", mtf_culture_2|mtf_sit_ambushed|mtf_sit_siege, mtf_sit_fight|mtf_culture_all), ("arena_1", "arena_1.ogg", mtf_sit_arena, 0), # ("arena_2", "arena_2.ogg", mtf_looping|mtf_sit_arena, 0), ("armorer", "armorer.ogg", mtf_sit_travel, 0), ("bandit_fight", "bandit_fight.ogg", mtf_sit_fight|mtf_sit_ambushed, 0), ("calm_night_1", "calm_night_2.ogg", mtf_sit_night, mtf_sit_town|mtf_sit_tavern|mtf_sit_travel), ("captured", "capture.ogg", mtf_persist_until_finished, 0), ("defeated_by_neutral", "defeated_by_neutral.ogg",mtf_persist_until_finished|mtf_sit_killed, 0), ("defeated_by_neutral_2", "defeated_by_neutral_2.ogg", mtf_persist_until_finished|mtf_sit_killed, 0), ("defeated_by_neutral_3", "defeated_by_neutral_3.ogg", mtf_persist_until_finished|mtf_sit_killed, 0), ("empty_village", "empty_village.ogg", mtf_persist_until_finished, 0), ("encounter_hostile_nords", "encounter_hostile_nords.ogg", mtf_persist_until_finished|mtf_sit_encounter_hostile, 0), ("escape", "escape.ogg", mtf_persist_until_finished, 0), ("fight_1", "fight_1.ogg", mtf_sit_fight|mtf_sit_ambushed, 0), ("fight_2", "fight_2.ogg", mtf_sit_fight|mtf_sit_ambushed, 0), ("fight_3", "fight_3.ogg", mtf_sit_fight|mtf_sit_ambushed, 0), ("fight_as_khergit", "fight_as_khergit.ogg", mtf_culture_3|mtf_sit_fight|mtf_sit_ambushed, mtf_culture_all), ("fight_as_nord", "fight_as_nord.ogg", mtf_culture_4|mtf_sit_fight|mtf_sit_ambushed, mtf_culture_all), ("fight_as_rhodok", "fight_as_rhodok.ogg", mtf_culture_5|mtf_sit_fight|mtf_sit_ambushed, mtf_culture_all), # ("fight_as_swadian", "fight_as_swadian.ogg", mtf_culture_1|mtf_sit_fight, mtf_culture_all), ("fight_as_vaegir", "fight_as_vaegir.ogg", mtf_culture_2|mtf_sit_fight|mtf_sit_ambushed, mtf_culture_all), ("fight_while_mounted_1", "fight_while_mounted_1.ogg", mtf_sit_fight|mtf_sit_ambushed, 0), ("fight_while_mounted_2", "fight_while_mounted_2.ogg", mtf_sit_fight|mtf_sit_ambushed, 0), ("infiltration_khergit", "infiltration_khergit.ogg", mtf_culture_3|mtf_sit_town_infiltrate, mtf_culture_all), ("killed_by_khergit", "killed_by_khergit.ogg", mtf_persist_until_finished|mtf_culture_3|mtf_sit_killed, 0), # ("killed_by_neutral", "killed_by_neutral.ogg", mtf_persist_until_finished|mtf_culture_6|mtf_sit_killed, 0), # ("killed_by_nord", "killed_by_nord.ogg", mtf_persist_until_finished|mtf_culture_4|mtf_sit_killed, 0), # ("killed_by_rhodok", "killed_by_rhodok.ogg", mtf_persist_until_finished|mtf_culture_5|mtf_sit_killed, 0), ("killed_by_swadian", "killed_by_swadian.ogg", mtf_persist_until_finished|mtf_culture_1|mtf_sit_killed, 0), # ("killed_by_vaegir", "killed_by_vaegir.ogg", mtf_persist_until_finished|mtf_culture_2|mtf_sit_killed, 0), ("lords_hall_khergit", "lords_hall_khergit.ogg", mtf_culture_3|mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_tavern|mtf_culture_all), ("lords_hall_nord", "lords_hall_nord.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_tavern), ("lords_hall_swadian", "lords_hall_swadian.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_tavern), ("lords_hall_rhodok", "lords_hall_rhodok.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_tavern), ("lords_hall_vaegir", "lords_hall_vaegir.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_tavern), ("mounted_snow_terrain_calm", "mounted_snow_terrain_calm.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_night|mtf_sit_tavern), ("neutral_infiltration", "neutral_infiltration.ogg", mtf_sit_town_infiltrate, 0), ("outdoor_beautiful_land", "outdoor_beautiful_land.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_night|mtf_sit_tavern), ("retreat", "retreat.ogg", mtf_persist_until_finished|mtf_sit_killed, 0), ("seige_neutral", "seige_neutral.ogg", mtf_sit_siege, mtf_sit_fight|mtf_sit_ambushed), ("tavern_1", "tavern_1.ogg", mtf_sit_tavern, 0), ("tavern_2", "tavern_2.ogg", mtf_sit_tavern, 0), ("town_neutral", "town_neutral.ogg", mtf_sit_town|mtf_sit_travel, mtf_sit_tavern|mtf_sit_night), ("town_khergit", "town_khergit.ogg", mtf_culture_3|mtf_sit_town|mtf_sit_travel, mtf_sit_tavern|mtf_sit_night|mtf_culture_all), ("town_nord", "town_nord.ogg", mtf_culture_4|mtf_sit_town|mtf_sit_travel, mtf_sit_tavern|mtf_sit_night|mtf_culture_all), ("town_rhodok", "town_rhodok.ogg", mtf_culture_5|mtf_sit_town|mtf_sit_travel, mtf_sit_tavern|mtf_sit_night|mtf_culture_all), ("town_swadian", "town_swadian.ogg", mtf_culture_1|mtf_sit_town|mtf_sit_travel, mtf_sit_tavern|mtf_sit_night|mtf_culture_all), ("town_vaegir", "town_vaegir.ogg", mtf_culture_2|mtf_sit_town|mtf_sit_travel, mtf_sit_tavern|mtf_sit_night|mtf_culture_all), ("travel_khergit", "travel_khergit.ogg", mtf_culture_3|mtf_sit_travel, mtf_sit_town|mtf_sit_tavern|mtf_sit_night|mtf_culture_all), ("travel_neutral", "travel_neutral.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_tavern|mtf_sit_night), ("travel_nord", "travel_nord.ogg", mtf_culture_4|mtf_sit_travel, mtf_sit_town|mtf_sit_tavern|mtf_sit_night|mtf_culture_all), ("travel_rhodok", "travel_rhodok.ogg", mtf_culture_5|mtf_sit_travel, mtf_sit_town|mtf_sit_tavern|mtf_sit_night|mtf_culture_all), ("travel_swadian", "travel_swadian.ogg", mtf_culture_1|mtf_sit_travel, mtf_sit_town|mtf_sit_tavern|mtf_sit_night|mtf_culture_all), ("travel_vaegir", "travel_vaegir.ogg", mtf_culture_2|mtf_sit_travel, mtf_sit_town|mtf_sit_tavern|mtf_sit_night|mtf_culture_all), ("uncertain_homestead", "uncertain_homestead.ogg", mtf_sit_travel, mtf_sit_town|mtf_sit_night|mtf_sit_tavern), ("victorious_evil", "victorious_evil.ogg", mtf_persist_until_finished, 0), ("victorious_neutral_1", "victorious_neutral_1.ogg", mtf_persist_until_finished|mtf_sit_victorious, 0), ("victorious_neutral_2", "victorious_neutral_2.ogg", mtf_persist_until_finished|mtf_sit_victorious, 0), ("victorious_neutral_3", "victorious_neutral_3.ogg", mtf_persist_until_finished|mtf_sit_victorious, 0), ("victorious_swadian", "victorious_swadian.ogg", mtf_persist_until_finished|mtf_culture_2|mtf_sit_victorious, 0), ("victorious_vaegir", "victorious_vaegir.ogg", mtf_persist_until_finished|mtf_culture_2|mtf_sit_victorious, 0), ("victorious_vaegir_2", "victorious_vaegir_2.ogg", mtf_persist_until_finished|mtf_culture_2|mtf_sit_victorious, 0), ]
Python
import string import types from module_info import * from module_triggers import * from module_dialogs import * from process_common import * from process_operations import * speaker_pos = 0 ipt_token_pos = 1 sentence_conditions_pos = 2 text_pos = 3 opt_token_pos = 4 sentence_consequences_pos = 5 #------------------------------------------------------- def save_dialog_states(dialog_states): file = open(export_dir + "dialog_states.txt","w") for dialog_state in dialog_states: file.write("%s\n"%dialog_state) file.close() #def compile_variables(cookies_list): # for trigger in triggers: # for consequence in trigger[trigger_consequences_pos]: # compile_statement(consequence,cookies_list) # for sentence in sentences: # for consequence in sentence[sentence_consequences_pos]: # compile_statement(consequence,cookies_list) # for trigger in triggers: # for condition in trigger[trigger_conditions_pos]: # compile_statement(condition,cookies_list) # for sentence in sentences: # for condition in sentence[sentence_conditions_pos]: # compile_statement(condition,cookies_list) # return cookies_list def save_triggers(variable_list,variable_uses,triggers,tag_uses,quick_strings): file = open(export_dir + "triggers.txt","w") file.write("triggersfile version 1\n") file.write("%d\n"%len(triggers)) for i in xrange(len(triggers)): trigger = triggers[i] file.write("%f %f %f "%(trigger[trigger_check_pos],trigger[trigger_delay_pos],trigger[trigger_rearm_pos])) save_statement_block(file,0,1,trigger[trigger_conditions_pos] , variable_list, variable_uses,tag_uses,quick_strings) save_statement_block(file,0,1,trigger[trigger_consequences_pos], variable_list, variable_uses,tag_uses,quick_strings) # for condition in trigger[trigger_conditions_pos]: # save_operation(file,condition,variable_list) # file.write(" %d "%(len(trigger[trigger_consequences_pos]))) # for consequence in trigger[trigger_consequences_pos]: # save_operation(file,consequence,variable_list) file.write("\n") file.close() #================================================================= def compile_sentence_tokens(sentences): input_tokens = [] output_tokens = [] dialog_states = ["start","party_encounter","prisoner_liberated","enemy_defeated","party_relieved","event_triggered","close_window","trade","exchange_members", "trade_prisoners","buy_mercenaries","view_char","training","member_chat","prisoner_chat"] for sentence in sentences: output_token_id = -1 output_token = sentence[opt_token_pos] found = 0 for i_t in xrange(len(dialog_states)): if output_token == dialog_states[i_t]: output_token_id = i_t found = 1 break if not found: dialog_states.append(output_token) output_token_id = len(dialog_states) - 1 output_tokens.append(output_token_id) for sentence in sentences: input_token_id = -1 input_token = sentence[ipt_token_pos] found = 0 for i_t in xrange(len(dialog_states)): if input_token == dialog_states[i_t]: input_token_id = i_t found = 1 break if not found: print sentence[ipt_token_pos] print sentence[text_pos] print sentence[opt_token_pos] print "**********************************************************************************" print "ERROR: INPUT TOKEN NOT FOUND:" + input_token print "**********************************************************************************" print "**********************************************************************************" input_tokens.append(input_token_id) save_dialog_states(dialog_states) return (input_tokens, output_tokens) def create_auto_id(sentence,auto_ids): text = convert_to_identifier(sentence[text_pos]) done = 0 i = 20 lt = len(text) if (i > lt): i = lt auto_id = "dlga_" + text[0:i] done = 0 if auto_ids.has_key(auto_id) and (auto_ids[auto_id] == text): done = 1 while (i <= lt) and not done: auto_id = "dlga_" + text[0:i] if auto_ids.has_key(auto_id): if auto_ids[auto_id] == text: done = 1 else: i += 1 else: done = 1 auto_ids[auto_id] = text if not done: number = 1 new_auto_id = auto_id + str(number) while auto_ids.has_key(new_auto_id): number += 1 new_auto_id = auto_id + str(number) auto_id = new_auto_id auto_ids[auto_id] = text return auto_id def create_auto_id2(sentence,auto_ids): text = sentence[text_pos] token_ipt = convert_to_identifier(sentence[ipt_token_pos]) token_opt = convert_to_identifier(sentence[opt_token_pos]) done = 0 auto_id = "dlga_" + token_ipt + ":" + token_opt done = 0 if not auto_ids.has_key(auto_id): done = 1 else: if auto_ids.has_key(auto_id) and (auto_ids[auto_id] == text): done = 1 if not done: number = 1 new_auto_id = auto_id + "." + str(number) while auto_ids.has_key(new_auto_id): number += 1 new_auto_id = auto_id + "." + str(number) auto_id = new_auto_id auto_ids[auto_id] = text return auto_id def save_sentences(variable_list,variable_uses,sentences,tag_uses,quick_strings,input_states,output_states): file = open(export_dir + "conversation.txt","w") file.write("dialogsfile version 1\n") file.write("%d\n"%len(sentences)) # Create an empty dictionary auto_ids = {} for i in xrange(len(sentences)): sentence = sentences[i] try: dialog_id = create_auto_id2(sentence,auto_ids) file.write("%s %d %d "%(dialog_id,sentence[speaker_pos],input_states[i])) save_statement_block(file, 0, 1, sentence[sentence_conditions_pos], variable_list,variable_uses,tag_uses,quick_strings) file.write("%s "%(string.replace(sentence[text_pos]," ","_"))) if (len(sentence[text_pos]) == 0): file.write("NO_TEXT ") file.write(" %d "%(output_states[i])) save_statement_block(file, 0, 1, sentence[sentence_consequences_pos], variable_list,variable_uses,tag_uses,quick_strings) file.write("\n") except: print "Error in dialog line:" print sentence file.close() # Registered cookies is a list which enables the order of cookies to remain fixed across changes. # In order to remove cookies not used anymore, edit the cookies_registery.py and remove all entries. print "exporting triggers..." variable_uses = [] variables = load_variables(export_dir,variable_uses) tag_uses = load_tag_uses(export_dir) quick_strings = load_quick_strings(export_dir) #compile_variables(variables) save_triggers(variables,variable_uses,triggers,tag_uses,quick_strings) print "exporting dialogs..." (input_states,output_states) = compile_sentence_tokens(dialogs) save_sentences(variables,variable_uses,dialogs,tag_uses,quick_strings,input_states,output_states) save_variables(export_dir,variables,variable_uses) save_tag_uses(export_dir, tag_uses) save_quick_strings(export_dir,quick_strings) #print "finished."
Python
import string from header_common import * from module_info import * from module_music import * from process_common import * def save_python_header(): ofile = open("./ID_music.py","w") for i_track in xrange(len(tracks)): ofile.write("track_%s = %d\n"%(tracks[i_track][0],i_track)) ofile.write("\n\n") ofile.close() def save_tracks(): file = open(export_dir + "music.txt","w") file.write("%d\n"%len(tracks)) for track in tracks: file.write("%s %d %d\n"%(track[1], track[2], (track[2] | track[3]))) file.close() print "Exporting tracks..." save_python_header() save_tracks()
Python
track_bogus = 0 track_mount_and_blade_title_screen = 1 track_ambushed_by_neutral = 2 track_ambushed_by_khergit = 3 track_ambushed_by_nord = 4 track_ambushed_by_rhodok = 5 track_ambushed_by_swadian = 6 track_ambushed_by_vaegir = 7 track_arena_1 = 8 track_armorer = 9 track_bandit_fight = 10 track_calm_night_1 = 11 track_captured = 12 track_defeated_by_neutral = 13 track_defeated_by_neutral_2 = 14 track_defeated_by_neutral_3 = 15 track_empty_village = 16 track_encounter_hostile_nords = 17 track_escape = 18 track_fight_1 = 19 track_fight_2 = 20 track_fight_3 = 21 track_fight_as_khergit = 22 track_fight_as_nord = 23 track_fight_as_rhodok = 24 track_fight_as_vaegir = 25 track_fight_while_mounted_1 = 26 track_fight_while_mounted_2 = 27 track_infiltration_khergit = 28 track_killed_by_khergit = 29 track_killed_by_swadian = 30 track_lords_hall_khergit = 31 track_lords_hall_nord = 32 track_lords_hall_swadian = 33 track_lords_hall_rhodok = 34 track_lords_hall_vaegir = 35 track_mounted_snow_terrain_calm = 36 track_neutral_infiltration = 37 track_outdoor_beautiful_land = 38 track_retreat = 39 track_seige_neutral = 40 track_tavern_1 = 41 track_tavern_2 = 42 track_town_neutral = 43 track_town_khergit = 44 track_town_nord = 45 track_town_rhodok = 46 track_town_swadian = 47 track_town_vaegir = 48 track_travel_khergit = 49 track_travel_neutral = 50 track_travel_nord = 51 track_travel_rhodok = 52 track_travel_swadian = 53 track_travel_vaegir = 54 track_uncertain_homestead = 55 track_victorious_evil = 56 track_victorious_neutral_1 = 57 track_victorious_neutral_2 = 58 track_victorious_neutral_3 = 59 track_victorious_swadian = 60 track_victorious_vaegir = 61 track_victorious_vaegir_2 = 62
Python
leave_wo_battle = 0 leave_during_battle = 1 cancel_attack = 2 speak = 3 intend_battle = 4 cancel_reinforce = 5 surrender = 6 stay_back = 7 charge = 8 stay_back_with_ally = 9 charge_with_ally = 10
Python
from ID_items import * from ID_quests import * from ID_factions import * ############################################################## # These constants are used in various files. # If you need to define a value that will be used in those files, # just define it here rather than copying it across each file, so # that it will be easy to change it if you need to. ############################################################## ######################################################## ## ITEM SLOTS ############################# ######################################################## slot_item_is_checked = 0 slot_item_food_bonus = 1 slot_item_book_reading_progress = 2 slot_item_book_read = 3 slot_item_intelligence_requirement= 4 ######################################################## ## AGENT SLOTS ############################# ######################################################## slot_agent_target_entry_point = 0 slot_agent_target_x_pos = 1 slot_agent_target_y_pos = 2 slot_agent_is_alive_before_retreat= 3 slot_agent_is_in_scripted_mode = 4 slot_agent_is_not_reinforcement = 5 slot_agent_tournament_point = 6 slot_agent_arena_team_set = 7 slot_agent_map_overlay_id = 10 slot_agent_target_entry_point = 11 ######################################################## ## FACTION SLOTS ############################# ######################################################## slot_faction_ai_state = 4 slot_faction_ai_object = 5 slot_faction_ai_last_offensive_time = 6 slot_faction_marshall = 7 slot_faction_ai_offensive_max_followers = 8 slot_faction_culture = 9 slot_faction_leader = 10 ##slot_faction_vassal_of = 11 slot_faction_number_of_parties = 20 slot_faction_state = 21 slot_faction_player_alarm = 30 slot_faction_last_mercenary_offer_time = 31 slot_faction_tier_1_troop = 41 slot_faction_tier_2_troop = 42 slot_faction_tier_3_troop = 43 slot_faction_tier_4_troop = 44 slot_faction_tier_5_troop = 45 slot_faction_deserter_troop = 48 slot_faction_guard_troop = 49 slot_faction_messenger_troop = 50 slot_faction_prison_guard_troop = 51 slot_faction_castle_guard_troop = 52 slot_faction_has_rebellion_chance = 60 #Rebellion changes #slot_faction_rebellion_target = 65 #slot_faction_inactive_leader_location = 66 #slot_faction_support_base = 67 #Rebellion changes #slot_faction_deserter_party_template = 62 slot_faction_reinforcements_a = 77 slot_faction_reinforcements_b = 78 slot_faction_reinforcements_c = 79 slot_faction_num_armies = 80 slot_faction_num_castles = 81 slot_faction_num_towns = 82 ######################################################## ## PARTY SLOTS ############################# ######################################################## slot_party_type = 0 #spt_caravan, spt_town, spt_castle slot_party_retreat_flag = 2 slot_party_ignore_player_until = 3 slot_party_ai_state = 4 slot_party_ai_object = 5 slot_town_belongs_to_kingdom = 6 slot_town_lord = 7 slot_party_ai_substate = 8 slot_town_claimed_by_player = 9 slot_cattle_driven_by_player = slot_town_lord #hack slot_town_center = 10 slot_town_castle = 11 slot_town_prison = 12 slot_town_tavern = 13 slot_town_store = 14 slot_town_arena = 16 slot_town_alley = 17 slot_town_walls = 18 slot_center_culture = 19 slot_town_tavernkeeper = 20 slot_town_weaponsmith = 21 slot_town_armorer = 22 slot_town_merchant = 23 slot_town_horse_merchant= 24 slot_town_elder = 25 slot_center_player_relation = 26 slot_center_siege_with_belfry = 27 slot_center_last_taken_by_troop = 28 # party will follow this party if set: slot_party_commander_party = 30 #default -1 slot_party_following_player = 31 slot_party_follow_player_until_time = 32 slot_party_dont_follow_player_until_time = 33 slot_village_raided_by = 34 slot_village_state = 35 #svs_normal, svs_being_raided, svs_looted, svs_recovering, svs_deserted slot_village_raid_progress = 36 slot_village_recover_progress = 37 slot_village_smoke_added = 38 slot_village_infested_by_bandits = 39 slot_center_last_player_alarm_hour = 42 slot_village_land_quality = 44 slot_village_number_of_cattle = 45 slot_village_player_can_not_steal_cattle = 46 slot_center_accumulated_rents = 47 slot_center_accumulated_tariffs = 48 slot_town_wealth = 49 slot_town_prosperity = 50 slot_town_player_odds = 51 slot_party_last_toll_paid_hours = 52 slot_party_food_store = 53 #used for sieges slot_center_is_besieged_by = 54 #used for sieges slot_center_last_spotted_enemy = 55 slot_party_cached_strength = 56 slot_party_nearby_friend_strength = 57 slot_party_nearby_enemy_strength = 58 slot_party_follower_strength = 59 slot_town_reinforcement_party_template = 60 slot_center_original_faction = 61 slot_center_ex_faction = 62 slot_party_follow_me = 63 slot_center_siege_begin_hours = 64 #used for sieges slot_center_siege_hardness = 65 slot_castle_exterior = slot_town_center #slot_town_rebellion_contact = 76 #trs_not_yet_approached = 0 #trs_approached_before = 1 #trs_approached_recently = 2 argument_none = 0 argument_claim = 1 argument_ruler = 2 argument_benefit = 3 argument_victory = 4 slot_town_rebellion_readiness = 77 #(readiness can be a negative number if the rebellion has been defeated) slot_town_arena_melee_mission_tpl = 78 slot_town_arena_torny_mission_tpl = 79 slot_town_arena_melee_1_num_teams = 80 slot_town_arena_melee_1_team_size = 81 slot_town_arena_melee_2_num_teams = 82 slot_town_arena_melee_2_team_size = 83 slot_town_arena_melee_3_num_teams = 84 slot_town_arena_melee_3_team_size = 85 slot_town_arena_melee_cur_tier = 86 ##slot_town_arena_template = 87 slot_center_npc_volunteer_troop_type = 90 slot_center_npc_volunteer_troop_amount = 91 slot_center_mercenary_troop_type = 90 slot_center_mercenary_troop_amount= 91 slot_center_volunteer_troop_type = 92 slot_center_volunteer_troop_amount= 93 #slot_center_companion_candidate = 94 slot_center_ransom_broker = 95 slot_center_tavern_traveler = 96 slot_center_traveler_info_faction = 97 slot_center_tavern_bookseller = 98 slot_center_tavern_minstrel = 99 num_party_loot_slots = 5 slot_party_next_looted_item_slot = 109 slot_party_looted_item_1 = 110 slot_party_looted_item_2 = 111 slot_party_looted_item_3 = 112 slot_party_looted_item_4 = 113 slot_party_looted_item_5 = 114 slot_party_looted_item_1_modifier = 115 slot_party_looted_item_2_modifier = 116 slot_party_looted_item_3_modifier = 117 slot_party_looted_item_4_modifier = 118 slot_party_looted_item_5_modifier = 119 slot_village_bound_center = 120 slot_village_market_town = 121 slot_village_farmer_party = 122 slot_party_home_center = 123 slot_center_current_improvement = 124 slot_center_improvement_end_hour = 125 slot_center_has_manor = 130 #village slot_center_has_fish_pond = 131 #village slot_center_has_watch_tower = 132 #village slot_center_has_school = 133 #village slot_center_has_messenger_post = 134 #town, castle, village slot_center_has_prisoner_tower = 135 #town, castle village_improvements_begin = slot_center_has_manor village_improvements_end = 135 walled_center_improvements_begin = slot_center_has_messenger_post walled_center_improvements_end = 136 slot_center_has_bandits = 149 slot_town_has_tournament = 150 slot_town_tournament_max_teams = 151 slot_town_tournament_max_team_size = 152 slot_center_faction_when_oath_renounced = 155 slot_center_walker_0_troop = 160 slot_center_walker_1_troop = 161 slot_center_walker_2_troop = 162 slot_center_walker_3_troop = 163 slot_center_walker_4_troop = 164 slot_center_walker_5_troop = 165 slot_center_walker_6_troop = 166 slot_center_walker_7_troop = 167 slot_center_walker_8_troop = 168 slot_center_walker_9_troop = 169 slot_center_walker_0_dna = 170 slot_center_walker_1_dna = 171 slot_center_walker_2_dna = 172 slot_center_walker_3_dna = 173 slot_center_walker_4_dna = 174 slot_center_walker_5_dna = 175 slot_center_walker_6_dna = 176 slot_center_walker_7_dna = 177 slot_center_walker_8_dna = 178 slot_center_walker_9_dna = 179 slot_center_walker_0_type = 180 slot_center_walker_1_type = 181 slot_center_walker_2_type = 182 slot_center_walker_3_type = 183 slot_center_walker_4_type = 184 slot_center_walker_5_type = 185 slot_center_walker_6_type = 186 slot_center_walker_7_type = 187 slot_center_walker_8_type = 188 slot_center_walker_9_type = 189 slot_town_trade_route_1 = 190 slot_town_trade_route_2 = 191 slot_town_trade_route_3 = 192 slot_town_trade_route_4 = 193 slot_town_trade_route_5 = 194 slot_town_trade_route_6 = 195 slot_town_trade_route_7 = 196 slot_town_trade_route_8 = 197 slot_town_trade_route_9 = 198 slot_town_trade_route_10 = 199 slot_town_trade_route_11 = 200 slot_town_trade_route_12 = 201 slot_town_trade_route_13 = 202 slot_town_trade_route_14 = 203 slot_town_trade_route_15 = 204 slot_town_trade_routes_begin = slot_town_trade_route_1 slot_town_trade_routes_end = slot_town_trade_route_15 + 1 num_trade_goods = itm_siege_supply - itm_smoked_fish slot_town_trade_good_productions_begin = 205 slot_town_trade_good_prices_begin = slot_town_trade_good_productions_begin + num_trade_goods + 1 #slot_party_type values ##spt_caravan = 1 spt_castle = 2 spt_town = 3 spt_village = 4 ##spt_forager = 5 ##spt_war_party = 6 ##spt_patrol = 7 ##spt_messenger = 8 ##spt_raider = 9 ##spt_scout = 10 spt_kingdom_caravan = 11 ##spt_prisoner_train = 12 spt_kingdom_hero_party = 13 ##spt_merchant_caravan = 14 spt_village_farmer = 15 spt_ship = 16 spt_cattle_herd = 17 #spt_deserter = 20 kingdom_party_types_begin = spt_kingdom_caravan kingdom_party_types_end = spt_kingdom_hero_party + 1 #slot_faction_state values sfs_active = 0 sfs_defeated = 1 sfs_inactive = 2 sfs_inactive_rebellion = 3 sfs_beginning_rebellion = 4 #slot_faction_ai_state values sfai_default = 0 sfai_gathering_army = 1 sfai_attacking_center = 2 sfai_raiding_village = 3 sfai_attacking_enemy_army = 4 sfai_attacking_enemies_around_center = 5 #Rebellion system changes begin sfai_nascent_rebellion = 6 #Rebellion system changes end #slot_party_ai_state values spai_undefined = -1 spai_besieging_center = 1 spai_patrolling_around_center = 4 spai_raiding_around_center = 5 ##spai_raiding_village = 6 spai_holding_center = 7 ##spai_helping_town_against_siege = 9 spai_engaging_army = 10 spai_accompanying_army = 11 spai_trading_with_town = 13 spai_retreating_to_center = 14 ##spai_trading_within_kingdom = 15 spai_recruiting_troops = 16 #slot_village_state values svs_normal = 0 svs_being_raided = 1 svs_looted = 2 svs_recovering = 3 svs_deserted = 4 svs_under_siege = 5 #$g_player_icon_state values pis_normal = 0 pis_camping = 1 pis_ship = 2 ######################################################## ## SCENE SLOTS ############################# ######################################################## slot_scene_visited = 0 slot_scene_belfry_props_begin = 10 ######################################################## ## TROOP SLOTS ############################# ######################################################## #slot_troop_role = 0 # 10=Kingdom Lord slot_troop_occupation = 2 # 0 = free, 1 = merchant #slot_troop_duty = 3 # Kingdom duty, 0 = free slot_troop_state = 3 slot_troop_last_talk_time = 4 slot_troop_met = 5 slot_troop_party_template = 6 #slot_troop_kingdom_rank = 7 slot_troop_renown = 7 ##slot_troop_is_prisoner = 8 # important for heroes only slot_troop_prisoner_of_party = 8 # important for heroes only #slot_troop_is_player_companion = 9 # important for heroes only:::USE slot_troop_occupation = slto_player_companion slot_troop_leaded_party = 10 # important for kingdom heroes only slot_troop_wealth = 11 # important for kingdom heroes only slot_troop_cur_center = 12 # important for royal family members only (non-kingdom heroes) slot_troop_banner_scene_prop = 13 # important for kingdom heroes and player only slot_troop_original_faction = 14 # for pretenders slot_troop_loyalty = 15 slot_troop_player_order_state = 16 slot_troop_player_order_object = 17 #slot_troop_present_at_event = 19 #defined below slot_troop_does_not_give_quest = 20 slot_troop_player_debt = 21 slot_troop_player_relation = 22 #slot_troop_player_favor = 23 slot_troop_last_quest = 24 slot_troop_last_quest_betrayed = 25 slot_troop_last_persuasion_time= 26 slot_troop_last_comment_time = 27 slot_troop_spawned_before = 28 #Post 0907 changes begin slot_troop_last_comment_slot = 29 slot_troop_present_at_event = 19 #Post 0907 changes end slot_troop_spouse = 30 slot_troop_father = 31 slot_troop_mother = 32 slot_troop_daughter = 33 slot_troop_son = 34 slot_troop_sibling = 35 slot_troop_lover = 36 slot_troop_trainer_met = 30 slot_troop_trainer_waiting_for_result = 31 slot_troop_trainer_training_fight_won = 32 slot_troop_trainer_num_opponents_to_beat = 33 slot_troop_trainer_training_system_explained = 34 slot_troop_trainer_opponent_troop = 35 slot_troop_trainer_training_difficulty = 36 slot_troop_trainer_training_fight_won = 37 slot_troop_family_begin = 30 slot_troop_family_end = 36 slot_troop_enemy_1 = 40 slot_troop_enemy_2 = 41 slot_troop_enemy_3 = 42 slot_troop_enemy_4 = 43 slot_troop_enemy_5 = 44 slot_troop_enemies_begin = 40 slot_troop_enemies_end = 45 slot_troop_honorable = 50 #slot_troop_merciful = 51 slot_lord_reputation_type = 52 slot_troop_change_to_faction = 55 slot_troop_readiness_to_join_army = 57 slot_troop_readiness_to_follow_orders = 58 # NPC-related constants #NPC companion changes begin slot_troop_first_encountered = 59 slot_troop_home = 60 slot_troop_morality_state = 61 tms_no_problem = 0 tms_acknowledged = 1 tms_dismissed = 2 slot_troop_morality_type = 62 tmt_aristocratic = 1 tmt_egalitarian = 2 tmt_humanitarian = 3 tmt_honest = 4 tmt_pious = 5 slot_troop_morality_value = 63 slot_troop_2ary_morality_type = 64 slot_troop_2ary_morality_state = 65 slot_troop_2ary_morality_value = 66 slot_troop_morality_penalties = 69 ### accumulated grievances from morality conflicts slot_troop_personalityclash_object = 71 #(0 - they have no problem, 1 - they have a problem) slot_troop_personalityclash_state = 72 #1 = pclash_penalty_to_self, 2 = pclash_penalty_to_other, 3 = pclash_penalty_to_other, pclash_penalty_to_self = 1 pclash_penalty_to_other = 2 pclash_penalty_to_both = 3 #(a string) slot_troop_personalityclash2_object = 73 slot_troop_personalityclash2_state = 74 slot_troop_personalitymatch_object = 75 slot_troop_personalitymatch_state = 76 slot_troop_personalityclash_penalties = 77 ### accumulated grievances from personality clash slot_troop_home_speech_delivered = 78 #NPC history slots slot_troop_met_previously = 80 slot_troop_turned_down_twice = 81 slot_troop_playerparty_history = 82 pp_history_scattered = 1 pp_history_dismissed = 2 pp_history_quit = 3 pp_history_indeterminate = 4 slot_troop_playerparty_history_string = 83 slot_troop_return_renown = 84 slot_troop_custom_banner_bg_color_1 = 85 slot_troop_custom_banner_bg_color_2 = 86 slot_troop_custom_banner_charge_color_1 = 87 slot_troop_custom_banner_charge_color_2 = 88 slot_troop_custom_banner_charge_color_3 = 89 slot_troop_custom_banner_charge_color_4 = 90 slot_troop_custom_banner_bg_type = 91 slot_troop_custom_banner_charge_type_1 = 92 slot_troop_custom_banner_charge_type_2 = 93 slot_troop_custom_banner_charge_type_3 = 94 slot_troop_custom_banner_charge_type_4 = 95 slot_troop_custom_banner_flag_type = 96 slot_troop_custom_banner_num_charges = 97 slot_troop_custom_banner_positioning = 98 slot_troop_custom_banner_map_flag_type = 99 #conversation strings -- must be in this order! slot_troop_intro = 101 slot_troop_intro_response_1 = 102 slot_troop_intro_response_2 = 103 slot_troop_backstory_a = 104 slot_troop_backstory_b = 105 slot_troop_backstory_c = 106 slot_troop_backstory_delayed = 107 slot_troop_backstory_response_1 = 108 slot_troop_backstory_response_2 = 109 slot_troop_signup = 110 slot_troop_signup_2 = 111 slot_troop_signup_response_1 = 112 slot_troop_signup_response_2 = 113 slot_troop_mentions_payment = 114 #Not actually used slot_troop_payment_response = 115 #Not actually used slot_troop_morality_speech = 116 slot_troop_2ary_morality_speech = 117 slot_troop_personalityclash_speech = 118 slot_troop_personalityclash_speech_b = 119 slot_troop_personalityclash2_speech = 120 slot_troop_personalityclash2_speech_b = 121 slot_troop_personalitymatch_speech = 122 slot_troop_personalitymatch_speech_b = 123 slot_troop_retirement_speech = 124 slot_troop_rehire_speech = 125 slot_troop_home_intro = 126 slot_troop_home_description = 127 slot_troop_home_description_2 = 128 slot_troop_home_recap = 129 slot_troop_honorific = 130 slot_troop_strings_end = 131 slot_troop_payment_request = 132 #Rebellion changes begin slot_troop_discussed_rebellion = 140 slot_troop_support_base = 141 #Rebellion changes end # character backgrounds cb_noble = 1 cb_merchant = 2 cb_guard = 3 cb_forester = 4 cb_nomad = 5 cb_thief = 6 cb_priest = 7 cb2_page = 0 cb2_apprentice = 1 cb2_urchin = 2 cb2_steppe_child = 3 cb2_merchants_helper = 4 cb3_poacher = 3 cb3_craftsman = 4 cb3_peddler = 5 cb3_troubadour = 7 cb3_squire = 8 cb3_lady_in_waiting = 9 cb3_student = 10 cb4_revenge = 1 cb4_loss = 2 cb4_wanderlust = 3 cb4_disown = 5 cb4_greed = 6 #NPC system changes end #Encounter types enctype_fighting_against_village_raid = 1 enctype_catched_during_village_raid = 2 ### Troop occupations slot_troop_occupation ##slto_merchant = 1 slto_kingdom_hero = 2 slto_player_companion = 3 slto_kingdom_lady = 4 slto_kingdom_seneschal = 5 slto_robber_knight = 6 stl_unassigned = -1 stl_reserved_for_player = -2 stl_rejected_by_player = -3 #NPC changes begin slto_retirement = 11 #slto_retirement_medium = 12 #slto_retirement_short = 13 #NPC changes end ######################################################## ## QUEST SLOTS ############################# ######################################################## slot_quest_target_center = 1 slot_quest_target_troop = 2 slot_quest_target_faction = 3 slot_quest_object_troop = 4 ##slot_quest_target_troop_is_prisoner = 5 slot_quest_giver_troop = 6 slot_quest_object_center = 7 slot_quest_target_party = 8 slot_quest_target_party_template = 9 slot_quest_target_amount = 10 slot_quest_current_state = 11 slot_quest_giver_center = 12 slot_quest_target_dna = 13 slot_quest_target_item = 14 slot_quest_object_faction = 15 slot_quest_convince_value = 19 slot_quest_importance = 20 slot_quest_xp_reward = 21 slot_quest_gold_reward = 22 slot_quest_expiration_days = 23 slot_quest_dont_give_again_period = 24 slot_quest_dont_give_again_remaining_days = 25 ######################################################## ## PARTY TEMPLATE SLOTS ############################# ######################################################## # Ryan BEGIN slot_party_template_num_killed = 1 # Ryan END ######################################################## rel_enemy = 0 rel_neutral = 1 rel_ally = 2 #Talk contexts tc_town_talk = 0 tc_court_talk = 1 tc_party_encounter = 2 tc_castle_gate = 3 tc_siege_commander = 4 tc_join_battle_ally = 5 tc_join_battle_enemy = 6 tc_castle_commander = 7 tc_hero_freed = 8 tc_hero_defeated = 9 tc_entering_center_quest_talk = 10 tc_back_alley = 11 tc_siege_won_seneschal = 12 tc_ally_thanks = 13 tc_tavern_talk = 14 tc_rebel_thanks = 15 #Troop Commentaries begin #Log entry types #civilian logent_village_raided = 1 logent_village_extorted = 2 logent_caravan_accosted = 3 logent_helped_peasants = 4 logent_castle_captured_by_player = 10 logent_lord_defeated_by_player = 11 logent_lord_captured_by_player = 12 logent_lord_defeated_but_let_go_by_player = 13 logent_player_defeated_by_lord = 14 logent_player_retreated_from_lord = 15 logent_player_retreated_from_lord_cowardly = 16 logent_lord_helped_by_player = 17 logent_player_participated_in_siege = 18 logent_player_participated_in_major_battle = 19 logent_pledged_allegiance = 21 logent_fief_granted_village = 22 logent_renounced_allegiance = 23 logent_game_start = 31 logent_poem_composed = 32 ##Not added logent_tournament_distinguished = 33 ##Not added logent_tournament_won = 34 ##Not added #lord reputation type, for commentaries #"Martial" will be twice as common as the other types lrep_none = 0 lrep_martial = 1 #chivalrous but not terribly empathetic or introspective, - eg Richard Lionheart, your average 14th century French baron lrep_quarrelsome = 2 #spiteful, cynical, a bit paranoid, possibly hotheaded - eg Robert Graves' Tiberius, Shakespeare's Richard III lrep_selfrighteous = 3 #coldblooded, moralizing, often cruel - eg William the Conqueror, Timur, Octavian, Aurangzeb (although he borders on upstanding) lrep_cunning = 4 #coldblooded, pragmatic, amoral - eg Louis XI, Guiscard, Akbar Khan, Abd al-Aziz Ibn Saud lrep_debauched = 5 #spiteful, amoral, sadistic, - eg Caligula, Tuchman's Charles of Navarre lrep_goodnatured = 6 #chivalrous, benevolent, perhaps a little too decent to be a good warlord - eg Hussein, poss Ranjit Singh (although roguish), Humayun lrep_upstanding = 7 #moralizing, benevolent, pragmatic, - eg Bernard Cornwell's Alfred, Charlemagne, Sher Shah Suri #Troop Commentaries end #Walker types: walkert_default = 0 walkert_needs_money = 1 walkert_needs_money_helped = 2 walkert_spy = 3 num_town_walkers = 8 town_walker_entries_start = 32 reinforcement_cost = 400 merchant_toll_duration = 72 #Tolls are valid for 72 hours hero_escape_after_defeat_chance = 80 raid_distance = 4 ########################## # Form Ranks Constants Section # ####### # Note: Some operations are based on the relative position of slots, # so when adding new slots, DO NOT insert in between, append them # at the bottom. ####### formation_keys_list = [ #0x07, # "$key_array_selection_1", #0x08, # "$key_array_selection_2", #0x09, # "$key_array_selection_3", #0x0a, # "$key_array_selection_4", #0x0b, # "$key_array_selection_5", #0x0c, # "$key_array_selection_6", #0x0d, # "$key_array_selection_7", #0x1b, # "$key_array_selection_8", "$key_array_select_all", "$key_formation_selection", "$key_formation_selection_backward", "$key_formation_tighten", "$key_formation_disperse", "$key_formation_follow", "$key_formation_hold_pos", "$key_auto_rotation_toggle", "$key_apply_formation", "$key_formation_charge", "$key_formation_fall_back", "$key_formation_halt", "$key_formation_tactical_charge", "$key_formation_move_forward", "$key_formation_move_backward", "$key_formation_move_left", "$key_formation_move_right", "$key_formation_turn_left", "$key_formation_turn_right", "$key_dismiss_formation", "$key_formation_view_orders", ] formation_default_key_list = [ 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x2b, 0x02, 0x15, 0x16, 0x42, 0x43, 0x3c, 0x3b, 0x22, 0x25, 0x30, 0x32, 0x31, 0x23, 0xc8, 0xd0, 0xcb, 0xcd, 0x33, 0x34, 0x18, 0x2d, ] all_keys_list = [ (0x02, "@1"), (0x03, "@2"), (0x04, "@3"), (0x05, "@4"), (0x06, "@5"), (0x07, "@6"), (0x08, "@7"), (0x09, "@8"), (0x0a, "@9"), (0x0b, "@0"), (0x1e, "@A"), (0x30, "@B"), (0x2e, "@C"), (0x20, "@D"), (0x12, "@E"), (0x21, "@F"), (0x22, "@G"), (0x23, "@H"), (0x17, "@I"), (0x24, "@J"), (0x25, "@K"), (0x26, "@L"), (0x32, "@M"), (0x31, "@N"), (0x18, "@O"), (0x19, "@P"), (0x10, "@Q"), (0x13, "@R"), (0x1f, "@S"), (0x14, "@T"), (0x16, "@U"), (0x2f, "@V"), (0x11, "@W"), (0x2d, "@X"), (0x15, "@Y"), (0x2c, "@Z"), (0x52, "@Numpad 0"), (0x4f, "@Numpad 1"), (0x50, "@Numpad 2"), (0x51, "@Numpad 3"), (0x4b, "@Numpad 4"), (0x4c, "@Numpad 5"), (0x4d, "@Numpad 6"), (0x47, "@Numpad 7"), (0x48, "@Numpad 8"), (0x49, "@Numpad 9"), (0x45, "@Num Lock"), (0xb5, "@Numpad Div"), (0x37, "@Numpad Mul"), (0x4a, "@Numpad Mins"), (0x4e, "@Numpad Pls"), (0x9c, "@Numpad Entr"), (0x53, "@Numpad Dot"), (0xd2, "@Insert"), (0xd3, "@Delete"), (0xc7, "@Home"), (0xcf, "@End"), (0xc9, "@Page Up"), (0xd1, "@Page Down"), (0xc8, "@Up"), (0xd0, "@Down"), (0xcb, "@Left"), (0xcd, "@Right"), (0x3b, "@F1"), (0x3c, "@F2"), (0x3d, "@F3"), (0x3e, "@F4"), (0x3f, "@F5"), (0x40, "@F6"), (0x41, "@F7"), (0x42, "@F8"), (0x43, "@F9"), (0x44, "@F10"), (0x57, "@F11"), (0x58, "@F12"), (0x39, "@Space Bar"), (0x1c, "@Enter"), (0x0f, "@Tab"), (0x0e, "@Backspace"), (0x1a, "@Left Bracess"), (0x1b, "@Right Braces"), (0x33, "@Comma"), (0x34, "@Period"), (0x35, "@Slash"), (0x2b, "@Back Slash"), (0x0d, "@Equals"), (0x0c, "@Minus"), (0x27, "@Semicolon"), (0x28, "@Apostrophe"), (0x29, "@Tilde"), (0x3a, "@Caps Lock"), (0x2a, "@Left Shift"), (0x36, "@Right Shift"), (0x1d, "@Left Ctrl"), (0x9d, "@Right Ctrl"), (0x38, "@Left Alt"), (0xb8, "@Right Alt"), (0xe0, "@Left Click"), (0xe1, "@Right Click"), (0xe2, "@Mouse Button 3"), (0xe3, "@Mouse Button 4"), (0xe4, "@Mouse Button 5"), (0xe5, "@Mouse Button 6"), (0xe6, "@Mouse Button 7"), (0xe7, "@Mouse Button 8"), (0xee, "@Scroll Up"), (0xef, "@Scroll Down"), ] # agent slots for formation slot_agent_native_end = 12 # refer this to the agent # slot section for native, # should be {the last slot}+1 slot_agent_formation_states = slot_agent_native_end slot_agent_formation_x_pos = slot_agent_native_end+1 slot_agent_formation_y_pos = slot_agent_native_end+2 # slots for tactical algorithms slot_agent_formation_alg_cell_1 = slot_agent_native_end+3 slot_agent_formation_alg_cell_2 = slot_agent_native_end+4 slot_agent_formation_alg_cell_3 = slot_agent_native_end+5 slot_agent_formation_alg_cell_4 = slot_agent_native_end+6 slot_agent_formation_alg_cell_5 = slot_agent_native_end+7 # slot_agent_formation_states masks safs_in_formation = 0x10 # used when calculating formation safs_array_leader = 0x20 # mark if agent is leader of array safs_array_no = 0xF # so arrays can be numbered through 16, see notes below safs_roar_stage = 0x1C0 # how long since the agent last roared safs_roar_stage_second = 0x40 # bit representing one second for roar_stage safs_full_mask = 0xFEF formation_arrays = 8 # This can be changed if you want more arrays, # but due to storage limitation of the party slots, # the maximum is 10 for current configuration. # Main party slots slot_party_array_parties_begin = slot_center_walker_0_troop slot_party_array_parties_end = slot_party_array_parties_begin+formation_arrays slot_party_formation_keys_begin = slot_party_array_parties_end slot_party_formation_keys_end = slot_party_formation_keys_begin+len(formation_keys_list) slot_party_formation_ai_switch = slot_party_formation_keys_end # Array party slots slot_array_party_leader = slot_center_walker_0_troop formation_vector = "$formation_vector" formation_temp_vector = "$formation_temp_vector" # Formation vector slots ############# slot_formation_array_marks_begin = 0 slot_formation_array_marks_end = slot_formation_array_marks_begin+formation_arrays+1 slot_formation_teams_begin = slot_formation_array_marks_end # formation team section # Indices are just offsets. slot_formation_team_array_selection = 0 slot_formation_team_max_array_no = 1 slot_formation_team_arrays_begin = 2 # formation array section # Nested in formation team section, these indices # are just offsets. slot_formation_array_leader = 0 slot_formation_array_ref_x_pos = 1 slot_formation_array_ref_y_pos = 2 slot_formation_array_ref_rotation = 3 slot_formation_array_num_of_men = 4 slot_formation_array_states = 5 # slot formation array states masks sfas_formation_type = 0xFF # 256 formation types maximum..hmm..should suffice... sfas_auto_rotate = 0x100 # mark if array should always face enemies sfas_charge = 0x200 # mark if array is charging sfas_fall_back = 0x400 # mark if array is falling back sfas_speed = 0xF000 # speed of charge or fall back sfas_speed_unit = 0x1000 # unit bit of speed sfas_speed_base = 0x1000 # convertion base from bits to meters sfas_speed_limit = 16 # maximum speed in kbits sfas_formation_density = 0x30000 # The tightness of the formation sfas_density_unit = 0x10000 # unit bit of density sfas_density_base = 75 # base interval in centimetres sfas_tactical_charge = 0x40000 # whether the formation is in tactical charge sfas_engaged = 0x80000 # whether the array has engaged enmey sfas_roar = 0x100000 # whether the soldiers give out war cry tactical_charge_adjust_in = 10 tactical_charge_adjust_out = 30 tactical_charge_cut_in = 30 tactical_charge_listen_interval = 1 # the interval for trigger to activate sfa_array_section_size = 6 slot_formation_team_arrays_end = slot_formation_team_arrays_begin \ +sfa_array_section_size*formation_arrays # slot formation team values sft_team_section_size = slot_formation_team_arrays_end slot_formation_teams_end = slot_formation_teams_begin \ +sft_team_section_size*4 # Formation types: formation_types = 4 #number of formations ft_line = 0 ft_phalanx = 1 ft_wedge = 2 ft_square = 3 # Formation vector slots end ########### # Formation temporary vector slots ##### slot_formation_tmp_maintain = 0 slot_formation_tmp_density = 4*formation_arrays*2 slot_formation_tmp_team_stat_begin = slot_formation_tmp_density+4*formation_arrays # below are off-sets for each team section slot_formation_tmp_team_total = 0 slot_formation_tmp_team_infantry_high = 1 slot_formation_tmp_team_infantry_low = 2 slot_formation_tmp_team_archer = 3 slot_formation_tmp_team_cavalry_1 = 6 slot_formation_tmp_team_cavalry_2 = 7 slot_formation_tmp_team_horse_archer_1 = 4 slot_formation_tmp_team_horse_archer_2 = 5 slot_formation_tmp_team_arrays = 8 slot_formation_tmp_team_stat_section_size = 9 slot_formation_tmp_alg_stat_begin = slot_formation_tmp_team_stat_begin+slot_formation_tmp_team_stat_section_size*4 slot_formation_tmp_cavalry_target = slot_formation_tmp_alg_stat_begin+4*20 slot_formation_tmp_clustering = slot_formation_tmp_cavalry_target+12 sftc_max_stage = 7 sfas_clustering_stage = 0xFE00000 # timer for recalculating clustering sfas_clustering_stage_unit=0x200000 # unit bit of stage sfas_clustering_max_stage=0x1E00000 # interval for recalculating clustering sftt_num_mask = 0xFFF sftt_num_assigned_mask = 0xFFF000 sftt_num_assigned_base = 0x1000 sftt_formation_stage_mask = 0xF000000 sftt_formation_stage = 0x1000000 sftt_array_no_mask = 0x70000000 sftt_array_no_base = 0x10000000 sftt_deployed = 0x80000000 sftd_ratio_base = 12 # Formation temporary vector slots end # # pos20 to pos51 for maintain formation, do not use in other mission-template triggers maintain_formation_pos_begin = 20 # Formation strings index formation_array_names_begin = "str_formation_array_1" formation_array_names_end = "str_formation_array_end" formation_order_panel_array_names_begin = "str_formation_order_panel_array_1" formation_order_panel_array_names_end = "str_formation_order_panel_array_end" formation_commands_begin = "str_formation_command_line" formation_commands_pl_begin = "str_formation_command_line_pl" formation_commands_end = "str_formation_command_end" formation_key_names_begin = "str_key_array_selection_1" formation_key_names_end = "str_formation_key_names_end" # Formation scripts index formation_scripts_begin = "script_formation_line" formation_scripts_end = "script_dismiss_battle_array" # Formation tactics scripts index formation_tactics_scripts_begin = "script_formation_tactical_charge_line" formation_tactcs_scripts_end = "script_formation_line" Pi = 3.1415926535 # Colors formation_message_color = 0xFFAAFF55 formation_warning_color = 0xFFAA5555 formation_order_color = 0xFFAAFF00 formation_debug_color = 0xFF0000FF debug_point = (1106, "@DEBUG: Line reached!", formation_debug_color) def concatenate_scripts(block_list): result = [] for block in block_list: result += block return result # # Form Ranks Constants Section End ############################ surnames_begin = "str_surname_1" surnames_end = "str_surnames_end" names_begin = "str_name_1" names_end = surnames_begin countersigns_begin = "str_countersign_1" countersigns_end = names_begin secret_signs_begin = "str_secret_sign_1" secret_signs_end = countersigns_begin kingdoms_begin = "fac_player_supporters_faction" kingdoms_end = "fac_kingdoms_end" kingdom_ladies_begin = "trp_knight_1_1_wife" kingdom_ladies_end = "trp_heroes_end" kings_begin = "trp_kingdom_1_lord" kings_end = "trp_knight_1_1" kingdom_heroes_begin = "trp_kingdom_1_lord" kingdom_heroes_end = kingdom_ladies_begin heroes_begin = kingdom_heroes_begin heroes_end = kingdom_ladies_end companions_begin = "trp_npc1" companions_end = "trp_kingdom_heroes_including_player_begin" soldiers_begin = "trp_farmer" soldiers_end = "trp_town_walker_1" #Rebellion changes ##rebel_factions_begin = "fac_kingdom_1_rebels" ##rebel_factions_end = "fac_kingdoms_end" pretenders_begin = "trp_kingdom_1_pretender" pretenders_end = kingdom_heroes_end #Rebellion changes tavern_minstrels_begin = "trp_tavern_minstrel_1" tavern_minstrels_end = companions_begin tavern_booksellers_begin = "trp_tavern_bookseller_1" tavern_booksellers_end = tavern_minstrels_begin tavern_travelers_begin = "trp_tavern_traveler_1" tavern_travelers_end = tavern_booksellers_begin ransom_brokers_begin = "trp_ransom_broker_1" ransom_brokers_end = tavern_travelers_begin mercenary_troops_begin = "trp_watchman" mercenary_troops_end = "trp_mercenaries_end" lord_quests_begin = "qst_deliver_message" lord_quests_end = "qst_follow_army" enemy_lord_quests_begin = "qst_lend_surgeon" enemy_lord_quests_end = lord_quests_end village_elder_quests_begin = "qst_deliver_grain" village_elder_quests_end = "qst_eliminate_bandits_infesting_village" mayor_quests_begin = "qst_move_cattle_herd" mayor_quests_end = village_elder_quests_begin lady_quests_begin = "qst_rescue_lord_by_replace" lady_quests_end = mayor_quests_begin army_quests_begin = "qst_deliver_cattle_to_army" army_quests_end = lady_quests_begin all_quests_begin = 0 all_quests_end = "qst_quests_end" towns_begin = "p_town_1" castles_begin = "p_castle_1" villages_begin = "p_village_1" towns_end = castles_begin castles_end = villages_begin villages_end = "p_salt_mine" walled_centers_begin = towns_begin walled_centers_end = castles_end centers_begin = towns_begin centers_end = villages_end training_grounds_begin = "p_training_ground_1" training_grounds_end = "p_Bridge_1" scenes_begin = "scn_town_1_center" scenes_end = "scn_castle_1_exterior" spawn_points_begin = "p_zendar" spawn_points_end = "p_spawn_points_end" regular_troops_begin = "trp_novice_fighter" regular_troops_end = "trp_tournament_master" swadian_merc_parties_begin = "p_town_1_mercs" swadian_merc_parties_end = "p_town_8_mercs" vaegir_merc_parties_begin = "p_town_8_mercs" vaegir_merc_parties_end = "p_zendar" arena_masters_begin = "trp_town_1_arena_master" arena_masters_end = "trp_town_1_armorer" training_gound_trainers_begin = "trp_trainer_1" training_gound_trainers_end = "trp_ransom_broker_1" town_walkers_begin = "trp_town_walker_1" town_walkers_end = "trp_village_walker_1" village_walkers_begin = "trp_village_walker_1" village_walkers_end = "trp_spy_walker_1" spy_walkers_begin = "trp_spy_walker_1" spy_walkers_end = "trp_tournament_master" walkers_begin = town_walkers_begin walkers_end = spy_walkers_end armor_merchants_begin = "trp_town_1_armorer" armor_merchants_end = "trp_town_1_weaponsmith" weapon_merchants_begin = "trp_town_1_weaponsmith" weapon_merchants_end = "trp_town_1_tavernkeeper" tavernkeepers_begin = "trp_town_1_tavernkeeper" tavernkeepers_end = "trp_town_1_merchant" goods_merchants_begin = "trp_town_1_merchant" goods_merchants_end = "trp_town_1_horse_merchant" horse_merchants_begin = "trp_town_1_horse_merchant" horse_merchants_end = "trp_town_1_mayor" mayors_begin = "trp_town_1_mayor" mayors_end = "trp_village_1_elder" village_elders_begin = "trp_village_1_elder" village_elders_end = "trp_merchants_end" average_price_factor = 1000 minimum_price_factor = 100 maximum_price_factor = 10000 village_prod_min = -5 village_prod_max = 18 trade_goods_begin = "itm_smoked_fish" trade_goods_end = "itm_siege_supply" food_begin = "itm_smoked_fish" food_end = "itm_wine" reference_books_begin = "itm_book_wound_treatment_reference" reference_books_end = trade_goods_begin readable_books_begin = "itm_book_tactics" readable_books_end = reference_books_begin books_begin = readable_books_begin books_end = reference_books_end horses_begin = "itm_sumpter_horse" horses_end = "itm_arrows" weapons_begin = "itm_wooden_stick" weapons_end = "itm_wooden_shield" ranged_weapons_begin = "itm_jarid" ranged_weapons_end = "itm_torch" armors_begin = "itm_leather_gloves" armors_end = "itm_wooden_stick" shields_begin = "itm_wooden_shield" shields_end = "itm_jarid" # Banner constants banner_meshes_begin = "mesh_banner_a01" banner_meshes_end_minus_one = "mesh_banner_f21" arms_meshes_begin = "mesh_arms_a01" arms_meshes_end_minus_one = "mesh_arms_f21" custom_banner_charges_begin = "mesh_custom_banner_charge_01" custom_banner_charges_end = "mesh_tableau_mesh_custom_banner" custom_banner_backgrounds_begin = "mesh_custom_banner_bg" custom_banner_backgrounds_end = custom_banner_charges_begin custom_banner_flag_types_begin = "mesh_custom_banner_01" custom_banner_flag_types_end = custom_banner_backgrounds_begin custom_banner_flag_map_types_begin = "mesh_custom_map_banner_01" custom_banner_flag_map_types_end = custom_banner_flag_types_begin custom_banner_flag_scene_props_begin = "spr_custom_banner_01" custom_banner_flag_scene_props_end = "spr_banner_a" custom_banner_map_icons_begin = "icon_custom_banner_01" custom_banner_map_icons_end = "icon_banner_01" banner_map_icons_begin = "icon_banner_01" banner_map_icons_end_minus_one = "icon_banner_126" banner_scene_props_begin = "spr_banner_a" banner_scene_props_end_minus_one = "spr_banner_f21" khergit_banners_begin_offset = 63 khergit_banners_end_offset = 84 # Some constants for merchant invenotries merchant_inventory_space = 30 num_merchandise_goods = 40 num_max_river_pirates = 25 num_max_zendar_peasants = 25 num_max_zendar_manhunters = 10 num_max_dp_bandits = 10 num_max_refugees = 10 num_max_deserters = 10 num_max_militia_bands = 15 num_max_armed_bands = 12 num_max_vaegir_punishing_parties = 20 num_max_rebel_peasants = 25 num_max_frightened_farmers = 50 num_max_undead_messengers = 20 num_forest_bandit_spawn_points = 1 num_mountain_bandit_spawn_points = 1 num_steppe_bandit_spawn_points = 1 num_black_khergit_spawn_points = 1 num_sea_raider_spawn_points = 2 peak_prisoner_trains = 4 peak_kingdom_caravans = 12 peak_kingdom_messengers = 3 # Note positions note_troop_location = 3 #battle tactics btactic_hold = 1 btactic_follow_leader = 2 btactic_charge = 3 btactic_stand_ground = 4 #default right mouse menu orders cmenu_move = -7 # Town center modes tcm_default = 0 tcm_disguised = 1 # Arena battle modes #abm_fight = 0 abm_training = 1 abm_visit = 2 abm_tournament = 3 # Camp training modes ctm_melee = 1 ctm_ranged = 2 ctm_mounted = 3 ctm_training = 4 # Village bandits attack modes vba_normal = 1 vba_after_training = 2 arena_tier1_opponents_to_beat = 3 arena_tier1_prize = 5 arena_tier2_opponents_to_beat = 6 arena_tier2_prize = 10 arena_tier3_opponents_to_beat = 10 arena_tier3_prize = 25 arena_tier4_opponents_to_beat = 20 arena_tier4_prize = 60 arena_grand_prize = 250
Python
script_game_start = 0 script_game_event_party_encounter = 1 script_game_event_simulate_battle = 2 script_game_event_battle_end = 3 script_order_best_besieger_party_to_guard_center = 4 script_game_get_item_buy_price_factor = 5 script_game_get_item_sell_price_factor = 6 script_get_trade_penalty = 7 script_game_event_buy_item = 8 script_game_event_sell_item = 9 script_game_get_troop_wage = 10 script_game_get_total_wage = 11 script_game_get_join_cost = 12 script_game_get_prisoner_price = 13 script_game_check_prisoner_can_be_sold = 14 script_game_event_detect_party = 15 script_game_event_undetect_party = 16 script_game_get_statistics_line = 17 script_game_get_date_text = 18 script_game_get_money_text = 19 script_game_get_party_companion_limit = 20 script_game_reset_player_party_name = 21 script_party_get_ideal_size = 22 script_game_get_party_prisoner_limit = 23 script_game_get_item_extra_text = 24 script_game_on_disembark = 25 script_game_context_menu_get_buttons = 26 script_game_event_context_menu_button_clicked = 27 script_game_get_skill_modifier_for_troop = 28 script_npc_get_troop_wage = 29 script_setup_talk_info = 30 script_setup_talk_info_companions = 31 script_update_party_creation_random_limits = 32 script_set_trade_route_between_centers = 33 script_center_change_trade_good_production = 34 script_average_trade_good_productions = 35 script_normalize_trade_good_productions = 36 script_update_trade_good_prices = 37 script_update_trade_good_price_for_party = 38 script_do_merchant_town_trade = 39 script_party_calculate_regular_strength = 40 script_party_calculate_strength = 41 script_loot_player_items = 42 script_party_calculate_loot = 43 script_calculate_main_party_shares = 44 script_party_give_xp_and_gold = 45 script_setup_troop_meeting = 46 script_setup_party_meeting = 47 script_party_remove_all_companions = 48 script_party_remove_all_prisoners = 49 script_party_add_party_companions = 50 script_party_add_party_prisoners = 51 script_party_prisoners_add_party_companions = 52 script_party_prisoners_add_party_prisoners = 53 script_party_add_party = 54 script_party_copy = 55 script_clear_party_group = 56 script_get_nonempty_party_in_group = 57 script_collect_prisoners_from_empty_parties = 58 script_print_casualties_to_s0 = 59 script_write_fit_party_members_to_stack_selection = 60 script_remove_fit_party_member_from_stack_selection = 61 script_remove_random_fit_party_member_from_stack_selection = 62 script_cf_training_ground_sub_routine_1_for_melee_details = 63 script_training_ground_sub_routine_2_for_melee_details = 64 script_cf_training_ground_sub_routine_for_training_result = 65 script_print_troop_owned_centers_in_numbers_to_s0 = 66 script_get_random_melee_training_weapon = 67 script_start_training_at_training_ground = 68 script_party_count_fit_regulars = 69 script_party_count_fit_for_battle = 70 script_party_count_members_with_full_health = 71 script_get_stack_with_rank = 72 script_inflict_casualties_to_party = 73 script_move_members_with_ratio = 74 script_count_parties_of_faction_and_party_type = 75 script_faction_get_number_of_armies = 76 script_faction_recalculate_strength = 77 script_cf_select_random_town_with_faction = 78 script_cf_select_random_village_with_faction = 79 script_cf_select_random_walled_center_with_faction = 80 script_cf_select_random_walled_center_with_faction_and_owner_priority_no_siege = 81 script_cf_select_random_walled_center_with_faction_and_less_strength_priority = 82 script_cf_select_random_town_at_peace_with_faction = 83 script_cf_select_random_town_at_peace_with_faction_in_trade_route = 84 script_shuffle_troop_slots = 85 script_get_random_quest = 86 script_cf_get_random_enemy_center_within_range = 87 script_cf_faction_get_random_enemy_faction = 88 script_cf_faction_get_random_friendly_faction = 89 script_cf_troop_get_random_enemy_troop_with_occupation = 90 script_cf_get_random_kingdom_hero_as_lover = 91 script_cf_get_random_lord_in_a_center_with_faction = 92 script_cf_get_random_lord_except_king_with_faction = 93 script_cf_get_random_lord_from_another_faction_in_a_center = 94 script_get_closest_walled_center = 95 script_get_closest_center = 96 script_get_closest_center_of_faction = 97 script_get_closest_walled_center_of_faction = 98 script_let_nearby_parties_join_current_battle = 99 script_party_wound_all_members_aux = 100 script_party_wound_all_members = 101 script_calculate_battle_advantage = 102 script_cf_check_enemies_nearby = 103 script_get_heroes_attached_to_center_aux = 104 script_get_heroes_attached_to_center = 105 script_get_heroes_attached_to_center_as_prisoner_aux = 106 script_get_heroes_attached_to_center_as_prisoner = 107 script_give_center_to_faction = 108 script_give_center_to_faction_aux = 109 script_change_troop_faction = 110 script_give_center_to_lord = 111 script_get_number_of_hero_centers = 112 script_cf_get_random_enemy_center = 113 script_find_travel_location = 114 script_get_relation_between_parties = 115 script_calculate_weekly_party_wage = 116 script_calculate_player_faction_wage = 117 script_calculate_hero_weekly_net_income_and_add_to_wealth = 118 script_cf_reinforce_party = 119 script_hire_men_to_kingdom_hero_party = 120 script_get_percentage_with_randomized_round = 121 script_create_cattle_herd = 122 script_buy_cattle_from_village = 123 script_kill_cattle_from_herd = 124 script_create_kingdom_hero_party = 125 script_create_kingdom_party_if_below_limit = 126 script_cf_create_kingdom_party = 127 script_get_troop_attached_party = 128 script_center_get_food_consumption = 129 script_center_get_food_store_limit = 130 script_refresh_village_merchant_inventory = 131 script_refresh_village_defenders = 132 script_village_set_state = 133 script_process_village_raids = 134 script_process_sieges = 135 script_lift_siege = 136 script_process_alarms = 137 script_party_set_ai_state = 138 script_decide_kingdom_party_ais = 139 script_party_decide_next_ai_state_under_command = 140 script_kingdom_hero_decide_next_ai_state_follow_or_not = 141 script_kingdom_hero_decide_next_ai_state = 142 script_process_kingdom_parties_ai = 143 script_process_hero_ai = 144 script_select_faction_marshall = 145 script_get_center_faction_relation_including_player = 146 script_decide_faction_ai = 147 script_check_and_finish_active_army_quests_for_faction = 148 script_troop_get_player_relation = 149 script_change_troop_renown = 150 script_change_player_relation_with_troop = 151 script_change_player_relation_with_center = 152 script_change_player_relation_with_faction = 153 script_set_player_relation_with_faction = 154 script_change_player_relation_with_faction_ex = 155 script_cf_get_random_active_faction_except_player_faction_and_faction = 156 script_make_kingdom_hostile_to_player = 157 script_change_player_honor = 158 script_change_player_party_morale = 159 script_cf_player_has_item_without_modifier = 160 script_get_player_party_morale_values = 161 script_diplomacy_start_war_between_kingdoms = 162 script_party_calculate_and_set_nearby_friend_strength = 163 script_init_ai_calculation = 164 script_recalculate_ais = 165 script_recalculate_ai_for_troop = 166 script_calculate_troop_ai = 167 script_calculate_troop_ai_under_command = 168 script_diplomacy_start_peace_between_kingdoms = 169 script_event_kingdom_make_peace_with_kingdom = 170 script_randomly_start_war_peace = 171 script_exchange_prisoners_between_factions = 172 script_add_notification_menu = 173 script_finish_quest = 174 script_get_information_about_troops_position = 175 script_recruit_troop_as_companion = 176 script_setup_random_scene = 177 script_enter_dungeon = 178 script_enter_court = 179 script_find_high_ground_around_pos1 = 180 script_select_battle_tactic = 181 script_select_battle_tactic_aux = 182 script_battle_tactic_init = 183 script_battle_tactic_init_aux = 184 script_battle_tactic_apply = 185 script_battle_tactic_apply_aux = 186 script_team_get_class_percentages = 187 script_get_closest3_distance_of_enemies_at_pos1 = 188 script_team_get_average_position_of_enemies = 189 script_search_troop_prisoner_of_party = 190 script_change_debt_to_troop = 191 script_abort_quest = 192 script_cf_is_quest_troop = 193 script_check_friendly_kills = 194 script_simulate_retreat = 195 script_simulate_battle_with_agents_aux = 196 script_map_get_random_position_around_position_within_range = 197 script_get_number_of_unclaimed_centers_by_player = 198 script_troop_count_number_of_enemy_troops = 199 script_cf_troop_check_troop_is_enemy = 200 script_troop_get_leaded_center_with_index = 201 script_cf_troop_get_random_leaded_walled_center_with_less_strength_priority = 202 script_cf_troop_get_random_leaded_town_or_village_except_center = 203 script_troop_write_owned_centers_to_s2 = 204 script_troop_write_family_relations_to_s1 = 205 script_write_family_relation_as_s3s_s2_to_s4 = 206 script_complete_family_relations = 207 script_collect_friendly_parties = 208 script_encounter_calculate_fit = 209 script_encounter_init_variables = 210 script_calculate_renown_value = 211 script_cf_get_first_agent_with_troop_id = 212 script_cf_team_get_average_position_of_agents_with_type_to_pos1 = 213 script_cf_turn_windmill_fans = 214 script_print_party_members = 215 script_round_value = 216 script_change_banners_and_chest = 217 script_remove_siege_objects = 218 script_describe_relation_to_s63 = 219 script_describe_center_relation_to_s3 = 220 script_center_ambiance_sounds = 221 script_center_set_walker_to_type = 222 script_cf_center_get_free_walker = 223 script_center_remove_walker_type_from_walkers = 224 script_init_town_walkers = 225 script_cf_enter_center_location_bandit_check = 226 script_init_town_agent = 227 script_init_town_walker_agents = 228 script_agent_get_town_walker_details = 229 script_tick_town_walkers = 230 script_set_town_walker_destination = 231 script_town_init_doors = 232 script_siege_init_ai_and_belfry = 233 script_cf_siege_move_belfry = 234 script_cf_siege_rotate_belfry_platform = 235 script_cf_siege_assign_men_to_belfry = 236 script_siege_move_archers_to_archer_positions = 237 script_store_movement_order_name_to_s1 = 238 script_store_riding_order_name_to_s1 = 239 script_store_weapon_usage_order_name_to_s1 = 240 script_team_give_order_from_order_panel = 241 script_update_order_panel = 242 script_update_agent_position_on_map = 243 script_convert_3d_pos_to_map_pos = 244 script_update_order_flags_on_map = 245 script_update_order_panel_checked_classes = 246 script_update_order_panel_statistics_and_map = 247 script_consume_food = 248 script_calculate_troop_score_for_center = 249 script_assign_lords_to_empty_centers = 250 script_create_village_farmer_party = 251 script_do_party_center_trade = 252 script_player_join_faction = 253 script_player_leave_faction = 254 script_activate_deactivate_player_faction = 255 script_agent_reassign_team = 256 script_start_quest = 257 script_conclude_quest = 258 script_succeed_quest = 259 script_fail_quest = 260 script_report_quest_troop_positions = 261 script_end_quest = 262 script_cancel_quest = 263 script_update_village_market_towns = 264 script_update_mercenary_units_of_towns = 265 script_update_volunteer_troops_in_village = 266 script_update_npc_volunteer_troops_in_village = 267 script_update_companion_candidates_in_taverns = 268 script_update_ransom_brokers = 269 script_update_tavern_travelers = 270 script_update_villages_infested_by_bandits = 271 script_update_booksellers = 272 script_update_tavern_minstels = 273 script_update_faction_notes = 274 script_update_faction_traveler_notes = 275 script_update_troop_notes = 276 script_update_troop_location_notes = 277 script_update_center_notes = 278 script_update_center_recon_notes = 279 script_update_all_notes = 280 script_shield_item_set_banner = 281 script_add_troop_to_cur_tableau = 282 script_add_troop_to_cur_tableau_for_character = 283 script_add_troop_to_cur_tableau_for_inventory = 284 script_add_troop_to_cur_tableau_for_party = 285 script_get_prosperity_text_to_s50 = 286 script_spawn_bandits = 287 script_count_mission_casualties_from_agents = 288 script_get_max_skill_of_player_party = 289 script_upgrade_hero_party = 290 script_get_improvement_details = 291 script_cf_troop_agent_is_alive = 292 script_cf_village_recruit_volunteers_cond = 293 script_village_recruit_volunteers_recruit = 294 script_get_troop_item_amount = 295 script_get_name_from_dna_to_s50 = 296 script_change_center_prosperity = 297 script_get_center_ideal_prosperity = 298 script_get_poorest_village_of_faction = 299 script_troop_add_gold = 300 script_initialize_npcs = 301 script_objectionable_action = 302 script_post_battle_personality_clash_check = 303 script_event_player_defeated_enemy_party = 304 script_event_player_captured_as_prisoner = 305 script_npc_morale = 306 script_retire_companion = 307 script_reduce_companion_morale_for_clash = 308 script_calculate_ransom_amount_for_troop = 309 script_offer_ransom_amount_to_player_for_prisoners_in_party = 310 script_event_hero_taken_prisoner_by_player = 311 script_cf_check_hero_can_escape_from_player = 312 script_cf_party_remove_random_regular_troop = 313 script_place_player_banner_near_inventory = 314 script_place_player_banner_near_inventory_bms = 315 script_stay_captive_for_hours = 316 script_set_parties_around_player_ignore_player = 317 script_randomly_make_prisoner_heroes_escape_from_party = 318 script_fill_tournament_participants_troop = 319 script_get_num_tournament_participants = 320 script_get_random_tournament_participant = 321 script_add_tournament_participant = 322 script_get_random_tournament_team_amount_and_size = 323 script_get_troop_priority_point_for_tournament = 324 script_sort_tournament_participant_troops = 325 script_remove_tournament_participants_randomly = 326 script_end_tournament_fight = 327 script_get_win_amount_for_tournament_bet = 328 script_tournament_place_bet = 329 script_calculate_amount_of_cattle_can_be_stolen = 330 script_draw_banner_to_region = 331 script_get_troop_custom_banner_num_positionings = 332 script_get_custom_banner_charge_type_position_scale_color = 333 script_get_random_custom_banner = 334 script_get_custom_banner_color_from_index = 335 script_cf_check_color_visibility = 336 script_get_next_active_kingdom = 337 script_store_average_center_value_per_faction = 338 script_remove_cattles_if_herd_is_close_to_party = 339 script_get_rumor_to_s61 = 340 script_lord_comment_to_s43 = 341 script_add_log_entry = 342 script_get_relevant_comment_for_log_entry = 343 script_get_relevant_comment_to_s42 = 344 script_find_rival_from_faction = 345 script_rebellion_arguments = 346 script_get_culture_with_party_faction_for_music = 347 script_music_set_situation_with_culture = 348 script_combat_music_set_situation_with_culture = 349 script_play_victorious_sound = 350 script_set_items_for_tournament = 351 script_custom_battle_end = 352 script_remove_troop_from_prison = 353 script_formation_agent_init = 354 script_formation_array_init = 355 script_formation_formulate_arrays = 356 script_cf_formation_agent_assign_array = 357 script_cf_formation_elect_array_leader = 358 script_formation_ai_tactics = 359 script_cf_formation_ai_deploy_array_generic = 360 script_formation_reassign_array = 361 script_cf_apply_formation = 362 script_maintain_formation = 363 script_formation_move_key_reaction = 364 script_formation_move_to_pos = 365 script_formation_move = 366 script_formation_turn_key_reaction = 367 script_formation_turn = 368 script_formation_charge_key_reaction = 369 script_formation_accelerate = 370 script_formation_density_key_reaction = 371 script_formation_density_change = 372 script_calculate_formation_row = 373 script_formation_follow_key_reaction = 374 script_formation_move_to_pos_key_reaction = 375 script_apply_formation_key_reaction = 376 script_formation_auto_rotation_key_reaction = 377 script_formation_tactical_charge_key_reaction = 378 script_formation_dismiss_key_reaction = 379 script_formation_clean_up = 380 script_get_closest_distance_of_enemy_at_pos1 = 381 script_formation_tactical_charge_generic = 382 script_cf_calculate_enemy_infantry_centroid = 383 script_get_square_distance_between_positions = 384 script_calculate_enemy_infantry_clustering = 385 script_cf_calculate_enemy_infantry_linear_regression_pos = 386 script_formation_tactical_charge_cavalry = 387 script_formation_check_array_ammo = 388 script_formation_tactical_charge_ranged = 389 script_formation_tactical_charge_line = 390 script_formation_tactical_charge_phalanx = 391 script_formation_tactical_charge_wedge = 392 script_formation_tactical_charge_square = 393 script_formation_line = 394 script_formation_phalanx = 395 script_formation_wedge = 396 script_formation_square = 397 script_dismiss_battle_array = 398 script_convert_to_slot_no = 399 script_arctan = 400 script_update_formation_key_config_buttons = 401 script_update_formation_order_panel = 402 script_update_formation_order_flags_on_map = 403 script_update_formation_order_panel_checked_arrays = 404 script_update_formation_order_panel_statistics_and_map = 405 script_cf_shift_pos1_along_y_axis_to_ground = 406
Python
# -*- coding: cp1254 -*- from header_common import * from header_operations import * from module_constants import * from header_parties import * from header_skills import * from header_mission_templates import * from header_items import * from header_triggers import * from header_terrain_types import * from header_music import * from ID_animations import * #################################################################################################################### # scripts is a list of script records. # Each script record contns the following two fields: # 1) Script id: The prefix "script_" will be inserted when referencing scripts. # 2) Operation block: This must be a valid operation block. See header_operations.py for reference. #################################################################################################################### scripts = [ #script_game_start: # This script is called when a new game is started # INPUT: none ("game_start", [ ################################## # Form Ranks section # # Set key configs to default in new game ]+[ (party_set_slot, "p_main_party", slot_party_formation_keys_begin+x, formation_default_key_list[x]) for x in range(len(formation_keys_list)) ]+[ (party_set_slot, "p_main_party", slot_party_formation_ai_switch, 1), # # Form Ranks section end ################################## (faction_set_slot, "fac_player_supporters_faction", slot_faction_state, sfs_inactive), (assign, "$g_player_luck", 200), (troop_set_slot, "trp_player", slot_troop_occupation, slto_kingdom_hero), (troop_set_slot, "trp_player", slot_troop_prisoner_of_party, -1), (try_for_range, ":cur_troop", kingdom_heroes_begin, kingdom_heroes_end), (troop_set_slot, ":cur_troop", slot_troop_prisoner_of_party, -1), (troop_set_slot, ":cur_troop", slot_troop_custom_banner_flag_type, -1), (troop_set_slot, ":cur_troop", slot_troop_custom_banner_map_flag_type, -1), (try_end), (troop_set_slot, "trp_player", slot_troop_custom_banner_flag_type, -1), (troop_set_slot, "trp_player", slot_troop_custom_banner_map_flag_type, -1), (store_random_in_range, "$g_election_date", 0, 45), #setting a random election date #Assigning global constant (call_script, "script_store_average_center_value_per_faction"), (troop_set_slot, "trp_player", slot_troop_custom_banner_bg_color_1, 0xFFFFFFFF), (troop_set_slot, "trp_player", slot_troop_custom_banner_bg_color_2, 0xFFFFFFFF), (troop_set_slot, "trp_player", slot_troop_custom_banner_charge_color_1, 0xFFFFFFFF), (troop_set_slot, "trp_player", slot_troop_custom_banner_charge_color_2, 0xFFFFFFFF), (troop_set_slot, "trp_player", slot_troop_custom_banner_charge_color_3, 0xFFFFFFFF), (troop_set_slot, "trp_player", slot_troop_custom_banner_charge_color_4, 0xFFFFFFFF), #Setting background colors for banners (troop_set_slot, "trp_banner_background_color_array", 0, 0xFF8f4531), (troop_set_slot, "trp_banner_background_color_array", 1, 0xFF315458), (troop_set_slot, "trp_banner_background_color_array", 2, 0xFF373736), (troop_set_slot, "trp_banner_background_color_array", 3, 0xFFa48b28), (troop_set_slot, "trp_banner_background_color_array", 4, 0xFF497735), (troop_set_slot, "trp_banner_background_color_array", 5, 0xFF82362d), (troop_set_slot, "trp_banner_background_color_array", 6, 0xFF793329), (troop_set_slot, "trp_banner_background_color_array", 7, 0xFF262521), (troop_set_slot, "trp_banner_background_color_array", 8, 0xFFd9dad1), (troop_set_slot, "trp_banner_background_color_array", 9, 0xFF524563), (troop_set_slot, "trp_banner_background_color_array", 10, 0xFF91312c), (troop_set_slot, "trp_banner_background_color_array", 11, 0xFFafa231), (troop_set_slot, "trp_banner_background_color_array", 12, 0xFF706d3c), (troop_set_slot, "trp_banner_background_color_array", 13, 0xFFd6d3ce), (troop_set_slot, "trp_banner_background_color_array", 14, 0xFF912929), (troop_set_slot, "trp_banner_background_color_array", 15, 0xFF394584), (troop_set_slot, "trp_banner_background_color_array", 16, 0xFF42662e), (troop_set_slot, "trp_banner_background_color_array", 17, 0xFFdfded6), (troop_set_slot, "trp_banner_background_color_array", 18, 0xFF292724), (troop_set_slot, "trp_banner_background_color_array", 19, 0xFF58611b), (troop_set_slot, "trp_banner_background_color_array", 20, 0xFF313a67), (troop_set_slot, "trp_banner_background_color_array", 21, 0xFFb5a231), (troop_set_slot, "trp_banner_background_color_array", 22, 0xFFbdb629), (troop_set_slot, "trp_banner_background_color_array", 23, 0xFF6e7929), (troop_set_slot, "trp_banner_background_color_array", 24, 0xFFd6d3ce), (troop_set_slot, "trp_banner_background_color_array", 25, 0xFF94a642), (troop_set_slot, "trp_banner_background_color_array", 26, 0xFF944131), (troop_set_slot, "trp_banner_background_color_array", 27, 0xFF893b34), (troop_set_slot, "trp_banner_background_color_array", 28, 0xFF425510), (troop_set_slot, "trp_banner_background_color_array", 29, 0xFF94452e), (troop_set_slot, "trp_banner_background_color_array", 30, 0xFF475a94), (troop_set_slot, "trp_banner_background_color_array", 31, 0xFFd1b231), (troop_set_slot, "trp_banner_background_color_array", 32, 0xFFe1e2df), (troop_set_slot, "trp_banner_background_color_array", 33, 0xFF4a4942), (troop_set_slot, "trp_banner_background_color_array", 34, 0xFFc6b74d), (troop_set_slot, "trp_banner_background_color_array", 35, 0xFF7b5184), (troop_set_slot, "trp_banner_background_color_array", 36, 0xFF212421), (troop_set_slot, "trp_banner_background_color_array", 37, 0xFF3c5d9a), (troop_set_slot, "trp_banner_background_color_array", 38, 0xFF4d7136), (troop_set_slot, "trp_banner_background_color_array", 39, 0xFFdfdfd6), (troop_set_slot, "trp_banner_background_color_array", 40, 0xFF527539), (troop_set_slot, "trp_banner_background_color_array", 41, 0xFF9c3c39), (troop_set_slot, "trp_banner_background_color_array", 42, 0xFF42518c), (troop_set_slot, "trp_banner_background_color_array", 43, 0xFFa46a2c), (troop_set_slot, "trp_banner_background_color_array", 44, 0xFF843829), (troop_set_slot, "trp_banner_background_color_array", 45, 0xFF2c6189), (troop_set_slot, "trp_banner_background_color_array", 46, 0xFF556421), (troop_set_slot, "trp_banner_background_color_array", 47, 0xFF9d621e), (troop_set_slot, "trp_banner_background_color_array", 48, 0xFFdeded6), (troop_set_slot, "trp_banner_background_color_array", 49, 0xFF6e4891), (troop_set_slot, "trp_banner_background_color_array", 50, 0xFF865a29), (troop_set_slot, "trp_banner_background_color_array", 51, 0xFFdedfd9), (troop_set_slot, "trp_banner_background_color_array", 52, 0xFF524273), (troop_set_slot, "trp_banner_background_color_array", 53, 0xFF8c3821), (troop_set_slot, "trp_banner_background_color_array", 54, 0xFF948403), (troop_set_slot, "trp_banner_background_color_array", 55, 0xFF313031), (troop_set_slot, "trp_banner_background_color_array", 56, 0xFF47620d), (troop_set_slot, "trp_banner_background_color_array", 57, 0xFFdfded6), (troop_set_slot, "trp_banner_background_color_array", 58, 0xFFd6d7d6), (troop_set_slot, "trp_banner_background_color_array", 59, 0xFF2e2f2c), (troop_set_slot, "trp_banner_background_color_array", 60, 0xFF604283), (troop_set_slot, "trp_banner_background_color_array", 61, 0xFF395584), (troop_set_slot, "trp_banner_background_color_array", 62, 0xFF313031), (troop_set_slot, "trp_banner_background_color_array", 63, 0xFF7e3f2e), (troop_set_slot, "trp_banner_background_color_array", 64, 0xFF343434), (troop_set_slot, "trp_banner_background_color_array", 65, 0xFF3c496b), (troop_set_slot, "trp_banner_background_color_array", 66, 0xFFd9d8d1), (troop_set_slot, "trp_banner_background_color_array", 67, 0xFF99823c), (troop_set_slot, "trp_banner_background_color_array", 68, 0xFF9f822e), (troop_set_slot, "trp_banner_background_color_array", 69, 0xFF393839), (troop_set_slot, "trp_banner_background_color_array", 70, 0xFFa54931), (troop_set_slot, "trp_banner_background_color_array", 71, 0xFFdfdcd6), (troop_set_slot, "trp_banner_background_color_array", 72, 0xFF9f4a36), (troop_set_slot, "trp_banner_background_color_array", 73, 0xFF8c7521), (troop_set_slot, "trp_banner_background_color_array", 74, 0xFF9f4631), (troop_set_slot, "trp_banner_background_color_array", 75, 0xFF793324), (troop_set_slot, "trp_banner_background_color_array", 76, 0xFF395076), (troop_set_slot, "trp_banner_background_color_array", 77, 0xFF2c2b2c), (troop_set_slot, "trp_banner_background_color_array", 78, 0xFF657121), (troop_set_slot, "trp_banner_background_color_array", 79, 0xFF7e3121), (troop_set_slot, "trp_banner_background_color_array", 80, 0xFF76512e), (troop_set_slot, "trp_banner_background_color_array", 81, 0xFFe7e3de), (troop_set_slot, "trp_banner_background_color_array", 82, 0xFF947921), (troop_set_slot, "trp_banner_background_color_array", 83, 0xFF4d7b7c), (troop_set_slot, "trp_banner_background_color_array", 84, 0xFF343331), (troop_set_slot, "trp_banner_background_color_array", 85, 0xFFa74d36), (troop_set_slot, "trp_banner_background_color_array", 86, 0xFFe7e3de), (troop_set_slot, "trp_banner_background_color_array", 87, 0xFFd6d8ce), (troop_set_slot, "trp_banner_background_color_array", 88, 0xFF3e4d67), (troop_set_slot, "trp_banner_background_color_array", 89, 0xFF913331), (troop_set_slot, "trp_banner_background_color_array", 90, 0xFF4d6994), (troop_set_slot, "trp_banner_background_color_array", 91, 0xFF4a6118), (troop_set_slot, "trp_banner_background_color_array", 92, 0xFFd9d8d3), (troop_set_slot, "trp_banner_background_color_array", 93, 0xFF394479), (troop_set_slot, "trp_banner_background_color_array", 94, 0xFF343331), (troop_set_slot, "trp_banner_background_color_array", 95, 0xFF3f4d5d), (troop_set_slot, "trp_banner_background_color_array", 96, 0xFF4a6489), (troop_set_slot, "trp_banner_background_color_array", 97, 0xFF313031), (troop_set_slot, "trp_banner_background_color_array", 98, 0xFFd6d7ce), (troop_set_slot, "trp_banner_background_color_array", 99, 0xFFc69e00), (troop_set_slot, "trp_banner_background_color_array", 100, 0xFF638e52), (troop_set_slot, "trp_banner_background_color_array", 101, 0xFFdcdbd3), (troop_set_slot, "trp_banner_background_color_array", 102, 0xFFdbdcd3), (troop_set_slot, "trp_banner_background_color_array", 103, 0xFF843831), (troop_set_slot, "trp_banner_background_color_array", 104, 0xFFcecfc6), (troop_set_slot, "trp_banner_background_color_array", 105, 0xFF8f4431), (troop_set_slot, "trp_banner_background_color_array", 106, 0xFF602926), (troop_set_slot, "trp_banner_background_color_array", 107, 0xFFd3d4cb), (troop_set_slot, "trp_banner_background_color_array", 108, 0xFFdcdbd3), (troop_set_slot, "trp_banner_background_color_array", 109, 0xFF556024), (troop_set_slot, "trp_banner_background_color_array", 110, 0xFF602d2c), (troop_set_slot, "trp_banner_background_color_array", 111, 0xFF315184), (troop_set_slot, "trp_banner_background_color_array", 112, 0xFF313031), (troop_set_slot, "trp_banner_background_color_array", 113, 0xFFe7e7e7), (troop_set_slot, "trp_banner_background_color_array", 114, 0xFF526d47), (troop_set_slot, "trp_banner_background_color_array", 115, 0xFFdedbd6), (troop_set_slot, "trp_banner_background_color_array", 116, 0xFFb2a631), (troop_set_slot, "trp_banner_background_color_array", 117, 0xFF76713f), (troop_set_slot, "trp_banner_background_color_array", 118, 0xFFdedbd6), (troop_set_slot, "trp_banner_background_color_array", 119, 0xFFe9eae7), (troop_set_slot, "trp_banner_background_color_array", 120, 0xFF6b5131), (troop_set_slot, "trp_banner_background_color_array", 121, 0xFF31557b), (troop_set_slot, "trp_banner_background_color_array", 122, 0xFF703324), (troop_set_slot, "trp_banner_background_color_array", 123, 0xFFe7e3de), (troop_set_slot, "trp_banner_background_color_array", 124, 0xFFd6d7ce), (troop_set_slot, "trp_banner_background_color_array", 125, 0xFF3f6e39), #Default banners (troop_set_slot, "trp_banner_background_color_array", 126, 0xFF212221), (troop_set_slot, "trp_banner_background_color_array", 127, 0xFF212221), (troop_set_slot, "trp_banner_background_color_array", 128, 0xFF2E3B10), (troop_set_slot, "trp_banner_background_color_array", 129, 0xFF425D7B), (troop_set_slot, "trp_banner_background_color_array", 130, 0xFF394608), (store_random_in_range, ":starting_training_ground", training_grounds_begin, training_grounds_end), (party_relocate_near_party, "p_main_party", ":starting_training_ground", 3), (str_store_troop_name, s5, "trp_player"), (party_set_name, "p_main_party", s5), (call_script, "script_update_party_creation_random_limits"), # Reseting player party icon (assign, "$g_player_party_icon", -1), # Setting food bonuses (item_set_slot, "itm_smoked_fish", slot_item_food_bonus, 5), (item_set_slot, "itm_dried_meat", slot_item_food_bonus, 5), (item_set_slot, "itm_cattle_meat", slot_item_food_bonus, 7), (item_set_slot, "itm_pork", slot_item_food_bonus, 6), (item_set_slot, "itm_bread", slot_item_food_bonus, 4), (item_set_slot, "itm_apples", slot_item_food_bonus, 5), (item_set_slot, "itm_cheese", slot_item_food_bonus, 5), (item_set_slot, "itm_chicken", slot_item_food_bonus, 6), (item_set_slot, "itm_honey", slot_item_food_bonus, 10), (item_set_slot, "itm_cabbages", slot_item_food_bonus, 4), (item_set_slot, "itm_sausages", slot_item_food_bonus, 5), (item_set_slot, "itm_butter", slot_item_food_bonus, 8), (item_set_slot, "itm_wine", slot_item_food_bonus, 5), (item_set_slot, "itm_ale", slot_item_food_bonus, 4), #NPC companion changes begin (call_script, "script_initialize_npcs"), (assign, "$disable_npc_complaints", 0), #NPC companion changes end # Setting book intelligence requirements (item_set_slot, "itm_book_tactics", slot_item_intelligence_requirement, 9), (item_set_slot, "itm_book_persuasion", slot_item_intelligence_requirement, 8), (item_set_slot, "itm_book_leadership", slot_item_intelligence_requirement, 7), (item_set_slot, "itm_book_intelligence", slot_item_intelligence_requirement, 10), (item_set_slot, "itm_book_trade", slot_item_intelligence_requirement, 11), (item_set_slot, "itm_book_weapon_mastery", slot_item_intelligence_requirement, 9), (item_set_slot, "itm_book_engineering", slot_item_intelligence_requirement, 12), (item_set_slot, "itm_book_wound_treatment_reference", slot_item_intelligence_requirement, 10), (item_set_slot, "itm_book_training_reference", slot_item_intelligence_requirement, 10), (item_set_slot, "itm_book_surgery_reference", slot_item_intelligence_requirement, 10), # Setting the random town sequence: (store_sub, ":num_towns", towns_end, towns_begin), (assign, ":num_iterations", ":num_towns"), (try_for_range, ":cur_town_no", 0, ":num_towns"), (troop_set_slot, "trp_random_town_sequence", ":cur_town_no", -1), (try_end), (assign, ":cur_town_no", 0), (try_for_range, ":unused", 0, ":num_iterations"), (store_random_in_range, ":random_no", 0, ":num_towns"), (assign, ":is_unique", 1), (try_for_range, ":cur_town_no_2", 0, ":num_towns"), (troop_slot_eq, "trp_random_town_sequence", ":cur_town_no_2", ":random_no"), (assign, ":is_unique", 0), (try_end), (try_begin), (eq, ":is_unique", 1), (troop_set_slot, "trp_random_town_sequence", ":cur_town_no", ":random_no"), (val_add, ":cur_town_no", 1), (else_try), (val_add, ":num_iterations", 1), (try_end), (try_end), # Cultures: (faction_set_slot, "fac_culture_1", slot_faction_tier_1_troop, "trp_swadian_recruit"), (faction_set_slot, "fac_culture_1", slot_faction_tier_2_troop, "trp_swadian_militia"), (faction_set_slot, "fac_culture_1", slot_faction_tier_3_troop, "trp_swadian_footman"), (faction_set_slot, "fac_culture_1", slot_faction_tier_4_troop, "trp_swadian_infantry"), (faction_set_slot, "fac_culture_1", slot_faction_tier_5_troop, "trp_swadian_knight"), (faction_set_slot, "fac_culture_2", slot_faction_tier_1_troop, "trp_vaegir_recruit"), (faction_set_slot, "fac_culture_2", slot_faction_tier_2_troop, "trp_vaegir_footman"), (faction_set_slot, "fac_culture_2", slot_faction_tier_3_troop, "trp_vaegir_veteran"), (faction_set_slot, "fac_culture_2", slot_faction_tier_4_troop, "trp_vaegir_infantry"), (faction_set_slot, "fac_culture_2", slot_faction_tier_5_troop, "trp_vaegir_knight"), (faction_set_slot, "fac_culture_3", slot_faction_tier_1_troop, "trp_khergit_tribesman"), (faction_set_slot, "fac_culture_3", slot_faction_tier_2_troop, "trp_khergit_skirmisher"), (faction_set_slot, "fac_culture_3", slot_faction_tier_3_troop, "trp_khergit_horseman"), (faction_set_slot, "fac_culture_3", slot_faction_tier_4_troop, "trp_khergit_horse_archer"), (faction_set_slot, "fac_culture_3", slot_faction_tier_5_troop, "trp_khergit_veteran_horse_archer"), (faction_set_slot, "fac_culture_4", slot_faction_tier_1_troop, "trp_nord_recruit"), (faction_set_slot, "fac_culture_4", slot_faction_tier_2_troop, "trp_nord_footman"), (faction_set_slot, "fac_culture_4", slot_faction_tier_3_troop, "trp_nord_trained_footman"), (faction_set_slot, "fac_culture_4", slot_faction_tier_4_troop, "trp_nord_warrior"), (faction_set_slot, "fac_culture_4", slot_faction_tier_5_troop, "trp_nord_veteran"), (faction_set_slot, "fac_culture_5", slot_faction_tier_1_troop, "trp_rhodok_tribesman"), (faction_set_slot, "fac_culture_5", slot_faction_tier_2_troop, "trp_rhodok_spearman"), (faction_set_slot, "fac_culture_5", slot_faction_tier_3_troop, "trp_rhodok_trained_spearman"), (faction_set_slot, "fac_culture_5", slot_faction_tier_4_troop, "trp_rhodok_veteran_spearman"), (faction_set_slot, "fac_culture_5", slot_faction_tier_5_troop, "trp_rhodok_sergeant"), # Factions: (faction_set_slot, "fac_kingdom_1", slot_faction_culture, "fac_culture_1"), (faction_set_slot, "fac_kingdom_1", slot_faction_leader, "trp_kingdom_1_lord"), (faction_set_slot, "fac_kingdom_2", slot_faction_culture, "fac_culture_2"), (faction_set_slot, "fac_kingdom_2", slot_faction_leader, "trp_kingdom_2_lord"), (faction_set_slot, "fac_kingdom_3", slot_faction_culture, "fac_culture_3"), (faction_set_slot, "fac_kingdom_3", slot_faction_leader, "trp_kingdom_3_lord"), (faction_set_slot, "fac_kingdom_4", slot_faction_culture, "fac_culture_4"), (faction_set_slot, "fac_kingdom_4", slot_faction_leader, "trp_kingdom_4_lord"), (faction_set_slot, "fac_kingdom_5", slot_faction_culture, "fac_culture_5"), (faction_set_slot, "fac_kingdom_5", slot_faction_leader, "trp_kingdom_5_lord"), ## (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_1", "fac_kingdom_2"), ## (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_1", "fac_kingdom_5"), ## (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_4", "fac_kingdom_2"), ## (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_4", "fac_kingdom_1"), ## (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_3", "fac_kingdom_2"), ## (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_3", "fac_kingdom_5"), (try_for_range, ":unused", 0, 70), (call_script, "script_randomly_start_war_peace", 0), (try_end), (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end), (faction_set_slot, ":faction_no", slot_faction_marshall, -1), (faction_get_slot, ":culture", ":faction_no", slot_faction_culture), (faction_get_slot, ":troop", ":culture", slot_faction_tier_1_troop), (faction_set_slot, ":faction_no", slot_faction_tier_1_troop, ":troop"), (faction_get_slot, ":troop", ":culture", slot_faction_tier_2_troop), (faction_set_slot, ":faction_no", slot_faction_tier_2_troop, ":troop"), (faction_get_slot, ":troop", ":culture", slot_faction_tier_3_troop), (faction_set_slot, ":faction_no", slot_faction_tier_3_troop, ":troop"), (faction_get_slot, ":troop", ":culture", slot_faction_tier_4_troop), (faction_set_slot, ":faction_no", slot_faction_tier_4_troop, ":troop"), (faction_get_slot, ":troop", ":culture", slot_faction_tier_5_troop), (faction_set_slot, ":faction_no", slot_faction_tier_5_troop, ":troop"), (try_begin), (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_1"), (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_swadian_deserter"), (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_swadian_sergeant"), (faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_swadian_messenger"), (faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_swadian_prison_guard"), (faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_swadian_castle_guard"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_a, "pt_kingdom_1_reinforcements_a"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_b, "pt_kingdom_1_reinforcements_b"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_c, "pt_kingdom_1_reinforcements_c"), (else_try), (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_2"), (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_vaegir_deserter"), (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_vaegir_guard"), (faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_vaegir_messenger"), (faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_vaegir_prison_guard"), (faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_vaegir_castle_guard"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_a, "pt_kingdom_2_reinforcements_a"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_b, "pt_kingdom_2_reinforcements_b"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_c, "pt_kingdom_2_reinforcements_c"), (else_try), (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_3"), (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_khergit_deserter"), (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_khergit_horseman"), (faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_khergit_messenger"), (faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_khergit_prison_guard"), (faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_khergit_castle_guard"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_a, "pt_kingdom_3_reinforcements_a"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_b, "pt_kingdom_3_reinforcements_b"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_c, "pt_kingdom_3_reinforcements_c"), (else_try), (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_4"), (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_nord_deserter"), (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_nord_warrior"), (faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_nord_messenger"), (faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_nord_prison_guard"), (faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_nord_castle_guard"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_a, "pt_kingdom_4_reinforcements_a"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_b, "pt_kingdom_4_reinforcements_b"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_c, "pt_kingdom_4_reinforcements_c"), (else_try), (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_5"), (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_rhodok_deserter"), (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_rhodok_veteran_spearman"), (faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_rhodok_messenger"), (faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_rhodok_prison_guard"), (faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_rhodok_castle_guard"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_a, "pt_kingdom_5_reinforcements_a"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_b, "pt_kingdom_5_reinforcements_b"), (faction_set_slot, ":faction_no", slot_faction_reinforcements_c, "pt_kingdom_5_reinforcements_c"), (try_end), (try_end), (faction_set_slot, "fac_player_supporters_faction", slot_faction_marshall, "trp_player"), # Towns: (try_for_range, ":item_no", trade_goods_begin, trade_goods_end), (store_sub, ":offset", ":item_no", trade_goods_begin), (val_add, ":offset", slot_town_trade_good_prices_begin), (try_for_range, ":center_no", centers_begin, centers_end), (party_set_slot, ":center_no", ":offset", average_price_factor), (try_end), ## (party_set_slot, "p_zendar", ":offset", average_price_factor), ## (party_set_slot, "p_salt_mine", ":offset", average_price_factor), ## (party_set_slot, "p_four_ways_inn", ":offset", average_price_factor), (try_end), (call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_2"), (call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_4"), (call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_8"), (call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_9"), (call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_11"), (call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_12"), (call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_13"), (call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_15"), (call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_16"), (call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_4"), (call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_6"), (call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_8"), (call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_12"), (call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_13"), (call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_15"), (call_script, "script_set_trade_route_between_centers", "p_town_2", "p_town_16"), (call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_4"), (call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_5"), (call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_6"), (call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_7"), (call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_14"), (call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_15"), (call_script, "script_set_trade_route_between_centers", "p_town_3", "p_town_18"), (call_script, "script_set_trade_route_between_centers", "p_town_4", "p_town_6"), (call_script, "script_set_trade_route_between_centers", "p_town_4", "p_town_12"), (call_script, "script_set_trade_route_between_centers", "p_town_4", "p_town_13"), (call_script, "script_set_trade_route_between_centers", "p_town_4", "p_town_15"), (call_script, "script_set_trade_route_between_centers", "p_town_4", "p_town_16"), (call_script, "script_set_trade_route_between_centers", "p_town_5", "p_town_6"), (call_script, "script_set_trade_route_between_centers", "p_town_5", "p_town_7"), (call_script, "script_set_trade_route_between_centers", "p_town_5", "p_town_14"), (call_script, "script_set_trade_route_between_centers", "p_town_5", "p_town_15"), (call_script, "script_set_trade_route_between_centers", "p_town_5", "p_town_17"), (call_script, "script_set_trade_route_between_centers", "p_town_5", "p_town_18"), (call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_7"), (call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_11"), (call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_13"), (call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_15"), (call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_16"), (call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_17"), (call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_10"), (call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_11"), (call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_13"), (call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_14"), (call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_15"), (call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_16"), (call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_17"), (call_script, "script_set_trade_route_between_centers", "p_town_7", "p_town_18"), (call_script, "script_set_trade_route_between_centers", "p_town_8", "p_town_9"), (call_script, "script_set_trade_route_between_centers", "p_town_8", "p_town_11"), (call_script, "script_set_trade_route_between_centers", "p_town_8", "p_town_12"), (call_script, "script_set_trade_route_between_centers", "p_town_8", "p_town_13"), (call_script, "script_set_trade_route_between_centers", "p_town_8", "p_town_16"), (call_script, "script_set_trade_route_between_centers", "p_town_9", "p_town_11"), (call_script, "script_set_trade_route_between_centers", "p_town_9", "p_town_12"), (call_script, "script_set_trade_route_between_centers", "p_town_9", "p_town_13"), (call_script, "script_set_trade_route_between_centers", "p_town_9", "p_town_16"), (call_script, "script_set_trade_route_between_centers", "p_town_10", "p_town_11"), (call_script, "script_set_trade_route_between_centers", "p_town_10", "p_town_14"), (call_script, "script_set_trade_route_between_centers", "p_town_10", "p_town_17"), (call_script, "script_set_trade_route_between_centers", "p_town_10", "p_town_18"), (call_script, "script_set_trade_route_between_centers", "p_town_11", "p_town_12"), (call_script, "script_set_trade_route_between_centers", "p_town_11", "p_town_13"), (call_script, "script_set_trade_route_between_centers", "p_town_11", "p_town_14"), (call_script, "script_set_trade_route_between_centers", "p_town_11", "p_town_16"), (call_script, "script_set_trade_route_between_centers", "p_town_11", "p_town_17"), (call_script, "script_set_trade_route_between_centers", "p_town_12", "p_town_13"), (call_script, "script_set_trade_route_between_centers", "p_town_12", "p_town_16"), (call_script, "script_set_trade_route_between_centers", "p_town_13", "p_town_16"), (call_script, "script_set_trade_route_between_centers", "p_town_13", "p_town_17"), (call_script, "script_set_trade_route_between_centers", "p_town_14", "p_town_17"), (call_script, "script_set_trade_route_between_centers", "p_town_14", "p_town_18"), (call_script, "script_set_trade_route_between_centers", "p_town_15", "p_town_16"), (call_script, "script_set_trade_route_between_centers", "p_town_16", "p_town_17"), (call_script, "script_set_trade_route_between_centers", "p_town_17", "p_town_18"), (try_for_range, ":town_no", towns_begin, towns_end), (party_set_slot, ":town_no", slot_town_tournament_max_teams, 4), (party_set_slot, ":town_no", slot_town_tournament_max_team_size, 8), (try_end), (party_set_slot, "p_town_6", slot_town_tournament_max_team_size, 2), #start some tournaments (try_for_range, ":town_no", towns_begin, towns_end), (store_random_in_range, ":rand", 0, 100), (lt, ":rand", 20), (store_random_in_range, ":random_days", 12, 15), (party_set_slot, ":town_no", slot_town_has_tournament, ":random_days"), (try_end), (party_set_slot,"p_town_1", slot_town_arena_melee_1_num_teams, 2), (party_set_slot,"p_town_1", slot_town_arena_melee_1_team_size, 1), (party_set_slot,"p_town_1", slot_town_arena_melee_2_num_teams, 4), (party_set_slot,"p_town_1", slot_town_arena_melee_2_team_size, 1), (party_set_slot,"p_town_1", slot_town_arena_melee_3_num_teams, 4), (party_set_slot,"p_town_1", slot_town_arena_melee_3_team_size, 1), (call_script, "script_center_change_trade_good_production", "p_town_1", "itm_linen", 110, 0), (party_set_slot,"p_town_2", slot_town_arena_melee_1_num_teams, 4), (party_set_slot,"p_town_2", slot_town_arena_melee_1_team_size, 4), (party_set_slot,"p_town_2", slot_town_arena_melee_2_num_teams, 4), (party_set_slot,"p_town_2", slot_town_arena_melee_2_team_size, 6), (party_set_slot,"p_town_2", slot_town_arena_melee_3_num_teams, 4), (party_set_slot,"p_town_2", slot_town_arena_melee_3_team_size, 8), (call_script, "script_center_change_trade_good_production", "p_town_2", "itm_smoked_fish", 130, 0), (party_set_slot,"p_town_3", slot_town_arena_melee_1_num_teams, 2), (party_set_slot,"p_town_3", slot_town_arena_melee_1_team_size, 8), (party_set_slot,"p_town_3", slot_town_arena_melee_2_num_teams, 2), (party_set_slot,"p_town_3", slot_town_arena_melee_2_team_size, 8), (party_set_slot,"p_town_3", slot_town_arena_melee_3_num_teams, 2), (party_set_slot,"p_town_3", slot_town_arena_melee_3_team_size, 8), (call_script, "script_center_change_trade_good_production", "p_town_3", "itm_wine", 120, 0), (party_set_slot,"p_town_4", slot_town_arena_melee_1_num_teams, 2), (party_set_slot,"p_town_4", slot_town_arena_melee_1_team_size, 8), (party_set_slot,"p_town_4", slot_town_arena_melee_2_num_teams, 3), (party_set_slot,"p_town_4", slot_town_arena_melee_2_team_size, 8), (party_set_slot,"p_town_4", slot_town_arena_melee_3_num_teams, 2), (party_set_slot,"p_town_4", slot_town_arena_melee_3_team_size, 5), (call_script, "script_center_change_trade_good_production", "p_town_4", "itm_oil", 130, 0), (party_set_slot,"p_town_5", slot_town_arena_melee_1_num_teams, 2), (party_set_slot,"p_town_5", slot_town_arena_melee_1_team_size, 3), (party_set_slot,"p_town_5", slot_town_arena_melee_2_num_teams, 2), (party_set_slot,"p_town_5", slot_town_arena_melee_2_team_size, 5), (party_set_slot,"p_town_5", slot_town_arena_melee_3_num_teams, 2), (party_set_slot,"p_town_5", slot_town_arena_melee_3_team_size, 8), (call_script, "script_center_change_trade_good_production", "p_town_5", "itm_velvet", 80, 0), (party_set_slot,"p_town_6", slot_town_arena_melee_1_num_teams, 2), (party_set_slot,"p_town_6", slot_town_arena_melee_1_team_size, 4), (party_set_slot,"p_town_6", slot_town_arena_melee_2_num_teams, 3), (party_set_slot,"p_town_6", slot_town_arena_melee_2_team_size, 4), (party_set_slot,"p_town_6", slot_town_arena_melee_3_num_teams, 3), (party_set_slot,"p_town_6", slot_town_arena_melee_3_team_size, 6), (call_script, "script_center_change_trade_good_production", "p_town_6", "itm_ale", 130, 0), (party_set_slot,"p_town_7", slot_town_arena_melee_1_num_teams, 4), (party_set_slot,"p_town_7", slot_town_arena_melee_1_team_size, 4), (party_set_slot,"p_town_7", slot_town_arena_melee_2_num_teams, 4), (party_set_slot,"p_town_7", slot_town_arena_melee_2_team_size, 6), (party_set_slot,"p_town_7", slot_town_arena_melee_3_num_teams, 4), (party_set_slot,"p_town_7", slot_town_arena_melee_3_team_size, 8), (call_script, "script_center_change_trade_good_production", "p_town_7", "itm_grain", 140, 0), (call_script, "script_center_change_trade_good_production", "p_town_7", "itm_flour", 110, 0), (party_set_slot,"p_town_8", slot_town_arena_melee_1_num_teams, 3), (party_set_slot,"p_town_8", slot_town_arena_melee_1_team_size, 1), (party_set_slot,"p_town_8", slot_town_arena_melee_2_num_teams, 3), (party_set_slot,"p_town_8", slot_town_arena_melee_2_team_size, 3), (party_set_slot,"p_town_8", slot_town_arena_melee_3_num_teams, 3), (party_set_slot,"p_town_8", slot_town_arena_melee_3_team_size, 7), (call_script, "script_center_change_trade_good_production", "p_town_8", "itm_wool", 130, 0), (party_set_slot,"p_town_9", slot_town_arena_melee_1_num_teams, 2), (party_set_slot,"p_town_9", slot_town_arena_melee_1_team_size, 2), (party_set_slot,"p_town_9", slot_town_arena_melee_2_num_teams, 2), (party_set_slot,"p_town_9", slot_town_arena_melee_2_team_size, 5), (party_set_slot,"p_town_9", slot_town_arena_melee_3_num_teams, 2), (party_set_slot,"p_town_9", slot_town_arena_melee_3_team_size, 8), (call_script, "script_center_change_trade_good_production", "p_town_9", "itm_furs", 135, 0), (party_set_slot,"p_town_10", slot_town_arena_melee_1_num_teams, 2), (party_set_slot,"p_town_10", slot_town_arena_melee_1_team_size, 3), (party_set_slot,"p_town_10", slot_town_arena_melee_2_num_teams, 2), (party_set_slot,"p_town_10", slot_town_arena_melee_2_team_size, 5), (party_set_slot,"p_town_10", slot_town_arena_melee_3_num_teams, 2), (party_set_slot,"p_town_10", slot_town_arena_melee_3_team_size, 8), (call_script, "script_center_change_trade_good_production", "p_town_10", "itm_spice", 86, 0), (party_set_slot,"p_town_11", slot_town_arena_melee_1_num_teams, 2), (party_set_slot,"p_town_11", slot_town_arena_melee_1_team_size, 8), (party_set_slot,"p_town_11", slot_town_arena_melee_2_num_teams, 3), (party_set_slot,"p_town_11", slot_town_arena_melee_2_team_size, 4), (party_set_slot,"p_town_11", slot_town_arena_melee_3_num_teams, 3), (party_set_slot,"p_town_11", slot_town_arena_melee_3_team_size, 6), (call_script, "script_center_change_trade_good_production", "p_town_11", "itm_iron", 130, 0), (party_set_slot,"p_town_12", slot_town_arena_melee_1_num_teams, 3), (party_set_slot,"p_town_12", slot_town_arena_melee_1_team_size, 8), (party_set_slot,"p_town_12", slot_town_arena_melee_2_num_teams, 4), (party_set_slot,"p_town_12", slot_town_arena_melee_2_team_size, 6), (party_set_slot,"p_town_12", slot_town_arena_melee_3_num_teams, 4), (party_set_slot,"p_town_12", slot_town_arena_melee_3_team_size, 5), (call_script, "script_center_change_trade_good_production", "p_town_12", "itm_smoked_fish", 140, 0), (party_set_slot,"p_town_13", slot_town_arena_melee_1_num_teams, 2), (party_set_slot,"p_town_13", slot_town_arena_melee_1_team_size, 8), (party_set_slot,"p_town_13", slot_town_arena_melee_2_num_teams, 4), (party_set_slot,"p_town_13", slot_town_arena_melee_2_team_size, 5), (party_set_slot,"p_town_13", slot_town_arena_melee_3_num_teams, 4), (party_set_slot,"p_town_13", slot_town_arena_melee_3_team_size, 7), (call_script, "script_center_change_trade_good_production", "p_town_13", "itm_dried_meat", 120, 0), (party_set_slot,"p_town_14", slot_town_arena_melee_1_num_teams, 2), (party_set_slot,"p_town_14", slot_town_arena_melee_1_team_size, 4), (party_set_slot,"p_town_14", slot_town_arena_melee_2_num_teams, 2), (party_set_slot,"p_town_14", slot_town_arena_melee_2_team_size, 5), (party_set_slot,"p_town_14", slot_town_arena_melee_3_num_teams, 2), (party_set_slot,"p_town_14", slot_town_arena_melee_3_team_size, 6), (call_script, "script_center_change_trade_good_production", "p_town_14", "itm_pottery", 120, 0), (party_set_slot,"p_town_15", slot_town_arena_melee_1_num_teams, 2), (party_set_slot,"p_town_15", slot_town_arena_melee_1_team_size, 8), (party_set_slot,"p_town_15", slot_town_arena_melee_2_num_teams, 3), (party_set_slot,"p_town_15", slot_town_arena_melee_2_team_size, 4), (party_set_slot,"p_town_15", slot_town_arena_melee_3_num_teams, 3), (party_set_slot,"p_town_15", slot_town_arena_melee_3_team_size, 6), (call_script, "script_center_change_trade_good_production", "p_town_15", "itm_cheese", 100, 0), (party_set_slot,"p_town_16", slot_town_arena_melee_1_num_teams, 3), (party_set_slot,"p_town_16", slot_town_arena_melee_1_team_size, 8), (party_set_slot,"p_town_16", slot_town_arena_melee_2_num_teams, 4), (party_set_slot,"p_town_16", slot_town_arena_melee_2_team_size, 6), (party_set_slot,"p_town_16", slot_town_arena_melee_3_num_teams, 4), (party_set_slot,"p_town_16", slot_town_arena_melee_3_team_size, 5), (call_script, "script_center_change_trade_good_production", "p_town_16", "itm_tools", 100, 0), (party_set_slot,"p_town_17", slot_town_arena_melee_1_num_teams, 2), (party_set_slot,"p_town_17", slot_town_arena_melee_1_team_size, 8), (party_set_slot,"p_town_17", slot_town_arena_melee_2_num_teams, 4), (party_set_slot,"p_town_17", slot_town_arena_melee_2_team_size, 5), (party_set_slot,"p_town_17", slot_town_arena_melee_3_num_teams, 4), (party_set_slot,"p_town_17", slot_town_arena_melee_3_team_size, 7), (call_script, "script_center_change_trade_good_production", "p_town_17", "itm_salt", 100, 0), (party_set_slot,"p_town_18", slot_town_arena_melee_1_num_teams, 2), (party_set_slot,"p_town_18", slot_town_arena_melee_1_team_size, 4), (party_set_slot,"p_town_18", slot_town_arena_melee_2_num_teams, 2), (party_set_slot,"p_town_18", slot_town_arena_melee_2_team_size, 5), (party_set_slot,"p_town_18", slot_town_arena_melee_3_num_teams, 2), (party_set_slot,"p_town_18", slot_town_arena_melee_3_team_size, 6), (call_script, "script_center_change_trade_good_production", "p_town_18", "itm_oil", 125, 0), (try_for_range, ":unused", 0, 1), (call_script, "script_average_trade_good_productions"), (try_end), (call_script, "script_normalize_trade_good_productions"), (try_for_range, ":town_no", towns_begin, towns_end), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_smoked_fish", -12, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_dried_meat", -12, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_cattle_meat", -15, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_cheese", -10, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_chicken", -10, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_honey", -9, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_cabbages", -10, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_butter", -12, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_wine", -14, 2), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_flour", -13, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_ale", -10, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_apples", -10, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_grain", -10, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_iron", -10, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_wool", -10, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_furs", -10, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_oil", -12, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_velvet", -3, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_spice", -5, 3), (call_script, "script_center_change_trade_good_production", ":town_no", "itm_linen", -3, 3), (try_end), # Towns (loop) (try_for_range, ":town_no", towns_begin, towns_end), (store_sub, ":offset", ":town_no", towns_begin), (party_set_slot,":town_no", slot_party_type, spt_town), # (store_add, ":cur_object_no", "trp_town_1_seneschal", ":offset"), # (party_set_slot,":town_no", slot_town_seneschal, ":cur_object_no"), (store_add, ":cur_object_no", "scn_town_1_center", ":offset"), (party_set_slot,":town_no", slot_town_center, ":cur_object_no"), (store_add, ":cur_object_no", "scn_town_1_castle", ":offset"), (party_set_slot,":town_no", slot_town_castle, ":cur_object_no"), (store_add, ":cur_object_no", "scn_town_1_prison", ":offset"), (party_set_slot,":town_no", slot_town_prison, ":cur_object_no"), (store_add, ":cur_object_no", "scn_town_1_walls", ":offset"), (party_set_slot,":town_no", slot_town_walls, ":cur_object_no"), (store_add, ":cur_object_no", "scn_town_1_tavern", ":offset"), (party_set_slot,":town_no", slot_town_tavern, ":cur_object_no"), (store_add, ":cur_object_no", "scn_town_1_store", ":offset"), (party_set_slot,":town_no", slot_town_store, ":cur_object_no"), (store_add, ":cur_object_no", "scn_town_1_arena", ":offset"), (party_set_slot,":town_no", slot_town_arena, ":cur_object_no"), (store_add, ":cur_object_no", "scn_town_1_alley", ":offset"), (party_set_slot,":town_no", slot_town_alley, ":cur_object_no"), (store_add, ":cur_object_no", "trp_town_1_mayor", ":offset"), (party_set_slot,":town_no", slot_town_elder, ":cur_object_no"), (store_add, ":cur_object_no", "trp_town_1_tavernkeeper", ":offset"), (party_set_slot,":town_no", slot_town_tavernkeeper, ":cur_object_no"), (store_add, ":cur_object_no", "trp_town_1_weaponsmith", ":offset"), (party_set_slot,":town_no", slot_town_weaponsmith, ":cur_object_no"), (store_add, ":cur_object_no", "trp_town_1_armorer", ":offset"), (party_set_slot,":town_no", slot_town_armorer, ":cur_object_no"), (store_add, ":cur_object_no", "trp_town_1_merchant", ":offset"), (party_set_slot,":town_no", slot_town_merchant, ":cur_object_no"), (store_add, ":cur_object_no", "trp_town_1_horse_merchant", ":offset"), (party_set_slot,":town_no", slot_town_horse_merchant, ":cur_object_no"), (store_add, ":cur_object_no", "scn_town_1_center", ":offset"), (party_set_slot,":town_no", slot_town_center, ":cur_object_no"), (party_set_slot,":town_no", slot_town_reinforcement_party_template, "pt_center_reinforcements"), (try_end), # Castles (try_for_range, ":castle_no", castles_begin, castles_end), (store_sub, ":offset", ":castle_no", castles_begin), (val_mul, ":offset", 3), # (store_add, ":senechal_troop_no", "trp_castle_1_seneschal", ":offset"), # (party_set_slot,":castle_no", slot_town_seneschal, ":senechal_troop_no"), (store_add, ":exterior_scene_no", "scn_castle_1_exterior", ":offset"), (party_set_slot,":castle_no", slot_castle_exterior, ":exterior_scene_no"), (store_add, ":interior_scene_no", "scn_castle_1_interior", ":offset"), (party_set_slot,":castle_no", slot_town_castle, ":interior_scene_no"), (store_add, ":interior_scene_no", "scn_castle_1_prison", ":offset"), (party_set_slot,":castle_no", slot_town_prison, ":interior_scene_no"), (party_set_slot,":castle_no", slot_town_reinforcement_party_template, "pt_center_reinforcements"), (party_set_slot,":castle_no", slot_party_type, spt_castle), (party_set_slot,":castle_no", slot_center_is_besieged_by, -1), (try_end), # Set which castles need to be attacked with siege towers. (party_set_slot,"p_town_1", slot_center_siege_with_belfry, 1), (party_set_slot,"p_town_13", slot_center_siege_with_belfry, 1), (party_set_slot,"p_town_16", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_1", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_2", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_3", slot_center_siege_with_belfry, 0), (party_set_slot,"p_castle_4", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_5", slot_center_siege_with_belfry, 0), (party_set_slot,"p_castle_6", slot_center_siege_with_belfry, 0), (party_set_slot,"p_castle_7", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_8", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_9", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_10", slot_center_siege_with_belfry, 0), (party_set_slot,"p_castle_11", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_13", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_21", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_25", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_38", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_34", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_35", slot_center_siege_with_belfry, 1), (party_set_slot,"p_castle_40", slot_center_siege_with_belfry, 1), # Towns # Villages (call_script, "script_center_change_trade_good_production", "p_village_56", "itm_smoked_fish", 60, 0), (call_script, "script_center_change_trade_good_production", "p_village_35", "itm_smoked_fish", 60, 0), (call_script, "script_center_change_trade_good_production", "p_village_36", "itm_smoked_fish", 60, 0), (call_script, "script_center_change_trade_good_production", "p_village_66", "itm_smoked_fish", 50, 0), (call_script, "script_center_change_trade_good_production", "p_village_67", "itm_smoked_fish", 50, 0), (try_for_range, ":village_no", villages_begin, villages_end), #Not setting production for the cattle meat here. (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_dried_meat", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_pork", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_bread", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_apples", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_cheese", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_chicken", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_honey", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_cabbages", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_butter", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_wine", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_flour", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_ale", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_apples", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_grain", ":rand", 0), (store_random_in_range, ":rand", village_prod_min, village_prod_max), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_oil", ":rand", 0), (try_end), (try_for_range, ":village_no", villages_begin, villages_end), (store_random_in_range, ":random_land_quality", 0, 5), (party_set_slot, ":village_no", slot_village_land_quality, ":random_land_quality"), (store_random_in_range, ":random_cattle", 25, 75), (party_set_slot, ":village_no", slot_village_number_of_cattle, ":random_cattle"), #Reassigning the cattle production in the village (store_sub, ":production", ":random_cattle", 10), (val_div, ":production", 2), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_cattle_meat", ":production", 0), (store_sub, ":offset", ":village_no", villages_begin), (store_add, ":exterior_scene_no", "scn_village_1", ":offset"), (party_set_slot,":village_no", slot_castle_exterior, ":exterior_scene_no"), (store_add, ":store_troop_no", "trp_village_1_elder", ":offset"), (party_set_slot,":village_no", slot_town_elder, ":store_troop_no"), (party_set_slot,":village_no", slot_party_type, spt_village), (party_set_slot,":village_no", slot_village_raided_by, -1), (call_script, "script_refresh_village_merchant_inventory", ":village_no"), (call_script, "script_refresh_village_merchant_inventory", ":village_no"), (call_script, "script_refresh_village_defenders", ":village_no"), (call_script, "script_refresh_village_defenders", ":village_no"), (call_script, "script_refresh_village_defenders", ":village_no"), (call_script, "script_refresh_village_defenders", ":village_no"), (try_end), # (store_sub, ":item_to_slot", slot_town_trade_good_productions_begin, trade_goods_begin), # (try_for_range, ":center_no", centers_begin, centers_end), # (str_clear, s3), # (this_or_next|is_between, ":center_no", towns_begin, towns_end), # (is_between, ":center_no", villages_begin, villages_end), # (try_for_range, ":cur_good", trade_goods_begin, trade_goods_end), # (store_add, ":cur_good_slot", ":cur_good", ":item_to_slot"), # (str_store_party_name, s1, ":center_no"), # (str_store_item_name, s2, ":cur_good"), # (party_get_slot, ":center_production", ":center_no", ":cur_good_slot"), # (assign, reg0, ":center_production"), # (str_store_string, s3, "@{s3}^{s1} production for {s2}: {reg0}"), # (try_end), # (add_party_note_from_sreg, ":center_no", 2, s3, 0), # (try_end), (try_for_range, ":center_no", centers_begin, centers_end), (party_set_slot, ":center_no", slot_center_last_spotted_enemy, -1), (party_set_slot, ":center_no", slot_center_is_besieged_by, -1), (party_set_slot, ":center_no", slot_center_last_taken_by_troop, -1), #Assigning random prosperity (store_random_in_range, ":random_prosperity_adder", -25, 15), (call_script, "script_get_center_ideal_prosperity", ":center_no"), (assign, ":prosperity", reg0), (val_add, ":prosperity", ":random_prosperity_adder"), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_town), (val_add, ":prosperity", 20), (try_end), (val_clamp, ":prosperity", 0, 100), (party_set_slot, ":center_no", slot_town_prosperity, ":prosperity"), (try_end), #Initialize walkers (try_for_range, ":center_no", centers_begin, centers_end), (this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town), (party_slot_eq, ":center_no", slot_party_type, spt_village), (try_for_range, ":walker_no", 0, num_town_walkers), (call_script, "script_center_set_walker_to_type", ":center_no", ":walker_no", walkert_default), (try_end), (try_end), # Troops: # Assign banners and renown. # We assume there are enough banners for all kingdom heroes. (assign, ":num_khergit_lords_assigned", 0), (try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end), (store_troop_faction, ":kingdom_hero_faction", ":kingdom_hero"), (try_begin), (eq, ":kingdom_hero_faction", "fac_kingdom_3"), #Khergit Khanate (store_add, ":kingdom_3_banners_begin", banner_scene_props_begin, khergit_banners_begin_offset), (store_add, ":banner_id", ":kingdom_3_banners_begin", ":num_khergit_lords_assigned"), (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"), (val_add, ":num_khergit_lords_assigned", 1), (else_try), (store_sub, ":hero_offset", ":kingdom_hero", kingdom_heroes_begin), (val_sub, ":hero_offset", ":num_khergit_lords_assigned"),#Remove khergits from offset since their banners are assigned above here (try_begin), (gt, ":hero_offset", khergit_banners_begin_offset),#Do not add khergit banners to non-khergit lords (val_add, ":hero_offset", khergit_banners_end_offset), (val_sub, ":hero_offset", khergit_banners_begin_offset), (try_end), (store_add, ":banner_id", banner_scene_props_begin, ":hero_offset"), (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"), (try_end), (store_character_level, ":level", ":kingdom_hero"), (store_mul, ":renown", ":level", ":level"), (val_div, ":renown", 2), (try_begin), (faction_slot_eq, ":kingdom_hero_faction", slot_faction_leader, ":kingdom_hero"), (troop_set_slot, ":kingdom_hero", slot_troop_loyalty, 100), (store_random_in_range, ":random_renown", 250, 400), (else_try), (store_random_in_range, ":random_loyalty", 50, 100), (troop_set_slot, ":kingdom_hero", slot_troop_loyalty, ":random_loyalty"), (store_random_in_range, ":random_renown", 100, 200), (try_end), (val_add, ":renown", ":random_renown"), (troop_set_slot, ":kingdom_hero", slot_troop_renown, ":renown"), (store_random_in_range, ":random_readiness", 0, 100), (troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_join_army, ":random_readiness"), (troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_follow_orders, 100), (troop_set_slot, ":kingdom_hero", slot_troop_player_order_state, spai_undefined), (troop_set_slot, ":kingdom_hero", slot_troop_player_order_object, -1), (try_end), #Correcting banners according to the player banner (troop_get_slot, ":selected_banner_spr", "trp_player", slot_troop_banner_scene_prop), (assign, ":end_cond", kingdom_heroes_end), (try_for_range, ":cur_troop", kingdom_heroes_begin, ":end_cond"), (troop_slot_eq, ":cur_troop", slot_troop_banner_scene_prop, ":selected_banner_spr"), (troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_one), (assign, ":end_cond", 0), (try_end), (call_script, "script_give_center_to_lord", "p_town_1", "trp_kingdom_4_lord", 0), (call_script, "script_give_center_to_lord", "p_town_2", "trp_knight_4_1", 0), (call_script, "script_give_center_to_lord", "p_town_3", "trp_knight_5_1", 0), (call_script, "script_give_center_to_lord", "p_town_4", "trp_knight_1_1", 0), (call_script, "script_give_center_to_lord", "p_town_5", "trp_kingdom_5_lord", 0), (call_script, "script_give_center_to_lord", "p_town_6", "trp_kingdom_1_lord", 0), (call_script, "script_give_center_to_lord", "p_town_7", "trp_knight_1_2", 0), (call_script, "script_give_center_to_lord", "p_town_8", "trp_kingdom_2_lord", 0), (call_script, "script_give_center_to_lord", "p_town_9", "trp_knight_2_1", 0), (call_script, "script_give_center_to_lord", "p_town_10", "trp_kingdom_3_lord", 0), (call_script, "script_give_center_to_lord", "p_town_11", "trp_knight_2_2", 0), (call_script, "script_give_center_to_lord", "p_town_12", "trp_knight_4_2", 0), (call_script, "script_give_center_to_lord", "p_town_13", "trp_knight_2_3", 0), (call_script, "script_give_center_to_lord", "p_town_14", "trp_knight_3_1", 0), (call_script, "script_give_center_to_lord", "p_town_15", "trp_knight_5_2", 0), (call_script, "script_give_center_to_lord", "p_town_16", "trp_knight_1_3", 0), (call_script, "script_give_center_to_lord", "p_town_17", "trp_knight_3_2", 0), (call_script, "script_give_center_to_lord", "p_town_18", "trp_knight_3_3", 0), (call_script, "script_give_center_to_faction_aux", "p_castle_1", "fac_kingdom_5"), (call_script, "script_give_center_to_faction_aux", "p_castle_2", "fac_kingdom_3"), (call_script, "script_give_center_to_faction_aux", "p_castle_3", "fac_kingdom_2"), (call_script, "script_give_center_to_faction_aux", "p_castle_4", "fac_kingdom_2"), (call_script, "script_give_center_to_faction_aux", "p_castle_5", "fac_kingdom_4"), (call_script, "script_give_center_to_faction_aux", "p_castle_6", "fac_kingdom_2"), (call_script, "script_give_center_to_faction_aux", "p_castle_7", "fac_kingdom_3"), (call_script, "script_give_center_to_faction_aux", "p_castle_8", "fac_kingdom_2"), (call_script, "script_give_center_to_faction_aux", "p_castle_9", "fac_kingdom_5"), (call_script, "script_give_center_to_faction_aux", "p_castle_10", "fac_kingdom_4"), (call_script, "script_give_center_to_faction_aux", "p_castle_11", "fac_kingdom_4"), (call_script, "script_give_center_to_faction_aux", "p_castle_12", "fac_kingdom_4"), (call_script, "script_give_center_to_faction_aux", "p_castle_13", "fac_kingdom_1"), (call_script, "script_give_center_to_faction_aux", "p_castle_14", "fac_kingdom_5"), (call_script, "script_give_center_to_faction_aux", "p_castle_15", "fac_kingdom_5"), (call_script, "script_give_center_to_faction_aux", "p_castle_16", "fac_kingdom_5"), (call_script, "script_give_center_to_faction_aux", "p_castle_17", "fac_kingdom_3"), (call_script, "script_give_center_to_faction_aux", "p_castle_18", "fac_kingdom_2"), (call_script, "script_give_center_to_faction_aux", "p_castle_19", "fac_kingdom_2"), (call_script, "script_give_center_to_faction_aux", "p_castle_20", "fac_kingdom_1"), (call_script, "script_give_center_to_faction_aux", "p_castle_21", "fac_kingdom_5"), (call_script, "script_give_center_to_faction_aux", "p_castle_22", "fac_kingdom_3"), (call_script, "script_give_center_to_faction_aux", "p_castle_23", "fac_kingdom_1"), (call_script, "script_give_center_to_faction_aux", "p_castle_24", "fac_kingdom_1"), (call_script, "script_give_center_to_faction_aux", "p_castle_25", "fac_kingdom_1"), (call_script, "script_give_center_to_faction_aux", "p_castle_26", "fac_kingdom_1"), (call_script, "script_give_center_to_faction_aux", "p_castle_27", "fac_kingdom_1"), (call_script, "script_give_center_to_faction_aux", "p_castle_28", "fac_kingdom_5"), (call_script, "script_give_center_to_faction_aux", "p_castle_29", "fac_kingdom_2"), (call_script, "script_give_center_to_faction_aux", "p_castle_30", "fac_kingdom_3"), (call_script, "script_give_center_to_faction_aux", "p_castle_31", "fac_kingdom_1"), (call_script, "script_give_center_to_faction_aux", "p_castle_32", "fac_kingdom_4"), (call_script, "script_give_center_to_faction_aux", "p_castle_33", "fac_kingdom_5"), (call_script, "script_give_center_to_faction_aux", "p_castle_34", "fac_kingdom_4"), (call_script, "script_give_center_to_faction_aux", "p_castle_35", "fac_kingdom_1"), (call_script, "script_give_center_to_faction_aux", "p_castle_36", "fac_kingdom_4"), (call_script, "script_give_center_to_faction_aux", "p_castle_37", "fac_kingdom_2"), (call_script, "script_give_center_to_faction_aux", "p_castle_38", "fac_kingdom_3"), (call_script, "script_give_center_to_faction_aux", "p_castle_39", "fac_kingdom_2"), (call_script, "script_give_center_to_faction_aux", "p_castle_40", "fac_kingdom_3"), # fill_village_bound_centers #pass 1: Give one village to each castle (try_for_range, ":cur_center", castles_begin, castles_end), (assign, ":min_dist", 999999), (assign, ":min_dist_village", -1), (try_for_range, ":cur_village", villages_begin, villages_end), (neg|party_slot_ge, ":cur_village", slot_village_bound_center, 1), #skip villages which are already bound. (store_distance_to_party_from_party, ":cur_dist", ":cur_village", ":cur_center"), (lt, ":cur_dist", ":min_dist"), (assign, ":min_dist", ":cur_dist"), (assign, ":min_dist_village", ":cur_village"), (try_end), (party_set_slot, ":min_dist_village", slot_village_bound_center, ":cur_center"), (store_faction_of_party, ":town_faction", ":cur_center"), (call_script, "script_give_center_to_faction_aux", ":min_dist_village", ":town_faction"), (try_end), # Give family castles to certain nobles. (call_script, "script_give_center_to_lord", "p_castle_29", "trp_knight_2_10", 0), #Nelag_Castle (call_script, "script_give_center_to_lord", "p_castle_30", "trp_knight_3_4", 0), #Asugan_Castle (call_script, "script_give_center_to_lord", "p_castle_35", "trp_knight_1_15", 0), #Haringoth_Castle #pass 2: Give other villages to closest town. (try_for_range, ":cur_village", villages_begin, villages_end), (neg|party_slot_ge, ":cur_village", slot_village_bound_center, 1), #skip villages which are already bound. (assign, ":min_dist", 999999), (assign, ":min_dist_town", -1), (try_for_range, ":cur_town", towns_begin, towns_end), (store_distance_to_party_from_party, ":cur_dist", ":cur_village", ":cur_town"), (lt, ":cur_dist", ":min_dist"), (assign, ":min_dist", ":cur_dist"), (assign, ":min_dist_town", ":cur_town"), (try_end), (party_set_slot, ":cur_village", slot_village_bound_center, ":min_dist_town"), (store_faction_of_party, ":town_faction", ":min_dist_town"), (call_script, "script_give_center_to_faction_aux", ":cur_village", ":town_faction"), (try_end), (try_for_range, ":center_no", centers_begin, centers_end), (store_faction_of_party, ":original_faction", ":center_no"), (faction_get_slot, ":culture", ":original_faction", slot_faction_culture), (party_set_slot, ":center_no", slot_center_culture, ":culture"), (party_set_slot, ":center_no", slot_center_original_faction, ":original_faction"), (party_set_slot, ":center_no", slot_center_ex_faction, ":original_faction"), (try_end), (call_script, "script_update_village_market_towns"), #Assign only family structures of lords who doesn't have a father. Other troops will get the family tree automatically (troop_set_slot,"trp_knight_1_1", slot_troop_spouse, "trp_knight_1_1_wife"), (troop_set_slot,"trp_knight_2_1", slot_troop_spouse, "trp_knight_2_1_wife"), (troop_set_slot,"trp_knight_3_1", slot_troop_spouse, "trp_knight_3_1_wife"), (troop_set_slot,"trp_knight_4_1", slot_troop_spouse, "trp_knight_4_1_wife"), (troop_set_slot,"trp_knight_5_1", slot_troop_spouse, "trp_knight_5_1_wife"), (troop_set_slot,"trp_knight_1_2", slot_troop_spouse, "trp_knight_1_2_wife"), (troop_set_slot,"trp_knight_2_2", slot_troop_spouse, "trp_knight_2_2_wife"), (troop_set_slot,"trp_knight_3_2", slot_troop_spouse, "trp_knight_3_2_wife"), (troop_set_slot,"trp_knight_4_2", slot_troop_spouse, "trp_knight_4_2_wife"), (troop_set_slot,"trp_knight_5_2", slot_troop_spouse, "trp_knight_5_2_wife"), (troop_set_slot,"trp_knight_1_3", slot_troop_spouse, "trp_knight_1_1_daughter"), (troop_set_slot,"trp_knight_2_3", slot_troop_spouse, "trp_knight_2_1_daughter"), (troop_set_slot,"trp_knight_3_3", slot_troop_spouse, "trp_knight_3_1_daughter"), (troop_set_slot,"trp_knight_4_3", slot_troop_spouse, "trp_knight_4_1_daughter"), (troop_set_slot,"trp_knight_5_3", slot_troop_spouse, "trp_knight_5_1_daughter"), (troop_set_slot,"trp_knight_1_4", slot_troop_spouse, "trp_knight_1_2_daughter"), (troop_set_slot,"trp_knight_2_4", slot_troop_spouse, "trp_knight_2_2_daughter"), (troop_set_slot,"trp_knight_3_4", slot_troop_spouse, "trp_knight_3_2_daughter"), (troop_set_slot,"trp_knight_4_4", slot_troop_spouse, "trp_knight_4_2_daughter"), (troop_set_slot,"trp_knight_5_4", slot_troop_spouse, "trp_knight_5_2_daughter"), ## (troop_set_slot,"trp_kingdom_2_lord_a", slot_troop_spouse, "trp_kingdom_2_lady_a"), ## (troop_set_slot,"trp_kingdom_2_lord_a", slot_troop_son, "trp_kingdom_2_lord_b"), ## (troop_set_slot,"trp_kingdom_2_lord_a", slot_troop_sibling, "trp_kingdom_2_lady_c"), ## (troop_set_slot,"trp_kingdom_2_lord_a", slot_troop_daughter, "trp_kingdom_2_lady_e"), ## ## (troop_set_slot,"trp_kingdom_2_lord_b", slot_troop_daughter, "trp_kingdom_2_lady_b"), ## (troop_set_slot,"trp_kingdom_2_lord_c", slot_troop_spouse, "trp_kingdom_2_lady_c"), ## (troop_set_slot,"trp_kingdom_2_lord_d", slot_troop_daughter, "trp_kingdom_2_lady_d"), ## (troop_set_slot,"trp_kingdom_2_lord_e", slot_troop_spouse, "trp_kingdom_2_lady_e"), ## (troop_set_slot,"trp_kingdom_2_lord_f", slot_troop_daughter, "trp_kingdom_2_lady_f"), ## (troop_set_slot,"trp_kingdom_2_lord_g", slot_troop_spouse, "trp_kingdom_2_lady_g"), ## (troop_set_slot,"trp_kingdom_2_lord_h", slot_troop_daughter, "trp_kingdom_2_lady_h"), ## (troop_set_slot,"trp_kingdom_2_lord_i", slot_troop_spouse, "trp_kingdom_2_lady_i"), ## (troop_set_slot,"trp_kingdom_2_lord_j", slot_troop_daughter, "trp_kingdom_2_lady_j"), ## (try_for_range, ":troop_id", merchants_begin, merchants_end), ## (troop_set_slot, ":troop_id", slot_troop_occupation, slto_merchant), ## (try_end), (try_for_range, ":troop_id", kingdom_heroes_begin, kingdom_heroes_end), (try_begin), (store_troop_faction, ":faction_id", ":troop_id"), (is_between, ":faction_id", kingdoms_begin, kingdoms_end), (troop_set_slot, ":troop_id", slot_troop_original_faction, ":faction_id"), (try_begin), (is_between, ":troop_id", pretenders_begin, pretenders_end), (faction_set_slot, ":faction_id", slot_faction_has_rebellion_chance, 1), (else_try), (troop_set_slot, ":troop_id", slot_troop_occupation, slto_kingdom_hero), (try_end), (try_end), (assign, ":initial_wealth", 6000), (try_begin), (store_troop_faction, ":faction", ":troop_id"), (faction_slot_eq, ":faction", slot_faction_leader, ":troop_id"), (assign, ":initial_wealth", 20000), (try_end), (troop_set_slot, ":troop_id", slot_troop_wealth, ":initial_wealth"), (try_end), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),#add town garrisons #Add initial center wealth (assign, ":initial_wealth", 2000), (try_begin), (is_between, ":center_no", towns_begin, towns_end), (val_mul, ":initial_wealth", 2), (try_end), (party_set_slot, ":center_no", slot_town_wealth, ":initial_wealth"), (assign, ":garrison_strength", 13), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_town), (assign, ":garrison_strength", 40), (try_end), (try_for_range, ":unused", 0, ":garrison_strength"), (call_script, "script_cf_reinforce_party", ":center_no"), (try_end), ## ADD some XP initially (store_div, ":xp_amount", ":garrison_strength", 8), (val_add, ":xp_amount", 4), (try_for_range, ":unused", 0, ":xp_amount"), (store_random_in_range, ":xp", 7000, 9000), (party_upgrade_with_xp, ":center_no", ":xp", 0), (try_end), #Fill town food stores upto half the limit (call_script, "script_center_get_food_store_limit", ":center_no"), (assign, ":food_store_limit", reg0), (val_div, ":food_store_limit", 2), (party_set_slot, ":center_no", slot_party_food_store, ":food_store_limit"), #create lord parties (party_get_slot, ":center_lord", ":center_no", slot_town_lord), (ge, ":center_lord", 1), (troop_slot_eq, ":center_lord", slot_troop_leaded_party, 0), (call_script, "script_create_kingdom_hero_party", ":center_lord", ":center_no"), (assign, ":lords_party", "$pout_party"), (party_attach_to_party, ":lords_party", ":center_no"), (party_set_slot, ":center_no", slot_town_player_odds, 1000), (try_end), (call_script, "script_complete_family_relations"), (call_script, "script_complete_family_relations"), (try_for_range, ":troop_id", kingdom_ladies_begin, kingdom_ladies_end), (troop_set_slot, ":troop_id", slot_troop_occupation, slto_kingdom_lady), (troop_get_slot, ":cur_family", ":troop_id", slot_troop_father), (try_begin), (eq, ":cur_family", 0), (troop_get_slot, ":cur_family", ":troop_id", slot_troop_spouse), (try_end), (try_begin), (gt, ":cur_family", 0), (call_script, "script_get_troop_attached_party", ":cur_family"), (assign, ":cur_center", reg0), (gt, ":cur_center", 0), (troop_set_slot, ":troop_id", slot_troop_cur_center, ":cur_center"), (else_try), (store_troop_faction, ":faction_no", ":troop_id"), (call_script, "script_cf_select_random_walled_center_with_faction", ":faction_no", -1), (assign, ":cur_center", reg0), (troop_set_slot, ":troop_id", slot_troop_cur_center, ":cur_center"), (try_end), (try_end), (try_for_range, ":troop_id", heroes_begin, heroes_end), (troop_slot_eq, ":troop_id", slot_troop_occupation, slto_kingdom_lady), (troop_get_slot, ":cur_father", ":troop_id", slot_troop_father), (gt, ":cur_father", 0),# Lovers for daughters only (store_random_in_range, ":random_no", 0, 100), (le, ":random_no", 80), (call_script, "script_cf_get_random_kingdom_hero_as_lover", ":troop_id"),#Can fail (assign, ":cur_lover", reg0), (troop_set_slot, ":troop_id", slot_troop_lover, ":cur_lover"), (troop_set_slot, ":cur_lover", slot_troop_lover, ":troop_id"), (try_end), (try_for_range, ":troop_id", heroes_begin, heroes_end), (troop_get_slot, ":in_relation_1", ":troop_id", slot_troop_spouse), (troop_get_slot, ":in_relation_2", ":troop_id", slot_troop_sibling), (troop_get_slot, ":in_relation_3", ":troop_id", slot_troop_daughter), (troop_get_slot, ":in_relation_4", ":troop_id", slot_troop_son), (troop_get_slot, ":in_relation_5", ":troop_id", slot_troop_father), (troop_get_slot, ":in_relation_6", ":troop_id", slot_troop_mother), (troop_get_slot, ":in_relation_7", ":troop_id", slot_troop_lover), # (troop_get_slot, ":troop_rank", ":troop_id", slot_troop_kingdom_rank), (store_troop_faction, ":troop_faction", ":troop_id"), (assign, ":troop_enemy_count", 0), (try_for_range, ":i_enemy_slot", slot_troop_enemies_begin, slot_troop_enemies_end), (troop_slot_ge, ":troop_id", ":i_enemy_slot", 1), (val_add, ":troop_enemy_count", 1), (try_end), (try_for_range, ":i_enemy_slot", slot_troop_enemies_begin, slot_troop_enemies_end), (troop_set_slot, ":troop_id", ":i_enemy_slot", -1), (try_end), (store_random_in_range, ":random_enemy_count", 0, 4), (val_add, ":random_enemy_count", ":troop_enemy_count"), (val_min, ":random_enemy_count", 5), (try_for_range, ":unused", ":troop_enemy_count", ":random_enemy_count"), (assign, ":possible_enemy_count", 0), (try_for_range, ":enemy_troop_id", heroes_begin, heroes_end), (neq, ":enemy_troop_id", ":troop_id"), (neq, ":enemy_troop_id", ":in_relation_1"), (neq, ":enemy_troop_id", ":in_relation_2"), (neq, ":enemy_troop_id", ":in_relation_3"), (neq, ":enemy_troop_id", ":in_relation_4"), (neq, ":enemy_troop_id", ":in_relation_5"), (neq, ":enemy_troop_id", ":in_relation_6"), (neq, ":enemy_troop_id", ":in_relation_7"), (store_troop_faction, ":enemy_troop_faction", ":enemy_troop_id"), (eq, ":enemy_troop_faction", ":troop_faction"), # (troop_get_slot, ":enemy_troop_rank", ":enemy_troop_id", slot_troop_kingdom_rank), # (lt, ":enemy_troop_rank", 4), # (lt, ":troop_rank", 4), (assign, ":marked_as_enemy", 0), (try_for_range, ":i_enemy_slot_mark", slot_troop_enemies_begin, slot_troop_enemies_end), (troop_slot_eq, ":troop_id", ":i_enemy_slot_mark", ":enemy_troop_id"), (assign, ":marked_as_enemy", 1), (try_end), (eq, ":marked_as_enemy", 0), (val_add, ":possible_enemy_count", 1), (try_end), (store_random_in_range, ":random_enemy", 0, ":possible_enemy_count"), (assign, ":possible_enemy_count", 0), (assign, ":result", -1), (try_for_range, ":enemy_troop_id", heroes_begin, heroes_end), (eq, ":result", -1), (neq, ":enemy_troop_id", ":troop_id"), (neq, ":enemy_troop_id", ":in_relation_1"), (neq, ":enemy_troop_id", ":in_relation_2"), (neq, ":enemy_troop_id", ":in_relation_3"), (neq, ":enemy_troop_id", ":in_relation_4"), (neq, ":enemy_troop_id", ":in_relation_5"), (neq, ":enemy_troop_id", ":in_relation_6"), (neq, ":enemy_troop_id", ":in_relation_7"), (store_troop_faction, ":enemy_troop_faction", ":enemy_troop_id"), (eq, ":enemy_troop_faction", ":troop_faction"), # (troop_get_slot, ":enemy_troop_rank", ":enemy_troop_id", slot_troop_kingdom_rank), # (lt, ":enemy_troop_rank", 4), # (lt, ":troop_rank", 4), (assign, ":marked_as_enemy", 0), (try_for_range, ":i_enemy_slot_mark", slot_troop_enemies_begin, slot_troop_enemies_end), (troop_slot_eq, ":troop_id", ":i_enemy_slot_mark", ":enemy_troop_id"), (assign, ":marked_as_enemy", 1), (try_end), (eq, ":marked_as_enemy", 0), (val_add, ":possible_enemy_count", 1), (gt, ":possible_enemy_count", ":random_enemy"), (assign, ":result", ":enemy_troop_id"), (try_end), (gt, ":result", 0), (assign, ":enemy_troop_enemy_count", 0), (try_for_range, ":i_enemy_slot", slot_troop_enemies_begin, slot_troop_enemies_end), (troop_slot_ge, ":result", ":i_enemy_slot", 1), (val_add, ":enemy_troop_enemy_count", 1), (try_end), (lt, ":enemy_troop_enemy_count", 5), (assign, ":troop_enemy_count", 0), (try_for_range, ":i_enemy_slot", slot_troop_enemies_begin, slot_troop_enemies_end), (troop_slot_ge, ":troop_id", ":i_enemy_slot", 1), (val_add, ":troop_enemy_count", 1), (try_end), (store_add, ":cur_slot", slot_troop_enemies_begin, ":troop_enemy_count"), (troop_set_slot, ":troop_id", ":cur_slot", ":result"), (store_add, ":cur_slot", slot_troop_enemies_begin, ":enemy_troop_enemy_count"), (troop_set_slot, ":result", ":cur_slot", ":troop_id"), (try_end), (try_end), (try_for_range, ":unused", 0, 8), (call_script, "script_spawn_bandits"), (try_end), (set_spawn_radius, 50), (try_for_range, ":unused", 0, 25), (spawn_around_party,"p_main_party","pt_looters"), (try_end), (try_for_range, ":unused", 0, 6), (call_script, "script_update_trade_good_prices"), (try_end), (call_script, "script_assign_lords_to_empty_centers"), (call_script, "script_update_mercenary_units_of_towns"), (call_script, "script_update_companion_candidates_in_taverns"), (call_script, "script_update_ransom_brokers"), (call_script, "script_update_tavern_travelers"), (call_script, "script_update_tavern_minstels"), (call_script, "script_update_booksellers"), (try_for_range, ":village_no", villages_begin, villages_end), (call_script, "script_update_volunteer_troops_in_village", ":village_no"), (try_end), (try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end), (call_script, "script_update_faction_notes", ":cur_kingdom"), (store_random_in_range, ":random_no", -60, 0), (faction_set_slot, ":faction_no", slot_faction_ai_last_offensive_time, ":random_no"), (try_end), (try_for_range, ":cur_troop", kingdom_heroes_begin, kingdom_heroes_end), (call_script, "script_update_troop_notes", ":cur_troop"), (try_end), (try_for_range, ":cur_center", centers_begin, centers_end), (call_script, "script_update_center_notes", ":cur_center"), (try_end), (call_script, "script_update_troop_notes", "trp_player"), (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end), (call_script, "script_faction_recalculate_strength", ":faction_no"), (try_end), ## (assign, "$players_kingdom", "fac_kingdom_1"), ## (call_script, "script_give_center_to_lord", "p_town_7", "trp_player", 0), ## (call_script, "script_give_center_to_lord", "p_town_16", "trp_player", 0), #### (call_script, "script_give_center_to_lord", "p_castle_10", "trp_player", 0), ## (assign, "$g_castle_requested_by_player", "p_castle_10"), (call_script, "script_get_player_party_morale_values"), (party_set_morale, "p_main_party", reg0), ]), # script_game_event_party_encounter: # This script is called from the game engine whenever player party encounters another party or a battle on the world map # INPUT: # param1: encountered_party # param2: second encountered_party (if this was a battle ("game_event_party_encounter", [ (store_script_param_1, "$g_encountered_party"), (store_script_param_2, "$g_encountered_party_2"),# encountered_party2 is set when we come across a battle or siege, otherwise it's a negative value # (store_encountered_party, "$g_encountered_party"), # (store_encountered_party2,"$g_encountered_party_2"), # encountered_party2 is set when we come across a battle or siege, otherwise it's a minus value (store_faction_of_party, "$g_encountered_party_faction","$g_encountered_party"), (store_relation, "$g_encountered_party_relation", "$g_encountered_party_faction", "fac_player_faction"), (party_get_slot, "$g_encountered_party_type", "$g_encountered_party", slot_party_type), (party_get_template_id,"$g_encountered_party_template","$g_encountered_party"), # (try_begin), # (gt, "$g_encountered_party_2", 0), # (store_faction_of_party, "$g_encountered_party_2_faction","$g_encountered_party_2"), # (store_relation, "$g_encountered_party_2_relation", "$g_encountered_party_2_faction", "fac_player_faction"), # (party_get_template_id,"$g_encountered_party_2_template","$g_encountered_party_2"), # (else_try), # (assign, "$g_encountered_party_2_faction",-1), # (assign, "$g_encountered_party_2_relation", 0), # (assign,"$g_encountered_party_2_template", -1), # (try_end), #NPC companion changes begin (call_script, "script_party_count_fit_regulars", "p_main_party"), (assign, "$playerparty_prebattle_regulars", reg0), # (try_begin), # (assign, "$player_party__regulars", 0), # (call_script, "script_party_count_fit_regulars", "p_main_party"), # (gt, reg0, 0), # (assign, "$player_party_contains_regulars", 1), # (try_end), #NPC companion changes end (assign, "$g_last_rest_center", -1), (assign, "$talk_context", 0), (assign,"$g_player_surrenders",0), (assign,"$g_enemy_surrenders",0), (assign, "$g_leave_encounter",0), (assign, "$g_engaged_enemy", 0), # (assign,"$waiting_for_arena_fight_result", 0), # (assign,"$arena_bet_amount",0), # (assign,"$g_player_raiding_village",0), (try_begin), (neg|is_between, "$g_encountered_party", centers_begin, centers_end), (rest_for_hours, 0), #stop waiting (try_end), # (assign, "$g_permitted_to_center",0), (assign, "$new_encounter", 1), #check this in the menu. (try_begin), (lt, "$g_encountered_party_2",0), #Normal encounter. Not battle or siege. (try_begin), (party_slot_eq, "$g_encountered_party", slot_party_type, spt_town), #(assign, reg0, "$g_encountered_party"), #(display_message, "@party_id: {reg0}"), (jump_to_menu, "mnu_castle_outside"), (else_try), (party_slot_eq, "$g_encountered_party", slot_party_type, spt_castle), (jump_to_menu, "mnu_castle_outside"), (else_try), (party_slot_eq, "$g_encountered_party", slot_party_type, spt_ship), (jump_to_menu, "mnu_ship_reembark"), (else_try), (party_slot_eq, "$g_encountered_party", slot_party_type, spt_village), (jump_to_menu, "mnu_village"), (else_try), (party_slot_eq, "$g_encountered_party", slot_party_type, spt_cattle_herd), (jump_to_menu, "mnu_cattle_herd"), (else_try), (is_between, "$g_encountered_party", training_grounds_begin, training_grounds_end), (jump_to_menu, "mnu_training_ground"), (else_try), (eq, "$g_encountered_party", "p_zendar"), (jump_to_menu, "mnu_zendar"), (else_try), (eq, "$g_encountered_party", "p_salt_mine"), (jump_to_menu, "mnu_salt_mine"), (else_try), (eq, "$g_encountered_party", "p_four_ways_inn"), (jump_to_menu, "mnu_four_ways_inn"), (else_try), (eq, "$g_encountered_party", "p_test_scene"), (jump_to_menu, "mnu_test_scene"), (else_try), (eq, "$g_encountered_party", "p_battlefields"), (jump_to_menu, "mnu_battlefields"), (else_try), (eq, "$g_encountered_party", "p_training_ground"), (jump_to_menu, "mnu_tutorial"), (else_try), (eq, "$g_encountered_party", "p_camp_bandits"), (jump_to_menu, "mnu_camp"), (else_try), (jump_to_menu, "mnu_simple_encounter"), (try_end), (else_try), #Battle or siege (try_begin), (this_or_next|party_slot_eq, "$g_encountered_party", slot_party_type, spt_town), (party_slot_eq, "$g_encountered_party", slot_party_type, spt_castle), (try_begin), (eq, "$auto_enter_town", "$g_encountered_party"), (jump_to_menu, "mnu_town"), (else_try), (eq, "$auto_besiege_town", "$g_encountered_party"), (jump_to_menu, "mnu_besiegers_camp_with_allies"), (else_try), (jump_to_menu, "mnu_join_siege_outside"), (try_end), (else_try), (jump_to_menu, "mnu_pre_join"), (try_end), (try_end), (assign,"$auto_enter_town",0), (assign,"$auto_besiege_town",0), ]), #script_game_event_simulate_battle: # This script is called whenever the game simulates the battle between two parties on the map. # INPUT: # param1: Defender Party # param2: Attacker Party ("game_event_simulate_battle", [ (store_script_param_1, ":root_defender_party"), (store_script_param_2, ":root_attacker_party"), (try_begin), (store_faction_of_party, ":defender_faction", ":root_defender_party"), (store_faction_of_party, ":attacker_faction", ":root_attacker_party"), (neq, ":defender_faction", "fac_player_faction"), (neq, ":attacker_faction", "fac_player_faction"), (store_relation, ":reln", ":defender_faction", ":attacker_faction"), (ge, ":reln", 0), (set_trigger_result, 1), (else_try), (assign, ":trigger_result", 0), (try_begin), (this_or_next|eq, "$g_battle_simulation_cancel_for_party", ":root_defender_party"), (eq, "$g_battle_simulation_cancel_for_party", ":root_attacker_party"), (assign, "$g_battle_simulation_cancel_for_party", -1), (assign, "$auto_enter_town", "$g_battle_simulation_auto_enter_town_after_battle"), (assign, ":trigger_result", 1), (else_try), (try_begin), (this_or_next|party_slot_eq, ":root_defender_party", slot_party_retreat_flag, 1), (party_slot_eq, ":root_attacker_party", slot_party_retreat_flag, 1), (assign, ":trigger_result", 1), #End battle! (try_end), (party_set_slot, ":root_attacker_party", slot_party_retreat_flag, 0), ## (assign, ":cancel_attack", 0), (party_collect_attachments_to_party, ":root_defender_party", "p_collective_ally"), (party_collect_attachments_to_party, ":root_attacker_party", "p_collective_enemy"), # (call_script, "script_party_count_fit_for_battle", "p_collective_ally"), (call_script, "script_party_calculate_strength", "p_collective_ally", 0), (assign, ":defender_strength", reg0), # (call_script, "script_party_count_fit_for_battle", "p_collective_enemy"), (call_script, "script_party_calculate_strength", "p_collective_enemy", 0), (assign, ":attacker_strength", reg0), (store_div, ":defender_strength", ":defender_strength", 20), (val_min, ":defender_strength", 50), (val_max, ":defender_strength", 1), (store_div, ":attacker_strength", ":attacker_strength", 20), (val_min, ":attacker_strength", 50), (val_add, ":attacker_strength", 1), (try_begin), #For sieges increase attacker casualties and reduce defender casualties. (this_or_next|party_slot_eq, ":root_defender_party", slot_party_type, spt_castle), (party_slot_eq, ":root_defender_party", slot_party_type, spt_town), (val_mul, ":defender_strength", 3), (val_div, ":defender_strength", 2), (val_div, ":attacker_strength", 2), (try_end), (try_begin), (neg|is_currently_night), #Don't fight at night (inflict_casualties_to_party_group, ":root_attacker_party", ":defender_strength", "p_temp_casualties"), (party_collect_attachments_to_party, ":root_attacker_party", "p_collective_enemy"), (try_end), (call_script, "script_party_count_fit_for_battle", "p_collective_enemy", 0), (assign, ":new_attacker_strength", reg0), (try_begin), (gt, ":new_attacker_strength", 0), (neg|is_currently_night), #Don't fight at night (inflict_casualties_to_party_group, ":root_defender_party", ":attacker_strength", "p_temp_casualties"), (party_collect_attachments_to_party, ":root_defender_party", "p_collective_ally"), (try_end), (call_script, "script_party_count_fit_for_battle", "p_collective_ally", 0), (assign, ":new_defender_strength", reg0), (try_begin), (this_or_next|eq, ":new_attacker_strength", 0), (eq, ":new_defender_strength", 0), # Battle concluded! determine winner (try_begin), (eq, ":new_attacker_strength", 0), (eq, ":new_defender_strength", 0), (assign, ":root_winner_party", -1), (assign, ":root_defeated_party", -1), (assign, ":collective_casualties", -1), (else_try), (eq, ":new_attacker_strength", 0), (assign, ":root_winner_party", ":root_defender_party"), (assign, ":root_defeated_party", ":root_attacker_party"), (assign, ":collective_casualties", "p_collective_enemy"), (else_try), (assign, ":root_winner_party", ":root_attacker_party"), (assign, ":root_defeated_party", ":root_defender_party"), (assign, ":collective_casualties", "p_collective_ally"), (try_end), (try_begin), (ge, ":root_winner_party", 0), (call_script, "script_get_nonempty_party_in_group", ":root_winner_party"), (assign, ":nonempty_winner_party", reg0), (store_faction_of_party, ":faction_receiving_prisoners", ":nonempty_winner_party"), (store_faction_of_party, ":defeated_faction", ":root_defeated_party"), (else_try), (assign, ":nonempty_winner_party", -1), (try_end), (try_begin), (ge, ":collective_casualties", 0), (party_get_num_companion_stacks, ":num_stacks", ":collective_casualties"), (else_try), (assign, ":num_stacks", 0), (try_end), (try_for_range, ":troop_iterator", 0, ":num_stacks"), (party_stack_get_troop_id, ":cur_troop_id", ":collective_casualties", ":troop_iterator"), (troop_is_hero, ":cur_troop_id"), (call_script, "script_remove_troop_from_prison", ":cur_troop_id"), (troop_set_slot, ":cur_troop_id", slot_troop_leaded_party, -1), (store_random_in_range, ":rand", 0, 100), (str_store_troop_name_link, s1, ":cur_troop_id"), (str_store_faction_name_link, s2, ":faction_receiving_prisoners"), (store_troop_faction, ":defeated_troop_faction", ":cur_troop_id"), (str_store_faction_name_link, s3, ":defeated_troop_faction"), (try_begin), (ge, ":rand", hero_escape_after_defeat_chance), (party_stack_get_troop_id, ":leader_troop_id", ":nonempty_winner_party", 0), (is_between, ":leader_troop_id", kingdom_heroes_begin, kingdom_heroes_end), #disable non-kingdom parties capturing enemy lords (party_add_prisoners, ":nonempty_winner_party", ":cur_troop_id", 1), (gt, reg0, 0), #(troop_set_slot, ":cur_troop_id", slot_troop_is_prisoner, 1), (troop_set_slot, ":cur_troop_id", slot_troop_prisoner_of_party, ":nonempty_winner_party"), (display_log_message, "str_hero_taken_prisoner"), (else_try), (display_message,"@{s1} of {s3} was defeated in battle but managed to escape."), (try_end), (try_begin), (store_troop_faction, ":cur_troop_faction", ":cur_troop_id"), (faction_slot_eq, ":cur_troop_faction", slot_faction_marshall, ":cur_troop_id"), #Marshall is defeated, refresh ai. (assign, "$g_recalculate_ais", 1), (try_end), (try_end), (try_begin), (ge, ":collective_casualties", 0), (party_get_num_prisoner_stacks, ":num_stacks", ":collective_casualties"), (else_try), (assign, ":num_stacks", 0), (try_end), (try_for_range, ":troop_iterator", 0, ":num_stacks"), (party_prisoner_stack_get_troop_id, ":cur_troop_id", ":collective_casualties", ":troop_iterator"), (troop_is_hero, ":cur_troop_id"), (call_script, "script_remove_troop_from_prison", ":cur_troop_id"), (store_troop_faction, ":cur_troop_faction", ":cur_troop_id"), (str_store_troop_name_link, s1, ":cur_troop_id"), (str_store_faction_name_link, s2, ":faction_receiving_prisoners"), (str_store_faction_name_link, s3, ":cur_troop_faction"), (display_log_message,"str_hero_freed"), (try_end), (try_begin), (ge, ":collective_casualties", 0), (party_clear, "p_temp_party"), (assign, "$g_move_heroes", 0), #heroes are already processed above. Skip them here. (call_script, "script_party_add_party_prisoners", "p_temp_party", ":collective_casualties"), (call_script, "script_party_prisoners_add_party_companions", "p_temp_party", ":collective_casualties"), (distribute_party_among_party_group, "p_temp_party", ":root_winner_party"), (call_script, "script_clear_party_group", ":root_defeated_party"), (try_end), (assign, ":trigger_result", 1), #End battle! #Center captured (try_begin), (ge, ":collective_casualties", 0), (party_get_slot, ":cur_party_type", ":root_defeated_party", slot_party_type), (this_or_next|eq, ":cur_party_type", spt_town), (eq, ":cur_party_type", spt_castle), (assign, "$g_recalculate_ais", 1), (store_faction_of_party, ":winner_faction", ":root_winner_party"), (store_faction_of_party, ":defeated_faction", ":root_defeated_party"), (str_store_party_name, s1, ":root_defeated_party"), (str_store_faction_name, s2, ":winner_faction"), (str_store_faction_name, s3, ":defeated_faction"), (display_log_message, "str_center_captured"), (try_begin), (eq, "$g_encountered_party", ":root_defeated_party"), ## (display_message, "@Player participation in siege called from g_encountered_party"), (call_script, "script_add_log_entry", logent_player_participated_in_siege, "trp_player", "$g_encountered_party", 0, "$g_encountered_party_faction"), (try_end), ## (try_begin), ## (eq, "$g_encountered_party_2", ":root_defeated_party"), ## (display_message, "@Player participation in siege called from game_event_simulate_battle thanks to g_encountered_party"), ## (try_end), ## (try_begin), ## (eq, "$g_enemy_party", ":root_defeated_party"), ## (display_message, "@Player participation in siege called from game_event_simulate_battle thanks to g_encountered_party"), ## (try_end), (try_begin), (party_get_num_companion_stacks, ":num_stacks", ":root_winner_party"), (gt, ":num_stacks", 0), (party_stack_get_troop_id, ":leader_troop_no", ":root_winner_party", 0), (is_between, ":leader_troop_no", kingdom_heroes_begin, kingdom_heroes_end), (party_set_slot, ":root_defeated_party", slot_center_last_taken_by_troop, ":leader_troop_no"), (else_try), (party_set_slot, ":root_defeated_party", slot_center_last_taken_by_troop, -1), (try_end), (call_script, "script_lift_siege", ":root_defeated_party", 0), (call_script, "script_give_center_to_faction", ":root_defeated_party", ":winner_faction"), (try_begin), (eq, ":defeated_faction", "fac_player_supporters_faction"), (call_script, "script_add_notification_menu", "mnu_notification_center_lost", ":root_defeated_party", ":winner_faction"), (try_end), #Reduce prosperity of the center by 5 (call_script, "script_change_center_prosperity", ":root_defeated_party", -5), (call_script, "script_order_best_besieger_party_to_guard_center", ":root_defeated_party", ":winner_faction"), (call_script, "script_cf_reinforce_party", ":root_defeated_party"), (call_script, "script_cf_reinforce_party", ":root_defeated_party"), (try_end), (try_end), #ADD XP (try_begin), (party_slot_eq, ":root_attacker_party", slot_party_type, spt_kingdom_hero_party), (store_random_in_range, ":random_num",0, 100), (lt, ":random_num", 25), (gt, ":new_attacker_strength", 0), (call_script, "script_upgrade_hero_party", ":root_attacker_party", 1000), (try_end), (try_begin), (party_slot_eq, ":root_defender_party", slot_party_type, spt_kingdom_hero_party), (store_random_in_range, ":random_num",0, 100), (lt, ":random_num", 25), (gt, ":new_defender_strength", 0), (call_script, "script_upgrade_hero_party", ":root_defender_party", 1000), (try_end), (store_random_in_range, ":random_num", 0, 100), (try_begin), (lt, ":random_num", 10), ## (this_or_next|lt, ":random_num", 10), ## (eq, ":cancel_attack", 1), (assign, ":trigger_result", 1), #End battle! (try_end), (try_end), (set_trigger_result, ":trigger_result"), (try_end), ]), #script_game_event_battle_end: # This script is called whenever the game ends the battle between two parties on the map. # INPUT: # param1: Defender Party # param2: Attacker Party ("game_event_battle_end", [ ## (store_script_param_1, ":root_defender_party"), ## (store_script_param_2, ":root_attacker_party"), #Fixing deleted heroes (try_for_range, ":cur_troop", kingdom_heroes_begin, kingdom_heroes_end), (troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party), (troop_get_slot, ":cur_prisoner_of_party", ":cur_troop", slot_troop_prisoner_of_party), (try_begin), (ge, ":cur_party", 0), (assign, ":continue", 0), (try_begin), (neg|party_is_active, ":cur_party"), (assign, ":continue", 1), (else_try), (party_count_companions_of_type, ":amount", ":cur_party", ":cur_troop"), (le, ":amount", 0), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (try_begin), (eq, "$cheat_mode", 1), (str_store_troop_name, s1, ":cur_troop"), (display_message, "@DEBUG: {s1} no longer leads a party."), (try_end), (troop_set_slot, ":cur_troop", slot_troop_leaded_party, -1), (try_end), (try_begin), (ge, ":cur_prisoner_of_party", 0), (assign, ":continue", 0), (try_begin), (neg|party_is_active, ":cur_prisoner_of_party"), (assign, ":continue", 1), (else_try), (party_count_prisoners_of_type, ":amount", ":cur_prisoner_of_party", ":cur_troop"), (le, ":amount", 0), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (try_begin), (eq, "$cheat_mode", 1), (str_store_troop_name, s1, ":cur_troop"), (display_message, "@DEBUG: {s1} is no longer a prisoner."), (try_end), (call_script, "script_remove_troop_from_prison", ":cur_troop"), #searching player (try_begin), (party_count_prisoners_of_type, ":amount", "p_main_party", ":cur_troop"), (gt, ":amount", 0), (troop_set_slot, ":cur_troop", slot_troop_prisoner_of_party, "p_main_party"), (assign, ":continue", 0), (try_begin), (eq, "$cheat_mode", 1), (str_store_troop_name, s1, ":cur_troop"), (display_message, "@DEBUG: {s1} is now a prisoner of player."), (try_end), (try_end), (eq, ":continue", 1), #searching kingdom heroes (try_for_range, ":cur_troop_2", kingdom_heroes_begin, kingdom_heroes_end), (eq, ":continue", 1), (troop_get_slot, ":cur_prisoner_of_party_2", ":cur_troop_2", slot_troop_leaded_party), (party_is_active, ":cur_prisoner_of_party_2"), (party_count_prisoners_of_type, ":amount", ":cur_prisoner_of_party_2", ":cur_troop"), (gt, ":amount", 0), (troop_set_slot, ":cur_troop", slot_troop_prisoner_of_party, ":cur_prisoner_of_party_2"), (assign, ":continue", 0), (try_begin), (eq, "$cheat_mode", 1), (str_store_troop_name, s1, ":cur_troop"), (str_store_party_name, s2, ":cur_prisoner_of_party_2"), (display_message, "@DEBUG: {s1} is now a prisoner of {s2}."), (try_end), (try_end), #searching walled centers (try_for_range, ":cur_prisoner_of_party_2", walled_centers_begin, walled_centers_end), (eq, ":continue", 1), (party_count_prisoners_of_type, ":amount", ":cur_prisoner_of_party_2", ":cur_troop"), (gt, ":amount", 0), (troop_set_slot, ":cur_troop", slot_troop_prisoner_of_party, ":cur_prisoner_of_party_2"), (assign, ":continue", 0), (try_begin), (eq, "$cheat_mode", 1), (str_store_troop_name, s1, ":cur_troop"), (str_store_party_name, s2, ":cur_prisoner_of_party_2"), (display_message, "@DEBUG: {s1} is now a prisoner of {s2}."), (try_end), (try_end), (try_end), (try_end), ]), #script_order_best_besieger_party_to_guard_center: # INPUT: # param1: defeated_center, param2: winner_faction # OUTPUT: # none ("order_best_besieger_party_to_guard_center", [ (store_script_param, ":defeated_center", 1), (store_script_param, ":winner_faction", 2), (assign, ":best_party", -1), (assign, ":best_party_strength", 0), (try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end), (troop_get_slot, ":kingdom_hero_party", ":kingdom_hero", slot_troop_leaded_party), (gt, ":kingdom_hero_party", 0), (store_distance_to_party_from_party, ":dist", ":kingdom_hero_party", ":defeated_center"), (lt, ":dist", 5), (store_faction_of_party, ":kingdom_hero_party_faction", ":kingdom_hero_party"), (eq, ":winner_faction", ":kingdom_hero_party_faction"), #If marshall has captured the castle, then do not leave him behind. (neg|faction_slot_eq, ":winner_faction", slot_faction_marshall, ":kingdom_hero"), (assign, ":has_besiege_ai", 0), (try_begin), (party_slot_eq, ":kingdom_hero_party", slot_party_ai_state, spai_besieging_center), (party_slot_eq, ":kingdom_hero_party", slot_party_ai_object, ":defeated_center"), (assign, ":has_besiege_ai", 1), (else_try), (party_slot_eq, ":kingdom_hero_party", slot_party_ai_state, spai_accompanying_army), (party_get_slot, ":kingdom_hero_party_commander_party", ":kingdom_hero_party", slot_party_commander_party), (party_slot_eq, ":kingdom_hero_party_commander_party", slot_party_ai_state, spai_besieging_center), (party_slot_eq, ":kingdom_hero_party_commander_party", slot_party_ai_object, ":defeated_center"), (assign, ":has_besiege_ai", 1), (try_end), (eq, ":has_besiege_ai", 1), (party_get_slot, ":kingdom_hero_party_strength", ":kingdom_hero_party", slot_party_cached_strength),#recently calculated (gt, ":kingdom_hero_party_strength", ":best_party_strength"), (assign, ":best_party_strength", ":kingdom_hero_party_strength"), (assign, ":best_party", ":kingdom_hero_party"), (try_end), (try_begin), (gt, ":best_party", 0), (call_script, "script_party_set_ai_state", ":best_party", spai_holding_center, ":defeated_center"), (party_set_slot, ":best_party", slot_party_commander_party, -1), (party_set_flags, ":best_party", pf_default_behavior, 1), (try_end), ]), #script_game_get_item_buy_price_factor: # This script is called from the game engine for calculating the buying price of any item. # INPUT: # param1: item_kind_id # OUTPUT: # trigger_result and reg0 = price_factor ("game_get_item_buy_price_factor", [ (store_script_param_1, ":item_kind_id"), (assign, ":price_factor", 100), (call_script, "script_get_trade_penalty", ":item_kind_id"), (assign, ":trade_penalty", reg0), (try_begin), (is_between, "$g_encountered_party", centers_begin, centers_end), (is_between, ":item_kind_id", trade_goods_begin, trade_goods_end), (store_sub, ":item_slot_no", ":item_kind_id", trade_goods_begin), (val_add, ":item_slot_no", slot_town_trade_good_prices_begin), (party_get_slot, ":price_factor", "$g_encountered_party", ":item_slot_no"), (val_mul, ":price_factor", 100), #normalize price factor to range 0..100 (val_div, ":price_factor", average_price_factor), (try_end), (store_add, ":penalty_factor", 100, ":trade_penalty"), (val_mul, ":price_factor", ":penalty_factor"), (val_div, ":price_factor", 100), (assign, reg0, ":price_factor"), (set_trigger_result, reg0), ]), #script_game_get_item_sell_price_factor: # This script is called from the game engine for calculating the selling price of any item. # INPUT: # param1: item_kind_id # OUTPUT: # trigger_result and reg0 = price_factor ("game_get_item_sell_price_factor", [ (store_script_param_1, ":item_kind_id"), (assign, ":price_factor", 100), (call_script, "script_get_trade_penalty", ":item_kind_id"), (assign, ":trade_penalty", reg0), (try_begin), (is_between, "$g_encountered_party", centers_begin, centers_end), (is_between, ":item_kind_id", trade_goods_begin, trade_goods_end), (store_sub, ":item_slot_no", ":item_kind_id", trade_goods_begin), (val_add, ":item_slot_no", slot_town_trade_good_prices_begin), (party_get_slot, ":price_factor", "$g_encountered_party", ":item_slot_no"), (val_mul, ":price_factor", 100),#normalize price factor to range 0..100 (val_div, ":price_factor", average_price_factor), (else_try), #increase trade penalty while selling (val_mul, ":trade_penalty", 4), (try_end), (store_add, ":penalty_divisor", 100, ":trade_penalty"), (val_mul, ":price_factor", 100), (val_div, ":price_factor", ":penalty_divisor"), (assign, reg0, ":price_factor"), (set_trigger_result, reg0), ]), # script_get_trade_penalty # # Input: # param1: troop_id, # Output: reg0 ("get_trade_penalty", [ (store_script_param_1, ":item_kind_id"), (assign, ":penalty",0), (party_get_skill_level, ":trade_skill", "p_main_party", skl_trade), (try_begin), (is_between, ":item_kind_id", trade_goods_begin, trade_goods_end), (assign, ":penalty",20), (store_mul, ":skill_bonus", ":trade_skill", 1), (val_sub, ":penalty", ":skill_bonus"), (else_try), (assign, ":penalty",100), (store_mul, ":skill_bonus", ":trade_skill", 5), (val_sub, ":penalty", ":skill_bonus"), (try_end), (assign, ":penalty_multiplier", 1000), ## # Apply penalty if player is hostile to merchants faction ## (store_relation, ":merchants_reln", "fac_merchants", "fac_player_supporters_faction"), ## (try_begin), ## (lt, ":merchants_reln", 0), ## (store_sub, ":merchants_reln_dif", 10, ":merchants_reln"), ## (store_mul, ":merchants_relation_penalty", ":merchants_reln_dif", 20), ## (val_add, ":penalty_multiplier", ":merchants_relation_penalty"), ## (try_end), # Apply penalty if player is on bad terms with the town (try_begin), (is_between, "$g_encountered_party", centers_begin, centers_end), (party_get_slot, ":center_relation", "$g_encountered_party", slot_center_player_relation), (store_mul, ":center_relation_penalty", ":center_relation", -3), (val_add, ":penalty_multiplier", ":center_relation_penalty"), (try_begin), (lt, ":center_relation", 0), (store_sub, ":center_penalty_multiplier", 100, ":center_relation"), (val_mul, ":penalty_multiplier", ":center_penalty_multiplier"), (val_div, ":penalty_multiplier", 100), (try_end), (try_end), # Apply penalty if player is on bad terms with the merchant (not currently used) (call_script, "script_troop_get_player_relation", "$g_talk_troop"), (assign, ":troop_reln", reg0), #(troop_get_slot, ":troop_reln", "$g_talk_troop", slot_troop_player_relation), (try_begin), (lt, ":troop_reln", 0), (store_sub, ":troop_reln_dif", 0, ":troop_reln"), (store_mul, ":troop_relation_penalty", ":troop_reln_dif", 20), (val_add, ":penalty_multiplier", ":troop_relation_penalty"), (try_end), (val_mul, ":penalty", ":penalty_multiplier"), (val_div, ":penalty", 1000), (val_max, ":penalty", 1), (assign, reg0, ":penalty"), ]), #script_game_event_buy_item: # This script is called from the game engine when player buys an item. # INPUT: # param1: item_kind_id ("game_event_buy_item", [ (store_script_param_1, ":item_kind_id"), (store_script_param_2, ":reclaim_mode"), (try_begin), (is_between, ":item_kind_id", trade_goods_begin, trade_goods_end), (store_sub, ":item_slot_no", ":item_kind_id", trade_goods_begin), (val_add, ":item_slot_no", slot_town_trade_good_prices_begin), (party_get_slot, ":multiplier", "$g_encountered_party", ":item_slot_no"), (try_begin), (eq, ":reclaim_mode", 0), (val_add, ":multiplier", 10), (else_try), (val_add, ":multiplier", 15), (try_end), (val_min, ":multiplier", maximum_price_factor), (party_set_slot, "$g_encountered_party", ":item_slot_no", ":multiplier"), (try_end), ]), #script_game_event_sell_item: # This script is called from the game engine when player sells an item. # INPUT: # param1: item_kind_id ("game_event_sell_item", [ (store_script_param_1, ":item_kind_id"), (store_script_param_2, ":return_mode"), (try_begin), (is_between, ":item_kind_id", trade_goods_begin, trade_goods_end), (store_sub, ":item_slot_no", ":item_kind_id", trade_goods_begin), (val_add, ":item_slot_no", slot_town_trade_good_prices_begin), (party_get_slot, ":multiplier", "$g_encountered_party", ":item_slot_no"), (try_begin), (eq, ":return_mode", 0), (val_sub, ":multiplier", 15), (else_try), (val_sub, ":multiplier", 10), (try_end), (val_max, ":multiplier", minimum_price_factor), (party_set_slot, "$g_encountered_party", ":item_slot_no", ":multiplier"), (try_end), ]), # script_game_get_troop_wage # This script is called from the game engine for calculating troop wages. # Input: # param1: troop_id, param2: party-id # Output: reg0: weekly wage ("game_get_troop_wage", [ (store_script_param_1, ":troop_id"), (store_script_param_2, ":unused"), #party id (assign,":wage", 0), (try_begin), (this_or_next|eq, ":troop_id", "trp_player"), (eq, ":troop_id", "trp_kidnapped_girl"), (else_try), (is_between, ":troop_id", pretenders_begin, pretenders_end), (else_try), (store_character_level, ":troop_level", ":troop_id"), (assign, ":wage", ":troop_level"), (val_add, ":wage", 3), (val_mul, ":wage", ":wage"), (val_div, ":wage", 25), (try_end), (try_begin), #mounted troops cost 65% more than the normal cost (troop_is_mounted, ":troop_id"), (val_mul, ":wage", 5), (val_div, ":wage", 3), (try_end), (try_begin), #mercenaries cost %50 more than the normal cost (is_between, ":troop_id", mercenary_troops_begin, mercenary_troops_end), (val_mul, ":wage", 3), (val_div, ":wage", 2), (try_end), (try_begin), (is_between, ":troop_id", companions_begin, companions_end), (val_mul, ":wage", 2), (try_end), (store_skill_level, ":leadership_level", "skl_leadership", "trp_player"), (store_mul, ":leadership_bonus", 5, ":leadership_level"), (store_sub, ":leadership_factor", 100, ":leadership_bonus"), (val_mul, ":wage", ":leadership_factor"), #wage = wage * (100 - 5*leadership)/100 (val_div, ":wage", 100), (try_begin), (neq, ":troop_id", "trp_player"), (neq, ":troop_id", "trp_kidnapped_girl"), (neg|is_between, ":troop_id", pretenders_begin, pretenders_end), (val_max, ":wage", 1), (try_end), (assign, reg0, ":wage"), (set_trigger_result, reg0), ]), # script_game_get_total_wage # This script is called from the game engine for calculating total wage of the player party which is shown at the party window. # Input: none # Output: reg0: weekly wage ("game_get_total_wage", [ (assign, ":total_wage", 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"), (party_stack_get_size, ":stack_size", "p_main_party", ":i_stack"), (call_script, "script_game_get_troop_wage", ":stack_troop", 0), (val_mul, reg0, ":stack_size"), (val_add, ":total_wage", reg0), (try_end), ############################## # Changed by Form Ranks kit # (party_get_num_attached_parties, ":array_num", "p_main_party"), (try_for_range, ":side_array", 0, ":array_num"), (party_get_attached_party_with_rank, ":array_party", "p_main_party", ":side_array"), (party_get_num_companion_stacks, ":num_stacks", ":array_party"), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop", ":array_party", ":i_stack"), (party_stack_get_size, ":stack_size", ":array_party", ":i_stack"), (call_script, "script_game_get_troop_wage", ":stack_troop", 0), (val_mul, reg0, ":stack_size"), (val_add, ":total_wage", reg0), (try_end), (try_end), # # Change of Form Ranks kit end ################################ (assign, reg0, ":total_wage"), (set_trigger_result, reg0), ]), # script_game_get_join_cost # This script is called from the game engine for calculating troop join cost. # Input: # param1: troop_id, # Output: reg0: weekly wage ("game_get_join_cost", [ (store_script_param_1, ":troop_id"), (assign,":join_cost", 0), (try_begin), (troop_is_hero, ":troop_id"), (else_try), (store_character_level, ":troop_level", ":troop_id"), (assign, ":join_cost", ":troop_level"), (val_add, ":join_cost", 5), (val_mul, ":join_cost", ":join_cost"), (val_add, ":join_cost", 40), (val_div, ":join_cost", 5), (try_begin), #mounted troops cost %100 more than the normal cost (troop_is_mounted, ":troop_id"), (val_mul, ":join_cost", 2), (try_end), (try_end), (assign, reg0, ":join_cost"), (set_trigger_result, reg0), ]), # script_game_get_prisoner_price # This script is called from the game engine for calculating prisoner price # Input: # param1: troop_id, # Output: reg0 ("game_get_prisoner_price", [ (store_script_param_1, ":troop_id"), (assign, reg0, 50), (try_begin), (is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end), (store_character_level, ":troop_level", ":troop_id"), (assign, ":ransom_amount", ":troop_level"), (val_add, ":ransom_amount", 10), (val_mul, ":ransom_amount", ":ransom_amount"), (val_div, ":ransom_amount", 6), (try_end), (set_trigger_result, reg0), ]), # script_game_check_prisoner_can_be_sold # This script is called from the game engine for checking if a given troop can be sold. # Input: # param1: troop_id, # Output: reg0: 1= can be sold; 0= cannot be sold. ("game_check_prisoner_can_be_sold", [ (store_script_param_1, ":troop_id"), (assign, reg0, 0), (try_begin), (neg|troop_is_hero, ":troop_id"), (assign, reg0, 1), (try_end), (set_trigger_result, reg0), ]), #script_game_event_detect_party: # This script is called from the game engine when player party inspects another party. # INPUT: # param1: Party-id ("game_event_detect_party", [ (store_script_param_1, ":party_id"), (try_begin), (party_slot_eq, ":party_id", slot_party_type, spt_kingdom_hero_party), (party_stack_get_troop_id, ":leader", ":party_id", 0), (is_between, ":leader", kingdom_heroes_begin, kingdom_heroes_end), (call_script, "script_update_troop_location_notes", ":leader", 0), (else_try), (is_between, ":party_id", walled_centers_begin, walled_centers_end), (party_get_num_attached_parties, ":num_attached_parties", ":party_id"), (try_for_range, ":attached_party_rank", 0, ":num_attached_parties"), (party_get_attached_party_with_rank, ":attached_party", ":party_id", ":attached_party_rank"), (party_stack_get_troop_id, ":leader", ":attached_party", 0), (is_between, ":leader", kingdom_heroes_begin, kingdom_heroes_end), (call_script, "script_update_troop_location_notes", ":leader", 0), (try_end), (try_end), ]), #script_game_event_undetect_party: # This script is called from the game engine when player party inspects another party. # INPUT: # param1: Party-id ("game_event_undetect_party", [ (store_script_param_1, ":party_id"), (try_begin), (party_slot_eq, ":party_id", slot_party_type, spt_kingdom_hero_party), (party_stack_get_troop_id, ":leader", ":party_id", 0), (is_between, ":leader", kingdom_heroes_begin, kingdom_heroes_end), (call_script, "script_update_troop_location_notes", ":leader", 0), (try_end), ]), #script_game_get_statistics_line: # This script is called from the game engine when statistics page is opened. # INPUT: # param1: line_no ("game_get_statistics_line", [ (store_script_param_1, ":line_no"), (try_begin), (eq, ":line_no", 0), (get_player_agent_kill_count, reg1), (str_store_string, s1, "str_number_of_troops_killed_reg1"), (set_result_string, s1), (else_try), (eq, ":line_no", 1), (get_player_agent_kill_count, reg1, 1), (str_store_string, s1, "str_number_of_troops_wounded_reg1"), (set_result_string, s1), (else_try), (eq, ":line_no", 2), (get_player_agent_own_troop_kill_count, reg1), (str_store_string, s1, "str_number_of_own_troops_killed_reg1"), (set_result_string, s1), (else_try), (eq, ":line_no", 3), (get_player_agent_own_troop_kill_count, reg1, 1), (str_store_string, s1, "str_number_of_own_troops_wounded_reg1"), (set_result_string, s1), (try_end), ]), #script_game_get_date_text: # This script is called from the game engine when the date needs to be displayed. # INPUT: arg1 = number of days passed since the beginning of the game # OUTPUT: result string = date ("game_get_date_text", [ (store_script_param_2, ":num_hours"), (store_div, ":num_days", ":num_hours", 24), (store_add, ":cur_day", ":num_days", 23), (assign, ":cur_month", 3), (assign, ":cur_year", 1257), (assign, ":try_range", 99999), (try_for_range, ":unused", 0, ":try_range"), (try_begin), (this_or_next|eq, ":cur_month", 1), (this_or_next|eq, ":cur_month", 3), (this_or_next|eq, ":cur_month", 5), (this_or_next|eq, ":cur_month", 7), (this_or_next|eq, ":cur_month", 8), (this_or_next|eq, ":cur_month", 10), (eq, ":cur_month", 12), (assign, ":month_day_limit", 31), (else_try), (this_or_next|eq, ":cur_month", 4), (this_or_next|eq, ":cur_month", 6), (this_or_next|eq, ":cur_month", 9), (eq, ":cur_month", 11), (assign, ":month_day_limit", 30), (else_try), (try_begin), (store_div, ":cur_year_div_4", ":cur_year", 4), (val_mul, ":cur_year_div_4", 4), (eq, ":cur_year_div_4", ":cur_year"), (assign, ":month_day_limit", 29), (else_try), (assign, ":month_day_limit", 28), (try_end), (try_end), (try_begin), (gt, ":cur_day", ":month_day_limit"), (val_sub, ":cur_day", ":month_day_limit"), (val_add, ":cur_month", 1), (try_begin), (gt, ":cur_month", 12), (val_sub, ":cur_month", 12), (val_add, ":cur_year", 1), (try_end), (else_try), (assign, ":try_range", 0), (try_end), (try_end), (assign, reg1, ":cur_day"), (assign, reg2, ":cur_year"), (try_begin), (eq, ":cur_month", 1), (str_store_string, s1, "str_january_reg1_reg2"), (else_try), (eq, ":cur_month", 2), (str_store_string, s1, "str_february_reg1_reg2"), (else_try), (eq, ":cur_month", 3), (str_store_string, s1, "str_march_reg1_reg2"), (else_try), (eq, ":cur_month", 4), (str_store_string, s1, "str_april_reg1_reg2"), (else_try), (eq, ":cur_month", 5), (str_store_string, s1, "str_may_reg1_reg2"), (else_try), (eq, ":cur_month", 6), (str_store_string, s1, "str_june_reg1_reg2"), (else_try), (eq, ":cur_month", 7), (str_store_string, s1, "str_july_reg1_reg2"), (else_try), (eq, ":cur_month", 8), (str_store_string, s1, "str_august_reg1_reg2"), (else_try), (eq, ":cur_month", 9), (str_store_string, s1, "str_september_reg1_reg2"), (else_try), (eq, ":cur_month", 10), (str_store_string, s1, "str_october_reg1_reg2"), (else_try), (eq, ":cur_month", 11), (str_store_string, s1, "str_november_reg1_reg2"), (else_try), (eq, ":cur_month", 12), (str_store_string, s1, "str_december_reg1_reg2"), (try_end), (set_result_string, s1), ]), #script_game_get_money_text: # This script is called from the game engine when an amount of money needs to be displayed. # INPUT: arg1 = amount in units # OUTPUT: result string = money in text ("game_get_money_text", [ (store_script_param_1, ":amount"), (try_begin), (eq, ":amount", 1), (str_store_string, s1, "str_1_denar"), (else_try), (assign, reg1, ":amount"), (str_store_string, s1, "str_reg1_denars"), (try_end), (set_result_string, s1), ]), #script_game_get_party_companion_limit: # This script is called from the game engine when the companion limit is needed for a party. # INPUT: arg1 = none # OUTPUT: reg0 = companion_limit ("game_get_party_companion_limit", [ (assign, ":troop_no", "trp_player"), (assign, ":limit", 10), (store_skill_level, ":skill", "skl_leadership", ":troop_no"), (store_attribute_level, ":charisma", ":troop_no", ca_charisma), (val_mul, ":skill", 5), (val_add, ":limit", ":skill"), (val_add, ":limit", ":charisma"), (troop_get_slot, ":troop_renown", ":troop_no", slot_troop_renown), (store_div, ":renown_bonus", ":troop_renown", 80), # Modified by Form Ranks kit, # to ensure the whole player party (including arrays) dont exceed the original limit (val_add, ":limit", ":renown_bonus"), (assign, reg0, ":limit"), (set_trigger_result, reg0), ]), #script_game_reset_player_party_name: # This script is called from the game engine when the player name is changed. # INPUT: none # OUTPUT: none ("game_reset_player_party_name", [(str_store_troop_name, s5, "trp_player"), (party_set_name, "p_main_party", s5), ]), # script_party_get_ideal_size @used for NPC parties. # Input: arg1 = party_no # Output: reg0: ideal size ("party_get_ideal_size", [ (store_script_param_1, ":party_no"), (assign, ":limit", 30), (try_begin), (party_slot_eq, ":party_no", slot_party_type, spt_kingdom_hero_party), (party_stack_get_troop_id, ":party_leader", ":party_no", 0), (store_faction_of_party, ":faction_id", ":party_no"), (assign, ":limit", 10), (store_skill_level, ":skill", "skl_leadership", ":party_leader"), (store_attribute_level, ":charisma", ":party_leader", ca_charisma), (val_mul, ":skill", 5), (val_add, ":limit", ":skill"), (val_add, ":limit", ":charisma"), (troop_get_slot, ":troop_renown", ":party_leader", slot_troop_renown), (store_div, ":renown_bonus", ":troop_renown", 25), (val_add, ":limit", ":renown_bonus"), (try_begin), (faction_slot_eq, ":faction_id", slot_faction_leader, ":party_leader"), (val_add, ":limit", 100), (try_end), (try_end), (store_character_level, ":level", "trp_player"), #increase limits a little bit as the game progresses. (store_add, ":level_factor", 90, ":level"), (val_mul, ":limit", ":level_factor"), (val_div, ":limit", 90), (assign, reg0, ":limit"), ]), #script_game_get_party_prisoner_limit: # This script is called from the game engine when the prisoner limit is needed for a party. # INPUT: arg1 = party_no # OUTPUT: reg0 = prisoner_limit ("game_get_party_prisoner_limit", [ # (store_script_param_1, ":party_no"), (assign, ":troop_no", "trp_player"), (assign, ":limit", 0), (store_skill_level, ":skill", "skl_prisoner_management", ":troop_no"), (store_mul, ":limit", ":skill", 5), (assign, reg0, ":limit"), (set_trigger_result, reg0), ]), #script_game_get_item_extra_text: # This script is called from the game engine when an item's properties are displayed. # INPUT: arg1 = item_no, arg2 = extra_text_id (this can be between 0-7 (7 included)), arg3 = item_modifier # OUTPUT: result_string = item extra text, trigger_result = text color (0 for default) ("game_get_item_extra_text", [ (store_script_param, ":item_no", 1), (store_script_param, ":extra_text_id", 2), (store_script_param, ":item_modifier", 3), (try_begin), (is_between, ":item_no", food_begin, food_end), (try_begin), (eq, ":extra_text_id", 0), (assign, ":continue", 1), (try_begin), (eq, ":item_no", "itm_cattle_meat"), (eq, ":item_modifier", imod_rotten), (assign, ":continue", 0), (try_end), (eq, ":continue", 1), (item_get_slot, ":food_bonus", ":item_no", slot_item_food_bonus), (assign, reg1, ":food_bonus"), (set_result_string, "@+{reg1} to party morale"), (set_trigger_result, 0x4444FF), (try_end), (else_try), (is_between, ":item_no", readable_books_begin, readable_books_end), (try_begin), (eq, ":extra_text_id", 0), (item_get_slot, reg1, ":item_no", slot_item_intelligence_requirement), (set_result_string, "@Requires {reg1} intelligence to read"), (set_trigger_result, 0xFFEEDD), (else_try), (eq, ":extra_text_id", 1), (item_get_slot, ":progress", ":item_no", slot_item_book_reading_progress), (val_div, ":progress", 10), (assign, reg1, ":progress"), (set_result_string, "@Reading Progress: {reg1}%"), (set_trigger_result, 0xFFEEDD), (try_end), (else_try), (is_between, ":item_no", reference_books_begin, reference_books_end), (try_begin), (eq, ":extra_text_id", 0), (try_begin), (eq, ":item_no", "itm_book_wound_treatment_reference"), (str_store_string, s1, "@wound treament"), (else_try), (eq, ":item_no", "itm_book_training_reference"), (str_store_string, s1, "@trainer"), (else_try), (eq, ":item_no", "itm_book_surgery_reference"), (str_store_string, s1, "@surgery"), (try_end), (set_result_string, "@+1 to {s1} while in inventory"), (set_trigger_result, 0xFFEEDD), (try_end), (try_end), ]), #script_game_on_disembark: # This script is called from the game engine when the player reaches the shore with a ship. # INPUT: pos0 = disembark position # OUTPUT: none ("game_on_disembark", [(jump_to_menu, "mnu_disembark"), ]), #script_game_context_menu_get_buttons: # This script is called from the game engine when the player clicks the right mouse button over a party on the map. # INPUT: arg1 = party_no # OUTPUT: none, fills the menu buttons ("game_context_menu_get_buttons", [(store_script_param, ":party_no", 1), (try_begin), (neq, ":party_no", "p_main_party"), (context_menu_add_item, "@Move here", cmenu_move), (try_end), (try_begin), (is_between, ":party_no", centers_begin, centers_end), (context_menu_add_item, "@View notes", 1), (else_try), (party_get_num_companion_stacks, ":num_stacks", ":party_no"), (gt, ":num_stacks", 0), (party_stack_get_troop_id, ":troop_no", ":party_no", 0), (is_between, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (context_menu_add_item, "@View notes", 2), (try_end), ]), #script_game_event_context_menu_button_clicked: # This script is called from the game engine when the player clicks on a button at the right mouse menu. # INPUT: arg1 = party_no, arg2 = button_value # OUTPUT: none ("game_event_context_menu_button_clicked", [(store_script_param, ":party_no", 1), (store_script_param, ":button_value", 2), (try_begin), (eq, ":button_value", 1), (change_screen_notes, 3, ":party_no"), (else_try), (eq, ":button_value", 2), (party_stack_get_troop_id, ":troop_no", ":party_no", 0), (change_screen_notes, 1, ":troop_no"), (try_end), ]), #script_game_get_skill_modifier_for_troop # This script is called from the game engine when a skill's modifiers are needed # INPUT: arg1 = troop_no, arg2 = skill_no # OUTPUT: trigger_result = modifier_value ("game_get_skill_modifier_for_troop", [(store_script_param, ":troop_no", 1), (store_script_param, ":skill_no", 2), (assign, ":modifier_value", 0), (try_begin), (eq, ":skill_no", "skl_wound_treatment"), (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_wound_treatment_reference"), (gt, reg0, 0), (val_add, ":modifier_value", 1), (else_try), (eq, ":skill_no", "skl_trainer"), (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_training_reference"), (gt, reg0, 0), (val_add, ":modifier_value", 1), (else_try), (eq, ":skill_no", "skl_surgery"), (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_surgery_reference"), (gt, reg0, 0), (val_add, ":modifier_value", 1), (try_end), (set_trigger_result, ":modifier_value"), ]), # Note to modders: Uncomment these if you'd like to use the following. ## #script_game_check_party_sees_party ## # This script is called from the game engine when a party is inside the range of another party ## # INPUT: arg1 = party_no_seer, arg2 = party_no_seen ## # OUTPUT: trigger_result = true or false (1 = true, 0 = false) ## ("game_check_party_sees_party", ## [ ## (store_script_param, ":party_no_seer", 1), ## (store_script_param, ":party_no_seen", 2), ## (set_trigger_result, 1), ## ]), ## ## #script_game_get_party_speed_multiplier ## # This script is called from the game engine when a skill's modifiers are needed ## # INPUT: arg1 = party_no ## # OUTPUT: trigger_result = multiplier (scaled by 100, meaning that giving 100 as the trigger result does not change the party speed) ## ("game_get_party_speed_multiplier", ## [ ## (store_script_param, ":party_no", 1), ## (set_trigger_result, 100), ## ]), # script_npc_get_troop_wage # This script is called from module system to calculate troop wages for npc parties. # Input: # param1: troop_id # Output: reg0: weekly wage ("npc_get_troop_wage", [ (store_script_param_1, ":troop_id"), (assign,":wage", 0), (try_begin), (troop_is_hero, ":troop_id"), (else_try), (store_character_level, ":wage", ":troop_id"), (val_mul, ":wage", ":wage"), (val_add, ":wage", 50), (val_div, ":wage", 30), (troop_is_mounted, ":troop_id"), (val_mul, ":wage", 5), (val_div, ":wage", 4), (try_end), (assign, reg0, ":wage"), ]), #script_setup_talk_info # INPUT: $g_talk_troop, $g_talk_troop_relation ("setup_talk_info", [ (talk_info_set_relation_bar, "$g_talk_troop_relation"), (str_store_troop_name, s61, "$g_talk_troop"), (str_store_string, s61, "@ {s61}"), (assign, reg1, "$g_talk_troop_relation"), (str_store_string, s62, "str_relation_reg1"), (talk_info_set_line, 0, s61), (talk_info_set_line, 1, s62), (call_script, "script_describe_relation_to_s63", "$g_talk_troop_relation"), (talk_info_set_line, 3, s63), ]), #NPC companion changes begin #script_setup_talk_info_companions ("setup_talk_info_companions", [ (call_script, "script_npc_morale", "$g_talk_troop"), (assign, ":troop_morale", reg0), (talk_info_set_relation_bar, ":troop_morale"), (str_store_troop_name, s61, "$g_talk_troop"), (str_store_string, s61, "@ {s61}"), (assign, reg1, ":troop_morale"), (str_store_string, s62, "str_morale_reg1"), (talk_info_set_line, 0, s61), (talk_info_set_line, 1, s62), (talk_info_set_line, 3, s63), ]), #NPC companion changes end #script_update_party_creation_random_limits # INPUT: none ("update_party_creation_random_limits", [ (store_character_level, ":player_level", "trp_player"), (store_mul, ":upper_limit", ":player_level", 3), (val_add, ":upper_limit", 25), (val_min, ":upper_limit", 100), (set_party_creation_random_limits, 0, ":upper_limit"), (assign, reg0, ":upper_limit"), ]), #script_set_trade_route_between_centers # INPUT: # param1: center_no_1 # param1: center_no_2 ("set_trade_route_between_centers", [(store_script_param, ":center_no_1", 1), (store_script_param, ":center_no_2", 2), (assign, ":center_1_added", 0), (assign, ":center_2_added", 0), (try_for_range, ":cur_slot", slot_town_trade_routes_begin, slot_town_trade_routes_end), (try_begin), (eq, ":center_1_added", 0), (party_slot_eq, ":center_no_1", ":cur_slot", 0), (party_set_slot, ":center_no_1", ":cur_slot", ":center_no_2"), (assign, ":center_1_added", 1), (try_end), (try_begin), (eq, ":center_2_added", 0), (party_slot_eq, ":center_no_2", ":cur_slot", 0), (party_set_slot, ":center_no_2", ":cur_slot", ":center_no_1"), (assign, ":center_2_added", 1), (try_end), (try_end), (try_begin), (eq, ":center_1_added", 0), (str_store_party_name, s1, ":center_no_1"), (display_message, "@ERROR: More than 15 trade routes are given for {s1}."), (try_end), (try_begin), (eq, ":center_2_added", 0), (str_store_party_name, s1, ":center_no_2"), (display_message, "@ERROR: More than 15 trade routes are given for {s1}."), (try_end), ]), #script_center_change_trade_good_production # INPUT: # param1: center_no # param2: item_id # param3: production_rate (should be between -100 (for net consumption) and 100 (for net production) # param4: randomness (between 0-100) ("center_change_trade_good_production", [ (store_script_param, ":center_no", 1), (store_script_param, ":item_no", 2), (store_script_param, ":production_rate", 3), # (val_mul, ":production_rate", 5), (store_script_param, ":randomness", 4), (store_random_in_range, ":random_num", 0, ":randomness"), (store_random_in_range, ":random_sign", 0, 2), (try_begin), (eq, ":random_sign", 0), (val_add, ":production_rate", ":random_num"), (else_try), (val_sub, ":production_rate", ":random_num"), (try_end), (val_sub, ":item_no", trade_goods_begin), (val_add, ":item_no", slot_town_trade_good_productions_begin), (party_get_slot, ":old_production_rate", ":center_no", ":item_no"), (val_add, ":production_rate", ":old_production_rate"), (party_set_slot, ":center_no", ":item_no", ":production_rate"), ]), #script_average_trade_good_productions # INPUT: none ("average_trade_good_productions", [ (store_sub, ":item_to_slot", slot_town_trade_good_productions_begin, trade_goods_begin), # (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin), (try_for_range, ":center_no", towns_begin, towns_end), (this_or_next|is_between, ":center_no", towns_begin, towns_end), (is_between, ":center_no", villages_begin, villages_end), (try_for_range, ":other_center", centers_begin, centers_end), (this_or_next|is_between, ":center_no", towns_begin, towns_end), (is_between, ":center_no", villages_begin, villages_end), (neq, ":other_center", ":center_no"), (store_distance_to_party_from_party, ":cur_distance", ":center_no", ":other_center"), (lt, ":cur_distance", 110), (store_sub, ":dist_factor", 110, ":cur_distance"), (try_for_range, ":cur_good", trade_goods_begin, trade_goods_end), (store_add, ":cur_good_slot", ":cur_good", ":item_to_slot"), (party_get_slot, ":center_production", ":center_no", ":cur_good_slot"), (party_get_slot, ":other_center_production", ":other_center", ":cur_good_slot"), (store_sub, ":prod_dif", ":center_production", ":other_center_production"), (gt, ":prod_dif", 0), (store_mul, ":prod_dif_change", ":prod_dif", 1), ## (try_begin), ## (is_between, ":center_no", towns_begin, towns_end), ## (is_between, ":other_center", towns_begin, towns_end), ## (val_mul, ":cur_distance", 2), ## (try_end), (val_mul ,":prod_dif_change", ":dist_factor"), (val_div ,":prod_dif_change", 110), (val_add, ":other_center_production", ":prod_dif_change"), (party_set_slot, ":other_center", ":cur_good_slot", ":other_center_production"), (try_end), (try_end), (try_end), ]), #script_normalize_trade_good_productions # INPUT: none ("normalize_trade_good_productions", [ (store_sub, ":item_to_slot", slot_town_trade_good_productions_begin, trade_goods_begin), (try_for_range, ":cur_good", trade_goods_begin, trade_goods_end), (assign, ":total_production", 0), (assign, ":num_centers", 0), (store_add, ":cur_good_slot", ":cur_good", ":item_to_slot"), (try_for_range, ":center_no", centers_begin, centers_end), (val_add, ":num_centers", 1), (try_begin), (is_between, ":center_no", towns_begin, towns_end), #each town is weighted as 5 villages... (val_add, ":num_centers", 4), (try_end), (party_get_slot, ":center_production", ":center_no", ":cur_good_slot"), (val_add, ":total_production", ":center_production"), (try_end), (store_div, ":new_production_difference", ":total_production", ":num_centers"), (neq, ":new_production_difference", 0), (try_for_range, ":center_no", centers_begin, centers_end), (this_or_next|is_between, ":center_no", towns_begin, towns_end), (is_between, ":center_no", villages_begin, villages_end), (party_get_slot, ":center_production", ":center_no", ":cur_good_slot"), (val_sub, ":center_production", ":new_production_difference"), (party_set_slot, ":center_no", ":cur_good_slot", ":center_production"), (try_end), (try_end), ]), #script_update_trade_good_prices # INPUT: none ("update_trade_good_prices", [ (try_for_range, ":center_no", centers_begin, centers_end), (this_or_next|is_between, ":center_no", towns_begin, towns_end), (is_between, ":center_no", villages_begin, villages_end), (call_script, "script_update_trade_good_price_for_party", ":center_no"), (try_end), # (call_script, "script_update_trade_good_price_for_party", "p_zendar"), # (call_script, "script_update_trade_good_price_for_party", "p_salt_mine"), # (call_script, "script_update_trade_good_price_for_party", "p_four_ways_inn"), ]), #script_update_trade_good_price_for_party # INPUT: arg1 = party_no ("update_trade_good_price_for_party", [ (store_script_param, ":center_no", 1), (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), (store_sub, ":cur_good_price_slot", ":cur_good", trade_goods_begin), (val_add, ":cur_good_price_slot", slot_town_trade_good_prices_begin), (party_get_slot, ":production", ":center_no", ":cur_good_slot"), (party_get_slot, ":cur_price", ":center_no", ":cur_good_price_slot"), (try_begin), (lt, ":production", 0), #demand is greater than supply (store_mul, ":change_factor", ":production", -3), #price will be increased by his factor (else_try), (store_mul, ":change_factor", ":production", 3), #price will be decreased by this factor (try_end), # (val_mul, ":change_factor", 2), (store_random_in_range, ":random_change", 0, ":change_factor"), (try_begin), (lt, ":production", 0), #demand is greater than supply (val_add, ":cur_price", ":random_change"), (else_try), (val_sub, ":cur_price", ":random_change"), (try_end), #Move price towards average by 2%... (store_sub, ":price_difference", ":cur_price", average_price_factor), (val_mul, ":price_difference", 97), (val_div, ":price_difference", 100), (store_add, ":new_price", average_price_factor, ":price_difference"), (val_clamp, ":new_price", minimum_price_factor, maximum_price_factor), (party_set_slot, ":center_no", ":cur_good_price_slot", ":new_price"), (try_end), ]), #script_do_merchant_town_trade # INPUT: arg1 = party_no (of the merchant), arg2 = center_no ("do_merchant_town_trade", [ (store_script_param_1, ":party_no"), (store_script_param_2, ":center_no"), (call_script, "script_do_party_center_trade", ":party_no", ":center_no", 20), #change prices by 20% (assign, ":total_change", reg0), #Adding the earnings to the wealth (maximum changed price is the earning) (val_div, ":total_change", 2), (str_store_party_name, s1, ":party_no"), (str_store_party_name, s2, ":center_no"), (assign, reg1, ":total_change"), ## (try_begin), ## (eq, "$cheat_mode", 1), ## (display_message, "@Merchant {s1} traded with {s2} and earned {reg1} denars."), ## (try_end), #Adding tax revenue to the center (party_get_slot, ":accumulated_tariffs", ":center_no", slot_center_accumulated_tariffs), (party_get_slot, ":prosperity", ":center_no", slot_town_prosperity), (store_add, ":tax_gain", ":prosperity", 10), (val_mul, ":tax_gain", ":total_change"), (val_div, ":tax_gain", 2200), #(10 + prosperity) / 110 * 5% of the merchant's revenue. (val_add, ":accumulated_tariffs", ":tax_gain"), (party_set_slot, ":center_no", slot_center_accumulated_tariffs, ":accumulated_tariffs"), # (try_begin), # (is_between, ":center_no", towns_begin, towns_end), # (party_get_slot, ":merchant",":center_no",slot_town_merchant), # (gt, ":merchant", 0), # (store_mul, ":merchant_profit", ":total_change", 1), # (val_div, ":merchant_profit", 2), # (troop_add_gold, ":merchant", ":merchant_profit"), # (try_end), #Adding 1 to center prosperity (try_begin), (store_random_in_range, ":rand", 0, 100), (lt, ":rand", 35), (call_script, "script_change_center_prosperity", ":center_no", 1), (try_end), ]), #script_party_calculate_regular_strength: # INPUT: # param1: Party-id ("party_calculate_regular_strength", [ (store_script_param_1, ":party"), #Party_id (assign, reg(0),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"), (neg|troop_is_hero, ":stack_troop"), (store_character_level, ":stack_strength", ":stack_troop"), (val_add, ":stack_strength", 12), (val_mul, ":stack_strength", ":stack_strength"), (val_div, ":stack_strength", 100), (party_stack_get_size, ":stack_size",":party",":i_stack"), (party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"), (val_sub, ":stack_size", ":num_wounded"), (val_mul, ":stack_strength", ":stack_size"), (val_add,reg(0), ":stack_strength"), (try_end), ]), #script_party_calculate_strength: # INPUT: arg1 = party_id, arg2 = exclude leader # OUTPUT: reg0 = strength ("party_calculate_strength", [ (store_script_param_1, ":party"), #Party_id (store_script_param_2, ":exclude_leader"), #Party_id (assign, reg(0),0), (party_get_num_companion_stacks, ":num_stacks",":party"), (assign, ":first_stack", 0), (try_begin), (neq, ":exclude_leader", 0), (assign, ":first_stack", 1), (try_end), (try_for_range, ":i_stack", ":first_stack", ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":party",":i_stack"), (store_character_level, ":stack_strength", ":stack_troop"), (val_add, ":stack_strength", 12), (val_mul, ":stack_strength", ":stack_strength"), (val_div, ":stack_strength", 100), (try_begin), (neg|troop_is_hero, ":stack_troop"), (party_stack_get_size, ":stack_size",":party",":i_stack"), (party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"), (val_sub, ":stack_size", ":num_wounded"), (val_mul, ":stack_strength", ":stack_size"), (else_try), (troop_is_wounded, ":stack_troop"), #hero... (assign,":stack_strength",0), (try_end), (val_add,reg(0), ":stack_strength"), (try_end), (party_set_slot, ":party", slot_party_cached_strength, reg(0)), ]), #script_loot_player_items: # INPUT: arg1 = enemy_party_no # Output: none ("loot_player_items", [ (store_script_param, ":enemy_party_no", 1), (troop_get_inventory_capacity, ":inv_cap", "trp_player"), (try_for_range, ":i_slot", 0, ":inv_cap"), (troop_get_inventory_slot, ":item_id", "trp_player", ":i_slot"), (ge, ":item_id", 0), (troop_get_inventory_slot_modifier, ":item_modifier", "trp_player", ":i_slot"), (try_begin), (is_between, ":item_id", trade_goods_begin, trade_goods_end), (assign, ":randomness", 20), (else_try), (is_between, ":item_id", horses_begin, horses_end), (assign, ":randomness", 15), (else_try), (this_or_next|is_between, ":item_id", weapons_begin, weapons_end), (is_between, ":item_id", ranged_weapons_begin, ranged_weapons_end), (assign, ":randomness", 5), (else_try), (this_or_next|is_between, ":item_id", armors_begin, armors_end), (is_between, ":item_id", shields_begin, shields_end), (assign, ":randomness", 5), (try_end), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", ":randomness"), (troop_remove_item, "trp_player", ":item_id"), (try_begin), (gt, ":enemy_party_no", 0), (party_get_slot, ":cur_loot_slot", ":enemy_party_no", slot_party_next_looted_item_slot), (val_add, ":cur_loot_slot", slot_party_looted_item_1), (party_set_slot, ":enemy_party_no", ":cur_loot_slot", ":item_id"), (val_sub, ":cur_loot_slot", slot_party_looted_item_1), (val_add, ":cur_loot_slot", slot_party_looted_item_1_modifier), (party_set_slot, ":enemy_party_no", ":cur_loot_slot", ":item_modifier"), (val_sub, ":cur_loot_slot", slot_party_looted_item_1_modifier), (val_add, ":cur_loot_slot", 1), (val_mod, ":cur_loot_slot", num_party_loot_slots), (party_set_slot, ":enemy_party_no", slot_party_next_looted_item_slot, ":cur_loot_slot"), (try_end), (try_end), (store_troop_gold, ":cur_gold", "trp_player"), (store_div, ":max_lost", ":cur_gold", 4), (store_div, ":min_lost", ":cur_gold", 10), (store_random_in_range, ":lost_gold", ":min_lost", ":max_lost"), (troop_remove_gold, "trp_player", ":lost_gold"), ]), #script_party_calculate_loot: # INPUT: # param1: Party-id # Returns num looted items in reg(0) ("party_calculate_loot", [ (store_script_param_1, ":enemy_party"), #Enemy Party_id (call_script, "script_calculate_main_party_shares"), (assign, ":num_player_party_shares", reg0), # (assign, ":num_ally_shares", reg1), # (store_add, ":num_shares", ":num_player_party_shares", ":num_ally_shares"), #Calculate player loot probability # (assign, ":loot_probability", 100), # (val_mul, ":loot_probability", 10), # (val_div, ":loot_probability", ":num_shares"), (try_for_range, ":i_loot", 0, num_party_loot_slots), (store_add, ":cur_loot_slot", ":i_loot", slot_party_looted_item_1), (party_get_slot, ":item_no", "$g_enemy_party", ":cur_loot_slot"), (gt, ":item_no", 0), (party_set_slot, "$g_enemy_party", ":cur_loot_slot", 0), (val_sub, ":cur_loot_slot", slot_party_looted_item_1), (val_add, ":cur_loot_slot", slot_party_looted_item_1_modifier), (party_get_slot, ":item_modifier", "$g_enemy_party", ":cur_loot_slot"), (troop_add_item, "trp_temp_troop", ":item_no", ":item_modifier"), (try_end), (party_set_slot, "$g_enemy_party", slot_party_next_looted_item_slot, 0), (assign, ":num_looted_items",0), (try_begin), (this_or_next|party_slot_eq, "$g_enemy_party", slot_party_type, spt_kingdom_caravan), (party_slot_eq, "$g_enemy_party", slot_party_type, spt_village_farmer), (store_mul, ":plunder_amount", player_loot_share, 30), (val_mul, ":plunder_amount", "$g_strength_contribution_of_player"), (val_div, ":plunder_amount", 100), (val_div, ":plunder_amount", ":num_player_party_shares"), (try_begin), (party_slot_eq, "$g_enemy_party", slot_party_type, spt_kingdom_caravan), # (val_clamp, ":plunder_amount", 1, 50), (reset_item_probabilities, 100), (assign, ":range_min", trade_goods_begin), (assign, ":range_max", trade_goods_end), (else_try), (val_div, ":plunder_amount", 5), # (val_clamp, ":plunder_amount", 1, 10), (reset_item_probabilities, 1), (assign, ":range_min", food_begin), (assign, ":range_max", food_end), (try_end), (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin), (try_for_range, ":cur_goods", ":range_min", ":range_max"), (store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"), (party_get_slot, ":cur_price", "$g_enemy_party", ":cur_price_slot"), (assign, ":cur_probability", 100), (val_mul, ":cur_probability", average_price_factor), (val_div, ":cur_probability", ":cur_price"), (val_mul, ":cur_probability", average_price_factor), (val_div, ":cur_probability", ":cur_price"), (val_mul, ":cur_probability", average_price_factor), (val_div, ":cur_probability", ":cur_price"), (assign, reg0, ":cur_probability"), (set_item_probability_in_merchandise, ":cur_goods", ":cur_probability"), (try_end), (troop_add_merchandise, "trp_temp_troop", itp_type_goods, ":plunder_amount"), (assign, reg5, ":plunder_amount"), (val_add, ":num_looted_items", ":plunder_amount"), (try_end), #Now loot the defeated party (store_mul, ":loot_probability", player_loot_share, 3), (val_mul, ":loot_probability", "$g_strength_contribution_of_player"), (party_get_skill_level, ":player_party_looting", "p_main_party", "skl_looting"), (val_add, ":player_party_looting", 10), (val_mul, ":loot_probability", ":player_party_looting"), (val_div, ":loot_probability", 10), (val_div, ":loot_probability", ":num_player_party_shares"), (party_get_num_companion_stacks, ":num_stacks",":enemy_party"), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":enemy_party",":i_stack"), (neg|troop_is_hero, ":stack_troop"), (party_stack_get_size, ":stack_size",":enemy_party",":i_stack"), (try_for_range, ":unused", 0, ":stack_size"), (troop_loot_troop,"trp_temp_troop",":stack_troop",":loot_probability"), (try_end), (try_end), (troop_get_inventory_capacity, ":inv_cap", "trp_temp_troop"), (try_for_range, ":i_slot", 0, ":inv_cap"), (troop_get_inventory_slot, ":item_id", "trp_temp_troop", ":i_slot"), (ge, ":item_id", 0), (val_add, ":num_looted_items",1), (try_end), (assign, reg0, ":num_looted_items"), ]), #script_calculate_main_party_shares: # INPUT: # Returns number of player party shares in reg0 ("calculate_main_party_shares", [ (assign, ":num_player_party_shares",player_loot_share), # Add shares for player's party (party_get_num_companion_stacks, ":num_stacks","p_main_party"), (try_for_range, ":i_stack", 1, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"), (try_begin), (neg|troop_is_hero, ":stack_troop"), (party_stack_get_size, ":stack_size","p_main_party",":i_stack"), (val_add, ":num_player_party_shares", ":stack_size"), (else_try), (val_add, ":num_player_party_shares", hero_loot_share), (try_end), (try_end), (assign, reg0, ":num_player_party_shares"), ]), #script_party_give_xp_and_gold: # INPUT: # param1: destroyed Party-id # calculates and gives player paty's share of gold and xp. ("party_give_xp_and_gold", [ (store_script_param_1, ":enemy_party"), #Party_id (call_script, "script_calculate_main_party_shares"), (assign, ":num_player_party_shares", reg0), # (assign, ":num_ally_shares", reg1), # (store_add, ":num_total_shares", ":num_player_party_shares", ":num_ally_shares"), (assign, ":total_gain", 0), (party_get_num_companion_stacks, ":num_stacks",":enemy_party"), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":enemy_party",":i_stack"), (neg|troop_is_hero, ":stack_troop"), (party_stack_get_size, ":stack_size",":enemy_party",":i_stack"), (store_character_level, ":level", ":stack_troop"), (store_add, ":gain", ":level", 10), (val_mul, ":gain", ":gain"), (val_div, ":gain", 10), (store_mul, ":stack_gain", ":gain", ":stack_size"), (val_add, ":total_gain", ":stack_gain"), (try_end), (val_mul, ":total_gain", "$g_strength_contribution_of_player"), (val_div, ":total_gain", 100), (val_min, ":total_gain", 40000), #eliminate negative results # (store_mul, ":player_party_xp_gain", ":total_gain", ":num_player_party_shares"), # (val_div, ":player_party_xp_gain", ":num_total_shares"), (assign, ":player_party_xp_gain", ":total_gain"), (store_random_in_range, ":r", 50, 100), (val_mul, ":player_party_xp_gain", ":r"), (val_div, ":player_party_xp_gain", 100), (party_add_xp, "p_main_party", ":player_party_xp_gain"), (store_mul, ":player_gold_gain", ":total_gain", player_loot_share), (val_min, ":player_gold_gain", 60000), #eliminate negative results (store_random_in_range, ":r", 50, 100), (val_mul, ":player_gold_gain", ":r"), (val_div, ":player_gold_gain", 100), (val_div, ":player_gold_gain", ":num_player_party_shares"), #add gold now (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"), (try_begin), (troop_is_hero, ":stack_troop"), (call_script, "script_troop_add_gold", ":stack_troop", ":player_gold_gain"), (try_end), (try_end), #Add morale (assign, ":morale_gain", ":total_gain"), (val_div, ":morale_gain", ":num_player_party_shares"), (call_script, "script_change_player_party_morale", ":morale_gain"), ]), #script_setup_troop_meeting: # INPUT: # param1: troop_id with which meeting will be made. # param2: troop_dna (optional) ("setup_troop_meeting", [ (store_script_param_1, ":meeting_troop"), (store_script_param_2, ":troop_dna"), (modify_visitors_at_site,"scn_conversation_scene"),(reset_visitors), (set_visitor,0,"trp_player"), # (party_stack_get_troop_dna,":troop_dna",":meeting_party",0), (set_visitor,17,":meeting_troop",":troop_dna"), (set_jump_mission,"mt_conversation_encounter"), (jump_to_scene,"scn_conversation_scene"), (change_screen_map_conversation, ":meeting_troop"), ]), #script_setup_party_meeting: # INPUT: # param1: Party-id with which meeting will be made. ("setup_party_meeting", [ (store_script_param_1, ":meeting_party"), (try_begin), (lt, "$g_encountered_party_relation", 0), #hostile # (call_script, "script_music_set_situation_with_culture", mtf_sit_encounter_hostile), (try_end), (modify_visitors_at_site,"scn_conversation_scene"),(reset_visitors), (set_visitor,0,"trp_player"), (party_stack_get_troop_id, ":meeting_troop",":meeting_party",0), (party_stack_get_troop_dna,":troop_dna",":meeting_party",0), (set_visitor,17,":meeting_troop",":troop_dna"), (set_jump_mission,"mt_conversation_encounter"), (jump_to_scene,"scn_conversation_scene"), (change_screen_map_conversation, ":meeting_troop"), ]), #script_party_remove_all_companions: # INPUT: # param1: Party-id from which companions will be removed. # "$g_move_heroes" : controls if heroes will also be removed. ("party_remove_all_companions", [ (store_script_param_1, ":party"), #Source Party_id (party_get_num_companion_stacks, ":num_companion_stacks",":party"), (try_for_range_backwards, ":stack_no", 0, ":num_companion_stacks"), (party_stack_get_troop_id, ":stack_troop",":party",":stack_no"), (this_or_next|neg|troop_is_hero, ":stack_troop"), (eq, "$g_move_heroes", 1), (party_stack_get_size, ":stack_size",":party",":stack_no"), (party_remove_members, ":party", ":stack_troop", ":stack_size"), (try_end), ]), #script_party_remove_all_prisoners: # INPUT: # param1: Party-id from which prisoners will be removed. # "$g_move_heroes" : controls if heroes will also be removed. ("party_remove_all_prisoners", [ (store_script_param_1, ":party"), #Source Party_id (party_get_num_prisoner_stacks, ":num_prisoner_stacks",":party"), (try_for_range_backwards, ":stack_no", 0, ":num_prisoner_stacks"), (party_prisoner_stack_get_troop_id, ":stack_troop",":party",":stack_no"), (this_or_next|neg|troop_is_hero, ":stack_troop"), (eq, "$g_move_heroes", 1), (party_prisoner_stack_get_size, ":stack_size",":party",":stack_no"), (party_remove_prisoners, ":party", ":stack_troop", ":stack_size"), (try_end), ]), #script_party_add_party_companions: # INPUT: # param1: Party-id to add the second part # param2: Party-id which will be added to the first one. # "$g_move_heroes" : controls if heroes will also be added. ("party_add_party_companions", [ (store_script_param_1, ":target_party"), #Target Party_id (store_script_param_2, ":source_party"), #Source Party_id (party_get_num_companion_stacks, ":num_stacks",":source_party"), (try_for_range, ":stack_no", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":source_party",":stack_no"), (this_or_next|neg|troop_is_hero, ":stack_troop"), (eq, "$g_move_heroes", 1), (party_stack_get_size, ":stack_size",":source_party",":stack_no"), (party_add_members, ":target_party", ":stack_troop", ":stack_size"), (party_stack_get_num_wounded, ":num_wounded", ":source_party", ":stack_no"), (party_wound_members, ":target_party", ":stack_troop", ":num_wounded"), (try_end), ]), #script_party_add_party_prisoners: # INPUT: # param1: Party-id to add the second party # param2: Party-id which will be added to the first one. # "$g_move_heroes" : controls if heroes will also be added. ("party_add_party_prisoners", [ (store_script_param_1, ":target_party"), #Target Party_id (store_script_param_2, ":source_party"), #Source Party_id (party_get_num_prisoner_stacks, ":num_stacks",":source_party"), (try_for_range, ":stack_no", 0, ":num_stacks"), (party_prisoner_stack_get_troop_id, ":stack_troop",":source_party",":stack_no"), (this_or_next|neg|troop_is_hero, ":stack_troop"), (eq, "$g_move_heroes", 1), (party_prisoner_stack_get_size, ":stack_size",":source_party",":stack_no"), (party_add_members, ":target_party", ":stack_troop", ":stack_size"), (try_end), ]), #script_party_prisoners_add_party_companions: # INPUT: # param1: Party-id to add the second part # param2: Party-id which will be added to the first one. # "$g_move_heroes" : controls if heroes will also be added. ("party_prisoners_add_party_companions", [ (store_script_param_1, ":target_party"), #Target Party_id (store_script_param_2, ":source_party"), #Source Party_id (party_get_num_companion_stacks, ":num_stacks",":source_party"), (try_for_range, ":stack_no", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":source_party",":stack_no"), (this_or_next|neg|troop_is_hero, ":stack_troop"), (eq, "$g_move_heroes", 1), (party_stack_get_size, ":stack_size",":source_party",":stack_no"), (party_add_prisoners, ":target_party", ":stack_troop", ":stack_size"), (try_end), ]), #script_party_prisoners_add_party_prisoners: # INPUT: # param1: Party-id to add the second part # param2: Party-id which will be added to the first one. # "$g_move_heroes" : controls if heroes will also be added. ("party_prisoners_add_party_prisoners", [ (store_script_param_1, ":target_party"), #Target Party_id (store_script_param_2, ":source_party"), #Source Party_id (party_get_num_prisoner_stacks, ":num_stacks",":source_party"), (try_for_range, ":stack_no", 0, ":num_stacks"), (party_prisoner_stack_get_troop_id, ":stack_troop",":source_party",":stack_no"), (this_or_next|neg|troop_is_hero, ":stack_troop"), (eq, "$g_move_heroes", 1), (party_prisoner_stack_get_size, ":stack_size",":source_party",":stack_no"), (party_add_prisoners, ":target_party", ":stack_troop", ":stack_size"), (try_end), ]), # script_party_add_party: # INPUT: # param1: Party-id to add the second part # param2: Party-id which will be added to the first one. # "$g_move_heroes" : controls if heroes will also be added. ("party_add_party", [ (store_script_param_1, ":target_party"), #Target Party_id (store_script_param_2, ":source_party"), #Source Party_id (call_script, "script_party_add_party_companions", ":target_party", ":source_party"), (call_script, "script_party_prisoners_add_party_prisoners", ":target_party", ":source_party"), ]), #script_party_copy: # INPUT: # param1: Party-id to copy the second party # param2: Party-id which will be copied to the first one. ("party_copy", [ (assign, "$g_move_heroes", 1), (store_script_param_1, ":target_party"), #Target Party_id (store_script_param_2, ":source_party"), #Source Party_id (party_clear, ":target_party"), (call_script, "script_party_add_party", ":target_party", ":source_party"), ]), #script_clear_party_group: # INPUT: # param1: Party-id of the root of the group. # This script will clear the root party and all parties attached to it recursively. ("clear_party_group", [ (store_script_param_1, ":root_party"), (party_clear, ":root_party"), (party_get_num_attached_parties, ":num_attached_parties", ":root_party"), (try_for_range, ":attached_party_rank", 0, ":num_attached_parties"), (party_get_attached_party_with_rank, ":attached_party", ":root_party", ":attached_party_rank"), (call_script, "script_clear_party_group", ":attached_party"), (try_end), ]), #script_get_nonempty_party_in_group: # INPUT: # param1: Party-id of the root of the group. # OUTPUT: reg0: nonempy party-id ("get_nonempty_party_in_group", [ (store_script_param_1, ":party_no"), (party_get_num_companion_stacks, ":num_companion_stacks", ":party_no"), (try_begin), (gt, ":num_companion_stacks", 0), (assign, reg0, ":party_no"), (else_try), (assign, reg0, -1), (party_get_num_attached_parties, ":num_attached_parties", ":party_no"), (try_for_range, ":attached_party_rank", 0, ":num_attached_parties"), (lt, reg0, 0), (party_get_attached_party_with_rank, ":attached_party", ":party_no", ":attached_party_rank"), (call_script, "script_get_nonempty_party_in_group", ":attached_party"), (try_end), (try_end), ]), #script_collect_prisoners_from_empty_parties: # INPUT: # param1: Party-id of the root of the group. # param2: Party to collect prisoners in. # make sure collection party is cleared before calling this. ("collect_prisoners_from_empty_parties", [ (store_script_param_1, ":party_no"), (store_script_param_2, ":collection_party"), (party_get_num_companions, ":num_companions", ":party_no"), (try_begin), (eq, ":num_companions", 0), #party is empty (has no companions). Collect its prisoners. (party_get_num_prisoner_stacks, ":num_stacks",":party_no"), (try_for_range, ":stack_no", 0, ":num_stacks"), (party_prisoner_stack_get_troop_id, ":stack_troop",":party_no",":stack_no"), (troop_is_hero, ":stack_troop"), (party_add_members, ":collection_party", ":stack_troop", 1), (try_end), (try_end), (party_get_num_attached_parties, ":num_attached_parties", ":party_no"), (try_for_range, ":attached_party_rank", 0, ":num_attached_parties"), (party_get_attached_party_with_rank, ":attached_party", ":party_no", ":attached_party_rank"), (call_script, "script_collect_prisoners_from_empty_parties", ":attached_party", ":collection_party"), (try_end), ]), #script_print_casualties_to_s0: # INPUT: # param1: Party_id, param2: 0 = use new line, 1 = use comma #OUTPUT: # string register 0. ("print_casualties_to_s0", [(store_script_param, ":party_no", 1), (store_script_param, ":use_comma", 2), (str_clear, s0), (assign, ":total_reported", 0), (assign, ":total_wounded", 0), (assign, ":total_killed", 0), (party_get_num_companion_stacks, ":num_stacks",":party_no"), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"), (party_stack_get_size, ":stack_size",":party_no",":i_stack"), (party_stack_get_num_wounded, ":num_wounded",":party_no",":i_stack"), (store_sub, ":num_killed", ":stack_size", ":num_wounded"), (val_add, ":total_killed", ":num_killed"), (val_add, ":total_wounded", ":num_wounded"), (try_begin), (this_or_next|gt, ":num_killed", 0), (gt, ":num_wounded", 0), (store_add, reg3, ":num_killed", ":num_wounded"), (str_store_troop_name_by_count, s1, ":stack_troop", reg3), (try_begin), (troop_is_hero, ":stack_troop"), (assign, reg3, 0), (try_end), (try_begin), (gt, ":num_killed", 0), (gt, ":num_wounded", 0), (assign, reg4, ":num_killed"), (assign, reg5, ":num_wounded"), (str_store_string, s2, "@{reg4} killed, {reg5} wounded"), (else_try), (gt, ":num_killed", 0), (str_store_string, s2, "@killed"), (else_try), (str_store_string, s2, "@wounded"), (try_end), (try_begin), (eq, ":use_comma", 1), (try_begin), (eq, ":total_reported", 0), (str_store_string, s0, "@{reg3?{reg3}:} {s1} ({s2})"), (else_try), (str_store_string, s0, "@{s0}, {reg3?{reg3}:} {s1} ({s2})"), (try_end), (else_try), (str_store_string, s0, "@{s0}^{reg3?{reg3}:} {s1} ({s2})"), (try_end), (val_add, ":total_reported", 1), (try_end), (try_end), (try_begin), (this_or_next|gt, ":total_killed", 0), (gt, ":total_wounded", 0), (store_add, reg3, ":total_killed", ":total_wounded"), (try_begin), (gt, ":total_killed", 0), (gt, ":total_wounded", 0), (assign, reg4, ":total_killed"), (assign, reg5, ":total_wounded"), (str_store_string, s2, "@{reg4} killed, {reg5} wounded"), (else_try), (gt, ":total_killed", 0), (str_store_string, s2, "@killed"), (else_try), (str_store_string, s2, "@wounded"), (try_end), (str_store_string, s0, "@{s0}^TOTAL: {reg3} ({s2})"), (else_try), (try_begin), (eq, ":use_comma", 1), (str_store_string, s0, "@None"), (else_try), (str_store_string, s0, "@^None"), (try_end), (try_end), ]), #script_write_fit_party_members_to_stack_selection # INPUT: # param1: party_no, exclude_leader #OUTPUT: # trp_stack_selection_amounts slots (slot 0 = number of stacks, 1 = number of men fit, 2..n = stack sizes (fit)) # trp_stack_selection_ids slots (2..n = stack troops) ("write_fit_party_members_to_stack_selection", [ (store_script_param, ":party_no", 1), (store_script_param, ":exclude_leader", 2), (party_get_num_companion_stacks, ":num_stacks", ":party_no"), (assign, ":slot_index", 2), (assign, ":total_fit", 0), (try_for_range, ":stack_index", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop", ":party_no", ":stack_index"), (assign, ":num_fit", 0), (try_begin), (troop_is_hero, ":stack_troop"), (try_begin), (neg|troop_is_wounded, ":stack_troop"), (this_or_next|eq, ":exclude_leader", 0), (neq, ":stack_index", 0), (assign, ":num_fit",1), (try_end), (else_try), (party_stack_get_size, ":num_fit", ":party_no", ":stack_index"), (party_stack_get_num_wounded, ":num_wounded", ":party_no", ":stack_index"), (val_sub, ":num_fit", ":num_wounded"), (try_end), (try_begin), (gt, ":num_fit", 0), (troop_set_slot, "trp_stack_selection_amounts", ":slot_index", ":num_fit"), (troop_set_slot, "trp_stack_selection_ids", ":slot_index", ":stack_troop"), (val_add, ":slot_index", 1), (try_end), (val_add, ":total_fit", ":num_fit"), (try_end), (val_sub, ":slot_index", 2), (troop_set_slot, "trp_stack_selection_amounts", 0, ":slot_index"), (troop_set_slot, "trp_stack_selection_amounts", 1, ":total_fit"), ]), #script_remove_fit_party_member_from_stack_selection # INPUT: # param1: slot_index #OUTPUT: # reg0 = troop_no # trp_stack_selection_amounts slots (slot 0 = number of stacks, 1 = number of men fit, 2..n = stack sizes (fit)) # trp_stack_selection_ids slots (2..n = stack troops) ("remove_fit_party_member_from_stack_selection", [ (store_script_param, ":slot_index", 1), (val_add, ":slot_index", 2), (troop_get_slot, ":amount", "trp_stack_selection_amounts", ":slot_index"), (troop_get_slot, ":troop_no", "trp_stack_selection_ids", ":slot_index"), (val_sub, ":amount", 1), (troop_set_slot, "trp_stack_selection_amounts", ":slot_index", ":amount"), (troop_get_slot, ":total_amount", "trp_stack_selection_amounts", 1), (val_sub, ":total_amount", 1), (troop_set_slot, "trp_stack_selection_amounts", 1, ":total_amount"), (try_begin), (le, ":amount", 0), (troop_get_slot, ":num_slots", "trp_stack_selection_amounts", 0), (store_add, ":end_cond", ":num_slots", 2), (store_add, ":begin_cond", ":slot_index", 1), (try_for_range, ":index", ":begin_cond", ":end_cond"), (store_sub, ":prev_index", ":index", 1), (troop_get_slot, ":value", "trp_stack_selection_amounts", ":index"), (troop_set_slot, "trp_stack_selection_amounts", ":prev_index", ":value"), (troop_get_slot, ":value", "trp_stack_selection_ids", ":index"), (troop_set_slot, "trp_stack_selection_ids", ":prev_index", ":value"), (try_end), (val_sub, ":num_slots", 1), (troop_set_slot, "trp_stack_selection_amounts", 0, ":num_slots"), (try_end), (assign, reg0, ":troop_no"), ]), #script_remove_random_fit_party_member_from_stack_selection # INPUT: # none #OUTPUT: # reg0 = troop_no # trp_stack_selection_amounts slots (slot 0 = number of stacks, 1 = number of men fit, 2..n = stack sizes (fit)) # trp_stack_selection_ids slots (2..n = stack troops) ("remove_random_fit_party_member_from_stack_selection", [ (troop_get_slot, ":total_amount", "trp_stack_selection_amounts", 1), (store_random_in_range, ":random_troop", 0, ":total_amount"), (troop_get_slot, ":num_slots", "trp_stack_selection_amounts", 0), (store_add, ":end_cond", ":num_slots", 2), (try_for_range, ":index", 2, ":end_cond"), (troop_get_slot, ":amount", "trp_stack_selection_amounts", ":index"), (val_sub, ":random_troop", ":amount"), (lt, ":random_troop", 0), (assign, ":end_cond", 0), (store_sub, ":slot_index", ":index", 2), (try_end), (call_script, "script_remove_fit_party_member_from_stack_selection", ":slot_index"), ]), #script_cf_training_ground_sub_routine_1_for_melee_details # INPUT: # value #OUTPUT: # none ("cf_training_ground_sub_routine_1_for_melee_details", [ (store_script_param, ":value", 1), (ge, "$temp_3", ":value"), (val_add, ":value", 1), (troop_get_slot, ":troop_id", "trp_stack_selection_ids", ":value"), (str_store_troop_name, s0, ":troop_id"), ]), #script_training_ground_sub_routine_2_for_melee_details # INPUT: # value #OUTPUT: # none ("training_ground_sub_routine_2_for_melee_details", [ (store_script_param, ":value", 1), (val_sub, ":value", 1), (try_begin), (lt, ":value", 0), (call_script, "script_remove_random_fit_party_member_from_stack_selection"), (else_try), (call_script, "script_remove_fit_party_member_from_stack_selection", ":value"), (try_end), (assign, ":troop_id", reg0), (store_sub, ":slot_index", "$temp_2", 1), (troop_set_slot, "trp_temp_array_a", ":slot_index", ":troop_id"), (try_begin), (eq, "$temp", "$temp_2"), (call_script, "script_start_training_at_training_ground", -1, "$temp"), (else_try), (val_add, "$temp_2", 1), (jump_to_menu, "mnu_training_ground_selection_details_melee_2"), (try_end), ]), #script_cf_training_ground_sub_routine_for_training_result # INPUT: # arg1: troop_id, arg2: stack_no, arg3: troop_count, arg4: xp_ratio_to_add #OUTPUT: # none ("cf_training_ground_sub_routine_for_training_result", [ (store_script_param, ":troop_id", 1), (store_script_param, ":stack_no", 2), (store_script_param, ":amount", 3), (store_script_param, ":xp_ratio_to_add", 4), (store_character_level, ":level", ":troop_id"), (store_add, ":level_added", ":level", 5), (store_mul, ":min_hardness", ":level_added", 3), (val_min, ":min_hardness", 100), (store_sub, ":hardness_dif", ":min_hardness", "$g_training_ground_training_hardness"), (val_max, ":hardness_dif", 0), (store_sub, ":hardness_dif", 100, ":hardness_dif"), (val_mul, ":hardness_dif", ":hardness_dif"), (val_div, ":hardness_dif", 10), # value over 1000 ## (assign, reg0, ":hardness_dif"), ## (display_message, "@Hardness difference: {reg0}/1000"), (store_mul, ":xp_ratio_to_add_for_stack", ":xp_ratio_to_add", ":hardness_dif"), (val_div, ":xp_ratio_to_add_for_stack", 1000), (try_begin), (eq, ":troop_id", "trp_player"), (val_mul, ":xp_ratio_to_add_for_stack", 1), (else_try), (try_begin), (eq, "$g_mt_mode", ctm_melee), (try_begin), (this_or_next|troop_is_guarantee_ranged, ":troop_id"), (troop_is_guarantee_horse, ":troop_id"), (val_div, ":xp_ratio_to_add_for_stack", 4), (try_end), (else_try), (eq, "$g_mt_mode", ctm_mounted), (try_begin), (neg|troop_is_guarantee_horse, ":troop_id"), (assign, ":xp_ratio_to_add_for_stack", 0), (try_end), (else_try), (neg|troop_is_guarantee_ranged, ":troop_id"), (assign, ":xp_ratio_to_add_for_stack", 0), (try_end), (try_end), (val_add, ":level", 1), (store_mul, ":xp_to_add", 100, ":level"), (val_mul, ":xp_to_add", ":amount"), (val_div, ":xp_to_add", 20), (val_mul, ":xp_to_add", ":xp_ratio_to_add_for_stack"), (val_div, ":xp_to_add", 1000), (store_mul, ":max_xp_to_add", ":xp_to_add", 3), (val_div, ":max_xp_to_add", 2), (store_div, ":min_xp_to_add", ":xp_to_add", 2), (store_random_in_range, ":random_xp_to_add", ":min_xp_to_add", ":max_xp_to_add"), (gt, ":random_xp_to_add", 0), (try_begin), (troop_is_hero, ":troop_id"), (add_xp_to_troop, ":random_xp_to_add", ":troop_id"), (store_div, ":proficiency_to_add", ":random_xp_to_add", 50), (try_begin), (gt, ":proficiency_to_add", 0), (troop_raise_proficiency, ":troop_id", "$g_training_ground_used_weapon_proficiency", ":proficiency_to_add"), (try_end), (else_try), (party_add_xp_to_stack, "p_main_party", ":stack_no", ":random_xp_to_add"), (try_end), (assign, reg0, ":random_xp_to_add"), ]), ## #script_cf_print_troop_name_with_stack_index_to_s0 ## # INPUT: ## # param1: stack_index ## ## #OUTPUT: ## # string register 0. ## ("cf_print_troop_name_with_stack_index_to_s0", ## [ ## (store_script_param_1, ":stack_index"), ## (party_get_num_companion_stacks, ":num_stacks", "p_main_party"), ## (lt, ":stack_index", ":num_stacks"), ## (party_stack_get_troop_id, ":stack_troop", "p_main_party", ":stack_index"), ## (str_store_troop_name, s0, ":stack_troop"), ## ]), #script_print_troop_owned_centers_in_numbers_to_s0 # INPUT: # param1: troop_no #OUTPUT: # string register 0. ("print_troop_owned_centers_in_numbers_to_s0", [ (store_script_param_1, ":troop_no"), (str_store_string, s0, "@nothing"), (assign, ":owned_towns", 0), (assign, ":owned_castles", 0), (assign, ":owned_villages", 0), (try_for_range_backwards, ":cur_center", centers_begin, centers_end), (party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"), (try_begin), (party_slot_eq, ":cur_center", slot_party_type, spt_town), (val_add, ":owned_towns", 1), (else_try), (party_slot_eq, ":cur_center", slot_party_type, spt_castle), (val_add, ":owned_castles", 1), (else_try), (val_add, ":owned_villages", 1), (try_end), (try_end), (assign, ":num_types", 0), (try_begin), (gt, ":owned_villages", 0), (assign, reg0, ":owned_villages"), (store_sub, reg1, reg0, 1), (str_store_string, s0, "@{reg0} village{reg1?s:}"), (val_add, ":num_types", 1), (try_end), (try_begin), (gt, ":owned_castles", 0), (assign, reg0, ":owned_castles"), (store_sub, reg1, reg0, 1), (try_begin), (eq, ":num_types", 0), (str_store_string, s0, "@{reg0} castle{reg1?s:}"), (else_try), (str_store_string, s0, "@{reg0} castle{reg1?s:} and {s0}"), (try_end), (val_add, ":num_types", 1), (try_end), (try_begin), (gt, ":owned_towns", 0), (assign, reg0, ":owned_towns"), (store_sub, reg1, reg0, 1), (try_begin), (eq, ":num_types", 0), (str_store_string, s0, "@{reg0} town{reg1?s:}"), (else_try), (eq, ":num_types", 1), (str_store_string, s0, "@{reg0} town{reg1?s:} and {s0}"), (else_try), (str_store_string, s0, "@{reg0} town{reg1?s:}, {s0}"), (try_end), (try_end), (store_add, reg0, ":owned_villages", ":owned_castles"), (val_add, reg0, ":owned_towns"), ]), #script_get_random_melee_training_weapon # INPUT: none # OUTPUT: reg0 = weapon_1, reg1 = weapon_2 ("get_random_melee_training_weapon", [ (assign, ":weapon_1", -1), (assign, ":weapon_2", -1), (store_random_in_range, ":random_no", 0, 3), (try_begin), (eq, ":random_no", 0), (assign, ":weapon_1", "itm_practice_staff"), (else_try), (eq, ":random_no", 1), (assign, ":weapon_1", "itm_practice_sword"), (assign, ":weapon_2", "itm_practice_shield"), (else_try), (assign, ":weapon_1", "itm_heavy_practice_sword"), (try_end), (assign, reg0, ":weapon_1"), (assign, reg1, ":weapon_2"), ]), #script_start_training_at_training_ground # INPUT: # param1: training_weapon_type, param2: training_param ("start_training_at_training_ground", [ (val_add, "$g_training_ground_training_count", 1), (store_script_param, ":mission_weapon_type", 1), (store_script_param, ":training_param", 2), (assign, ":training_default_weapon_1", -1), (assign, ":training_default_weapon_2", -1), (assign, ":training_default_weapon_3", -1), (assign, "$scene_num_total_gourds_destroyed", 0), (try_begin), (eq, ":mission_weapon_type", itp_type_bow), (assign, "$g_training_ground_used_weapon_proficiency", wpt_archery), (assign, ":training_default_weapon_1", "itm_practice_bow"), (try_begin), (eq, "$g_mt_mode", ctm_mounted), (assign, ":training_default_weapon_2", "itm_practice_arrows_100_amount"), (else_try), (assign, ":training_default_weapon_2", "itm_practice_arrows_10_amount"), (try_end), (else_try), (eq, ":mission_weapon_type", itp_type_crossbow), (assign, "$g_training_ground_used_weapon_proficiency", wpt_crossbow), (assign, ":training_default_weapon_1", "itm_practice_crossbow"), (assign, ":training_default_weapon_2", "itm_practice_bolts_9_amount"), (else_try), (eq, ":mission_weapon_type", itp_type_thrown), (assign, "$g_training_ground_used_weapon_proficiency", wpt_throwing), (try_begin), (eq, "$g_mt_mode", ctm_mounted), (assign, ":training_default_weapon_2", "itm_practice_throwing_daggers_100_amount"), (else_try), (assign, ":training_default_weapon_2", "itm_practice_throwing_daggers"), (try_end), (else_try), (eq, ":mission_weapon_type", itp_type_one_handed_wpn), (assign, "$g_training_ground_used_weapon_proficiency", wpt_one_handed_weapon), (assign, ":training_default_weapon_1", "itm_practice_sword"), (else_try), (eq, ":mission_weapon_type", itp_type_polearm), (assign, "$g_training_ground_used_weapon_proficiency", wpt_polearm), (assign, ":training_default_weapon_1", "itm_practice_lance"), (else_try), #weapon_type comes as -1 when melee training is selected (assign, "$g_training_ground_used_weapon_proficiency", wpt_one_handed_weapon), (call_script, "script_get_random_melee_training_weapon"), (assign, ":training_default_weapon_1", reg0), (assign, ":training_default_weapon_2", reg1), (try_end), ## (assign, "$g_training_ground_training_troop_stack_index", ":stack_index"), (try_begin), (eq, "$g_mt_mode", ctm_mounted), (assign, ":training_default_weapon_3", "itm_practice_horse"), (store_add, "$g_training_ground_training_scene", "scn_training_ground_horse_track_1", "$g_encountered_party"), (val_sub, "$g_training_ground_training_scene", training_grounds_begin), (else_try), (store_add, "$g_training_ground_training_scene", "scn_training_ground_ranged_melee_1", "$g_encountered_party"), (val_sub, "$g_training_ground_training_scene", training_grounds_begin), (try_end), (modify_visitors_at_site, "$g_training_ground_training_scene"), (reset_visitors), (set_visitor, 0, "trp_player"), (assign, ":selected_weapon", -1), (try_for_range, ":cur_slot", 0, 4),#equipment slots (troop_get_inventory_slot, ":cur_item", "trp_player", ":cur_slot"), (ge, ":cur_item", 0), (item_get_type, ":item_type", ":cur_item"), (try_begin), (eq, ":item_type", ":mission_weapon_type"), (eq, ":selected_weapon", -1), (assign, ":selected_weapon", ":cur_item"), (try_end), (try_end), (mission_tpl_entry_clear_override_items, "mt_training_ground_training", 0), (mission_tpl_entry_add_override_item, "mt_training_ground_training", 0, "itm_practice_boots"), (try_begin), (ge, ":training_default_weapon_1", 0), (try_begin), (ge, ":selected_weapon", 0), (mission_tpl_entry_add_override_item, "mt_training_ground_training", 0, ":selected_weapon"), (else_try), (mission_tpl_entry_add_override_item, "mt_training_ground_training", 0, ":training_default_weapon_1"), (try_end), (try_end), (try_begin), (ge, ":training_default_weapon_2", 0), (mission_tpl_entry_add_override_item, "mt_training_ground_training", 0, ":training_default_weapon_2"), (try_end), (try_begin), (ge, ":training_default_weapon_3", 0), (mission_tpl_entry_add_override_item, "mt_training_ground_training", 0, ":training_default_weapon_3"), (try_end), (assign, ":cur_visitor_point", 5), (troop_get_slot, ":num_fit", "trp_stack_selection_amounts", 1), (store_add, ":end_cond", 5, ":num_fit"), (val_min, ":end_cond", 13), (try_for_range, ":cur_visitor_point", 5, ":end_cond"), (call_script, "script_remove_random_fit_party_member_from_stack_selection"), (set_visitor, ":cur_visitor_point", reg0), (val_add, ":cur_visitor_point", 1), (try_end), (try_begin), (eq, "$g_mt_mode", ctm_melee), (assign, ":total_difficulty", 0), (try_for_range, ":i", 0, ":training_param"), (troop_get_slot, ":cur_troop", "trp_temp_array_a", ":i"), (store_add, ":cur_entry_point", ":i", 1), (set_visitor, ":cur_entry_point", ":cur_troop"), (mission_tpl_entry_clear_override_items, "mt_training_ground_training", ":cur_entry_point"), (mission_tpl_entry_add_override_item, "mt_training_ground_training", ":cur_entry_point", "itm_practice_boots"), (call_script, "script_get_random_melee_training_weapon"), (mission_tpl_entry_add_override_item, "mt_training_ground_training", ":cur_entry_point", reg0), (try_begin), (ge, reg1, 0), (mission_tpl_entry_add_override_item, "mt_training_ground_training", ":cur_entry_point", reg1), (try_end), (store_character_level, ":cur_troop_level", ":cur_troop"), (val_add, ":cur_troop_level", 10), (val_mul, ":cur_troop_level", ":cur_troop_level"), (val_add, ":total_difficulty", ":cur_troop_level"), (try_end), (assign, "$g_training_ground_training_num_enemies", ":training_param"), (assign, "$g_training_ground_training_hardness", ":total_difficulty"), (store_add, ":number_multiplier", "$g_training_ground_training_num_enemies", 4), (val_mul, "$g_training_ground_training_hardness", ":number_multiplier"), (val_div, "$g_training_ground_training_hardness", 2400), (str_store_string, s0, "@Your opponents are ready for the fight."), (else_try), (eq, "$g_mt_mode", ctm_mounted), (try_begin), (eq, ":mission_weapon_type", itp_type_bow), (assign, "$g_training_ground_training_hardness", 350), (assign, "$g_training_ground_training_num_gourds_to_destroy", 30), (else_try), (eq, ":mission_weapon_type", itp_type_thrown), (assign, "$g_training_ground_training_hardness", 400), (assign, "$g_training_ground_training_num_gourds_to_destroy", 30), (else_try), (eq, ":mission_weapon_type", itp_type_one_handed_wpn), (assign, "$g_training_ground_training_hardness", 200), (assign, "$g_training_ground_training_num_gourds_to_destroy", 45), (else_try), (eq, ":mission_weapon_type", itp_type_polearm), (assign, "$g_training_ground_training_hardness", 280), (assign, "$g_training_ground_training_num_gourds_to_destroy", 35), (try_end), (str_store_string, s0, "@Try to destroy as many targets as you can. You have two and a half minutes to clear the track."), (else_try), (eq, "$g_mt_mode", ctm_ranged), (store_mul, "$g_training_ground_ranged_distance", ":training_param", 100), (assign, ":hardness_modifier", ":training_param"), (val_mul, ":hardness_modifier", ":hardness_modifier"), (try_begin), (eq, ":mission_weapon_type", itp_type_bow), (val_mul, ":hardness_modifier", 3), (val_div, ":hardness_modifier", 2), (else_try), (eq, ":mission_weapon_type", itp_type_thrown), (val_mul, ":hardness_modifier", 5), (val_div, ":hardness_modifier", 2), (val_mul, ":hardness_modifier", ":training_param"), (val_div, ":hardness_modifier", 2), (try_end), (store_mul, "$g_training_ground_training_hardness", 100, ":hardness_modifier"), (val_div, "$g_training_ground_training_hardness", 6000), (str_store_string, s0, "@Stay behind the line on the ground and shoot the targets. Try not to waste any shots."), (try_end), (jump_to_menu, "mnu_training_ground_description"), ]), #script_print_party_to_s0: # INPUT: # param1: Party-id #OUTPUT: # string register 0. ## ("print_party_to_s0", ## [ ## (store_script_param_1, ":party"), #Party_id ## (party_get_num_companion_stacks, ":num_stacks",":party"), ## (str_store_string, s50, "str_none"), ## (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"), ## (str_store_troop_name_by_count, s61, ":stack_troop", ":stack_size"), ## (try_begin), ## (troop_is_hero, ":stack_troop"), ## (str_store_string_reg, s51, s61), ## (else_try), ## (assign, reg60, ":stack_size"), ## (str_store_string, s63, "str_reg60_s61"), ## (try_end), ## (try_begin), ## (eq, ":i_stack", 0), ## (str_store_string_reg, s50, s51), ## (else_try), ## (str_store_string, s50, "str_s50_comma_s51"), ## (try_end), ## (try_end), ## (str_store_string_reg, s0, s50), ## ]), #script_party_count_fit_regulars: # Returns the number of unwounded regular companions in a party # INPUT: # param1: Party-id ("party_count_fit_regulars", [ (store_script_param_1, ":party"), #Party_id (party_get_num_companion_stacks, ":num_stacks",":party"), (assign, reg0, 0), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":party",":i_stack"), (neg|troop_is_hero, ":stack_troop"), (party_stack_get_size, ":stack_size",":party",":i_stack"), (party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"), (val_sub, ":stack_size", ":num_wounded"), (val_add, reg0, ":stack_size"), (try_end), ]), #script_party_count_fit_for_battle: # Returns the number of unwounded companions in a party # INPUT: # param1: Party-id # OUTPUT: reg0 = result ("party_count_fit_for_battle", [ (store_script_param_1, ":party"), #Party_id (party_get_num_companion_stacks, ":num_stacks",":party"), (assign, reg0, 0), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":party",":i_stack"), (assign, ":num_fit",0), (try_begin), (troop_is_hero, ":stack_troop"), # (store_troop_health, ":troop_hp", ":stack_troop"), (try_begin), (neg|troop_is_wounded, ":stack_troop"), # (ge, ":troop_hp", 20), (assign, ":num_fit",1), (try_end), (else_try), (party_stack_get_size, ":num_fit",":party",":i_stack"), (party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"), (val_sub, ":num_fit", ":num_wounded"), (try_end), (val_add, reg0, ":num_fit"), (try_end), ]), #script_party_count_members_with_full_health # Returns the number of unwounded regulars, and heroes other than player with 100% hitpoints in a party # INPUT: # param1: Party-id # OUTPUT: reg0 = result ("party_count_members_with_full_health", [ (store_script_param_1, ":party"), #Party_id (party_get_num_companion_stacks, ":num_stacks",":party"), (assign, reg0, 0), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":party",":i_stack"), (assign, ":num_fit",0), (try_begin), (troop_is_hero, ":stack_troop"), (neq, ":stack_troop", "trp_player"), (store_troop_health, ":troop_hp", ":stack_troop"), (try_begin), (ge, ":troop_hp", 80), (assign, ":num_fit",1), (try_end), (else_try), (party_stack_get_size, ":num_fit",":party",":i_stack"), (party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"), (val_sub, ":num_fit", ":num_wounded"), (val_max, ":num_fit", 0), (try_end), (val_add, reg0, ":num_fit"), (try_end), ]), ## ("get_fit_stack_with_rank", ## [ ## (store_script_param_1, ":party"), #Party_id ## (store_script_param_2, ":rank"), #Rank ## (party_get_num_companion_stacks, ":num_stacks",":party"), ## (assign, reg0, -1), ## (assign, ":num_total", 0), ## (try_for_range, ":i_stack", 0, ":num_stacks"), ## (eq, reg(0), -1), #continue only if we haven't found the result yet. ## (party_stack_get_troop_id, ":stack_troop",":party",":i_stack"), ## (assign, ":num_fit",0), ## (try_begin), ## (troop_is_hero, ":stack_troop"), ## (store_troop_health, ":troop_hp", ":stack_troop"), ## (try_begin), ## (ge, ":troop_hp", 20), ## (assign, ":num_fit",1), ## (try_end), ## (else_try), ## (party_stack_get_size, ":num_fit",":party",":i_stack"), ## (party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"), ## (val_sub, ":num_fit", ":num_wounded"), ## (try_end), ## (val_add, ":num_total", ":num_fit"), ## (try_begin), ## (lt, ":rank", ":num_total"), ## (assign, reg(0), ":i_stack"), ## (try_end), ## (try_end), ## ]), #script_get_stack_with_rank: # Returns the stack no, containing unwounded regular companions with rank rank. # INPUT: # param1: Party-id # param2: rank ("get_stack_with_rank", [ (store_script_param_1, ":party"), #Party_id (store_script_param_2, ":rank"), #Rank (party_get_num_companion_stacks, ":num_stacks",":party"), (assign, reg(0), -1), (assign, ":num_total", 0), (try_for_range, ":i_stack", 0, ":num_stacks"), (eq, reg(0), -1), #continue only if we haven't found the result yet. (party_stack_get_troop_id, ":stack_troop",":party",":i_stack"), (neg|troop_is_hero, ":stack_troop"), (party_stack_get_size, ":stack_size",":party",":i_stack"), (party_stack_get_num_wounded, ":num_wounded",":party",":i_stack"), (val_sub, ":stack_size", ":num_wounded"), (val_add, ":num_total", ":stack_size"), (try_begin), (lt, ":rank", ":num_total"), (assign, reg(0), ":i_stack"), (try_end), (try_end), ]), #script_inflict_casualties_to_party: # INPUT: # param1: Party-id # param2: number of rounds #OUTPUT: # This script doesn't return a value but populates the parties p_temp_wounded and p_temp_killed with the wounded and killed. #Example: # (script_inflict_casualties_to_party, "_p_main_party" ,50), # Simulate 50 rounds of casualties to main_party. ("inflict_casualties_to_party", [ (party_clear, "p_temp_casualties"), (store_script_param_1, ":party"), #Party_id (call_script, "script_party_count_fit_regulars", ":party"), (assign, ":num_fit", reg(0)), #reg(47) = number of fit regulars. (store_script_param_2, ":num_attack_rounds"), #number of attacks (try_for_range, ":unused", 0, ":num_attack_rounds"), (gt, ":num_fit", 0), (store_random_in_range, ":attacked_troop_rank", 0 , ":num_fit"), #attack troop with rank reg(46) (assign, reg1, ":attacked_troop_rank"), (call_script, "script_get_stack_with_rank", ":party", ":attacked_troop_rank"), (assign, ":attacked_stack", reg(0)), #reg(53) = stack no to attack. (party_stack_get_troop_id, ":attacked_troop",":party",":attacked_stack"), (store_character_level, ":troop_toughness", ":attacked_troop"), (val_add, ":troop_toughness", 5), #troop-toughness = level + 5 (assign, ":casualty_chance", 10000), (val_div, ":casualty_chance", ":troop_toughness"), #dying chance (try_begin), (store_random_in_range, ":rand_num", 0 ,10000), (lt, ":rand_num", ":casualty_chance"), #check chance to be a casualty (store_random_in_range, ":rand_num2", 0, 2), #check if this troop will be wounded or killed (try_begin), (troop_is_hero,":attacked_troop"), #currently troop can't be a hero, but no harm in keeping this. (store_troop_health, ":troop_hp",":attacked_troop"), (val_sub, ":troop_hp", 45), (val_max, ":troop_hp", 1), (troop_set_health, ":attacked_troop", ":troop_hp"), (else_try), (lt, ":rand_num2", 1), #wounded (party_add_members, "p_temp_casualties", ":attacked_troop", 1), (party_wound_members, "p_temp_casualties", ":attacked_troop", 1), (party_wound_members, ":party", ":attacked_troop", 1), (else_try), #killed (party_add_members, "p_temp_casualties", ":attacked_troop", 1), (party_remove_members, ":party", ":attacked_troop", 1), (try_end), (val_sub, ":num_fit", 1), #adjust number of fit regulars. (try_end), (try_end), ]), #script_move_members_with_ratio: # INPUT: # param1: Source Party-id # param2: Target Party-id # pin_number = ratio of members to move, multiplied by 1000 #OUTPUT: # This script doesn't return a value but moves some of the members of source party to target party according to the given ratio. ("move_members_with_ratio", [ (store_script_param_1, ":source_party"), #Source Party_id (store_script_param_2, ":target_party"), #Target Party_id (party_get_num_prisoner_stacks, ":num_stacks",":source_party"), (try_for_range_backwards, ":stack_no", 0, ":num_stacks"), (party_prisoner_stack_get_troop_id, ":stack_troop",":source_party",":stack_no"), (party_prisoner_stack_get_size, ":stack_size",":source_party",":stack_no"), (store_mul, ":number_to_move",":stack_size","$pin_number"), (val_div, ":number_to_move", 1000), (party_remove_prisoners, ":source_party", ":stack_troop", ":number_to_move"), (assign, ":number_moved", reg0), (party_add_prisoners, ":target_party", ":stack_troop", ":number_moved"), (try_end), (party_get_num_companion_stacks, ":num_stacks",":source_party"), (try_for_range_backwards, ":stack_no", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":source_party",":stack_no"), (party_stack_get_size, ":stack_size",":source_party",":stack_no"), (store_mul, ":number_to_move",":stack_size","$pin_number"), (val_div, ":number_to_move", 1000), (party_remove_members, ":source_party", ":stack_troop", ":number_to_move"), (assign, ":number_moved", reg0), (party_add_members, ":target_party", ":stack_troop", ":number_moved"), (try_end), ]), # script_count_parties_of_faction_and_party_type: # counts number of active parties with a template and faction. # Input: arg1 = faction_no, arg2 = party_type # Output: reg0 = count ("count_parties_of_faction_and_party_type", [ (store_script_param_1, ":faction_no"), (store_script_param_2, ":party_type"), (assign, reg0, 0), (try_for_parties, ":party_no"), (party_is_active, ":party_no"), (party_get_slot, ":cur_party_type", ":party_no", slot_party_type), (store_faction_of_party, ":cur_faction", ":party_no"), (eq, ":cur_party_type", ":party_type"), (eq, ":cur_faction", ":faction_no"), (val_add, reg0, 1), (try_end), ]), # script_faction_get_number_of_armies # Input: arg1 = faction_no # Output: reg0 = number_of_armies ("faction_get_number_of_armies", [ (store_script_param_1, ":faction_no"), (assign, ":num_armies", 0), (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (store_troop_faction, ":hero_faction_no", ":troop_no"), (eq, ":hero_faction_no", ":faction_no"), (troop_get_slot, ":hero_party", ":troop_no", slot_troop_leaded_party), (ge, ":hero_party", 0), (call_script, "script_party_count_fit_regulars", ":hero_party"), (assign, ":party_size", reg0), (call_script, "script_party_get_ideal_size", ":hero_party"), (assign, ":ideal_size", reg0), (val_mul, ":ideal_size", 60), (val_div, ":ideal_size", 100), (gt, ":party_size", ":ideal_size"), (val_add, ":num_armies", 1), (try_end), (assign, reg0, ":num_armies"), ]), # script_faction_recalculate_strength # Input: arg1 = faction_no # Output: reg0 = strength ("faction_recalculate_strength", [ (store_script_param_1, ":faction_no"), (call_script, "script_faction_get_number_of_armies", ":faction_no"), (assign, ":num_armies", reg0), (assign, ":num_castles", 0), (assign, ":num_towns", 0), (try_for_range, ":center_no", centers_begin, centers_end), (store_faction_of_party, ":center_faction", ":center_no"), (eq, ":center_faction", ":faction_no"), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_castle), (val_add, ":num_castles", 1), (else_try), (party_slot_eq, ":center_no", slot_party_type, spt_town), (val_add, ":num_towns", 1), (try_end), (try_end), (faction_set_slot, ":faction_no", slot_faction_num_armies, ":num_armies"), (faction_set_slot, ":faction_no", slot_faction_num_castles, ":num_castles"), (faction_set_slot, ":faction_no", slot_faction_num_towns, ":num_towns"), ]), #script_select_random_town: # This script selects a random town in range [towns_begin, towns_end) # INPUTS: # none #OUTPUT: # reg0: id of the selected random town ## ("select_random_town", ## [ ## (assign, ":num_towns", towns_end), ## (val_sub,":num_towns", towns_begin), ## (store_random, ":random_town", ":num_towns"), ## (val_add,":random_town", towns_begin), ## (assign, reg0, ":random_town"), ## ]), # ("select_random_spawn_point", # [ # (assign, reg(20), spawn_points_end), # (val_sub,reg(20), spawn_points_begin), # (store_random, reg(21), reg(20)), # (val_add,reg(21), spawn_points_begin), # (assign, "$pout_town", reg(21)), # ]), #script_cf_select_random_town_with_faction: # This script selects a random town in range [towns_begin, towns_end) # such that faction of the town is equal to given_faction # INPUT: # arg1 = faction_no #OUTPUT: # This script may return false if there is no matching town. # reg0 = town_no ("cf_select_random_town_with_faction", [ (store_script_param_1, ":faction_no"), (assign, ":result", -1), # First count num matching spawn points (assign, ":no_towns", 0), (try_for_range,":cur_town", towns_begin, towns_end), (store_faction_of_party, ":cur_faction", ":cur_town"), (eq, ":cur_faction", ":faction_no"), (val_add, ":no_towns", 1), (try_end), (gt, ":no_towns", 0), #Fail if there are no towns (store_random_in_range, ":random_town", 0, ":no_towns"), (assign, ":no_towns", 0), (try_for_range,":cur_town", towns_begin, towns_end), (eq, ":result", -1), (store_faction_of_party, ":cur_faction", ":cur_town"), (eq, ":cur_faction", ":faction_no"), (val_add, ":no_towns", 1), (gt, ":no_towns", ":random_town"), (assign, ":result", ":cur_town"), (try_end), (assign, reg0, ":result"), ]), #script_cf_select_random_village_with_faction: # This script selects a random village in range [villages_begin, villages_end) # such that faction of the village is equal to given_faction # INPUT: # arg1 = faction_no #OUTPUT: # This script may return false if there is no matching village. # reg0 = village_no ("cf_select_random_village_with_faction", [ (store_script_param_1, ":faction_no"), (assign, ":result", -1), # First count num matching spawn points (assign, ":no_villages", 0), (try_for_range,":cur_village", villages_begin, villages_end), (store_faction_of_party, ":cur_faction", ":cur_village"), (eq, ":cur_faction", ":faction_no"), (val_add, ":no_villages", 1), (try_end), (gt, ":no_villages", 0), #Fail if there are no villages (store_random_in_range, ":random_village", 0, ":no_villages"), (assign, ":no_villages", 0), (try_for_range,":cur_village", villages_begin, villages_end), (eq, ":result", -1), (store_faction_of_party, ":cur_faction", ":cur_village"), (eq, ":cur_faction", ":faction_no"), (val_add, ":no_villages", 1), (gt, ":no_villages", ":random_village"), (assign, ":result", ":cur_village"), (try_end), (assign, reg0, ":result"), ]), #script_cf_select_random_walled_center_with_faction: # This script selects a random center in range [centers_begin, centers_end) # such that faction of the town is equal to given_faction # INPUT: # arg1 = faction_no # arg2 = preferred_center_no #OUTPUT: # This script may return false if there is no matching town. # reg0 = town_no (Can fail) ("cf_select_random_walled_center_with_faction", [ (store_script_param, ":faction_no", 1), (store_script_param, ":preferred_center_no", 2), (assign, ":result", -1), # First count num matching spawn points (assign, ":no_centers", 0), (try_for_range,":cur_center", walled_centers_begin, walled_centers_end), (store_faction_of_party, ":cur_faction", ":cur_center"), (eq, ":cur_faction", ":faction_no"), (val_add, ":no_centers", 1), (eq, ":cur_center", ":preferred_center_no"), (val_add, ":no_centers", 99), (try_end), (gt, ":no_centers", 0), #Fail if there are no centers (store_random_in_range, ":random_center", 0, ":no_centers"), (try_for_range,":cur_center", walled_centers_begin, walled_centers_end), (eq, ":result", -1), (store_faction_of_party, ":cur_faction", ":cur_center"), (eq, ":cur_faction", ":faction_no"), (val_sub, ":random_center", 1), (try_begin), (eq, ":cur_center", ":preferred_center_no"), (val_sub, ":random_center", 99), (try_end), (lt, ":random_center", 0), (assign, ":result", ":cur_center"), (try_end), (assign, reg0, ":result"), ]), #script_cf_select_random_walled_center_with_faction_and_owner_priority_no_siege: # INPUT: # arg1 = faction_no # arg2 = owner_troop_no #OUTPUT: # This script may return false if there is no matching town. # reg0 = center_no (Can fail) ("cf_select_random_walled_center_with_faction_and_owner_priority_no_siege", [ (store_script_param, ":faction_no", 1), (store_script_param, ":troop_no", 2), (assign, ":result", -1), (assign, ":no_centers", 0), (try_for_range,":cur_center", walled_centers_begin, walled_centers_end), (store_faction_of_party, ":cur_faction", ":cur_center"), (eq, ":cur_faction", ":faction_no"), (party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1), (val_add, ":no_centers", 1), (party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"), (val_add, ":no_centers", 1000), (try_end), (gt, ":no_centers", 0), #Fail if there are no centers (store_random_in_range, ":random_center", 0, ":no_centers"), (try_for_range,":cur_center", walled_centers_begin, walled_centers_end), (eq, ":result", -1), (store_faction_of_party, ":cur_faction", ":cur_center"), (eq, ":cur_faction", ":faction_no"), (party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1), (val_sub, ":random_center", 1), (try_begin), (party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"), (val_sub, ":random_center", 1000), (try_end), (lt, ":random_center", 0), (assign, ":result", ":cur_center"), (try_end), (assign, reg0, ":result"), ]), #script_cf_select_random_walled_center_with_faction_and_less_strength_priority: # This script selects a random center in range [centers_begin, centers_end) # such that faction of the town is equal to given_faction # INPUT: # arg1 = faction_no # arg2 = preferred_center_no #OUTPUT: # This script may return false if there is no matching town. # reg0 = town_no (Can fail) ("cf_select_random_walled_center_with_faction_and_less_strength_priority", [ (store_script_param, ":faction_no", 1), (store_script_param, ":preferred_center_no", 2), (assign, ":result", -1), # First count num matching spawn points (assign, ":no_centers", 0), (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end), (store_faction_of_party, ":cur_faction", ":cur_center"), (eq, ":cur_faction", ":faction_no"), (party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1), (val_add, ":no_centers", 1), (try_begin), (eq, ":cur_center", ":preferred_center_no"), (val_add, ":no_centers", 99), (try_end), ## (call_script, "script_party_calculate_regular_strength", ":cur_center"), ## (assign, ":strength", reg0), ## (lt, ":strength", 80), ## (store_sub, ":strength", 100, ":strength"), ## (val_div, ":strength", 20), ## (val_add, ":no_centers", ":strength"), (try_end), (gt, ":no_centers", 0), #Fail if there are no centers (store_random_in_range, ":random_center", 0, ":no_centers"), (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end), (eq, ":result", -1), (store_faction_of_party, ":cur_faction", ":cur_center"), (eq, ":cur_faction", ":faction_no"), (party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1), (val_sub, ":random_center", 1), (try_begin), (eq, ":cur_center", ":preferred_center_no"), (val_sub, ":random_center", 99), (try_end), ## (try_begin), ## (call_script, "script_party_calculate_regular_strength", ":cur_center"), ## (assign, ":strength", reg0), ## (lt, ":strength", 80), ## (store_sub, ":strength", 100, ":strength"), ## (val_div, ":strength", 20), ## (val_sub, ":random_center", ":strength"), ## (try_end), (lt, ":random_center", 0), (assign, ":result", ":cur_center"), (try_end), (assign, reg0, ":result"), ]), #script_cf_select_random_town_at_peace_with_faction: # This script selects a random town in range [towns_begin, towns_end) # such that faction of the town is friendly to given_faction # INPUT: # arg1 = faction_no #OUTPUT: # This script may return false if there is no matching town. # reg0 = town_no ("cf_select_random_town_at_peace_with_faction", [ (store_script_param_1, ":faction_no"), (assign, ":result", -1), # First count num matching towns (assign, ":no_towns", 0), (try_for_range,":cur_town", towns_begin, towns_end), (store_faction_of_party, ":cur_faction", ":cur_town"), (store_relation,":reln", ":cur_faction", ":faction_no"), (ge, ":reln", 0), (val_add, ":no_towns", 1), (try_end), (gt, ":no_towns", 0), #Fail if there are no towns (store_random_in_range, ":random_town", 0, ":no_towns"), (assign, ":no_towns", 0), (try_for_range,":cur_town", towns_begin, towns_end), (eq, ":result", -1), (store_faction_of_party, ":cur_faction", ":cur_town"), (store_relation,":reln", ":cur_faction", ":faction_no"), (ge, ":reln", 0), (val_add, ":no_towns", 1), (gt, ":no_towns", ":random_town"), (assign, ":result", ":cur_town"), (try_end), (assign, reg0, ":result"), ]), #script_cf_select_random_town_at_peace_with_faction_in_trade_route # INPUT: # arg1 = town_no # arg2 = faction_no #OUTPUT: # This script may return false if there is no matching town. # reg0 = town_no ("cf_select_random_town_at_peace_with_faction_in_trade_route", [ (store_script_param, ":town_no", 1), (store_script_param, ":faction_no", 2), (assign, ":result", -1), (assign, ":no_towns", 0), (try_for_range, ":cur_slot", slot_town_trade_routes_begin, slot_town_trade_routes_end), (party_get_slot, ":cur_town", ":town_no", ":cur_slot"), (gt, ":cur_town", 0), (store_faction_of_party, ":cur_faction", ":cur_town"), (store_relation, ":reln", ":cur_faction", ":faction_no"), (ge, ":reln", 0), (val_add, ":no_towns", 1), (try_end), (gt, ":no_towns", 0), #Fail if there are no towns (store_random_in_range, ":random_town", 0, ":no_towns"), (try_for_range, ":cur_slot", slot_town_trade_routes_begin, slot_town_trade_routes_end), (eq, ":result", -1), (party_get_slot, ":cur_town", ":town_no", ":cur_slot"), (gt, ":cur_town", 0), (store_faction_of_party, ":cur_faction", ":cur_town"), (store_relation, ":reln", ":cur_faction", ":faction_no"), (ge, ":reln", 0), (val_sub, ":random_town", 1), (lt, ":random_town", 0), (assign, ":result", ":cur_town"), (try_end), (assign, reg0, ":result"), ]), ## ("cf_select_faction_spawn_point", ## [ ## # First count num matching spawn points ## (assign, reg(24), 0), ## (try_for_range,reg(25), spawn_points_begin, spawn_points_end), ## (store_faction_of_party, reg(23), reg(25)), ## (eq, reg(23), "$pin_faction"), ## (val_add, reg(24), 1), ## (end_try,0), ## # reg4 now holds num towns of this faction. ## (gt, reg(24), 0), #Fail if there are no towns ## (store_random, reg(26), reg(24)), ## ## (assign, reg(24), 0), # reg24 = num points of this faction. ## (try_for_range,reg(25), spawn_points_begin, spawn_points_end), ## (store_faction_of_party, reg(23), reg(25)), ## (eq, reg(23), "$pin_faction"), ## (try_begin,0), ## (eq, reg(24), reg(26)), ## (assign, "$pout_town", reg(25)), # result is this town ## (end_try,0), ## (val_add, reg(24), 1), ## (end_try,0), ## ]), #script_spawn_party_at_random_town: # This script selects a random town in range [towns_begin, towns_end) # such that faction of the town is equal to given_faction # and spawns a new party there. # INPUT: # $pin_faction: given_faction # $pin_party_template: given_party_template #OUTPUT: # This script may return false if party cannot be spawned. # $pout_party: id of the spawned party ## ("spawn_party_at_random_town", ## [ ## (call_script,"script_select_random_spawn_point"), ## (set_spawn_radius,1), ## (spawn_around_party,"$pout_town","$pin_party_template"), ## (assign, "$pout_party", reg(0)), ## ]), #script_cf_spawn_party_at_faction_town: # This script selects a random town in range [towns_begin, towns_end) # such that faction of the town is equal to given_faction # and spawns a new party there. # INPUT: # $pin_faction: given_faction # $pin_party_template: given_party_template #OUTPUT: # This script may return false if party cannot be spawned. # $pout_party: id of the spawned party ## ("cf_spawn_party_at_faction_town", ## [ ## (call_script,"script_cf_select_faction_spawn_point"), ## (set_spawn_radius,1), ## (spawn_around_party,"$pout_town","$pin_party_template"), ## (assign, "$pout_party", reg(0)), ## ]), #script_spawn_party_at_random_town_if_below_limit: # This script checks if number of parties # of specified template is less than limit, # If so, it selects a random town in range [towns_begin, towns_end) # and spawns a new party there. # INPUT: # $pin_party_template: given_party_template # $pin_limit: limit value #OUTPUT: # $pout_party: id of the spawned party # $pout_town: id of the selected faction town # Note: # This script may return false if number of parties # of specified template is greater or equal to limit, # or if party cannot be spawned. ## ("cf_spawn_party_at_random_town_if_below_limit", ## [ ## (store_num_parties_of_template, reg(22), "$pin_party_template"), ## (lt,reg(22),"$pin_limit"), #check if we are below limit. ## (call_script,"script_select_random_spawn_point"), ## (set_spawn_radius,1), ## (spawn_around_party,"$pout_town","$pin_party_template"), ## (assign, "$pout_party", reg(0)), ## ]), ## #script_spawn_party_at_faction_town_if_below_limit: ## # This script checks if number of parties ## # of specified template is less than limit, ## # If so, it selects a random town in range [towns_begin, towns_end) ## # such that faction of the town is equal to given_faction ## # and spawns a new party there. ## # INPUT: ## # $pin_faction: given_faction ## # $pin_party_template: given_party_template ## # $pin_limit: limit value ## ## #OUTPUT: ## # $pout_party: id of the spawned party ## # $pout_town: id of the selected faction town ## # Note: ## # This script may return false if number of parties ## # of specified template is greater or equal to limit, ## # or if party cannot be spawned. ## ("cf_spawn_party_at_faction_town_if_below_limit", ## [ ## (store_num_parties_of_template, reg(22), "$pin_party_template"), ## (lt,reg(22),"$pin_limit"), #check if we are below limit. ## (call_script,"script_cf_select_faction_spawn_point"), ## (set_spawn_radius,1), ## (spawn_around_party,"$pout_town","$pin_party_template"), ## (assign, "$pout_party", reg(0)), ## ]), # script_shuffle_troop_slots: # Shuffles a range of slots of a given troop. # Used for exploiting a troop as an array. # Input: arg1 = troop_no, arg2 = slot_begin, arg3 = slot_end ("shuffle_troop_slots", [ (store_script_param, ":troop_no", 1), (store_script_param, ":slots_begin", 2), (store_script_param, ":slots_end", 3), (try_for_range, ":cur_slot_no", ":slots_begin", ":slots_end"), (store_random_in_range, ":random_slot_no", ":slots_begin", ":slots_end"), #reg(58) = random slot. Now exchange slots reg(57) and reg(58) (troop_get_slot, ":cur_slot_value", ":troop_no", ":cur_slot_no"), #temporarily store the value in slot reg(57) in reg(59) (troop_get_slot, ":random_slot_value", ":troop_no", ":random_slot_no"), #temporarily store the value in slot reg(58) in reg(60) (troop_set_slot, ":troop_no", ":cur_slot_no", ":random_slot_value"), # Now exchange the two... (troop_set_slot, ":troop_no", ":random_slot_no", ":cur_slot_value"), (try_end), ]), # script_get_random_quest # Input: arg1 = troop_no (of the troop in conversation), arg2 = min_importance (of the quest) # Output: reg0 = quest_no (the slots of the quest will be filled after calling this script) ("get_random_quest", [ (store_script_param_1, ":giver_troop"), (store_character_level, ":player_level", "trp_player"), (store_troop_faction, ":giver_faction_no", ":giver_troop"), (troop_get_slot, ":giver_party_no", ":giver_troop", slot_troop_leaded_party), (troop_get_slot, ":giver_reputation", ":giver_troop", slot_lord_reputation_type), (assign, ":giver_center_no", -1), (try_begin), (gt, ":giver_party_no", 0), (party_get_attached_to, ":giver_center_no", ":giver_party_no"), (else_try), (is_between, "$g_encountered_party", centers_begin, centers_end), (assign, ":giver_center_no", "$g_encountered_party"), (try_end), (try_begin), (troop_slot_eq, ":giver_troop", slot_troop_occupation, slto_kingdom_hero), (try_begin), (ge, "$g_talk_troop_faction_relation", 0), (assign, ":quests_begin", lord_quests_begin), (assign, ":quests_end", lord_quests_end), (else_try), (assign, ":quests_begin", enemy_lord_quests_begin), (assign, ":quests_end", enemy_lord_quests_end), (try_end), (else_try), (is_between, ":giver_troop", village_elders_begin, village_elders_end), (assign, ":quests_begin", village_elder_quests_begin), (assign, ":quests_end", village_elder_quests_end), (else_try), (is_between, ":giver_troop", mayors_begin, mayors_end), (assign, ":quests_begin", mayor_quests_begin), (assign, ":quests_end", mayor_quests_end), (else_try), (assign, ":quests_begin", lady_quests_begin), (assign, ":quests_end", lady_quests_end), (try_end), (assign, ":result", -1), (try_for_range, ":unused", 0, 20), #Repeat trial twenty times (eq, ":result", -1), (assign, ":quest_target_troop", -1), (assign, ":quest_target_center", -1), (assign, ":quest_target_faction", -1), (assign, ":quest_object_faction", -1), (assign, ":quest_object_troop", -1), (assign, ":quest_object_center", -1), (assign, ":quest_target_party", -1), (assign, ":quest_target_party_template", -1), (assign, ":quest_target_amount", -1), (assign, ":quest_target_dna", -1), (assign, ":quest_target_item", -1), (assign, ":quest_importance", 1), (assign, ":quest_xp_reward", 0), (assign, ":quest_gold_reward", 0), (assign, ":quest_convince_value", 0), (assign, ":quest_expiration_days", 0), (assign, ":quest_dont_give_again_period", 0), (store_random_in_range, ":quest_no", ":quests_begin", ":quests_end"), #TODO: Remove this when test is done # (assign, ":quest_no", "qst_meet_spy_in_enemy_town"), #TODO: Remove this when test is done end (neg|check_quest_active,":quest_no"), (neg|quest_slot_ge, ":quest_no", slot_quest_dont_give_again_remaining_days, 1), (try_begin), # Village Elder quests (eq, ":quest_no", "qst_deliver_grain"), (try_begin), (is_between, ":giver_center_no", villages_begin, villages_end), #The quest giver is the village elder (call_script, "script_get_troop_item_amount", ":giver_troop", "itm_grain"), (eq, reg0, 0), (neg|party_slot_ge, ":giver_center_no", slot_town_prosperity, 40), (assign, ":quest_target_center", ":giver_center_no"), (store_random_in_range, ":quest_target_amount", 4, 8), (assign, ":quest_expiration_days", 30), (assign, ":quest_dont_give_again_period", 20), (assign, ":result", ":quest_no"), (try_end), (else_try), (eq, ":quest_no", "qst_deliver_cattle"), (try_begin), (is_between, ":giver_center_no", villages_begin, villages_end), #The quest giver is the village elder (party_get_slot, ":num_cattle", ":giver_center_no", slot_village_number_of_cattle), (lt, ":num_cattle", 50), (assign, ":quest_target_center", ":giver_center_no"), (store_random_in_range, ":quest_target_amount", 5, 10), (assign, ":quest_expiration_days", 30), (assign, ":quest_dont_give_again_period", 20), (assign, ":result", ":quest_no"), (try_end), (else_try), (eq, ":quest_no", "qst_train_peasants_against_bandits"), (try_begin), (is_between, ":giver_center_no", villages_begin, villages_end), #The quest giver is the village elder (store_skill_level, ":player_trainer", "skl_trainer", "trp_player"), (gt, ":player_trainer", 0), (store_random_in_range, ":quest_target_amount", 5, 8), (assign, ":quest_target_center", ":giver_center_no"), (assign, ":quest_expiration_days", 20), (assign, ":quest_dont_give_again_period", 40), (assign, ":result", ":quest_no"), (try_end), (else_try), # Mayor quests (eq, ":quest_no", "qst_escort_merchant_caravan"), (is_between, ":giver_center_no", centers_begin, centers_end), (store_random_party_in_range, ":quest_target_center", towns_begin, towns_end), (store_distance_to_party_from_party, ":dist", ":giver_center_no",":quest_target_center"), (assign, ":quest_gold_reward", ":dist"), (val_add, ":quest_gold_reward", 25), (val_mul, ":quest_gold_reward", 25), (val_div, ":quest_gold_reward", 20), (store_random_in_range, ":quest_target_amount", 6, 12), (assign, "$escort_merchant_caravan_mode", 0), (assign, ":result", ":quest_no"), (else_try), (eq, ":quest_no", "qst_deliver_wine"), (is_between, ":giver_center_no", centers_begin, centers_end), (store_random_party_in_range, ":quest_target_center", towns_begin, towns_end), (store_random_in_range, ":random_no", 0, 2), (try_begin), (eq, ":random_no", 0), (assign, ":quest_target_item", "itm_quest_wine"), (else_try), (assign, ":quest_target_item", "itm_quest_ale"), (try_end), (store_random_in_range, ":quest_target_amount", 6, 12), (store_distance_to_party_from_party, ":dist", ":giver_center_no",":quest_target_center"), (assign, ":quest_gold_reward", ":dist"), (val_add, ":quest_gold_reward", 2), (assign, ":multiplier", 5), (val_add, ":multiplier", ":quest_target_amount"), (val_mul, ":quest_gold_reward", ":multiplier"), (val_div, ":quest_gold_reward", 100), (val_mul, ":quest_gold_reward", 10), (store_item_value,"$qst_deliver_wine_debt",":quest_target_item"), (val_mul,"$qst_deliver_wine_debt",":quest_target_amount"), (val_mul,"$qst_deliver_wine_debt", 6), (val_div,"$qst_deliver_wine_debt",5), (assign, ":quest_expiration_days", 7), (assign, ":quest_dont_give_again_period", 20), (assign, ":result", ":quest_no"), (else_try), (eq, ":quest_no", "qst_troublesome_bandits"), (is_between, ":giver_center_no", centers_begin, centers_end), (store_character_level, ":quest_gold_reward", "trp_player"), (val_add, ":quest_gold_reward", 20), (val_mul, ":quest_gold_reward", 35), (val_div, ":quest_gold_reward",100), (val_mul, ":quest_gold_reward", 10), (assign, ":quest_expiration_days", 30), (assign, ":quest_dont_give_again_period", 30), (assign, ":result", ":quest_no"), (else_try), (eq, ":quest_no", "qst_kidnapped_girl"), (is_between, ":giver_center_no", centers_begin, centers_end), (store_random_in_range, ":quest_target_center", villages_begin, villages_end), (store_character_level, ":quest_target_amount"), (val_add, ":quest_target_amount", 15), (store_distance_to_party_from_party, ":dist", ":giver_center_no", ":quest_target_center"), (val_add, ":dist", 15), (val_mul, ":dist", 2), (val_mul, ":quest_target_amount", ":dist"), (val_div, ":quest_target_amount",100), (val_mul, ":quest_target_amount",10), (assign, ":quest_gold_reward", ":quest_target_amount"), (val_div, ":quest_gold_reward", 40), (val_mul, ":quest_gold_reward", 10), (assign, ":quest_dont_give_again_period", 30), (assign, ":result", ":quest_no"), (else_try), (eq, ":quest_no", "qst_move_cattle_herd"), (is_between, ":giver_center_no", centers_begin, centers_end), (call_script, "script_cf_select_random_town_at_peace_with_faction", ":giver_faction_no"), (neq, ":giver_center_no", reg0), (assign, ":quest_target_center", reg0), (store_distance_to_party_from_party, ":dist",":giver_center_no",":quest_target_center"), (assign, ":quest_gold_reward", ":dist"), (val_add, ":quest_gold_reward", 25), (val_mul, ":quest_gold_reward", 50), (val_div, ":quest_gold_reward", 20), (assign, ":quest_expiration_days", 20), (assign, ":quest_dont_give_again_period", 20), (assign, ":result", ":quest_no"), (else_try), (eq, ":quest_no", "qst_persuade_lords_to_make_peace"), (is_between, ":giver_center_no", centers_begin, centers_end), (store_faction_of_party, ":cur_object_faction", ":giver_center_no"), (call_script, "script_cf_faction_get_random_enemy_faction", ":cur_object_faction"), (assign, ":cur_target_faction", reg0), (call_script, "script_cf_get_random_lord_except_king_with_faction", ":cur_object_faction"), (assign, ":cur_object_troop", reg0), (call_script, "script_cf_get_random_lord_except_king_with_faction", ":cur_target_faction"), (assign, ":quest_target_troop", reg0), (assign, ":quest_object_troop", ":cur_object_troop"), (assign, ":quest_target_faction", ":cur_target_faction"), (assign, ":quest_object_faction", ":cur_object_faction"), (assign, ":quest_gold_reward", 12000), (assign, ":quest_convince_value", 7000), (assign, ":quest_expiration_days", 30), (assign, ":quest_dont_give_again_period", 100), (assign, ":result", ":quest_no"), (else_try), (eq, ":quest_no", "qst_deal_with_looters"), (is_between, ":player_level", 0, 15), (is_between, ":giver_center_no", centers_begin, centers_end), (store_faction_of_party, ":cur_object_faction", ":giver_center_no"), (store_num_parties_destroyed_by_player, ":num_looters_destroyed", "pt_looters"), (party_template_set_slot,"pt_looters",slot_party_template_num_killed,":num_looters_destroyed"), (quest_set_slot,"$random_merchant_quest_no",slot_quest_current_state,0), (quest_set_slot,"$random_merchant_quest_no",slot_quest_target_party_template,"pt_looters"), (assign, ":quest_gold_reward", 500), (assign, ":quest_xp_reward", 500), (assign, ":quest_expiration_days", 20), (assign, ":quest_dont_give_again_period", 30), (assign, ":result", ":quest_no"), (else_try), (eq, ":quest_no", "qst_deal_with_night_bandits"), (is_between, ":player_level", 0, 15), (is_between, ":giver_center_no", centers_begin, centers_end), (party_slot_ge, ":giver_center_no", slot_center_has_bandits, 1), (assign, ":quest_target_center", ":giver_center_no"), (assign, ":quest_expiration_days", 4), (assign, ":quest_dont_give_again_period", 15), (assign, ":result", ":quest_no"), (else_try), # Lady quests (eq, ":quest_no", "qst_rescue_lord_by_replace"), (try_begin), (ge, "$g_talk_troop_faction_relation", 0), (is_between, ":player_level", 5, 25), (troop_get_slot, ":cur_target_troop", ":giver_troop", slot_troop_father), (try_begin), (eq, ":cur_target_troop", 0), (troop_get_slot, ":cur_target_troop", ":giver_troop", slot_troop_spouse), (try_end), #(troop_slot_eq, ":cur_target_troop", slot_troop_is_prisoner, 1),#Skip if the lady's father/husband is not in prison (troop_slot_ge, ":cur_target_troop", slot_troop_prisoner_of_party, 0), (call_script, "script_search_troop_prisoner_of_party", ":cur_target_troop"), (assign, ":cur_target_center", reg0), (is_between, ":cur_target_center", towns_begin, towns_end),#Skip if he is not in a town (assign, ":quest_target_center", ":cur_target_center"), (assign, ":quest_target_troop", ":cur_target_troop"), (assign, ":quest_expiration_days", 30), (assign, ":quest_dont_give_again_period", 73), (assign, ":result", ":quest_no"), (try_end), (else_try), (eq, ":quest_no", "qst_deliver_message_to_prisoner_lord"), (try_begin), (ge, "$g_talk_troop_faction_relation", 0), (is_between, ":player_level", 5, 25), (troop_get_slot, ":cur_target_troop", ":giver_troop", slot_troop_father), (try_begin), (eq, ":cur_target_troop", 0), (troop_get_slot, ":cur_target_troop", ":giver_troop", slot_troop_spouse), (try_end), #(troop_slot_eq, ":cur_target_troop", slot_troop_is_prisoner, 1),#Skip if the lady's father/husband is not in prison (troop_slot_ge, ":cur_target_troop", slot_troop_prisoner_of_party, 0), (call_script, "script_search_troop_prisoner_of_party", ":cur_target_troop"), (assign, ":cur_target_center", reg0), (is_between, ":cur_target_center", towns_begin, towns_end),#Skip if he is not in a town (assign, ":quest_target_center", ":cur_target_center"), (assign, ":quest_target_troop", ":cur_target_troop"), (assign, ":quest_expiration_days", 30), (assign, ":quest_dont_give_again_period", 30), (assign, ":result", ":quest_no"), (try_end), (else_try), (eq, ":quest_no", "qst_duel_for_lady"), (try_begin), (ge, "$g_talk_troop_faction_relation", 0), (ge, ":player_level", 10), (call_script, "script_cf_troop_get_random_enemy_troop_with_occupation", ":giver_troop", slto_kingdom_hero),#Can fail (assign, ":cur_target_troop", reg0), (neg|troop_slot_eq, ":giver_troop", slot_troop_spouse, ":cur_target_troop"), #must not be in the family (neg|troop_slot_eq, ":giver_troop", slot_troop_father, ":cur_target_troop"), #(troop_slot_eq, ":cur_target_troop", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":cur_target_troop", slot_troop_prisoner_of_party, 0), (troop_slot_ge, ":cur_target_troop", slot_troop_leaded_party, 0), (neg|troop_slot_eq, ":cur_target_troop", slot_lord_reputation_type, lrep_goodnatured), (neg|troop_slot_eq, ":cur_target_troop", slot_lord_reputation_type, lrep_upstanding), (assign, ":quest_target_troop", ":cur_target_troop"), (assign, ":quest_expiration_days", 30), (assign, ":quest_dont_give_again_period", 50), (assign, ":result", ":quest_no"), (try_end), # Enemy Lord Quests (else_try), (eq, ":quest_no", "qst_lend_surgeon"), (try_begin), (eq, "$g_defending_against_siege", 0),#Skip if the center is under siege (because of resting) (neq, ":giver_reputation", lrep_quarrelsome), (neq, ":giver_reputation", lrep_debauched), (assign, ":max_surgery_level", 0), (assign, ":best_surgeon", -1), (party_get_num_companion_stacks, ":num_stacks","p_main_party"), (try_for_range, ":i_stack", 1, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"), (troop_is_hero, ":stack_troop"), (store_skill_level, ":cur_surgery_skill", skl_surgery, ":stack_troop"), (gt, ":cur_surgery_skill", ":max_surgery_level"), (assign, ":max_surgery_level", ":cur_surgery_skill"), (assign, ":best_surgeon", ":stack_troop"), (try_end), (store_character_level, ":cur_level", "trp_player"), (assign, ":required_skill", 5), (val_div, ":cur_level", 10), (val_add, ":required_skill", ":cur_level"), (ge, ":max_surgery_level", ":required_skill"), #Skip if party skill level is less than the required value (assign, ":quest_object_troop", ":best_surgeon"), (assign, ":quest_importance", 1), (assign, ":quest_xp_reward", 10), (assign, ":quest_gold_reward", 10), (assign, ":quest_dont_give_again_period", 50), (assign, ":result", ":quest_no"), (try_end), # Lord Quests (else_try), (eq, ":quest_no", "qst_meet_spy_in_enemy_town"), (try_begin), (eq, "$players_kingdom", ":giver_faction_no"), (neq, ":giver_reputation", lrep_goodnatured), (call_script, "script_troop_get_player_relation", ":giver_troop"), (assign, ":giver_relation", reg0), (gt, ":giver_relation", 3), (call_script, "script_cf_faction_get_random_enemy_faction", ":giver_faction_no"), (assign, ":enemy_faction", reg0), (store_relation, ":reln", ":enemy_faction", "fac_player_supporters_faction"), (lt, ":reln", 0), (call_script, "script_cf_select_random_town_with_faction", ":enemy_faction"), (assign, ":cur_target_center", reg0), #Just to make sure that there is a free walker (call_script, "script_cf_center_get_free_walker", ":cur_target_center"), (assign, ":quest_target_center", ":cur_target_center"), (store_random_in_range, ":quest_target_amount", secret_signs_begin, secret_signs_end), (assign, ":result", ":quest_no"), (assign, ":quest_gold_reward", 500), (assign, ":quest_expiration_days", 30), (assign, ":quest_dont_give_again_period", 50), (quest_set_slot, "qst_meet_spy_in_enemy_town", slot_quest_gold_reward, 500), (try_end), (else_try), (eq, ":quest_no", "qst_raid_caravan_to_start_war"), (try_begin), (eq, "$players_kingdom", ":giver_faction_no"), (this_or_next|eq, ":giver_reputation", lrep_cunning), (this_or_next|eq, ":giver_reputation", lrep_quarrelsome), ( eq, ":giver_reputation", lrep_debauched), (gt, ":player_level", 10), (neg|faction_slot_eq, ":giver_faction_no", slot_faction_leader, ":giver_troop"),#Can not take the quest from the king (call_script, "script_cf_faction_get_random_friendly_faction", ":giver_faction_no"),#Can fail (assign, ":quest_target_faction", reg0), (store_troop_faction, ":quest_object_faction", ":giver_troop"), (assign, ":quest_target_party_template", "pt_kingdom_caravan_party"), (assign, ":quest_target_amount", 2), (assign, ":result", ":quest_no"), (assign, ":quest_expiration_days", 30), (assign, ":quest_dont_give_again_period", 100), (try_end), (else_try), (eq, ":quest_no", "qst_deliver_message"), (try_begin), (ge, "$g_talk_troop_faction_relation", 0), (lt, ":player_level", 20), (call_script, "script_cf_get_random_lord_in_a_center_with_faction", ":giver_faction_no"),#Can fail (assign, ":cur_target_troop", reg0), (neq, ":cur_target_troop", ":giver_troop"),#Skip himself (call_script, "script_get_troop_attached_party", ":cur_target_troop"), (assign, ":cur_target_center", reg0),#cur_target_center will definitely be a valid center (neq,":giver_center_no", ":cur_target_center"),#Skip current center (assign, ":quest_target_center", ":cur_target_center"), (assign, ":quest_target_troop", ":cur_target_troop"), (assign, ":quest_xp_reward", 30), (assign, ":quest_gold_reward", 40), (assign, ":result", ":quest_no"), (assign, ":quest_expiration_days", 30), (try_end), (else_try), (eq, ":quest_no", "qst_escort_lady"), (try_begin), (ge, "$g_talk_troop_faction_relation", 0), (ge, ":player_level", 10), (troop_get_slot, ":cur_object_troop", ":giver_troop", slot_troop_daughter), (store_random_in_range, ":random_no", 0, 2), (try_begin), (this_or_next|eq, ":cur_object_troop", 0), (eq, ":random_no", 0), (troop_get_slot, ":cur_object_troop_2", ":giver_troop", slot_troop_spouse), (gt, ":cur_object_troop_2", 0), (assign, ":cur_object_troop", ":cur_object_troop_2"), (try_end), (gt, ":cur_object_troop", 0),#Skip lords without a lady (troop_get_type, ":cur_troop_gender", ":cur_object_troop"), (eq, ":cur_troop_gender", 1),#Skip if it is not female (gt, ":giver_center_no", 0),#Skip if lord is outside the center (troop_slot_eq, ":cur_object_troop", slot_troop_cur_center, ":giver_center_no"),#Skip if the lady is not at the same center (call_script, "script_cf_select_random_town_with_faction", ":giver_faction_no"),#Can fail (assign, ":cur_target_center", reg0), (neq, ":cur_target_center", ":giver_center_no"), (hero_can_join),#Skip if player has no available slots (assign, ":quest_object_troop", ":cur_object_troop"), (assign, ":quest_target_center", ":cur_target_center"), (assign, ":quest_expiration_days", 20), (assign, ":quest_dont_give_again_period", 30), (assign, ":result", ":quest_no"), (try_end), ## (else_try), ## (eq, ":quest_no", "qst_hunt_down_raiders"), ## (try_begin), ## (gt, ":player_level", 10), ## (faction_slot_eq, ":giver_faction_no", slot_faction_leader, ":giver_troop"), ## (call_script, "script_cf_select_random_town_with_faction", ":giver_faction_no"),#Can fail ## (assign, ":cur_object_center", reg0), ## (neq, ":cur_object_center", ":giver_center_no"),#Skip current center ## (call_script, "script_get_random_enemy_center", ":giver_party_no"), ## (assign, ":cur_target_center", reg0), ## (ge, ":cur_target_center", 0), ## (store_faction_of_party, ":cur_target_faction", ":cur_target_center"), ## (is_between, ":cur_target_faction", kingdoms_begin, kingdoms_end), ## ## (assign, ":quest_object_center", ":cur_object_center"), ## (assign, ":quest_target_center", ":cur_target_center"), ## (assign, ":quest_importance", 1), ## (assign, ":quest_xp_reward", 1500), ## (assign, ":quest_gold_reward", 1000), ## (assign, ":result", ":quest_no"), ## (try_end), ## (else_try), ## (eq, ":quest_no", "qst_bring_back_deserters"), ## (try_begin), ## (gt, ":player_level", 5), ## (faction_get_slot, ":cur_target_party_template", ":giver_faction_no", slot_faction_deserter_party_template), ## (faction_get_slot, ":cur_target_troop", ":giver_faction_no", slot_faction_deserter_troop), ## (gt, ":cur_target_party_template", 0),#Skip factions with no deserter party templates ## (store_num_parties_of_template, ":num_deserters", ":cur_target_party_template"), ## (ge, ":num_deserters", 2),#Skip if there are less than 2 active deserter parties ## ## (assign, ":quest_target_troop", ":cur_target_troop"), ## (assign, ":quest_target_party_template", ":cur_target_party_template"), ## (assign, ":quest_target_amount", 5), ## (assign, ":quest_importance", 1), ## (assign, ":quest_xp_reward", 500), ## (assign, ":quest_gold_reward", 300), ## (assign, ":result", ":quest_no"), ## (try_end), ## (else_try), ## (eq, ":quest_no", "qst_deliver_supply_to_center_under_siege"), ## (try_begin), ## (gt, ":player_level", 10), ## (gt, ":giver_center_no", 0),#Skip if lord is outside the center ## (call_script, "script_cf_get_random_siege_location_with_faction", ":giver_faction_no"),#Can fail ## (assign, ":quest_target_center", reg0), ## (assign, ":quest_target_amount", 10), ## (assign, ":quest_importance", 1), ## (assign, ":quest_xp_reward", 500), ## (assign, ":quest_gold_reward", 300), ## (assign, ":result", ":quest_no"), ## (try_end), ## (else_try), ## (eq, ":quest_no", "qst_rescue_lady_under_siege"), ## (try_begin), ## (gt, ":player_level", 15), ## (troop_get_slot, ":cur_object_troop", ":giver_troop", slot_troop_daughter), ## (store_random_in_range, ":random_no", 0, 2), ## (try_begin), ## (this_or_next|eq, ":cur_object_troop", 0), ## (eq, ":random_no", 0), ## (troop_get_slot, ":cur_object_troop_2", ":giver_troop", slot_troop_spouse), ## (gt, ":cur_object_troop_2", 0), ## (assign, ":cur_object_troop", ":cur_object_troop_2"), ## (try_end), ## (gt, ":cur_object_troop", 0),#Skip lords without a lady ## (troop_get_type, ":cur_troop_gender", ":cur_object_troop"), ## (eq, ":cur_troop_gender", 1),#Skip if lady is not female ## (troop_get_slot, ":cur_target_center", ":cur_object_troop", slot_troop_cur_center), ## (is_between, ":cur_target_center", centers_begin, centers_end),#Skip if she is not in a center ## (neq,":giver_center_no", ":cur_target_center"),#Skip current center ## (call_script, "script_cf_get_random_siege_location_with_faction", ":giver_faction_no"),#Can fail ## (assign, ":cur_target_center", reg0), ## (troop_set_slot, ":cur_object_troop", slot_troop_cur_center, ":cur_target_center"),#Move lady to the siege location ## (assign, ":quest_object_troop", ":cur_object_troop"), ## (assign, ":quest_target_center", ":cur_target_center"), ## (assign, ":quest_target_troop", ":giver_troop"), ## (assign, ":quest_importance", 1), ## (assign, ":quest_xp_reward", 200), ## (assign, ":quest_gold_reward", 750), ## (assign, ":result", ":quest_no"), ## (try_end), ## (else_try), ## (eq, ":quest_no", "qst_deliver_message_to_lover"), ## (try_begin), ## (is_between, ":player_level", 5, 30), ## (troop_get_slot, ":cur_target_troop", ":giver_troop", slot_troop_lover), ## (gt, ":cur_target_troop", 0),#Skip lords without a lover ## (troop_get_slot, ":cur_target_center", ":cur_target_troop", slot_troop_cur_center), ## (is_between, ":cur_target_center", centers_begin, centers_end),#Skip if she is not in a center ## (neq,":giver_center_no", ":cur_target_center"),#Skip current center ## (assign, ":quest_target_troop", ":cur_target_troop"), ## (assign, ":quest_target_center", ":cur_target_center"), ## (assign, ":result", ":quest_no"), ## (try_end), ## (else_try), ## (eq, ":quest_no", "qst_bring_reinforcements_to_siege"), ## (try_begin), ## (gt, ":player_level", 10), ## (call_script, "script_cf_get_random_siege_location_with_attacker_faction", ":giver_faction_no"),#Can fail ## (assign, ":cur_target_center", reg0), ## (store_random_in_range, ":random_no", 5, 11), ## (troops_can_join, ":random_no"),#Skip if the player doesn't have enough room ## (call_script, "script_cf_get_number_of_random_troops_from_party", ":giver_party_no", ":random_no"),#Can fail ## (assign, ":cur_object_troop", reg0), ## (party_get_battle_opponent, ":cur_target_party", ":cur_target_center"), ## (party_get_num_companion_stacks, ":num_stacks", ":cur_target_party"), ## (gt, ":num_stacks", 0),#Skip if the besieger party has no troops ## (party_stack_get_troop_id, ":cur_target_troop", ":cur_target_party", 0), ## (troop_is_hero, ":cur_target_troop"),#Skip if the besieger party has no heroes ## (neq, ":cur_target_troop", ":giver_troop"),#Skip if the quest giver is the same troop ## (assign, ":quest_target_troop", ":cur_target_troop"), ## (assign, ":quest_object_troop", ":cur_object_troop"), ## (assign, ":quest_target_party", ":cur_target_party"), ## (assign, ":quest_target_center", ":cur_target_center"), ## (assign, ":quest_target_amount", ":random_no"), ## (assign, ":quest_importance", 1), ## (assign, ":quest_xp_reward", 400), ## (assign, ":quest_gold_reward", 200), ## (assign, ":result", ":quest_no"), ## (try_end), (else_try), (eq, ":quest_no", "qst_deliver_message_to_enemy_lord"), (try_begin), (ge, "$g_talk_troop_faction_relation", 0), (is_between, ":player_level", 5,25), (call_script, "script_cf_get_random_lord_from_another_faction_in_a_center", ":giver_faction_no"),#Can fail (assign, ":cur_target_troop", reg0), (call_script, "script_get_troop_attached_party", ":cur_target_troop"), (assign, ":quest_target_center", reg0),#quest_target_center will definitely be a valid center (assign, ":quest_target_troop", ":cur_target_troop"), (assign, ":quest_importance", 1), (assign, ":quest_xp_reward", 200), (assign, ":quest_gold_reward", 0), (assign, ":result", ":quest_no"), (assign, ":quest_expiration_days", 40), (try_end), ## (else_try), ## (eq, ":quest_no", "qst_bring_prisoners_to_enemy"), ## (try_begin), ## (gt, ":player_level", 10), ## (is_between, ":giver_center_no", centers_begin, centers_end),#Skip if the quest giver is not at a center ## (store_random_in_range, ":random_no", 5, 11), ## (troops_can_join_as_prisoner, ":random_no"),#Skip if the player doesn't have enough room ## (call_script, "script_get_random_enemy_town", ":giver_center_no"), ## (assign, ":cur_target_center", reg0), ## (ge, ":cur_target_center", 0),#Skip if there are no enemy towns ## (store_faction_of_party, ":cur_target_faction", ":cur_target_center"), ## (faction_get_slot, ":cur_object_troop", ":cur_target_faction", slot_faction_tier_5_troop), ## (assign, ":quest_target_center", ":cur_target_center"), ## (assign, ":quest_object_troop", ":cur_object_troop"), ## (assign, ":quest_target_amount", ":random_no"), ## (assign, ":quest_importance", 1), ## (assign, ":quest_xp_reward", 300), ## (assign, ":quest_gold_reward", 200), ## (assign, ":result", ":quest_no"), ## (try_end), (else_try), (eq, ":quest_no", "qst_deal_with_bandits_at_lords_village"), (try_begin), (neq, ":giver_reputation", lrep_debauched), (neq, ":giver_reputation", lrep_quarrelsome), (ge, "$g_talk_troop_faction_relation", 0), (assign, ":end_cond", villages_end), (assign, ":cur_target_center", -1), (try_for_range, ":cur_village", villages_begin, ":end_cond"), (party_slot_eq, ":cur_village", slot_town_lord, ":giver_troop"), (party_slot_eq, ":cur_village", slot_village_infested_by_bandits, 1), (assign, ":cur_target_center", ":cur_village"), (assign, ":end_cond", 0), (try_end), (ge, ":cur_target_center", 0), (neg|check_quest_active, "qst_eliminate_bandits_infesting_village"), (assign, ":quest_target_center", ":cur_target_center"), (assign, ":result", ":quest_no"), (assign, ":quest_expiration_days", 30), (try_end), (else_try), (eq, ":quest_no", "qst_raise_troops"), (try_begin), (neq, ":giver_reputation", lrep_martial), (neq, ":giver_faction_no", "fac_player_supporters_faction"), #we need tier_1_troop a valid value (ge, "$g_talk_troop_faction_relation", 0), (store_character_level, ":cur_level", "trp_player"), (gt, ":cur_level", 5), (troop_slot_ge, "trp_player", slot_troop_renown, 100), (store_random_in_range, ":quest_target_amount", 5, 8), (party_get_free_companions_capacity, ":free_capacity", "p_main_party"), (le, ":quest_target_amount", ":free_capacity"), (faction_get_slot, ":quest_object_troop", ":giver_faction_no", slot_faction_tier_1_troop), (store_random_in_range, ":level_up", 20, 40), (val_add, ":level_up", ":cur_level"), (val_div, ":level_up", 10), (store_mul, ":quest_gold_reward", ":quest_target_amount", 10), (assign, ":quest_target_troop", ":quest_object_troop"), (try_for_range, ":unused", 0, ":level_up"), (troop_get_upgrade_troop, ":level_up_troop", ":quest_target_troop", 0), (gt, ":level_up_troop", 0), (assign, ":quest_target_troop", ":level_up_troop"), (val_mul, ":quest_gold_reward", ":quest_gold_reward", 7), (val_div, ":quest_gold_reward", ":quest_gold_reward", 4), (try_end), ## (try_begin), ## (ge, ":cur_level", 15), ## (faction_get_slot, ":cur_target_troop", ":giver_faction_no", slot_faction_tier_5_troop), ## (assign, ":quest_gold_reward", 300), ## (else_try), ## (faction_get_slot, ":cur_target_troop", ":giver_faction_no", slot_faction_tier_4_troop), ## (assign, ":quest_gold_reward", 150), ## (try_end), ## (gt, ":cur_target_troop", 0), (assign, ":quest_xp_reward", ":quest_gold_reward"), (val_mul, ":quest_xp_reward", 3), (val_div, ":quest_xp_reward", 10), (assign, ":result", ":quest_no"), (assign, ":quest_expiration_days", 120), (assign, ":quest_dont_give_again_period", 15), (try_end), (else_try), (eq, ":quest_no", "qst_collect_taxes"), (try_begin), (neq, ":giver_reputation", lrep_goodnatured), (neq, ":giver_reputation", lrep_upstanding), (ge, "$g_talk_troop_faction_relation", 0), (call_script, "script_cf_troop_get_random_leaded_town_or_village_except_center", ":giver_troop", ":giver_center_no"), (assign, ":quest_target_center", reg0), (assign, ":quest_importance", 1), (assign, ":quest_gold_reward", 0), (assign, ":quest_xp_reward", 100), (assign, ":result", ":quest_no"), (assign, ":quest_expiration_days", 50), (assign, ":quest_dont_give_again_period", 20), (try_end), (else_try), (eq, ":quest_no", "qst_hunt_down_fugitive"), (try_begin), (ge, "$g_talk_troop_faction_relation", 0), (call_script, "script_cf_select_random_village_with_faction", ":giver_faction_no"), (assign, ":quest_target_center", reg0), (store_random_in_range, ":quest_target_dna", 0, 1000000), (assign, ":result", ":quest_no"), (assign, ":quest_expiration_days", 30), (assign, ":quest_dont_give_again_period", 30), (try_end), ## (else_try), ## (eq, ":quest_no", "qst_capture_messenger"), ## (try_begin), ## (call_script, "script_cf_faction_get_random_enemy_faction", ":giver_faction_no"), ## (assign, ":cur_target_faction", reg0), ## (faction_get_slot, ":cur_target_troop", ":cur_target_faction", slot_faction_messenger_troop), ## (gt, ":cur_target_troop", 0),#Checking the validiy of cur_target_troop ## (store_num_parties_destroyed_by_player, ":quest_target_amount", "pt_messenger_party"), ## ## (assign, ":quest_target_troop", ":cur_target_troop"), ## (assign, ":quest_target_party_template", ":cur_target_party_template"), ## (assign, ":quest_importance", 1), ## (assign, ":quest_xp_reward", 700), ## (assign, ":quest_gold_reward", 400), ## (assign, ":result", ":quest_no"), ## (try_end), (else_try), (eq, ":quest_no", "qst_kill_local_merchant"), (try_begin), (this_or_next|eq, ":giver_reputation", lrep_quarrelsome), (this_or_next|eq, ":giver_reputation", lrep_cunning), ( eq, ":giver_reputation", lrep_debauched), (neg|faction_slot_eq, ":giver_faction_no", slot_faction_leader, ":giver_troop"),#Can not take the quest from the king (ge, "$g_talk_troop_faction_relation", 0), (gt, ":player_level", 5), (is_between, ":giver_center_no", towns_begin, towns_end), (assign, ":quest_importance", 1), (assign, ":quest_xp_reward", 300), (assign, ":quest_gold_reward", 1000), (assign, ":result", ":quest_no"), (assign, ":quest_expiration_days", 10), (assign, ":quest_dont_give_again_period", 30), (try_end), (else_try), (eq, ":quest_no", "qst_bring_back_runaway_serfs"), (try_begin), (neq, ":giver_reputation", lrep_goodnatured), (neq, ":giver_reputation", lrep_upstanding), (ge, "$g_talk_troop_faction_relation", 0), (ge, ":player_level", 5), (gt, ":giver_center_no", 0),#Skip if lord is outside the center (eq, "$g_defending_against_siege", 0),#Skip if the center is under siege (because of resting) (assign, ":cur_object_center", -1), (try_for_range, ":cur_village", villages_begin, villages_end), (party_slot_eq, ":cur_village", slot_town_lord, ":giver_troop"), (store_distance_to_party_from_party, ":dist", ":cur_village", ":giver_center_no"), (lt, ":dist", 25), (assign, ":cur_object_center", ":cur_village"), (try_end), (ge, ":cur_object_center", 0),#Skip if the quest giver is not the owner of any villages around the center (call_script, "script_cf_select_random_town_with_faction", ":giver_faction_no"), (assign, ":cur_target_center", reg0), (neq, ":cur_target_center", ":giver_center_no"),#Skip current center (store_distance_to_party_from_party, ":dist", ":cur_target_center", ":giver_center_no"), (ge, ":dist", 20), (assign, ":quest_target_party_template", "pt_runaway_serfs"), (assign, ":quest_object_center", ":cur_object_center"), (assign, ":quest_target_center", ":cur_target_center"), (assign, ":quest_importance", 1), (assign, ":quest_xp_reward", 200), (assign, ":quest_gold_reward", 150), (assign, ":result", ":quest_no"), (assign, ":quest_expiration_days", 30), (assign, ":quest_dont_give_again_period", 20), (assign, "$qst_bring_back_runaway_serfs_num_parties_returned", 0), (assign, "$qst_bring_back_runaway_serfs_num_parties_fleed", 0), (try_end), (else_try), (eq, ":quest_no", "qst_follow_spy"), (try_begin), (ge, "$g_talk_troop_faction_relation", 0), (neq, ":giver_reputation", lrep_goodnatured), (party_get_skill_level, ":tracking_skill", "p_main_party", "skl_tracking"), (ge, ":tracking_skill", 2), (ge, ":player_level", 10), (eq, "$g_defending_against_siege", 0), #Skip if the center is under siege (because of resting) (gt, ":giver_party_no", 0), #Skip if the quest giver doesn't have a party (gt, ":giver_center_no", 0), #skip if the quest giver is not in a center (party_slot_eq, "$g_encountered_party", slot_party_type, spt_town), #skip if we are not in a town. (party_get_position, pos2, "p_main_party"), (assign, ":min_distance", 99999), (try_for_range, ":unused_2", 0, 10), (call_script, "script_cf_get_random_enemy_center", ":giver_party_no"), (assign, ":random_object_center", reg0), (party_get_position, pos3, ":random_object_center"), (map_get_random_position_around_position, pos4, pos3, 6), (get_distance_between_positions, ":cur_distance", pos2, pos4), (lt, ":cur_distance", ":min_distance"), (assign, ":min_distance", ":cur_distance"), (assign, ":cur_object_center", ":random_object_center"), (copy_position, pos63, pos4), #Do not change pos63 until quest is accepted (try_end), (gt, ":cur_object_center", 0), #Skip if there are no enemy centers (assign, ":quest_object_center", ":cur_object_center"), (assign, ":quest_dont_give_again_period", 50), (assign, ":result", ":quest_no"), (assign, "$qst_follow_spy_run_away", 0), (assign, "$qst_follow_spy_meeting_state", 0), (assign, "$qst_follow_spy_meeting_counter", 0), (assign, "$qst_follow_spy_spy_back_in_town", 0), (assign, "$qst_follow_spy_partner_back_in_town", 0), (assign, "$qst_follow_spy_no_active_parties", 0), (try_end), (else_try), (eq, ":quest_no", "qst_capture_enemy_hero"), (try_begin), (eq, "$players_kingdom", ":giver_faction_no"), (neg|faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"), (ge, ":player_level", 15), (call_script, "script_cf_faction_get_random_enemy_faction", ":giver_faction_no"),#Can fail (assign, ":quest_target_faction", reg0), (assign, ":quest_expiration_days", 30), (assign, ":quest_dont_give_again_period", 80), (assign, ":quest_gold_reward", 2000), (assign, ":result", ":quest_no"), (try_end), (else_try), (eq, ":quest_no", "qst_lend_companion"), (try_begin), (ge, "$g_talk_troop_faction_relation", 0), (assign, ":total_heroes", 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"), (troop_is_hero, ":stack_troop"), (is_between, ":stack_troop", companions_begin, companions_end), (store_character_level, ":stack_level", ":stack_troop"), (ge, ":stack_level", 15), (assign, ":is_quest_hero", 0), (try_for_range, ":i_quest", 0, all_quests_end), (check_quest_active, ":i_quest"), (this_or_next|quest_slot_eq, ":i_quest", slot_quest_target_troop, ":stack_troop"), (quest_slot_eq, ":i_quest", slot_quest_object_troop, ":stack_troop"), (assign, ":is_quest_hero", 1), (try_end), (eq, ":is_quest_hero", 0), (val_add, ":total_heroes", 1), (try_end), (gt, ":total_heroes", 0),#Skip if party has no eligible heroes (store_random_in_range, ":random_hero", 0, ":total_heroes"), (assign, ":total_heroes", 0), (assign, ":cur_target_troop", -1), (try_for_range, ":i_stack", 0, ":num_stacks"), (eq, ":cur_target_troop", -1), (party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"), (troop_is_hero, ":stack_troop"), (neq, ":stack_troop", "trp_player"), (store_character_level, ":stack_level", ":stack_troop"), (ge, ":stack_level", 15), (assign, ":is_quest_hero", 0), (try_for_range, ":i_quest", 0, all_quests_end), (check_quest_active, ":i_quest"), (this_or_next|quest_slot_eq, ":i_quest", slot_quest_target_troop, ":stack_troop"), (quest_slot_eq, ":i_quest", slot_quest_object_troop, ":stack_troop"), (assign, ":is_quest_hero", 1), (try_end), (eq, ":is_quest_hero", 0), (val_add, ":total_heroes", 1), (gt, ":total_heroes", ":random_hero"), (assign, ":cur_target_troop", ":stack_troop"), (try_end), (assign, ":quest_target_troop", ":cur_target_troop"), (store_current_day, ":quest_target_amount"), (val_add, ":quest_target_amount", 8), (assign, ":quest_importance", 1), (assign, ":quest_xp_reward", 300), (assign, ":quest_gold_reward", 400), (assign, ":result", ":quest_no"), (assign, ":quest_dont_give_again_period", 30), (try_end), (else_try), (eq, ":quest_no", "qst_collect_debt"), (try_begin), (ge, "$g_talk_troop_faction_relation", 0), # Find a vassal (within the same kingdom?) (call_script, "script_cf_get_random_lord_in_a_center_with_faction", ":giver_faction_no"),#Can fail (assign, ":quest_target_troop", reg0), (neq, ":quest_target_troop", ":giver_troop"),#Skip himself (call_script, "script_get_troop_attached_party", ":quest_target_troop"), (assign, ":quest_target_center", reg0),#cur_target_center will definitely be a valid center (neq,":giver_center_no", ":quest_target_center"),#Skip current center (assign, ":quest_xp_reward", 30), (assign, ":quest_gold_reward", 40), (assign, ":result", ":quest_no"), (store_random_in_range, ":quest_target_amount", 6, 9), (val_mul, ":quest_target_amount", 500), (store_div, ":quest_convince_value", ":quest_target_amount", 5), (assign, ":quest_expiration_days", 90), (assign, ":quest_dont_give_again_period", 20), (try_end), ## (else_try), ## (eq, ":quest_no", "qst_capture_conspirators"), ## (try_begin), ## (eq, 1,0), #TODO: disable this for now ## (ge, ":player_level", 10), ## (is_between, ":giver_center_no", towns_begin, towns_end),#Skip if quest giver's center is not a town ## (party_slot_eq, ":giver_center_no", slot_town_lord, ":giver_troop"),#Skip if the current center is not ruled by the quest giver ## (call_script, "script_cf_get_random_kingdom_hero", ":giver_faction_no"),#Can fail ## ## (assign, ":quest_target_troop", reg0), ## (assign, ":quest_target_center", ":giver_center_no"), ## (assign, ":quest_importance", 1), ## (assign, ":quest_xp_reward", 10), ## (assign, ":quest_gold_reward", 10), ## (assign, ":result", ":quest_no"), ## (store_character_level, ":cur_level"), ## (val_div, ":cur_level", 5), ## (val_max, ":cur_level", 3), ## (store_add, ":max_parties", 4, ":cur_level"), ## (store_random_in_range, "$qst_capture_conspirators_num_parties_to_spawn", 4, ":max_parties"), ## (assign, "$qst_capture_conspirators_num_troops_to_capture", 0), ## (assign, "$qst_capture_conspirators_num_parties_spawned", 0), ## (assign, "$qst_capture_conspirators_leave_meeting_counter", 0), ## (assign, "$qst_capture_conspirators_party_1", 0), ## (assign, "$qst_capture_conspirators_party_2", 0), ## (assign, "$qst_capture_conspirators_party_3", 0), ## (assign, "$qst_capture_conspirators_party_4", 0), ## (assign, "$qst_capture_conspirators_party_5", 0), ## (assign, "$qst_capture_conspirators_party_6", 0), ## (assign, "$qst_capture_conspirators_party_7", 0), ## (try_end), ## (else_try), ## (eq, ":quest_no", "qst_defend_nobles_against_peasants"), ## (try_begin), ## (eq, 1,0), #TODO: disable this for now ## (ge, ":player_level", 10), ## (is_between, ":giver_center_no", towns_begin, towns_end),#Skip if quest giver's center is not a town ## (party_slot_eq, ":giver_center_no", slot_town_lord, ":giver_troop"),#Skip if the current center is not ruled by the quest giver ## ## (assign, ":quest_target_center", ":giver_center_no"), ## (assign, ":quest_importance", 1), ## (assign, ":quest_xp_reward", 10), ## (assign, ":quest_gold_reward", 10), ## (assign, ":result", ":quest_no"), ## (store_character_level, ":cur_level"), ## (val_div, ":cur_level", 5), ## (val_max, ":cur_level", 4), ## (store_add, ":max_parties", 4, ":cur_level"), ## (store_random_in_range, "$qst_defend_nobles_against_peasants_num_peasant_parties_to_spawn", 4, ":cur_level"), ## (store_random_in_range, "$qst_defend_nobles_against_peasants_num_noble_parties_to_spawn", 4, ":cur_level"), ## (assign, "$qst_defend_nobles_against_peasants_num_nobles_to_save", 0), ## (assign, "$qst_defend_nobles_against_peasants_num_nobles_saved", 0), ## (assign, "$qst_defend_nobles_against_peasants_peasant_party_1", 0), ## (assign, "$qst_defend_nobles_against_peasants_peasant_party_2", 0), ## (assign, "$qst_defend_nobles_against_peasants_peasant_party_3", 0), ## (assign, "$qst_defend_nobles_against_peasants_peasant_party_4", 0), ## (assign, "$qst_defend_nobles_against_peasants_peasant_party_5", 0), ## (assign, "$qst_defend_nobles_against_peasants_peasant_party_6", 0), ## (assign, "$qst_defend_nobles_against_peasants_peasant_party_7", 0), ## (assign, "$qst_defend_nobles_against_peasants_peasant_party_8", 0), ## (assign, "$qst_defend_nobles_against_peasants_noble_party_1", 0), ## (assign, "$qst_defend_nobles_against_peasants_noble_party_2", 0), ## (assign, "$qst_defend_nobles_against_peasants_noble_party_3", 0), ## (assign, "$qst_defend_nobles_against_peasants_noble_party_4", 0), ## (assign, "$qst_defend_nobles_against_peasants_noble_party_5", 0), ## (assign, "$qst_defend_nobles_against_peasants_noble_party_6", 0), ## (assign, "$qst_defend_nobles_against_peasants_noble_party_7", 0), ## (assign, "$qst_defend_nobles_against_peasants_noble_party_8", 0), ## (try_end), (else_try), (eq, ":quest_no", "qst_incriminate_loyal_commander"), (try_begin), (neq, ":giver_reputation", lrep_upstanding), (neq, ":giver_reputation", lrep_goodnatured), (eq, "$players_kingdom", ":giver_faction_no"), (ge, ":player_level", 10), (faction_slot_eq, ":giver_faction_no", slot_faction_leader, ":giver_troop"), (assign, ":try_times", 1), (assign, ":found", 0), (try_for_range, ":unused", 0, ":try_times"), (call_script, "script_cf_faction_get_random_enemy_faction", ":giver_faction_no"),#Can fail (assign, ":cur_target_faction", reg0), (faction_get_slot, ":cur_target_troop", ":cur_target_faction", slot_faction_leader), (assign, ":num_centerless_heroes", 0), (try_for_range, ":cur_kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end), (troop_slot_eq, ":cur_kingdom_hero", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":cur_kingdom_hero", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":cur_kingdom_hero", slot_troop_prisoner_of_party, 0), (neq, ":cur_target_troop", ":cur_kingdom_hero"), (store_troop_faction, ":cur_kingdom_hero_faction", ":cur_kingdom_hero"), (eq, ":cur_target_faction", ":cur_kingdom_hero_faction"), ## (call_script, "script_get_number_of_hero_centers", ":cur_kingdom_hero"), ## (eq, reg0, 0), (val_add, ":num_centerless_heroes", 1), (try_end), (gt, ":num_centerless_heroes", 0), (assign, ":cur_object_troop", -1), (store_random_in_range, ":random_kingdom_hero", 0, ":num_centerless_heroes"), (try_for_range, ":cur_kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end), (eq, ":cur_object_troop", -1), (troop_slot_eq, ":cur_kingdom_hero", slot_troop_occupation, slto_kingdom_hero), (neq, ":cur_target_troop", ":cur_kingdom_hero"), (store_troop_faction, ":cur_kingdom_hero_faction", ":cur_kingdom_hero"), (eq, ":cur_target_faction", ":cur_kingdom_hero_faction"), ## (call_script, "script_get_number_of_hero_centers", ":cur_kingdom_hero"), ## (eq, reg0, 0), (val_sub, ":random_kingdom_hero", 1), (lt, ":random_kingdom_hero", 0), (assign, ":cur_object_troop", ":cur_kingdom_hero"), (try_end), (assign, ":cur_target_center", -1), (call_script, "script_get_troop_attached_party", ":cur_target_troop"), (is_between, reg0, towns_begin, towns_end), (party_slot_eq, reg0, slot_town_lord, ":cur_target_troop"), (assign, ":cur_target_center", reg0), (assign, ":try_times", -1),#Exit the second loop (assign, ":found", 1), (try_end), (eq, ":found", 1), (assign, "$incriminate_quest_sacrificed_troop", 0), (party_get_num_companion_stacks, ":num_stacks", "p_main_party"), (try_for_range, ":i_stack", 1, ":num_stacks"), (eq ,"$incriminate_quest_sacrificed_troop", 0), (party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"), (neg|troop_is_hero, ":stack_troop"), (store_character_level, ":stack_troop_level", ":stack_troop"), (ge, ":stack_troop_level", 25), (assign, "$incriminate_quest_sacrificed_troop", ":stack_troop"), (try_end), (gt, "$incriminate_quest_sacrificed_troop", 0), (assign, ":quest_target_troop", ":cur_target_troop"), (assign, ":quest_object_troop", ":cur_object_troop"), (assign, ":quest_target_center", ":cur_target_center"), (assign, ":quest_target_faction", ":cur_target_faction"), (assign, ":quest_importance", 1), (assign, ":quest_xp_reward", 700), (assign, ":quest_gold_reward", 1000), (assign, ":result", ":quest_no"), (assign, ":quest_expiration_days", 30), (assign, ":quest_dont_give_again_period", 180), (try_end), (else_try), (eq, ":quest_no", "qst_capture_prisoners"), (try_begin), (eq, "$players_kingdom", ":giver_faction_no"), (call_script, "script_cf_faction_get_random_enemy_faction", ":giver_faction_no"),#Can fail (assign, ":cur_target_faction", reg0), (store_add, ":max_tier_no", slot_faction_tier_5_troop, 1), (store_random_in_range, ":random_tier_no", slot_faction_tier_2_troop, ":max_tier_no"), (faction_get_slot, ":cur_target_troop", ":cur_target_faction", ":random_tier_no"), (gt, ":cur_target_troop", 0), (store_random_in_range, ":quest_target_amount", 3, 7), (assign, ":quest_target_troop", ":cur_target_troop"), (assign, ":quest_target_faction", ":cur_target_faction"), (assign, ":quest_importance", 1), (store_character_level, ":quest_gold_reward", ":cur_target_troop"), (val_add, ":quest_gold_reward", 5), (val_mul, ":quest_gold_reward", ":quest_gold_reward"), (val_div, ":quest_gold_reward", 5), (val_mul, ":quest_gold_reward", ":quest_target_amount"), (assign, ":quest_xp_reward", ":quest_gold_reward"), (assign, ":result", ":quest_no"), (assign, ":quest_expiration_days", 90), (assign, ":quest_dont_give_again_period", 20), (try_end), (try_end), (try_end), (try_begin), (neq, ":result", -1), (try_begin), (ge, ":quest_target_center", 0), (store_faction_of_party, ":quest_target_faction", ":quest_target_center"), (try_end), (quest_set_slot, ":result", slot_quest_target_troop, ":quest_target_troop"), (quest_set_slot, ":result", slot_quest_target_center, ":quest_target_center"), (quest_set_slot, ":result", slot_quest_object_troop, ":quest_object_troop"), (quest_set_slot, ":result", slot_quest_target_faction, ":quest_target_faction"), (quest_set_slot, ":result", slot_quest_object_faction, ":quest_object_faction"), (quest_set_slot, ":result", slot_quest_object_center, ":quest_object_center"), (quest_set_slot, ":result", slot_quest_target_party, ":quest_target_party"), (quest_set_slot, ":result", slot_quest_target_party_template, ":quest_target_party_template"), (quest_set_slot, ":result", slot_quest_target_amount, ":quest_target_amount"), (quest_set_slot, ":result", slot_quest_importance, ":quest_importance"), (quest_set_slot, ":result", slot_quest_xp_reward, ":quest_xp_reward"), (quest_set_slot, ":result", slot_quest_gold_reward, ":quest_gold_reward"), (quest_set_slot, ":result", slot_quest_convince_value, ":quest_convince_value"), (quest_set_slot, ":result", slot_quest_expiration_days, ":quest_expiration_days"), (quest_set_slot, ":result", slot_quest_dont_give_again_period, ":quest_dont_give_again_period"), (quest_set_slot, ":result", slot_quest_current_state, 0), (quest_set_slot, ":result", slot_quest_giver_troop, ":giver_troop"), (quest_set_slot, ":result", slot_quest_giver_center, ":giver_center_no"), (quest_set_slot, ":result", slot_quest_target_dna, ":quest_target_dna"), (quest_set_slot, ":result", slot_quest_target_item, ":quest_target_item"), (try_end), (assign, reg0, ":result"), ]), # script_cf_get_random_enemy_center_within_range # Input: arg1 = party_no, arg2 = range (in kms) # Output: reg0 = center_no ("cf_get_random_enemy_center_within_range", [ (store_script_param, ":party_no", 1), (store_script_param, ":range", 2), (assign, ":num_centers", 0), (store_faction_of_party, ":faction_no", ":party_no"), (try_for_range, ":cur_center", centers_begin, centers_end), (store_faction_of_party, ":cur_faction", ":cur_center"), (store_relation, ":cur_relation", ":faction_no", ":cur_faction"), (lt, ":cur_relation", 0), (store_distance_to_party_from_party, ":dist", ":party_no", ":cur_center"), (le, ":dist", ":range"), (val_add, ":num_centers", 1), (try_end), (gt, ":num_centers", 0), (store_random_in_range, ":random_center", 0, ":num_centers"), (assign, ":end_cond", centers_end), (try_for_range, ":cur_center", centers_begin, ":end_cond"), (store_faction_of_party, ":cur_faction", ":cur_center"), (store_relation, ":cur_relation", ":faction_no", ":cur_faction"), (lt, ":cur_relation", 0), (store_distance_to_party_from_party, ":dist", ":party_no", ":cur_center"), (le, ":dist", ":range"), (val_sub, ":random_center", 1), (lt, ":random_center", 0), (assign, ":result", ":cur_center"), (assign, ":end_cond", 0),#break (try_end), (assign, reg0, ":result"), ]), # script_cf_faction_get_random_enemy_faction # Input: arg1 = faction_no # Output: reg0 = faction_no (Can fail) ("cf_faction_get_random_enemy_faction", [ (store_script_param_1, ":faction_no"), (assign, ":result", -1), (assign, ":count_factions", 0), (try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active), (store_relation, ":cur_relation", ":faction_no", ":cur_faction"), (le, ":cur_relation", -1), (val_add, ":count_factions", 1), (try_end), (store_random_in_range,":random_faction",0,":count_factions"), (assign, ":count_factions", 0), (try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end), (eq, ":result", -1), (faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active), (store_relation, ":cur_relation", ":faction_no", ":cur_faction"), (le, ":cur_relation", -1), (val_add, ":count_factions", 1), (gt, ":count_factions", ":random_faction"), (assign, ":result", ":cur_faction"), (try_end), (neq, ":result", -1), (assign, reg0, ":result"), ]), # script_cf_faction_get_random_friendly_faction # Input: arg1 = faction_no # Output: reg0 = faction_no (Can fail) ("cf_faction_get_random_friendly_faction", [ (store_script_param_1, ":faction_no"), (assign, ":result", -1), (assign, ":count_factions", 0), (try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active), (neq, ":cur_faction", ":faction_no"), (store_relation, ":cur_relation", ":faction_no", ":cur_faction"), (ge, ":cur_relation", 0), (val_add, ":count_factions", 1), (try_end), (store_random_in_range,":random_faction",0,":count_factions"), (assign, ":count_factions", 0), (try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end), (eq, ":result", -1), (faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active), (neq, ":cur_faction", ":faction_no"), (store_relation, ":cur_relation", ":faction_no", ":cur_faction"), (ge, ":cur_relation", 0), (val_add, ":count_factions", 1), (gt, ":count_factions", ":random_faction"), (assign, ":result", ":cur_faction"), (try_end), (neq, ":result", -1), (assign, reg0, ":result"), ]), # script_cf_troop_get_random_enemy_troop_with_occupation # Input: arg1 = troop_no, # Output: reg0 = enemy_troop_no (Can fail) ("cf_troop_get_random_enemy_troop_with_occupation", [ (store_script_param_1, ":troop_no"), (store_script_param_2, ":occupation"), (assign, ":result", -1), (assign, ":count_enemies", 0), (try_for_range, ":cur_slot", slot_troop_enemies_begin, slot_troop_enemies_end), (troop_get_slot, ":cur_enemy", ":troop_no", ":cur_slot"), (gt, ":cur_enemy", 0), (troop_slot_eq, ":cur_enemy", slot_troop_occupation, ":occupation"), (val_add, ":count_enemies", 1), (try_end), (store_random_in_range,":random_enemy",0,":count_enemies"), (assign, ":count_enemies", 0), (try_for_range, ":cur_slot", slot_troop_enemies_begin, slot_troop_enemies_end), (eq, ":result", -1), (troop_get_slot, ":cur_enemy", ":troop_no", ":cur_slot"), (gt, ":cur_enemy", 0), (troop_slot_eq, ":cur_enemy", slot_troop_occupation, ":occupation"), (val_add, ":count_enemies", 1), (gt, ":count_enemies", ":random_enemy"), (assign, ":result", ":cur_enemy"), (try_end), (neq, ":result", -1), (assign, reg0, ":result"), ]), ## # script_cf_troop_get_random_enemy_troop_as_a_town_lord ## # Input: arg1 = troop_no ## # Output: reg0 = enemy_troop_no (Can fail) ## ("cf_troop_get_random_enemy_troop_as_a_town_lord", ## [ ## (store_script_param_1, ":troop_no"), ## ## (assign, ":result", -1), ## (assign, ":count_enemies", 0), ## (try_for_range, ":cur_slot", slot_troop_enemies_begin, slot_troop_enemies_end), ## (troop_get_slot, ":cur_enemy", ":troop_no", ":cur_slot"), ## (gt, ":cur_enemy", 0), ## (troop_slot_eq, ":cur_enemy", slot_troop_occupation, slto_kingdom_hero), ## (call_script, "script_get_number_of_hero_centers", ":cur_enemy"), ## (gt, reg0, 0), ## (val_add, ":count_enemies", 1), ## (try_end), ## (store_random_in_range,":random_enemy",0,":count_enemies"), ## (assign, ":count_enemies", 0), ## (try_for_range, ":cur_slot", slot_troop_enemies_begin, slot_troop_enemies_end), ## (eq, ":result", -1), ## (troop_get_slot, ":cur_enemy", ":troop_no", ":cur_slot"), ## (gt, ":cur_enemy", 0), ## (troop_slot_eq, ":cur_enemy", slot_troop_occupation, slto_kingdom_hero), ## (call_script, "script_get_number_of_hero_centers", ":cur_enemy"), ## (gt, reg0, 0), ## (val_add, ":count_enemies", 1), ## (gt, ":count_enemies", ":random_enemy"), ## (assign, ":result", ":cur_enemy"), ## (try_end), ## (neq, ":result", -1), ## (assign, reg0, ":result"), ## ]), ## # script_cf_get_random_enemy_with_valid_slot ## # Input: arg1 = faction_no, arg2 = slot_no ## # Output: reg0 = faction_no (Can fail) ## ("cf_get_random_enemy_with_valid_slot", ## [ ## (store_script_param_1, ":faction_no"), ## (store_script_param_2, ":slot_no"), ## ## (assign, ":result", -1), ## (assign, ":count_factions", 0), ## (try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end), ## (store_relation, ":cur_relation", ":faction_no", ":cur_faction"), ## (le, ":cur_relation", -10), ## (faction_get_slot, ":cur_value", ":cur_faction", ":slot_no"), ## (gt, ":cur_value", 0),#Checking validity ## (val_add, ":count_factions", 1), ## (try_end), ## (store_random_in_range,":random_faction",0,":count_factions"), ## (assign, ":count_factions", 0), ## (try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end), ## (eq, ":result", -1), ## (store_relation, ":cur_relation", ":faction_no", ":cur_faction"), ## (le, ":cur_relation", -10), ## (faction_get_slot, ":cur_value", ":cur_faction", ":slot_no"), ## (gt, ":cur_value", 0),#Checking validity ## (val_add, ":count_factions", 1), ## (gt, ":count_factions", ":random_faction"), ## (assign, ":result", ":cur_faction"), ## (try_end), ## ## (neq, ":result", -1), ## (assign, reg0, ":result"), ## ]), ## # script_cf_get_random_kingdom_hero ## # Input: arg1 = faction_no ## # Output: reg0 = troop_no (Can fail) ## ("cf_get_random_kingdom_hero", ## [ ## (store_script_param_1, ":faction_no"), ## (assign, ":count_heroes", 0), ## (try_for_range, ":center_no", centers_begin, centers_end), ## (store_faction_of_party, ":cur_faction", ":center_no"), ## (eq, ":cur_faction", ":faction_no"), ## (party_get_slot, ":cur_lord", ":center_no", slot_town_lord), ## (is_between, ":cur_lord", heroes_begin, heroes_end), ## (val_add, ":count_heroes", 1), ## (try_end), ## (store_random_in_range, ":random_hero", 0, ":count_heroes"), ## (assign, ":result", -1), ## (assign, ":count_heroes", 0), ## (try_for_range, ":center_no", centers_begin, centers_end), ## (eq, ":result", -1), ## (store_faction_of_party, ":cur_faction", ":center_no"), ## (eq, ":cur_faction", ":faction_no"), ## (party_get_slot, ":cur_lord", ":center_no", slot_town_lord), ## (is_between, ":cur_lord", heroes_begin, heroes_end), ## (val_add, ":count_heroes", 1), ## (lt, ":random_hero", ":count_heroes"), ## (assign, ":result", ":cur_lord"), ## (try_end), ## (neq, ":result", -1), ## (assign, reg0, ":result"), ## ]), # script_cf_get_random_kingdom_hero_as_lover # Input: arg1 = troop_no (of the lady) # Output: reg0 = troop_no (of the hero) (Can fail) ("cf_get_random_kingdom_hero_as_lover", [ # (store_script_param_1, ":cur_lady"), # (troop_get_slot, ":cur_father", ":cur_lady", slot_troop_father), # (troop_get_slot, ":fathers_rank", ":cur_father", slot_troop_kingdom_rank), (assign, ":result", -1), (assign, ":count_heroes", 0), (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (troop_slot_eq, ":troop_no", slot_troop_lover, 0), (troop_slot_eq, ":troop_no", slot_troop_spouse, 0), # (troop_get_slot, ":cur_rank", ":troop_no", slot_troop_kingdom_rank), # (lt, ":cur_rank", ":fathers_rank"), # Only heroes with lower ranks may be the lovers of the daughters (val_add, ":count_heroes", 1), (try_end), (store_random_in_range,":random_hero",0,":count_heroes"), (assign, ":count_heroes", 0), (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (eq, ":result", -1), (troop_slot_eq, ":troop_no", slot_troop_lover, 0), (troop_slot_eq, ":troop_no", slot_troop_spouse, 0), # (troop_get_slot, ":cur_rank", ":troop_no", slot_troop_kingdom_rank), # (lt, ":cur_rank", ":fathers_rank"), # Only heroes with lower ranks may be the lovers of the daughters (val_add, ":count_heroes", 1), (gt, ":count_heroes", ":random_hero"), (assign, ":result", ":troop_no"), (try_end), (neq, ":result", -1), (assign, reg0, ":result"), ]), ## # script_cf_get_random_siege_location_with_faction ## # Input: arg1 = faction_no ## # Output: reg0 = center_no, Can Fail! ## ("cf_get_random_siege_location_with_faction", ## [ ## (store_script_param_1, ":faction_no"), ## (assign, ":result", -1), ## (assign, ":count_sieges", 0), ## (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), ## (party_get_battle_opponent, ":besieger_party", ":center_no"), ## (gt, ":besieger_party", 0), ## (store_faction_of_party, ":cur_faction_no", ":center_no"), ## (eq, ":cur_faction_no", ":faction_no"), ## (val_add, ":count_sieges", 1), ## (try_end), ## (store_random_in_range,":random_center",0,":count_sieges"), ## (assign, ":count_sieges", 0), ## (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), ## (eq, ":result", -1), ## (party_get_battle_opponent, ":besieger_party", ":center_no"), ## (gt, ":besieger_party", 0), ## (store_faction_of_party, ":cur_faction_no", ":center_no"), ## (eq, ":cur_faction_no", ":faction_no"), ## (val_add, ":count_sieges", 1), ## (gt, ":count_sieges", ":random_center"), ## (assign, ":result", ":center_no"), ## (try_end), ## (neq, ":result", -1), ## (assign, reg0, ":result"), ## ]), ## # script_cf_get_random_siege_location_with_attacker_faction ## # Input: arg1 = faction_no ## # Output: reg0 = center_no, Can Fail! ## ("cf_get_random_siege_location_with_attacker_faction", ## [ ## (store_script_param_1, ":faction_no"), ## (assign, ":result", -1), ## (assign, ":count_sieges", 0), ## (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), ## (party_get_battle_opponent, ":besieger_party", ":center_no"), ## (gt, ":besieger_party", 0), ## (store_faction_of_party, ":cur_faction_no", ":besieger_party"), ## (eq, ":cur_faction_no", ":faction_no"), ## (val_add, ":count_sieges", 1), ## (try_end), ## (store_random_in_range,":random_center",0,":count_sieges"), ## (assign, ":count_sieges", 0), ## (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), ## (eq, ":result", -1), ## (party_get_battle_opponent, ":besieger_party", ":center_no"), ## (gt, ":besieger_party", 0), ## (store_faction_of_party, ":cur_faction_no", ":besieger_party"), ## (eq, ":cur_faction_no", ":faction_no"), ## (val_add, ":count_sieges", 1), ## (gt, ":count_sieges", ":random_center"), ## (assign, ":result", ":center_no"), ## (try_end), ## (neq, ":result", -1), ## (assign, reg0, ":result"), ## ]), ## # script_cf_get_number_of_random_troops_from_party ## # Input: arg1 = party_no, arg2 = number of troops to remove ## # Output: reg0 = troop_no, Can fail if there are no slots having the required number of units! ## ("cf_get_number_of_random_troops_from_party", ## [ ## (store_script_param_1, ":party_no"), ## (store_script_param_2, ":no_to_remove"), ## ## (assign, ":result", -1), ## (assign, ":count_stacks", 0), ## ## (party_get_num_companion_stacks, ":num_stacks",":party_no"), ## (try_for_range, ":i_stack", 0, ":num_stacks"), ## (party_stack_get_size, ":stack_size",":party_no",":i_stack"), ## (party_stack_get_num_wounded, ":num_wounded",":party_no",":i_stack"), ## (val_sub, ":stack_size", ":num_wounded"), ## (ge, ":stack_size", ":no_to_remove"), ## (party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"), ## (neg|troop_is_hero, ":stack_troop"), ## (val_add, ":count_stacks", 1), ## (try_end), ## (store_random_in_range,":random_stack",0,":count_stacks"), ## (assign, ":count_stacks", 0), ## (try_for_range, ":i_stack", 0, ":num_stacks"), ## (eq, ":result", -1), ## (party_stack_get_size, ":stack_size",":party_no",":i_stack"), ## (party_stack_get_num_wounded, ":num_wounded",":party_no",":i_stack"), ## (val_sub, ":stack_size", ":num_wounded"), ## (ge, ":stack_size", ":no_to_remove"), ## (party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"), ## (neg|troop_is_hero, ":stack_troop"), ## (val_add, ":count_stacks", 1), ## (gt, ":count_stacks", ":random_stack"), ## (assign, ":result", ":stack_troop"), ## (try_end), ## ## (neq, ":result", -1), ## (assign, reg0, ":result"), ## ]), # script_cf_get_random_lord_in_a_center_with_faction # Input: arg1 = faction_no # Output: reg0 = troop_no, Can Fail! ("cf_get_random_lord_in_a_center_with_faction", [ (store_script_param_1, ":faction_no"), (assign, ":result", -1), (assign, ":count_lords", 0), (try_for_range, ":lord_no", heroes_begin, heroes_end), (store_troop_faction, ":lord_faction_no", ":lord_no"), (eq, ":faction_no", ":lord_faction_no"), (troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":lord_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":lord_no", slot_troop_prisoner_of_party, 0), (troop_get_slot, ":lord_party", ":lord_no", slot_troop_leaded_party), (ge, ":lord_party", 0), (party_get_attached_to, ":lord_attachment", ":lord_party"), (is_between, ":lord_attachment", centers_begin, centers_end), #is troop in a center? (val_add, ":count_lords", 1), (try_end), (store_random_in_range, ":random_lord", 0, ":count_lords"), (assign, ":count_lords", 0), (try_for_range, ":lord_no", heroes_begin, heroes_end), (eq, ":result", -1), (store_troop_faction, ":lord_faction_no", ":lord_no"), (eq, ":faction_no", ":lord_faction_no"), (troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":lord_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":lord_no", slot_troop_prisoner_of_party, 0), (troop_get_slot, ":lord_party", ":lord_no", slot_troop_leaded_party), (ge, ":lord_party", 0), (party_get_attached_to, ":lord_attachment", ":lord_party"), (is_between, ":lord_attachment", centers_begin, centers_end), #is troop in a center? (val_add, ":count_lords", 1), (lt, ":random_lord", ":count_lords"), (assign, ":result", ":lord_no"), (try_end), (neq, ":result", -1), (assign, reg0, ":result"), ]), # script_cf_get_random_lord_except_king_with_faction # Input: arg1 = faction_no # Output: reg0 = troop_no, Can Fail! ("cf_get_random_lord_except_king_with_faction", [ (store_script_param_1, ":faction_no"), (assign, ":result", -1), (assign, ":count_lords", 0), (try_for_range, ":lord_no", heroes_begin, heroes_end), (store_troop_faction, ":lord_faction_no", ":lord_no"), (eq, ":faction_no", ":lord_faction_no"), (neg|faction_slot_eq, ":faction_no", slot_faction_leader, ":lord_no"), (troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":lord_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":lord_no", slot_troop_prisoner_of_party, 0), (troop_get_slot, ":lord_party", ":lord_no", slot_troop_leaded_party), (ge, ":lord_party", 0), (val_add, ":count_lords", 1), (try_end), (store_random_in_range, ":random_lord", 0, ":count_lords"), (assign, ":count_lords", 0), (try_for_range, ":lord_no", heroes_begin, heroes_end), (eq, ":result", -1), (store_troop_faction, ":lord_faction_no", ":lord_no"), (eq, ":faction_no", ":lord_faction_no"), (neg|faction_slot_eq, ":faction_no", slot_faction_leader, ":lord_no"), (troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":lord_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":lord_no", slot_troop_prisoner_of_party, 0), (troop_get_slot, ":lord_party", ":lord_no", slot_troop_leaded_party), (ge, ":lord_party", 0), (val_add, ":count_lords", 1), (lt, ":random_lord", ":count_lords"), (assign, ":result", ":lord_no"), (try_end), (neq, ":result", -1), (assign, reg0, ":result"), ]), # script_cf_get_random_lord_from_another_faction_in_a_center # Input: arg1 = faction_no # Output: reg0 = troop_no, Can Fail! ("cf_get_random_lord_from_another_faction_in_a_center", [ (store_script_param_1, ":faction_no"), (assign, ":result", -1), (assign, ":count_lords", 0), (try_for_range, ":lord_no", heroes_begin, heroes_end), (store_troop_faction, ":lord_faction_no", ":lord_no"), (neq, ":lord_faction_no", ":faction_no"), (store_relation, ":our_relation", ":lord_faction_no", "fac_player_supporters_faction"), (store_relation, ":lord_relation", ":lord_faction_no", ":faction_no"), (lt, ":lord_relation", 0), (ge, ":our_relation", 0), (troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":lord_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":lord_no", slot_troop_prisoner_of_party, 0), (troop_get_slot, ":lord_party", ":lord_no", slot_troop_leaded_party), (ge, ":lord_party", 0), (party_get_attached_to, ":lord_attachment", ":lord_party"), (is_between, ":lord_attachment", centers_begin, centers_end), #is troop in a center? (val_add, ":count_lords", 1), (try_end), (store_random_in_range, ":random_lord", 0, ":count_lords"), (assign, ":count_lords", 0), (try_for_range, ":lord_no", heroes_begin, heroes_end), (eq, ":result", -1), (store_troop_faction, ":lord_faction_no", ":lord_no"), (neq, ":lord_faction_no", ":faction_no"), (store_relation, ":our_relation", ":lord_faction_no", "fac_player_supporters_faction"), (store_relation, ":lord_relation", ":lord_faction_no", ":faction_no"), (lt, ":lord_relation", 0), (ge, ":our_relation", 0), (troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":lord_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":lord_no", slot_troop_prisoner_of_party, 0), (troop_get_slot, ":lord_party", ":lord_no", slot_troop_leaded_party), (ge, ":lord_party", 0), (party_get_attached_to, ":lord_attachment", ":lord_party"), (is_between, ":lord_attachment", centers_begin, centers_end), #is troop in a center? (val_add, ":count_lords", 1), (lt, ":random_lord", ":count_lords"), (assign, ":result", ":lord_no"), (try_end), (neq, ":result", -1), (assign, reg0, ":result"), ]), # script_get_closest_walled_center # Input: arg1 = party_no # Output: reg0 = center_no (closest) ("get_closest_walled_center", [ (store_script_param_1, ":party_no"), (assign, ":min_distance", 9999999), (assign, reg0, -1), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), (store_distance_to_party_from_party, ":party_distance", ":party_no", ":center_no"), (lt, ":party_distance", ":min_distance"), (assign, ":min_distance", ":party_distance"), (assign, reg0, ":center_no"), (try_end), ]), # script_get_closest_center # Input: arg1 = party_no # Output: reg0 = center_no (closest) ("get_closest_center", [ (store_script_param_1, ":party_no"), (assign, ":min_distance", 9999999), (assign, reg0, -1), (try_for_range, ":center_no", centers_begin, centers_end), (store_distance_to_party_from_party, ":party_distance", ":party_no", ":center_no"), (lt, ":party_distance", ":min_distance"), (assign, ":min_distance", ":party_distance"), (assign, reg0, ":center_no"), (try_end), ]), # script_get_closest_center_of_faction # Input: arg1 = party_no, arg2 = kingdom_no # Output: reg0 = center_no (closest) ("get_closest_center_of_faction", [ (store_script_param_1, ":party_no"), (store_script_param_2, ":kingdom_no"), (assign, ":min_distance", 99999), (assign, ":result", -1), (try_for_range, ":center_no", centers_begin, centers_end), (store_faction_of_party, ":faction_no", ":center_no"), (eq, ":faction_no", ":kingdom_no"), (store_distance_to_party_from_party, ":party_distance", ":party_no", ":center_no"), (lt, ":party_distance", ":min_distance"), (assign, ":min_distance", ":party_distance"), (assign, ":result", ":center_no"), (try_end), (assign, reg0, ":result"), ]), # script_get_closest_walled_center_of_faction # Input: arg1 = party_no, arg2 = kingdom_no # Output: reg0 = center_no (closest) ("get_closest_walled_center_of_faction", [ (store_script_param_1, ":party_no"), (store_script_param_2, ":kingdom_no"), (assign, ":min_distance", 99999), (assign, ":result", -1), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), (store_faction_of_party, ":faction_no", ":center_no"), (eq, ":faction_no", ":kingdom_no"), (store_distance_to_party_from_party, ":party_distance", ":party_no", ":center_no"), (lt, ":party_distance", ":min_distance"), (assign, ":min_distance", ":party_distance"), (assign, ":result", ":center_no"), (try_end), (assign, reg0, ":result"), ]), ## # script_get_closest_town_of_faction ## # Input: arg1 = party_no, arg2 = kingdom_no ## # Output: reg0 = center_no (closest) ## ("get_closest_town_of_faction", ## [ ## (store_script_param_1, ":party_no"), ## (store_script_param_2, ":kingdom_no"), ## (assign, ":min_distance", 9999999), ## (assign, ":result", -1), ## (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), ## (store_faction_of_party, ":faction_no", ":center_no"), ## (eq, ":faction_no", ":kingdom_no"), ## (party_slot_eq, ":center_no", slot_party_type, spt_town), ## (store_distance_to_party_from_party, ":party_distance", ":party_no", ":center_no"), ## (lt, ":party_distance", ":min_distance"), ## (assign, ":min_distance", ":party_distance"), ## (assign, ":result", ":center_no"), ## (try_end), ## (assign, reg0, ":result"), ## ]), # script_let_nearby_parties_join_current_battle # Input: arg1 = besiege_mode, arg2 = dont_add_friends # Output: none ("let_nearby_parties_join_current_battle", [ (store_script_param, ":besiege_mode", 1), (store_script_param, ":dont_add_friends", 2), (assign, ":join_distance", 5), (try_begin), (is_currently_night), (assign, ":join_distance", 3), (try_end), (try_for_parties, ":party_no"), (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 (get_party_ai_behavior, ":behavior", ":party_no"), (neq, ":behavior", ai_bhvr_in_town), (store_distance_to_party_from_party, ":distance", ":party_no", "p_main_party"), (lt, ":distance", ":join_distance"), (store_faction_of_party, ":faction_no", ":party_no"), (store_faction_of_party, ":enemy_faction", "$g_enemy_party"), (try_begin), (eq, ":faction_no", "fac_player_supporters_faction"), (assign, ":reln_with_player", 100), (else_try), (store_relation, ":reln_with_player", ":faction_no", "fac_player_supporters_faction"), (try_end), (try_begin), (eq, ":faction_no", ":enemy_faction"), (assign, ":reln_with_enemy", 100), (else_try), (store_relation, ":reln_with_enemy", ":faction_no", ":enemy_faction"), (try_end), (assign, ":enemy_side", 1), (try_begin), (neq, "$g_enemy_party", "$g_encountered_party"), (assign, ":enemy_side", 2), (try_end), (try_begin), (eq, ":besiege_mode", 0), (lt, ":reln_with_player", 0), (gt, ":reln_with_enemy", 0), (party_get_slot, ":party_type", ":party_no"), (eq, ":party_type", spt_kingdom_hero_party), (get_party_ai_behavior, ":ai_bhvr", ":party_no"), (neq, ":ai_bhvr", ai_bhvr_avoid_party), (party_quick_attach_to_current_battle, ":party_no", ":enemy_side"), #attach as enemy (str_store_party_name, s1, ":party_no"), (display_message, "str_s1_joined_battle_enemy"), (else_try), (eq, ":dont_add_friends", 0), (gt, ":reln_with_player", 0), (lt, ":reln_with_enemy", 0), (assign, ":do_join", 1), (try_begin), (eq, ":besiege_mode", 1), (assign, ":do_join", 0), (eq, ":faction_no", "$players_kingdom"), (faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"), (assign, ":do_join", 1), (try_end), (eq, ":do_join", 1), (party_get_slot, ":party_type", ":party_no"), (eq, ":party_type", spt_kingdom_hero_party), (party_stack_get_troop_id, ":leader", ":party_no", 0), # (troop_get_slot, ":player_relation", ":leader", slot_troop_player_relation), (call_script, "script_troop_get_player_relation", ":leader"), (assign, ":player_relation", reg0), (ge, ":player_relation", 0), (party_quick_attach_to_current_battle, ":party_no", 0), #attach as friend (str_store_party_name, s1, ":party_no"), (display_message, "str_s1_joined_battle_friend"), (try_end), (try_end), ]), # script_party_wound_all_members_aux # Input: arg1 = party_no ("party_wound_all_members_aux", [ (store_script_param_1, ":party_no"), (party_get_num_companion_stacks, ":num_stacks",":party_no"), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"), (try_begin), (neg|troop_is_hero, ":stack_troop"), (party_stack_get_size, ":stack_size",":party_no",":i_stack"), (party_wound_members, ":party_no", ":stack_troop", ":stack_size"), (else_try), (troop_set_health, ":stack_troop", 0), (try_end), (try_end), (party_get_num_attached_parties, ":num_attached_parties", ":party_no"), (try_for_range, ":attached_party_rank", 0, ":num_attached_parties"), (party_get_attached_party_with_rank, ":attached_party", ":party_no", ":attached_party_rank"), (call_script, "script_party_wound_all_members_aux", ":attached_party"), (try_end), ]), # script_party_wound_all_members # Input: arg1 = party_no ("party_wound_all_members", [ (store_script_param_1, ":party_no"), (call_script, "script_party_wound_all_members_aux", ":party_no"), ]), # script_calculate_battle_advantage # Output: reg0 = battle advantage ("calculate_battle_advantage", [ (call_script, "script_party_count_fit_for_battle", "p_collective_friends"), (assign, ":friend_count", reg(0)), (party_get_skill_level, ":player_party_tactics", "p_main_party", skl_tactics), (party_get_skill_level, ":ally_party_tactics", "p_collective_friends", skl_tactics), (val_max, ":player_party_tactics", ":ally_party_tactics"), (call_script, "script_party_count_fit_for_battle", "p_collective_enemy"), (assign, ":enemy_count", reg(0)), (party_get_skill_level, ":enemy_party_tactics", "p_collective_enemy", skl_tactics), (val_add, ":friend_count", 1), (val_add, ":enemy_count", 1), (try_begin), (ge, ":friend_count", ":enemy_count"), (val_mul, ":friend_count", 100), (store_div, ":ratio", ":friend_count", ":enemy_count"), (store_sub, ":raw_advantage", ":ratio", 100), (else_try), (val_mul, ":enemy_count", 100), (store_div, ":ratio", ":enemy_count", ":friend_count"), (store_sub, ":raw_advantage", 100, ":ratio"), (try_end), (val_mul, ":raw_advantage", 2), (val_mul, ":player_party_tactics", 30), (val_mul, ":enemy_party_tactics", 30), (val_add, ":raw_advantage", ":player_party_tactics"), (val_sub, ":raw_advantage", ":enemy_party_tactics"), (val_div, ":raw_advantage", 100), (assign, reg0, ":raw_advantage"), (display_message, "@Battle Advantage = {reg0}.", 0xFFFFFFFF), ]), # script_cf_check_enemies_nearby # Input: none # Output: none, fails when enemies are nearby ("cf_check_enemies_nearby", [ (get_player_agent_no, ":player_agent"), (agent_is_alive, ":player_agent"), (agent_get_position, pos1, ":player_agent"), (assign, ":result", 0), (set_fixed_point_multiplier, 100), (try_for_agents,":cur_agent"), (neq, ":cur_agent", ":player_agent"), (agent_is_alive, ":cur_agent"), (agent_is_human, ":cur_agent"), (neg|agent_is_ally, ":cur_agent"), (agent_get_position, pos2, ":cur_agent"), (get_distance_between_positions, ":cur_distance", pos1, pos2), (le, ":cur_distance", 1500), #15 meters (assign, ":result", 1), (try_end), (eq, ":result", 0), ]), # script_get_heroes_attached_to_center_aux # For internal use only ("get_heroes_attached_to_center_aux", [ (store_script_param_1, ":center_no"), (store_script_param_2, ":party_no_to_collect_heroes"), (party_get_num_companion_stacks, ":num_stacks",":center_no"), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":center_no",":i_stack"), (troop_is_hero, ":stack_troop"), (party_add_members, ":party_no_to_collect_heroes", ":stack_troop", 1), (try_end), (party_get_num_attached_parties, ":num_attached_parties", ":center_no"), (try_for_range, ":attached_party_rank", 0, ":num_attached_parties"), (party_get_attached_party_with_rank, ":attached_party", ":center_no", ":attached_party_rank"), (call_script, "script_get_heroes_attached_to_center_aux", ":attached_party", ":party_no_to_collect_heroes"), (try_end), ]), # script_get_heroes_attached_to_center # Input: arg1 = center_no, arg2 = party_no_to_collect_heroes # Output: none, adds heroes to the party_no_to_collect_heroes party ("get_heroes_attached_to_center", [ (store_script_param_1, ":center_no"), (store_script_param_2, ":party_no_to_collect_heroes"), (party_clear, ":party_no_to_collect_heroes"), (call_script, "script_get_heroes_attached_to_center_aux", ":center_no", ":party_no_to_collect_heroes"), #rebellion changes begin -Arma (try_for_range, ":pretender", pretenders_begin, pretenders_end), (neq, ":pretender", "$supported_pretender"), (troop_slot_eq, ":pretender", slot_troop_cur_center, ":center_no"), (party_add_members, ":party_no_to_collect_heroes", ":pretender", 1), (try_end), # (try_for_range, ":rebel_faction", rebel_factions_begin, rebel_factions_end), # (faction_slot_eq, ":rebel_faction", slot_faction_state, sfs_inactive_rebellion), # (faction_slot_eq, ":rebel_faction", slot_faction_inactive_leader_location, ":center_no"), # (faction_get_slot, ":pretender", ":rebel_faction", slot_faction_leader), # (party_add_members, ":party_no_to_collect_heroes", ":pretender", 1), # (try_end), #rebellion changes end ]), # script_get_heroes_attached_to_center_as_prisoner_aux # For internal use only ("get_heroes_attached_to_center_as_prisoner_aux", [ (store_script_param_1, ":center_no"), (store_script_param_2, ":party_no_to_collect_heroes"), (party_get_num_prisoner_stacks, ":num_stacks",":center_no"), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_prisoner_stack_get_troop_id, ":stack_troop",":center_no",":i_stack"), (troop_is_hero, ":stack_troop"), (party_add_members, ":party_no_to_collect_heroes", ":stack_troop", 1), (try_end), (party_get_num_attached_parties, ":num_attached_parties", ":center_no"), (try_for_range, ":attached_party_rank", 0, ":num_attached_parties"), (party_get_attached_party_with_rank, ":attached_party", ":center_no", ":attached_party_rank"), (call_script, "script_get_heroes_attached_to_center_as_prisoner_aux", ":attached_party", ":party_no_to_collect_heroes"), (try_end), ]), # script_get_heroes_attached_to_center_as_prisoner # Input: arg1 = center_no, arg2 = party_no_to_collect_heroes # Output: none, adds heroes to the party_no_to_collect_heroes party ("get_heroes_attached_to_center_as_prisoner", [ (store_script_param_1, ":center_no"), (store_script_param_2, ":party_no_to_collect_heroes"), (party_clear, ":party_no_to_collect_heroes"), (call_script, "script_get_heroes_attached_to_center_as_prisoner_aux", ":center_no", ":party_no_to_collect_heroes"), ]), ## ## # script_cf_get_party_leader ## # Input: arg1 = party_no ## # Output: reg0 = troop_no of the leader (Can fail) ## ("cf_get_party_leader", ## [ ## (store_script_param_1, ":party_no"), ## ## (party_get_num_companion_stacks, ":num_stacks",":party_no"), ## (gt, ":num_stacks", 0), ## (party_stack_get_troop_id, ":stack_troop", ":party_no", 0), ## (troop_is_hero, ":stack_troop"), ## (assign, reg0, ":stack_troop"), ## ]), # script_give_center_to_faction # Input: arg1 = center_no, arg2 = faction ("give_center_to_faction", [ (store_script_param_1, ":center_no"), (store_script_param_2, ":faction_no"), (try_begin), (check_quest_active, "qst_join_siege_with_army"), (quest_slot_eq, "qst_join_siege_with_army", slot_quest_target_center, ":center_no"), (call_script, "script_abort_quest", "qst_join_siege_with_army", 0), #Reactivating follow army quest (faction_get_slot, ":faction_marshall", "$players_kingdom", slot_faction_marshall), (str_store_troop_name_link, s9, ":faction_marshall"), (setup_quest_text, "qst_follow_army"), (str_store_string, s2, "@{s9} wants you to resume following his army until further notice."), (call_script, "script_start_quest", "qst_follow_army", ":faction_marshall"), (assign, "$g_player_follow_army_warnings", 0), (try_end), (store_faction_of_party, ":old_faction", ":center_no"), (call_script, "script_give_center_to_faction_aux", ":center_no", ":faction_no"), (call_script, "script_update_village_market_towns"), (try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end), (call_script, "script_faction_recalculate_strength", ":cur_faction"), (try_end), (assign, "$g_recalculate_ais", 1), (call_script, "script_activate_deactivate_player_faction", ":old_faction"), (try_begin), (eq, ":faction_no", "fac_player_supporters_faction"), (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"), (call_script, "script_give_center_to_lord", ":center_no", "trp_player", 0), (try_for_range, ":cur_village", villages_begin, villages_end), (store_faction_of_party, ":cur_village_faction", ":cur_village"), (eq, ":cur_village_faction", "fac_player_supporters_faction"), (neg|party_slot_eq, ":cur_village", slot_town_lord, "trp_player"), (call_script, "script_give_center_to_lord", ":cur_village", "trp_player", 0), (try_end), (try_end), ]), # script_give_center_to_faction_aux # Input: arg1 = center_no, arg2 = faction ("give_center_to_faction_aux", [ (store_script_param_1, ":center_no"), (store_script_param_2, ":faction_no"), (store_faction_of_party, ":old_faction", ":center_no"), (party_set_slot, ":center_no", slot_center_ex_faction, ":old_faction"), (party_set_faction, ":center_no", ":faction_no"), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_village), (party_get_slot, ":farmer_party", ":center_no", slot_village_farmer_party), (gt, ":farmer_party", 0), (party_is_active, ":farmer_party"), (party_set_faction, ":farmer_party", ":faction_no"), (try_end), (party_get_slot, ":old_town_lord", ":center_no", slot_town_lord), (party_set_slot, ":center_no", slot_town_lord, stl_unassigned), (party_set_banner_icon, ":center_no", 0),#Removing banner (call_script, "script_update_faction_notes", ":old_faction"), (call_script, "script_update_faction_notes", ":faction_no"), (call_script, "script_update_center_notes", ":center_no"), (try_begin), (ge, ":old_town_lord", 0), (call_script, "script_update_troop_notes", ":old_town_lord"), (try_end), (try_for_range, ":other_center", centers_begin, centers_end), (party_slot_eq, ":other_center", slot_village_bound_center, ":center_no"), (call_script, "script_give_center_to_faction_aux", ":other_center", ":faction_no"), (try_end), ]), # script_change_troop_faction # Input: arg1 = troop_no, arg2 = faction ("change_troop_faction", [ (store_script_param_1, ":troop_no"), (store_script_param_2, ":faction_no"), (try_begin), #Reactivating inactive or defeated faction (is_between, ":faction_no", kingdoms_begin, kingdoms_end), (neg|faction_slot_eq, ":faction_no", slot_faction_state, sfs_active), (faction_set_slot, ":faction_no", slot_faction_state, sfs_active), (call_script, "script_store_average_center_value_per_faction"), (try_end), (troop_set_faction, ":troop_no", ":faction_no"), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), (party_slot_eq, ":center_no", slot_town_lord, ":troop_no"), (party_set_faction, ":center_no", ":faction_no"), (try_for_range, ":village_no", villages_begin, villages_end), (party_slot_eq, ":village_no", slot_village_bound_center, ":center_no"), (party_set_faction, ":village_no", ":faction_no"), (party_get_slot, ":farmer_party_no", ":village_no", slot_village_farmer_party), (try_begin), (gt, ":farmer_party_no", 0), (party_is_active, ":farmer_party_no"), (party_set_faction, ":farmer_party_no", ":faction_no"), (try_end), (try_begin), (party_get_slot, ":old_town_lord", ":village_no", slot_town_lord), (neq, ":old_town_lord", ":troop_no"), (party_set_slot, ":village_no", slot_town_lord, stl_unassigned), (try_end), (try_end), (try_end), (try_for_range, ":village_no", villages_begin, villages_end), (party_slot_eq, ":village_no", slot_town_lord, ":troop_no"), (store_faction_of_party, ":village_faction", ":village_no"), (try_begin), (neq, ":village_faction", ":faction_no"), (party_set_slot, ":village_no", slot_town_lord, stl_unassigned), (try_end), (try_end), (try_begin), (troop_get_slot, ":leaded_party", ":troop_no", slot_troop_leaded_party), (ge, ":leaded_party", 0), (party_set_faction, ":leaded_party", ":faction_no"), (party_get_num_prisoner_stacks, ":num_stacks", ":leaded_party"), (try_for_range_backwards, ":troop_iterator", 0, ":num_stacks"), (party_prisoner_stack_get_troop_id, ":cur_troop_id", ":leaded_party", ":troop_iterator"), (store_troop_faction, ":cur_faction", ":cur_troop_id"), (troop_is_hero, ":cur_troop_id"), (eq, ":cur_faction", ":faction_no"), (call_script, "script_remove_troop_from_prison", ":cur_troop_id"), (party_remove_prisoners, ":leaded_party", ":cur_troop_id", 1), (try_end), (try_end), (call_script, "script_update_all_notes"), (call_script, "script_update_village_market_towns"), (assign, "$g_recalculate_ais", 1), ]), # script_give_center_to_lord # Input: arg1 = center_no, arg2 = lord_troop, arg3 = add_garrison_to_center ("give_center_to_lord", [ (store_script_param, ":center_no", 1), (store_script_param, ":lord_troop_id", 2), (store_script_param, ":add_garrison", 3), (party_get_slot, ":old_lord_troop_id", ":center_no", slot_town_lord), (store_troop_faction, ":lord_troop_faction", ":lord_troop_id"), (try_begin), (eq, ":lord_troop_id", "trp_player"), (gt, "$players_kingdom", 0), (party_set_faction, ":center_no", "$players_kingdom"), (else_try), (eq, ":lord_troop_id", "trp_player"), (le, "$players_kingdom", 0), (party_set_faction, ":center_no", "fac_player_supporters_faction"), (else_try), (party_set_faction, ":center_no", ":lord_troop_faction"), (try_end), (party_set_slot, ":center_no", slot_town_lord, ":lord_troop_id"), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_village), (party_get_slot, ":farmer_party_no", ":center_no", slot_village_farmer_party), (gt, ":farmer_party_no", 0), (party_is_active, ":farmer_party_no"), (store_faction_of_party, ":center_faction", ":center_no"), (party_set_faction, ":farmer_party_no", ":center_faction"), (try_end), (try_begin), (this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town), (party_slot_eq, ":center_no", slot_party_type, spt_castle), #normal_banner_begin (troop_get_slot, ":cur_banner", ":lord_troop_id", slot_troop_banner_scene_prop), (gt, ":cur_banner", 0), (val_sub, ":cur_banner", banner_scene_props_begin), (val_add, ":cur_banner", banner_map_icons_begin), (party_set_banner_icon, ":center_no", ":cur_banner"), # custom_banner_begin # (troop_get_slot, ":flag_icon", ":lord_troop_id", slot_troop_custom_banner_map_flag_type), # (ge, ":flag_icon", 0), # (val_add, ":flag_icon", custom_banner_map_icons_begin), # (party_set_banner_icon, ":center_no", ":flag_icon"), (try_end), (try_begin), (eq, ":lord_troop_id", "trp_player"), (neq, ":old_lord_troop_id", "trp_player"), (party_get_slot, ":center_relation", ":center_no", slot_center_player_relation), (is_between, ":center_relation", -4, 5), (call_script, "script_change_player_relation_with_center", ":center_no", 5), (gt, ":old_lord_troop_id", 0), (call_script, "script_change_player_relation_with_troop", ":old_lord_troop_id", -25), (try_end), (call_script, "script_update_troop_notes", ":lord_troop_id"), (call_script, "script_update_center_notes", ":center_no"), (call_script, "script_update_faction_notes", ":lord_troop_faction"), (try_begin), (ge, ":old_lord_troop_id", 0), (call_script, "script_update_troop_notes", ":old_lord_troop_id"), (store_troop_faction, ":old_lord_troop_faction", ":old_lord_troop_id"), (call_script, "script_update_faction_notes", ":old_lord_troop_faction"), (try_end), (try_begin), (eq, ":add_garrison", 1), (this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town), (party_slot_eq, ":center_no", slot_party_type, spt_castle), (assign, ":garrison_strength", 3), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_town), (assign, ":garrison_strength", 9), (try_end), (try_for_range, ":unused", 0, ":garrison_strength"), (call_script, "script_cf_reinforce_party", ":center_no"), (try_end), ## ADD some XP initially (try_for_range, ":unused", 0, 7), (store_random_in_range, ":xp", 1500, 2000), (party_upgrade_with_xp, ":center_no", ":xp", 0), (try_end), (try_end), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_castle), (try_for_range, ":cur_village", villages_begin, villages_end), (party_slot_eq, ":cur_village", slot_village_bound_center, ":center_no"), (call_script, "script_give_center_to_lord", ":cur_village", ":lord_troop_id", 0), (try_end), (try_end), ]), ## # script_give_town_to_besiegers ## # Input: arg1 = center_no, arg2 = besieger_party ## ("give_town_to_besiegers", ## [ ## (store_script_param_1, ":center_no"), ## (store_script_param_2, ":besieger_party"), ## (store_faction_of_party, ":besieger_faction", ":besieger_party"), ## ## (try_begin), ## (call_script, "script_cf_get_party_leader", ":besieger_party"), ## (assign, ":new_leader", reg0), ## (else_try), ## (call_script, "script_select_kingdom_hero_for_new_center", ":besieger_faction"), ## (assign, ":new_leader", reg0), ## (try_end), ## ## (call_script, "script_give_center_to_lord", ":center_no", ":new_leader"), ## ## (try_for_parties, ":party_no"), ## (get_party_ai_object, ":object", ":party_no"), ## (get_party_ai_behavior, ":behavior", ":party_no"), ## (eq, ":object", ":center_no"), ## (this_or_next|eq, ":behavior", ai_bhvr_travel_to_party), ## (eq, ":behavior", ai_bhvr_attack_party), ## (party_set_ai_behavior, ":party_no", ai_bhvr_hold), ## (party_set_slot, ":party_no", slot_party_ai_state, spai_undefined), ## (party_set_flags, ":party_no", pf_default_behavior, 0), ## (try_end), ## ## #Staying at the center for a while ## (party_set_ai_behavior, ":besieger_party", ai_bhvr_hold), ## (party_set_slot, ":besieger_party", slot_party_ai_state, spai_undefined), ## (party_set_flags, ":besieger_party", pf_default_behavior, 0), ## ## (faction_get_slot, ":reinforcement_a", ":besieger_faction", slot_faction_reinforcements_a), ## (faction_get_slot, ":reinforcement_b", ":besieger_faction", slot_faction_reinforcements_b), ## (party_add_template, ":center_no", ":reinforcement_a"), ## (party_add_template, ":center_no", ":reinforcement_b"), ## ]), ## # script_get_number_of_hero_centers # Input: arg1 = troop_no # Output: reg0 = number of centers that are ruled by the hero ("get_number_of_hero_centers", [ (store_script_param_1, ":troop_no"), (assign, ":result", 0), (try_for_range, ":center_no", centers_begin, centers_end), (party_slot_eq, ":center_no", slot_town_lord, ":troop_no"), (val_add, ":result", 1), (try_end), (assign, reg0, ":result"), ]), ## # script_cf_get_new_center_leader_chance_for_troop ## # Input: arg1 = troop_no ## # Output: reg0 = chance of the troop to rule a new center ## ("cf_get_new_center_leader_chance_for_troop", ## [ ## (store_script_param_1, ":troop_no"), ## (troop_get_slot, ":troop_rank", ":troop_no", slot_troop_kingdom_rank), ## (try_begin), ## (eq, ":troop_rank", 4), ## (assign, ":troop_chance", 1000), ## (else_try), ## (eq, ":troop_rank", 3), ## (assign, ":troop_chance", 800), ## (else_try), ## (eq, ":troop_rank", 2), ## (assign, ":troop_chance", 400), ## (else_try), ## (eq, ":troop_rank", 1), ## (assign, ":troop_chance", 100), ## (else_try), ## (assign, ":troop_chance", 10), ## (try_end), ## ## (call_script, "script_get_number_of_hero_centers", ":troop_no"), ## (assign, ":number_of_hero_centers", reg0), ## (try_begin), ## (gt, ":number_of_hero_centers", 0), ## (val_mul, ":number_of_hero_centers", 2), ## (val_mul, ":number_of_hero_centers", ":number_of_hero_centers"), ## (val_div, ":troop_chance", ":number_of_hero_centers"), ## (try_end), ## (assign, reg0, ":troop_chance"), ## (eq, reg0, 0), ## (assign, reg0, 1), ## ]), ## # script_select_kingdom_hero_for_new_center ## # Input: arg1 = faction_no ## # Output: reg0 = troop_no as the new leader ## ("select_kingdom_hero_for_new_center", ## [ ## (store_script_param_1, ":kingdom"), ## ## (assign, ":min_num_centers", -1), ## (assign, ":min_num_centers_troop", -1), ## ## (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), ## (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), ## (store_troop_faction, ":troop_faction", ":troop_no"), ## (eq, ":troop_faction", ":kingdom"), ## (call_script, "script_get_number_of_hero_centers", ":troop_no"), ## (assign, ":num_centers", reg0), ## (try_begin), ## (lt, ":num_centers", ":min_num_centers"), ## (assign, ":min_num_centers", ":num_centers"), ## (assign, ":min_num_centers_troop", ":troop_no"), ## (try_end), ## (try_end), ## (assign, reg0, ":min_num_centers_troop"), ## ]), # script_cf_get_random_enemy_center # Input: arg1 = party_no # Output: reg0 = center_no ("cf_get_random_enemy_center", [ (store_script_param_1, ":party_no"), (assign, ":result", -1), (assign, ":total_enemy_centers", 0), (store_faction_of_party, ":party_faction", ":party_no"), (try_for_range, ":center_no", centers_begin, centers_end), (store_faction_of_party, ":center_faction", ":center_no"), (store_relation, ":party_relation", ":center_faction", ":party_faction"), (lt, ":party_relation", 0), (val_add, ":total_enemy_centers", 1), (try_end), (gt, ":total_enemy_centers", 0), (store_random_in_range, ":random_center", 0, ":total_enemy_centers"), (assign, ":total_enemy_centers", 0), (try_for_range, ":center_no", centers_begin, centers_end), (eq, ":result", -1), (store_faction_of_party, ":center_faction", ":center_no"), (store_relation, ":party_relation", ":center_faction", ":party_faction"), (lt, ":party_relation", 0), (val_sub, ":random_center", 1), (lt, ":random_center", 0), (assign, ":result", ":center_no"), (try_end), (assign, reg0, ":result"), ]), ## # script_get_random_enemy_town ## # Input: arg1 = party_no ## # Output: reg0 = center_no ## ("get_random_enemy_town", ## [ ## (store_script_param_1, ":party_no"), ## ## (assign, ":result", -1), ## (assign, ":total_enemy_centers", 0), ## (store_faction_of_party, ":party_faction", ":party_no"), ## ## (try_for_range, ":center_no", towns_begin, towns_end), ## (store_faction_of_party, ":center_faction", ":center_no"), ## (neq, ":center_faction", ":party_faction"), ## (val_add, ":total_enemy_centers", 1), ## (try_end), ## ## (try_begin), ## (eq, ":total_enemy_centers", 0), ## (else_try), ## (store_random_in_range, ":random_center", 0, ":total_enemy_centers"), ## (assign, ":total_enemy_centers", 0), ## (try_for_range, ":center_no", towns_begin, towns_end), ## (eq, ":result", -1), ## (store_faction_of_party, ":center_faction", ":center_no"), ## (neq, ":center_faction", ":party_faction"), ## (store_relation, ":party_relation", ":center_faction", ":party_faction"), ## (le, ":party_relation", -10), ## (val_add, ":total_enemy_centers", 1), ## (lt, ":random_center", ":total_enemy_centers"), ## (assign, ":result", ":center_no"), ## (try_end), ## (try_end), ## (assign, reg0, ":result"), ## ]), # script_find_travel_location # Input: arg1 = center_no # Output: reg0 = new_center_no (to travel within the same faction) ("find_travel_location", [ (store_script_param_1, ":center_no"), (store_faction_of_party, ":faction_no", ":center_no"), (assign, ":total_weight", 0), (try_for_range, ":cur_center_no", centers_begin, centers_end), (neq, ":center_no", ":cur_center_no"), (store_faction_of_party, ":center_faction_no", ":cur_center_no"), (eq, ":faction_no", ":center_faction_no"), (store_distance_to_party_from_party, ":cur_distance", ":center_no", ":cur_center_no"), (val_add, ":cur_distance", 1), (assign, ":new_weight", 100000), (val_div, ":new_weight", ":cur_distance"), (val_add, ":total_weight", ":new_weight"), (try_end), (assign, reg0, -1), (try_begin), (eq, ":total_weight", 0), (else_try), (store_random_in_range, ":random_weight", 0 , ":total_weight"), (assign, ":total_weight", 0), (assign, ":done", 0), (try_for_range, ":cur_center_no", centers_begin, centers_end), (eq, ":done", 0), (neq, ":center_no", ":cur_center_no"), (store_faction_of_party, ":center_faction_no", ":cur_center_no"), (eq, ":faction_no", ":center_faction_no"), (store_distance_to_party_from_party, ":cur_distance", ":center_no", ":cur_center_no"), (val_add, ":cur_distance", 1), (assign, ":new_weight", 100000), (val_div, ":new_weight", ":cur_distance"), (val_add, ":total_weight", ":new_weight"), (lt, ":random_weight", ":total_weight"), (assign, reg0, ":cur_center_no"), (assign, ":done", 1), (try_end), (try_end), ]), # script_get_relation_between_parties # Input: arg1 = party_no_1, arg2 = party_no_2 # Output: reg0 = relation between parties ("get_relation_between_parties", [ (store_script_param_1, ":party_no_1"), (store_script_param_2, ":party_no_2"), (store_faction_of_party, ":party_no_1_faction", ":party_no_1"), (store_faction_of_party, ":party_no_2_faction", ":party_no_2"), (try_begin), (eq, ":party_no_1_faction", ":party_no_2_faction"), (assign, reg0, 100), (else_try), (store_relation, ":relation", ":party_no_1_faction", ":party_no_2_faction"), (assign, reg0, ":relation"), (try_end), ]), # script_calculate_weekly_party_wage # Input: arg1 = party_no # Output: reg0 = weekly wage ("calculate_weekly_party_wage", [ (store_script_param_1, ":party_no"), (assign, ":result", 0), (party_get_num_companion_stacks, ":num_stacks",":party_no"), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"), (party_stack_get_size, ":stack_size",":party_no",":i_stack"), (call_script, "script_npc_get_troop_wage", ":stack_troop", ":party_no"), (assign, ":cur_wage", reg0), (val_mul, ":cur_wage", ":stack_size"), (val_add, ":result", ":cur_wage"), (try_end), (assign, reg0, ":result"), ]), # script_calculate_player_faction_wage # Input: arg1 = party_no # Output: reg0 = weekly wage ("calculate_player_faction_wage", [(assign, ":nongarrison_wages", 0), (assign, ":garrison_wages", 0), (try_for_parties, ":party_no"), (assign, ":garrison_troop", 0), (try_begin), (this_or_next|party_slot_eq, ":party_no", slot_party_type, spt_town), (party_slot_eq, ":party_no", slot_party_type, spt_castle), (party_slot_eq, ":party_no", slot_town_lord, "trp_player"), (assign, ":garrison_troop", 1), (try_end), (party_get_attached_to, ":attached_party", ":party_no"), (this_or_next|eq, ":party_no", "p_main_party"), (this_or_next|eq, ":attached_party", "p_main_party"), # Added by Form Ranks kit (eq, ":garrison_troop", 1), (party_get_num_companion_stacks, ":num_stacks",":party_no"), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"), (party_stack_get_size, ":stack_size",":party_no",":i_stack"), (call_script, "script_game_get_troop_wage", ":stack_troop", ":party_no"), (assign, ":cur_wage", reg0), (val_mul, ":cur_wage", ":stack_size"), (try_begin), (eq, ":garrison_troop", 1), (val_add, ":garrison_wages", ":cur_wage"), (else_try), (val_add, ":nongarrison_wages", ":cur_wage"), (try_end), (try_end), (try_end), (val_div, ":garrison_wages", 2),#Half payment for garrisons (store_sub, ":total_payment", 14, "$g_cur_week_half_daily_wage_payments"), #between 0 and 7 (val_mul, ":nongarrison_wages", ":total_payment"), (val_div, ":nongarrison_wages", 14), (store_add, reg0, ":nongarrison_wages", ":garrison_wages"), ]), # script_calculate_hero_weekly_net_income_and_add_to_wealth # Input: arg1 = troop_no # Output: none ("calculate_hero_weekly_net_income_and_add_to_wealth", [ (store_script_param_1, ":troop_no"), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (troop_get_slot, ":cur_wealth", ":troop_no", slot_troop_wealth), (assign, ":weekly_income", 750), #let every hero receive 750 denars by default (store_character_level, ":troop_level", ":troop_no"), (store_mul, ":level_income", ":troop_level", 10), (val_add, ":weekly_income", ":level_income"), (store_troop_faction,":faction_no", ":troop_no"), (try_begin), #check if troop is kingdom leader (faction_slot_eq, ":faction_no", slot_faction_leader, ":troop_no"), (val_add, ":weekly_income", 1500), (try_end), (assign, ":cur_weekly_wage", 0), (try_begin), (gt, ":party_no",0), (call_script, "script_calculate_weekly_party_wage", ":party_no"), (assign, ":cur_weekly_wage", reg0), (try_end), (val_sub, ":weekly_income", ":cur_weekly_wage"), (val_add, ":cur_wealth", ":weekly_income"), (val_max, ":cur_wealth", 0), (troop_set_slot, ":troop_no", slot_troop_wealth, ":cur_wealth"), ]), # script_cf_reinforce_party # Input: arg1 = party_no, # Output: none # Adds reinforcement to party according to its type and faction ("cf_reinforce_party", [ (store_script_param_1, ":party_no"), (store_faction_of_party, ":party_faction", ":party_no"), (party_get_slot, ":party_type",":party_no", slot_party_type), #Rebellion changes begin: (try_begin), (eq, ":party_type", spt_kingdom_hero_party), (party_stack_get_troop_id, ":leader", ":party_no"), (troop_get_slot, ":party_faction", ":leader", slot_troop_original_faction), # (this_or_next|is_between, ":party_faction", rebel_factions_begin, rebel_factions_end), # (faction_get_slot, ":target_faction", ":party_faction", slot_faction_rebellion_target), # (assign, ":party_faction", ":target_faction"), # (assign, ":party_faction", "fac_kingdom_1"), (try_end), #Rebellion changes end (try_begin), (eq, ":party_faction", "fac_player_supporters_faction"), (party_get_slot, ":town_lord", ":party_no", slot_town_lord), (try_begin), (gt, ":town_lord", 0), (troop_get_slot, ":party_faction", ":town_lord", slot_troop_original_faction), (else_try), (party_get_slot, ":party_faction", ":party_no", slot_center_original_faction), (try_end), (try_end), (faction_get_slot, ":party_template_a", ":party_faction", slot_faction_reinforcements_a), (faction_get_slot, ":party_template_b", ":party_faction", slot_faction_reinforcements_b), (faction_get_slot, ":party_template_c", ":party_faction", slot_faction_reinforcements_c), (assign, ":party_template", 0), (store_random_in_range, ":rand", 0, 100), (try_begin), (this_or_next|eq, ":party_type", spt_town), (eq, ":party_type", spt_castle), #CASTLE OR TOWN (try_begin), (lt, ":rand", 65), (assign, ":party_template", ":party_template_a"), (else_try), (assign, ":party_template", ":party_template_b"), (try_end), (else_try), (eq, ":party_type", spt_kingdom_hero_party), (try_begin), (lt, ":rand", 50), (assign, ":party_template", ":party_template_a"), (else_try), (lt, ":rand", 75), (assign, ":party_template", ":party_template_b"), (else_try), (assign, ":party_template", ":party_template_c"), (try_end), (else_try), (try_end), (try_begin), (gt, ":party_template", 0), (party_add_template, ":party_no", ":party_template"), (try_end), ]), # script_hire_men_to_kingdom_hero_party # Input: arg1 = troop_no (hero of the party) # Output: none ("hire_men_to_kingdom_hero_party", [ (store_script_param_1, ":troop_no"), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (troop_get_slot, ":cur_wealth", ":troop_no", slot_troop_wealth), (assign, ":hiring_budget", ":cur_wealth"), (val_mul, ":hiring_budget", 3), (val_div, ":hiring_budget", 4), (assign, ":num_rounds", 1), (call_script, "script_party_get_ideal_size", ":party_no"), (assign, ":ideal_size", reg0), (store_mul, ":ideal_top_size", ":ideal_size", 3), (val_div, ":ideal_top_size", 2), (party_get_num_companions, ":party_size", ":party_no"), (try_for_range, ":unused", 0 , ":num_rounds"), (try_begin), (lt, ":party_size", ":ideal_size"), (gt, ":hiring_budget", reinforcement_cost), (gt, ":party_no", 0), (call_script, "script_cf_reinforce_party", ":party_no"), (val_sub, ":cur_wealth", reinforcement_cost), (troop_set_slot, ":troop_no", slot_troop_wealth, ":cur_wealth"), (else_try), (gt, ":party_size", ":ideal_top_size"), (store_troop_faction, ":troop_faction", ":troop_no"), (party_get_num_companion_stacks, ":num_stacks", ":party_no"), (assign, ":total_regulars", 0), (assign, ":total_regular_levels", 0), (try_for_range_backwards, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"), (neg|troop_is_hero, ":stack_troop"), (party_stack_get_size, ":stack_size", ":party_no", ":i_stack"), (store_character_level, ":stack_level", ":stack_troop"), (store_troop_faction, ":stack_faction", ":stack_troop"), (try_begin), (eq, ":troop_faction", ":stack_faction"), (val_mul, ":stack_level", 3), #reducing the chance of the faction troops' removal (try_end), (val_mul, ":stack_level", ":stack_size"), (val_add, ":total_regulars", ":stack_size"), (val_add, ":total_regular_levels", ":stack_level"), (try_end), (gt, ":total_regulars", 0), (store_div, ":average_level", ":total_regular_levels", ":total_regulars"), (try_for_range_backwards, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"), (neg|troop_is_hero, ":stack_troop"), (party_stack_get_size, ":stack_size", ":party_no", ":i_stack"), (store_character_level, ":stack_level", ":stack_troop"), (store_troop_faction, ":stack_faction", ":stack_troop"), (try_begin), (eq, ":troop_faction", ":stack_faction"), (val_mul, ":stack_level", 3), (try_end), (store_sub, ":level_dif", ":average_level", ":stack_level"), (val_div, ":level_dif", 3), (store_add, ":prune_chance", 10, ":level_dif"), (gt, ":prune_chance", 0), (call_script, "script_get_percentage_with_randomized_round", ":stack_size", ":prune_chance"), (gt, reg0, 0), (party_remove_members, ":party_no", ":stack_troop", reg0), (try_end), (try_end), (try_end), ]), # script_get_percentage_with_randomized_round # Input: arg1 = value, arg2 = percentage # Output: none ("get_percentage_with_randomized_round", [ (store_script_param, ":value", 1), (store_script_param, ":percentage", 2), (store_mul, ":result", ":value", ":percentage"), (val_div, ":result", 100), (store_mul, ":used_amount", ":result", 100), (val_div, ":used_amount", ":percentage"), (store_sub, ":left_amount", ":value", ":used_amount"), (try_begin), (gt, ":left_amount", 0), (store_mul, ":chance", ":left_amount", ":percentage"), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", ":chance"), (val_add, ":result", 1), (try_end), (assign, reg0, ":result"), ]), # script_cf_create_merchant_party # Input: arg1 = troop_no, # Output: $pout_party = party_no ## ("cf_create_merchant_party", ## [ ## (store_script_param_1, ":troop_no"), ## (store_troop_faction, ":troop_faction", ":troop_no"), ## ## (call_script, "script_cf_select_random_town_at_peace_with_faction", ":troop_faction"), ## (assign, ":center_no", reg0), ## ## (assign, "$pout_party", -1), ## (set_spawn_radius,0), ## (spawn_around_party,":center_no", "pt_merchant_party"), ## (assign, "$pout_party", reg0), ## ## (party_set_faction, "$pout_party", ":troop_faction"), ## (party_set_slot, "$pout_party", slot_party_type, spt_merchant_caravan), ## (party_set_slot, "$pout_party", slot_party_ai_state, spai_undefined), ## (troop_set_slot, ":troop_no", slot_troop_leaded_party, "$pout_party"), ## (party_add_leader, "$pout_party", ":troop_no"), ## (str_store_troop_name, s5, ":troop_no"), ## (party_set_name, "$pout_party", "str_s5_s_caravan"), ## (party_set_ai_behavior, "$pout_party", ai_bhvr_travel_to_party), ## (party_set_ai_object, "$pout_party", ":center_no"), ## (party_set_flags, "$pout_party", pf_default_behavior, 0), ## (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin), ## (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end), ## (store_add, ":cur_goods_price_slot", ":cur_goods", ":item_to_price_slot"), ## (party_set_slot, "$pout_party", ":cur_goods_price_slot", average_price_factor), ## (try_end), ## (troop_set_slot, ":troop_no", slot_troop_wealth, 2000), ## ]), # script_create_cattle_herd # Input: arg1 = center_no, arg2 = amount (0 = default) # Output: reg0 = party_no ("create_cattle_herd", [ (store_script_param_1, ":center_no"), (store_script_param_2, ":amount"), (assign, ":herd_party", -1), (set_spawn_radius,1), (spawn_around_party,":center_no", "pt_cattle_herd"), (assign, ":herd_party", reg0), (party_get_position, pos1, ":center_no"), (call_script, "script_map_get_random_position_around_position_within_range", 1, 2), (party_set_position, ":herd_party", pos2), (party_set_slot, ":herd_party", slot_party_type, spt_cattle_herd), (party_set_slot, ":herd_party", slot_party_ai_state, spai_undefined), (party_set_ai_behavior, ":herd_party", ai_bhvr_hold), (party_set_slot, ":herd_party", slot_party_commander_party, -1), #we need this because 0 is player's party! (try_begin), (gt, ":amount", 0), (party_clear, ":herd_party"), (party_add_members, ":herd_party", "trp_cattle", ":amount"), (try_end), (assign, reg0, ":herd_party"), ]), #script_buy_cattle_from_village # Input: arg1 = village_no, arg2 = amount, arg3 = single_cost # Output: reg0 = party_no ("buy_cattle_from_village", [ (store_script_param, ":village_no", 1), (store_script_param, ":amount", 2), (store_script_param, ":single_cost", 3), #Changing price of the cattle (try_for_range, ":unused", 0, ":amount"), (call_script, "script_game_event_buy_item", "itm_cattle_meat", 0), (call_script, "script_game_event_buy_item", "itm_cattle_meat", 0), (try_end), (party_get_slot, ":num_cattle", ":village_no", slot_village_number_of_cattle), (val_sub, ":num_cattle", ":amount"), (party_set_slot, ":village_no", slot_village_number_of_cattle, ":num_cattle"), (store_mul, ":cost", ":single_cost", ":amount"), (troop_remove_gold, "trp_player", ":cost"), (assign, ":continue", 1), (try_for_parties, ":cur_party"), (eq, ":continue", 1), (party_slot_eq, ":cur_party", slot_party_type, spt_cattle_herd), (store_distance_to_party_from_party, ":dist", ":village_no", ":cur_party"), (lt, ":dist", 6), (assign, ":subcontinue", 1), (try_begin), (check_quest_active, "qst_move_cattle_herd"), (quest_slot_eq, "qst_move_cattle_herd", slot_quest_target_party, ":cur_party"), (assign, ":subcontinue", 0), (try_end), (eq, ":subcontinue", 1), (party_add_members, ":cur_party", "trp_cattle", ":amount"), (assign, ":continue", 0), (assign, reg0, ":cur_party"), (try_end), (try_begin), (eq, ":continue", 1), (call_script, "script_create_cattle_herd", ":village_no", ":amount"), (try_end), ]), #script_kill_cattle_from_herd # Input: arg1 = party_no, arg2 = amount # Output: none (fills trp_temp_troop's inventory) ("kill_cattle_from_herd", [ (store_script_param_1, ":party_no"), (store_script_param_2, ":amount"), (troop_clear_inventory, "trp_temp_troop"), (store_mul, ":meat_amount", ":amount", 2), (troop_add_items, "trp_temp_troop", "itm_cattle_meat", ":meat_amount"), (troop_get_inventory_capacity, ":inv_size", "trp_temp_troop"), (try_for_range, ":i_slot", 0, ":inv_size"), (troop_get_inventory_slot, ":item_id", "trp_temp_troop", ":i_slot"), (eq, ":item_id", "itm_cattle_meat"), (troop_set_inventory_slot_modifier, "trp_temp_troop", ":i_slot", imod_fresh), (try_end), (party_get_num_companions, ":num_cattle", ":party_no"), (try_begin), (ge, ":amount", ":num_cattle"), (remove_party, ":party_no"), (else_try), (party_remove_members, ":party_no", "trp_cattle", ":amount"), (try_end), ]), # script_create_kingdom_hero_party # Input: arg1 = troop_no, arg2 = center_no # Output: $pout_party = party_no ("create_kingdom_hero_party", [ (store_script_param, ":troop_no", 1), (store_script_param, ":center_no", 2), (store_troop_faction, ":troop_faction_no", ":troop_no"), (assign, "$pout_party", -1), (set_spawn_radius,0), (spawn_around_party,":center_no", "pt_kingdom_hero_party"), (assign, "$pout_party", reg0), (party_set_faction, "$pout_party", ":troop_faction_no"), (party_set_slot, "$pout_party", slot_party_type, spt_kingdom_hero_party), (call_script, "script_party_set_ai_state", "$pout_party", spai_undefined, -1), (troop_set_slot, ":troop_no", slot_troop_leaded_party, "$pout_party"), (party_add_leader, "$pout_party", ":troop_no"), (str_store_troop_name, s5, ":troop_no"), (party_set_name, "$pout_party", "str_s5_s_party"), (party_set_slot, "$pout_party", slot_party_commander_party, -1), #we need this because 0 is player's party! #Setting the flag icon #normal_banner_begin (troop_get_slot, ":cur_banner", ":troop_no", slot_troop_banner_scene_prop), (try_begin), (gt, ":cur_banner", 0), (val_sub, ":cur_banner", banner_scene_props_begin), (val_add, ":cur_banner", banner_map_icons_begin), (party_set_banner_icon, "$pout_party", ":cur_banner"), #custom_banner_begin # (troop_get_slot, ":flag_icon", ":troop_no", slot_troop_custom_banner_map_flag_type), # (try_begin), # (ge, ":flag_icon", 0), # (val_add, ":flag_icon", custom_banner_map_icons_begin), # (party_set_banner_icon, "$pout_party", ":flag_icon"), (try_end), (try_begin), (troop_slot_eq, ":troop_no", slot_troop_spawned_before, 0), (troop_set_slot, ":troop_no", slot_troop_spawned_before, 1), (assign, ":num_tries", 20), (try_begin), (store_troop_faction, ":troop_kingdom", ":troop_no"), (faction_slot_eq, ":troop_kingdom", slot_faction_leader, ":troop_no"), (assign, ":num_tries", 50), (try_end), (try_for_range, ":unused", 0, ":num_tries"), (call_script, "script_hire_men_to_kingdom_hero_party", ":troop_no"), (try_end), (store_random_in_range, ":xp_rounds", 2, 6), (troop_get_slot, ":renown", ":troop_no", slot_troop_renown), (store_div, ":renown_xp_rounds", ":renown", 100), (val_add, ":xp_rounds", ":renown_xp_rounds"), (try_for_range, ":unused", 0, ":xp_rounds"), (call_script, "script_upgrade_hero_party", "$pout_party", 4000), (try_end), (try_end), ]), # script_create_kingdom_party_if_below_limit # Input: arg1 = faction_no, arg2 = party_type (variables beginning with spt_) # Output: reg0 = party_no ("create_kingdom_party_if_below_limit", [ (store_script_param_1, ":faction_no"), (store_script_param_2, ":party_type"), (call_script, "script_count_parties_of_faction_and_party_type", ":faction_no", ":party_type"), (assign, ":party_count", reg0), (assign, ":party_count_limit", 0), (try_begin), ## (eq, ":party_type", spt_forager), ## (assign, ":party_count_limit", 1), ## (else_try), ## (eq, ":party_type", spt_scout), ## (assign, ":party_count_limit", 1), ## (else_try), ## (eq, ":party_type", spt_patrol), ## (assign, ":party_count_limit", 1), ## (else_try), ## (eq, ":party_type", spt_messenger), ## (assign, ":party_count_limit", 1), ## (else_try), (eq, ":party_type", spt_kingdom_caravan), (assign, ":party_count_limit", 5), ## (else_try), ## (eq, ":party_type", spt_prisoner_train), ## (assign, ":party_count_limit", 1), (try_end), (assign, reg0, -1), (try_begin), (lt, ":party_count", ":party_count_limit"), (call_script,"script_cf_create_kingdom_party", ":faction_no", ":party_type"), (try_end), ]), # script_cf_create_kingdom_party # Input: arg1 = faction_no, arg2 = party_type (variables beginning with spt_) # Output: reg0 = party_no ("cf_create_kingdom_party", [ (store_script_param_1, ":faction_no"), (store_script_param_2, ":party_type"), (str_store_faction_name, s7, ":faction_no"), (assign, ":party_name_str", "str_no_string"), ## (faction_get_slot, ":reinforcements_a", ":faction_no", slot_faction_reinforcements_a), (faction_get_slot, ":reinforcements_b", ":faction_no", slot_faction_reinforcements_b), ## (faction_get_slot, ":reinforcements_c", ":faction_no", slot_faction_reinforcements_c), (try_begin), ## (eq, ":party_type", spt_forager), ## (assign, ":party_template", "pt_forager_party"), # (assign, ":party_name_str", "str_s7_foragers"), ## (else_try), ## (eq, ":party_type", spt_scout), ## (assign, ":party_template", "pt_scout_party"), # (assign, ":party_name_str", "str_s7_scouts"), ## (else_try), ## (eq, ":party_type", spt_patrol), ## (assign, ":party_template", "pt_patrol_party"), # (assign, ":party_name_str", "str_s7_patrol"), ## (else_try), (eq, ":party_type", spt_kingdom_caravan), (assign, ":party_template", "pt_kingdom_caravan_party"), # (assign, ":party_name_str", "str_s7_caravan"), ## (else_try), ## (eq, ":party_type", spt_messenger), ## (assign, ":party_template", "pt_messenger_party"), # (assign, ":party_name_str", "str_s7_messenger"), ## (else_try), ## (eq, ":party_type", spt_raider), ## (assign, ":party_template", "pt_raider_party"), ## (assign, ":party_name_str", "str_s7_raiders"), ## (else_try), ## (eq, ":party_type", spt_prisoner_train), ## (assign, ":party_template", "pt_prisoner_train_party"), # (assign, ":party_name_str", "str_s7_prisoner_train"), (try_end), (assign, ":result", -1), (try_begin), (try_begin), (eq, ":party_type", spt_kingdom_caravan), (call_script,"script_cf_select_random_town_with_faction", ":faction_no", -1), (set_spawn_radius, 0), (else_try), #not used at the moment (call_script,"script_cf_select_random_walled_center_with_faction", ":faction_no", -1), (set_spawn_radius, 1), (try_end), (assign, ":spawn_center", reg0), (is_between, ":spawn_center", centers_begin, centers_end), (spawn_around_party,":spawn_center",":party_template"), (assign, ":result", reg0), (party_set_faction, ":result", ":faction_no"), (try_begin), (eq, ":party_type", spt_kingdom_caravan), (party_set_slot, ":result", slot_party_home_center, ":spawn_center"), (try_end), (party_set_slot, ":result", slot_party_type, ":party_type"), (party_set_slot, ":result", slot_party_ai_state, spai_undefined), (try_begin), (neq, ":party_name_str", "str_no_string"), (party_set_name, ":result", ":party_name_str"), (try_end), (try_begin), ## (eq, ":party_type", spt_forager), ## (party_add_template, ":result", ":reinforcements_a"), ## (else_try), ## (eq, ":party_type", spt_scout), ## (party_add_template, ":result", ":reinforcements_c"), ## (else_try), ## (eq, ":party_type", spt_patrol), ## (party_add_template, ":result", ":reinforcements_a"), ## (party_add_template, ":result", ":reinforcements_b"), ## (else_try), (eq, ":party_type", spt_kingdom_caravan), (party_add_template, ":result", ":reinforcements_b"), (party_add_template, ":result", ":reinforcements_b"), (party_set_ai_behavior,":result",ai_bhvr_travel_to_party), (party_set_ai_object,":result",":spawn_center"), (party_set_flags, ":result", pf_default_behavior, 1), (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin), (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end), (store_add, ":cur_goods_price_slot", ":cur_goods", ":item_to_price_slot"), (party_set_slot, ":result", ":cur_goods_price_slot", average_price_factor), (try_end), ## (else_try), ## (eq, ":party_type", spt_messenger), ## (faction_get_slot, ":messenger_troop", ":faction_no", slot_faction_messenger_troop), ## (party_add_leader, ":result", ":messenger_troop"), ## (party_set_ai_behavior,":result",ai_bhvr_travel_to_party), ## (party_set_ai_object,":result",":spawn_center"), ## (party_set_flags, ":result", pf_default_behavior, 0), ## (else_try), ## (eq, ":party_type", spt_raider), ## (party_add_template, ":result", ":reinforcements_c"), ## (party_add_template, ":result", ":reinforcements_b"), ## (party_add_template, ":result", "pt_raider_captives"), ## (else_try), ## (eq, ":party_type", spt_prisoner_train), ## (party_add_template, ":result", ":reinforcements_b"), ## (party_add_template, ":result", ":reinforcements_a"), ## (try_begin), ## (call_script,"script_cf_faction_get_random_enemy_faction",":faction_no"), ## (store_random_in_range,":r",0,3), ## (try_begin), ## (lt, ":r", 1), ## (faction_get_slot, ":captive_reinforcements", reg0, slot_faction_reinforcements_b), ## (else_try), ## (faction_get_slot, ":captive_reinforcements", reg0, slot_faction_reinforcements_a), ## (try_end), ## (party_add_template, ":result", ":captive_reinforcements",1), ## (else_try), ## (party_add_template, ":result", "pt_default_prisoners"), ## (try_end), (try_end), (try_end), (ge, ":result", 0), (assign, reg0, ":result"), ]), # script_get_troop_attached_party # Input: arg1 = troop_no # Output: reg0 = party_no (-1 if troop's party is not attached to a party) ("get_troop_attached_party", [ (store_script_param_1, ":troop_no"), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (assign, ":attached_party_no", -1), (try_begin), (ge, ":party_no", 0), (party_get_attached_to, ":attached_party_no", ":party_no"), (try_end), (assign, reg0, ":attached_party_no"), ]), # script_center_get_food_consumption # Input: arg1 = center_no # Output: reg0: food consumption (1 food item counts as 100 units) ("center_get_food_consumption", [ (store_script_param_1, ":center_no"), (assign, ":food_consumption", 0), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_town), (assign, ":food_consumption", 500), (else_try), (party_slot_eq, ":center_no", slot_party_type, spt_castle), (assign, ":food_consumption", 50), (try_end), (assign, reg0, ":food_consumption"), ]), # script_center_get_food_store_limit # Input: arg1 = center_no # Output: reg0: food consumption (1 food item counts as 100 units) ("center_get_food_store_limit", [ (store_script_param_1, ":center_no"), (assign, ":food_store_limit", 0), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_town), (assign, ":food_store_limit", 50000), (else_try), (party_slot_eq, ":center_no", slot_party_type, spt_castle), (assign, ":food_store_limit", 1500), (try_end), (assign, reg0, ":food_store_limit"), ]), # script_refresh_village_merchant_inventory # Input: arg1 = village_no # Output: none ("refresh_village_merchant_inventory", [ (store_script_param_1, ":village_no"), (party_get_slot, ":merchant_troop", ":village_no", slot_town_elder), (reset_item_probabilities,0), (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin), (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end), (store_add, ":cur_price_slot", ":cur_goods", ":item_to_price_slot"), (party_get_slot, ":cur_price", ":village_no", ":cur_price_slot"), (assign, ":cur_probability", 100), (val_mul, ":cur_probability", average_price_factor), (val_div, ":cur_probability", ":cur_price"), (val_mul, ":cur_probability", average_price_factor), (val_div, ":cur_probability", ":cur_price"), (val_mul, ":cur_probability", average_price_factor), (val_div, ":cur_probability", ":cur_price"), (val_mul, ":cur_probability", average_price_factor), (val_div, ":cur_probability", ":cur_price"), (set_item_probability_in_merchandise, ":cur_goods", ":cur_probability"), (try_end), (set_item_probability_in_merchandise, "itm_spice", 0), (set_item_probability_in_merchandise, "itm_velvet", 0), (troop_add_merchandise, ":merchant_troop", itp_type_goods, 3), (troop_ensure_inventory_space, ":merchant_troop", 80), #Adding 1 prosperity to the village while reducing each 3000 gold from the elder (store_troop_gold, ":gold",":merchant_troop"), (try_begin), (gt, ":gold", 3500), (store_div, ":prosperity_added", ":gold", 3000), (store_mul, ":gold_removed", ":prosperity_added", 3000), (troop_remove_gold, ":merchant_troop", ":gold_removed"), (call_script, "script_change_center_prosperity", ":village_no", ":prosperity_added"), (try_end), ]), # script_refresh_village_defenders # Input: arg1 = village_no # Output: none ("refresh_village_defenders", [ (store_script_param_1, ":village_no"), (assign, ":ideal_size", 50), (try_begin), (party_get_num_companions, ":party_size", ":village_no"), (lt, ":party_size", ":ideal_size"), (party_add_template, ":village_no", "pt_village_defenders"), (try_end), ]), # script_village_set_state # Input: arg1 = center_no arg2:new_state # Output: reg0: food consumption (1 food item counts as 100 units) ("village_set_state", [ (store_script_param_1, ":village_no"), (store_script_param_2, ":new_state"), # (party_get_slot, ":old_state", ":village_no", slot_village_state), (try_begin), (eq, ":new_state", 0), (party_set_extra_text, ":village_no", "str_empty_string"), (party_set_slot, ":village_no", slot_village_raided_by, -1), (else_try), (eq, ":new_state", svs_being_raided), (party_set_extra_text, ":village_no", "@(Being Raided)"), (else_try), (eq, ":new_state", svs_looted), (party_set_extra_text, ":village_no", "@(Looted)"), (party_set_slot, ":village_no", slot_village_raided_by, -1), (call_script, "script_change_center_prosperity", ":village_no", -30), (else_try), (eq, ":new_state", svs_under_siege), (party_set_extra_text, ":village_no", "@(Under Siege)"), (try_end), (party_set_slot, ":village_no", slot_village_state, ":new_state"), ]), # script_process_village_raids # Input: none # Output: none # called from triggers every two hours ("process_village_raids", [ (try_for_range, ":village_no", villages_begin, villages_end), (party_get_slot, ":village_raid_progress", ":village_no", slot_village_raid_progress), (try_begin), (party_slot_eq, ":village_no", slot_village_state, 0), #village is normal (val_sub, ":village_raid_progress", 5), (val_max, ":village_raid_progress", 0), (party_set_slot, ":village_no", slot_village_raid_progress, ":village_raid_progress"), (else_try), (party_slot_eq, ":village_no", slot_village_state, svs_being_raided), #village is being raided # End raid unless there is an enemy party nearby (assign, ":raid_ended", 1), (party_get_slot, ":raider_party", ":village_no", slot_village_raided_by), (try_begin), (ge, ":raider_party", 0), (party_is_active, ":raider_party"), (this_or_next|neq, ":raider_party", "p_main_party"), (eq, "$g_player_is_captive", 0), (store_distance_to_party_from_party, ":distance", ":village_no", ":raider_party"), (lt, ":distance", raid_distance), (assign, ":raid_ended", 0), (try_end), (try_begin), (eq, ":raid_ended", 1), (call_script, "script_village_set_state", ":village_no", 0), #clear raid flag (party_set_slot, ":village_no", slot_village_smoke_added, 0), (party_clear_particle_systems, ":village_no"), (else_try), (assign, ":raid_progress_increase", 11), (party_get_slot, ":looter_party", ":village_no", slot_village_raided_by), (try_begin), (party_get_skill_level, ":looting_skill", ":looter_party", "skl_looting"), (val_add, ":raid_progress_increase", ":looting_skill"), (try_end), (try_begin), (party_slot_eq, ":village_no", slot_center_has_watch_tower, 1), (val_mul, ":raid_progress_increase", 75), (val_div, ":raid_progress_increase", 100), (try_end), (val_add, ":village_raid_progress", ":raid_progress_increase"), (party_set_slot, ":village_no", slot_village_raid_progress, ":village_raid_progress"), (try_begin), (ge, ":village_raid_progress", 50), (party_slot_eq, ":village_no", slot_village_smoke_added, 0), (party_add_particle_system, ":village_no", "psys_map_village_fire"), (party_add_particle_system, ":village_no", "psys_map_village_fire_smoke"), (party_set_icon, ":village_no", "icon_village_burnt_a"), (party_set_slot, ":village_no", slot_village_smoke_added, 1), (try_end), (try_begin), (gt, ":village_raid_progress", 100), (str_store_party_name_link, s1, ":village_no"), (party_stack_get_troop_id, ":raid_leader", ":looter_party"), (ge, ":raid_leader", 0), (str_store_party_name, s2, ":looter_party"), (display_log_message, "@The village of {s1} has been looted by {s2}."), (call_script, "script_village_set_state", ":village_no", svs_looted), (party_set_slot, ":village_no", slot_village_raid_progress, 0), (party_set_slot, ":village_no", slot_village_recover_progress, 0), (try_begin), (store_faction_of_party, ":village_faction", ":village_no"), (this_or_next|party_slot_eq, ":village_no", slot_town_lord, "trp_player"), (eq, ":village_faction", "fac_player_supporters_faction"), (call_script, "script_add_notification_menu", "mnu_notification_village_raided", ":village_no", ":raid_leader"), (try_end), (call_script, "script_add_log_entry", logent_village_raided, ":raid_leader", ":village_no", -1, -1), (try_end), (try_end), (else_try), (party_slot_eq, ":village_no", slot_village_state, svs_looted), #village is looted (party_get_slot, ":recover_progress", ":village_no", slot_village_recover_progress), (val_add, ":recover_progress", 1), (party_set_slot, ":village_no", slot_village_recover_progress, ":recover_progress"), #village looted (try_begin), (ge, ":recover_progress", 10), (party_slot_eq, ":village_no", slot_village_smoke_added, 1), (party_clear_particle_systems, ":village_no"), (party_add_particle_system, ":village_no", "psys_map_village_looted_smoke"), (party_set_slot, ":village_no", slot_village_smoke_added, 2), (try_end), (try_begin), (gt, ":recover_progress", 50), (party_slot_eq, ":village_no", slot_village_smoke_added, 2), (party_clear_particle_systems, ":village_no"), (party_set_slot, ":village_no", slot_village_smoke_added, 3), (party_set_icon, ":village_no", "icon_village_deserted_a"), (try_end), (try_begin), (gt, ":recover_progress", 100), (call_script, "script_village_set_state", ":village_no", 0),#village back to normal (party_set_slot, ":village_no", slot_village_recover_progress, 0), (party_clear_particle_systems, ":village_no"), (party_set_slot, ":village_no", slot_village_smoke_added, 0), (party_set_icon, ":village_no", "icon_village_a"), (try_end), (try_end), (try_end), ]), # script_process_sieges # Input: none # Output: none #called from triggers ("process_sieges", [ (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), #Reducing siege hardness every day by 20 (party_get_slot, ":siege_hardness", ":center_no", slot_center_siege_hardness), (val_sub, ":siege_hardness", 20), (val_max, ":siege_hardness", 0), (party_set_slot, ":center_no", slot_center_siege_hardness, ":siege_hardness"), (party_get_slot, ":town_food_store", ":center_no", slot_party_food_store), (call_script, "script_center_get_food_store_limit", ":center_no"), (assign, ":food_store_limit", reg0), (try_begin), (party_get_slot, ":besieger_party", ":center_no", slot_center_is_besieged_by), (ge, ":besieger_party", 0), #town is under siege #Reduce prosperity of besieged center by -1 with a 33% chance every day. (try_begin), (store_random_in_range, ":random_no", 0, 3), (eq, ":random_no", 0), (call_script, "script_change_center_prosperity", ":center_no", -1), (try_end), (store_faction_of_party, ":center_faction", ":center_no"), # Lift siege unless there is an enemy party nearby (assign, ":siege_lifted", 0), (try_begin), (try_begin), (neg|party_is_active, ":besieger_party"), (assign, ":siege_lifted", 1), (else_try), (store_distance_to_party_from_party, ":besieger_distance", ":center_no", ":besieger_party"), (gt, ":besieger_distance", 5), (assign, ":siege_lifted", 1), (try_end), (eq, ":siege_lifted", 1), (try_for_range, ":enemy_hero", kingdom_heroes_begin, kingdom_heroes_end), (troop_slot_eq, ":enemy_hero", slot_troop_occupation, slto_kingdom_hero), (troop_get_slot, ":enemy_party", ":enemy_hero", slot_troop_leaded_party), (ge, ":enemy_party", 0), (party_is_active, ":enemy_party"), (store_faction_of_party, ":party_faction", ":enemy_party"), (store_relation, ":reln", ":party_faction", ":center_faction"), (lt, ":reln", 0), (store_distance_to_party_from_party, ":distance", ":center_no", ":enemy_party"), (lt, ":distance", 4), (assign, ":besieger_party", ":enemy_party"), (party_set_slot, ":center_no", slot_center_is_besieged_by, ":enemy_party"), (assign, ":siege_lifted", 0), (try_end), (try_end), (try_begin), (eq, ":siege_lifted", 1), (call_script, "script_lift_siege", ":center_no", 1), (else_try), (call_script, "script_center_get_food_consumption", ":center_no"), (assign, ":food_consumption", reg0), (val_sub, ":town_food_store", ":food_consumption"), # reduce food only under siege??? (try_begin), (le, ":town_food_store", 0), #town is starving (store_random_in_range, ":r", 0, 100), (lt, ":r", 10), (call_script, "script_party_wound_all_members", ":center_no"), # town falls with 10% chance if starving (try_end), (try_end), (else_try), #town is not under siege... (val_add, ":town_food_store", 30), #add 30 food (significant for castles only. (try_end), (val_min, ":town_food_store", ":food_store_limit"), (val_max, ":town_food_store", 0), (party_set_slot, ":center_no", slot_party_food_store, ":town_food_store"), (try_end), ]), # script_lift_siege # Input: arg1 = center_no, arg2 = display_message # Output: none #called from triggers ("lift_siege", [ (store_script_param, ":center_no", 1), (store_script_param, ":display_message", 2), (party_set_slot, ":center_no", slot_center_is_besieged_by, -1), #clear siege (call_script, "script_village_set_state", ":center_no", 0), #clear siege flag (try_begin), (eq, ":center_no", "$g_player_besiege_town"), (assign, "$g_siege_method", 0), #remove siege progress (try_end), (try_begin), (eq, ":display_message", 1), (str_store_party_name_link, s3, ":center_no"), (display_message, "@{s3} is no longer under siege."), (try_end), ]), # script_process_alarms # Input: none # Output: none #called from triggers ("process_alarms", [(try_for_range, ":center_no", centers_begin, centers_end), (party_set_slot, ":center_no", slot_center_last_spotted_enemy, -1), (try_end), (assign, ":spotting_range", 2), (try_begin), (is_currently_night), (assign, ":spotting_range", 1), (try_end), (try_begin), (party_slot_eq, ":center_no", slot_center_has_watch_tower, 1), (val_mul, ":spotting_range", 2), (try_end), (try_for_parties, ":party_no"), (party_slot_eq, ":party_no", slot_party_type, spt_kingdom_hero_party), (neg|party_is_in_any_town, ":party_no"), (store_faction_of_party, ":party_faction", ":party_no"), (try_for_range, ":center_no", centers_begin, centers_end), (store_distance_to_party_from_party, ":distance", ":party_no", ":center_no"), (le, ":distance", ":spotting_range"), (store_faction_of_party, ":center_faction", ":center_no"), (store_relation, ":reln", ":center_faction", ":party_faction"), (lt, ":reln", 0), (party_set_slot, ":center_no", slot_center_last_spotted_enemy, ":party_no"), (try_end), (try_end), (try_for_range, ":center_no", centers_begin, centers_end), (store_faction_of_party, ":center_faction", ":center_no"), (this_or_next|party_slot_eq, ":center_no", slot_town_lord, "trp_player"), (eq, ":center_faction", "$players_kingdom"), (party_get_slot, ":enemy_party", ":center_no", slot_center_last_spotted_enemy), (ge, ":enemy_party", 0), (store_distance_to_party_from_party, ":dist", "p_main_party", ":center_no"), (assign, ":has_messenger", 0), (try_begin), (this_or_next|party_slot_eq, ":center_no", slot_town_lord, "trp_player"), (eq, ":center_faction", "fac_player_supporters_faction"), (party_slot_eq, ":center_no", slot_center_has_messenger_post, 1), (assign, ":has_messenger", 1), (try_end), (this_or_next|lt, ":dist", 30), (eq, ":has_messenger", 1), (str_store_party_name_link, s1, ":center_no"), (display_message, "@Enemies spotted near {s1}."), (try_end), ]), # script_party_set_ai_state # Input: arg1 = party_no, arg2 = new_ai_state, arg3 = action_object (if necessary) # Output: none (Can fail) ("party_set_ai_state", [ (store_script_param, ":party_no", 1), (store_script_param, ":new_ai_state", 2), (store_script_param, ":new_ai_object", 3), (party_get_slot, ":old_ai_state", ":party_no", slot_party_ai_state), (party_get_slot, ":old_ai_object", ":party_no", slot_party_ai_object), (party_get_attached_to, ":attached_to_party", ":party_no"), (assign, ":party_is_in_town", 0), (try_begin), (is_between, ":attached_to_party", centers_begin, centers_end), (assign, ":party_is_in_town", ":attached_to_party"), (try_end), (party_set_slot, ":party_no", slot_party_follow_me, 0), (try_begin), (eq, ":old_ai_state", ":new_ai_state"), (eq, ":old_ai_object", ":new_ai_object"), #do nothing. Nothing is changed. (else_try), (try_begin), (eq, ":new_ai_state", spai_accompanying_army), (party_set_ai_behavior, ":party_no", ai_bhvr_escort_party), (party_set_ai_object, ":party_no", ":new_ai_object"), (party_set_flags, ":party_no", pf_default_behavior, 0), (try_begin), (gt, ":party_is_in_town", 0), (party_detach, ":party_no"), (try_end), (else_try), (eq, ":new_ai_state", spai_besieging_center), (party_get_position, pos1, ":new_ai_object"), (map_get_random_position_around_position, pos2, pos1, 2), (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_point), (party_set_ai_target_position, ":party_no", pos2), (party_set_ai_object, ":party_no", ":new_ai_object"), (party_set_flags, ":party_no", pf_default_behavior, 0), (party_set_slot, ":party_no", slot_party_follow_me, 1), (party_set_slot, ":party_no", slot_party_ai_substate, 0), (try_begin), (gt, ":party_is_in_town", 0), (neq, ":party_is_in_town", ":new_ai_object"), (party_detach, ":party_no"), (try_end), (else_try), (eq, ":new_ai_state", spai_holding_center), (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party), (party_set_ai_object, ":party_no", ":new_ai_object"), (party_set_flags, ":party_no", pf_default_behavior, 0), (try_begin), (gt, ":party_is_in_town", 0), (neq, ":party_is_in_town", ":new_ai_object"), (party_detach, ":party_no"), (try_end), (else_try), (eq, ":new_ai_state", spai_patrolling_around_center), (party_get_position, pos1, ":new_ai_object"), (map_get_random_position_around_position, pos2, pos1, 1), (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_point), (party_set_ai_target_position, ":party_no", pos2), (party_set_ai_object, ":party_no", ":new_ai_object"), (party_set_ai_patrol_radius, ":party_no", 5), (party_set_flags, ":party_no", pf_default_behavior, 0), (party_set_slot, ":party_no", slot_party_follow_me, 1), (party_set_slot, ":party_no", slot_party_ai_substate, 0), (try_begin), (gt, ":party_is_in_town", 0), (party_detach, ":party_no"), (try_end), (else_try), (eq, ":new_ai_state", spai_recruiting_troops), (party_get_position, pos1, ":new_ai_object"), (map_get_random_position_around_position, pos2, pos1, 2), (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_point), (party_set_ai_target_position, ":party_no", pos2), (party_set_ai_object, ":party_no", ":new_ai_object"), (party_set_flags, ":party_no", pf_default_behavior, 0), (party_set_slot, ":party_no", slot_party_ai_substate, 0), (try_begin), (gt, ":party_is_in_town", 0), (neq, ":party_is_in_town", ":new_ai_object"), (party_detach, ":party_no"), (try_end), (else_try), (eq, ":new_ai_state", spai_raiding_around_center), (party_get_position, pos1, ":new_ai_object"), (map_get_random_position_around_position, pos2, pos1, 1), (party_set_ai_behavior, ":party_no", ai_bhvr_patrol_location), (party_set_ai_patrol_radius, ":party_no", 10), (party_set_ai_target_position, ":party_no", pos2), (party_set_ai_object, ":party_no", ":new_ai_object"), (party_set_flags, ":party_no", pf_default_behavior, 0), (party_set_slot, ":party_no", slot_party_follow_me, 1), (party_set_slot, ":party_no", slot_party_ai_substate, 0), (try_begin), (gt, ":party_is_in_town", 0), (neq, ":party_is_in_town", ":new_ai_object"), (party_detach, ":party_no"), (try_end), (else_try), ## (eq, ":new_ai_state", spai_raiding_village), ## (party_get_position, pos1, ":new_ai_object"), ## (map_get_random_position_around_position, pos2, pos1, 1), ## (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_point), ## (party_set_ai_target_position, ":party_no", pos2), ## (party_set_ai_object, ":party_no", ":new_ai_object"), ## (party_set_flags, ":party_no", pf_default_behavior, 0), ## (party_set_slot, ":party_no", slot_party_follow_me, 1), ## (try_begin), ## (gt, ":party_is_in_town", 0), ## (neq, ":party_is_in_town", ":new_ai_object"), ## (party_detach, ":party_no"), ## (try_end), ## (else_try), (eq, ":new_ai_state", spai_engaging_army), (party_set_ai_behavior, ":party_no", ai_bhvr_attack_party), (party_set_ai_object, ":party_no", ":new_ai_object"), (party_set_flags, ":party_no", pf_default_behavior, 0), (try_begin), (gt, ":party_is_in_town", 0), (party_detach, ":party_no"), (try_end), (else_try), (eq, ":new_ai_state", spai_retreating_to_center), (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party), (party_set_ai_object, ":party_no", ":new_ai_object"), (party_set_flags, ":party_no", pf_default_behavior, 1), (party_set_slot, ":party_no", slot_party_commander_party, -1), (try_begin), (gt, ":party_is_in_town", 0), (neq, ":party_is_in_town", ":new_ai_object"), (party_detach, ":party_no"), (try_end), (else_try), (eq, ":new_ai_state", spai_undefined), (party_set_ai_behavior, ":party_no", ai_bhvr_hold), (party_set_flags, ":party_no", pf_default_behavior, 0), (try_end), (try_end), (party_set_slot, ":party_no", slot_party_ai_state, ":new_ai_state"), (party_set_slot, ":party_no", slot_party_ai_object, ":new_ai_object"), ]), # script_decide_kingdom_party_ais # Input: none # Output: none #called from triggers ("decide_kingdom_party_ais", [ (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active), (neq, ":faction_no", "fac_player_supporters_faction"), (faction_get_slot, ":faction_ai_state", ":faction_no", slot_faction_ai_state), (neq, ":faction_ai_state", sfai_default), (faction_get_slot, ":faction_ai_object", ":faction_no", slot_faction_ai_object), (faction_get_slot, ":faction_marshall", ":faction_no", slot_faction_marshall), (gt, ":faction_marshall", 0), (neq, ":faction_marshall", "trp_player"), (troop_get_slot, ":faction_marshall_party", ":faction_marshall", slot_troop_leaded_party), (gt, ":faction_marshall_party", 0), (try_begin), (eq, ":faction_ai_state", sfai_gathering_army), (call_script, "script_party_set_ai_state", ":faction_marshall_party", spai_undefined, -1), (party_set_ai_initiative, ":faction_marshall_party", 100), (else_try), (eq, ":faction_ai_state", sfai_attacking_center), (call_script, "script_party_set_ai_state", ":faction_marshall_party", spai_besieging_center, ":faction_ai_object"), (party_set_ai_initiative, ":faction_marshall_party", 50), (else_try), (eq, ":faction_ai_state", sfai_raiding_village), (call_script, "script_party_set_ai_state", ":faction_marshall_party", spai_raiding_around_center, ":faction_ai_object"), (party_set_ai_initiative, ":faction_marshall_party", 50), (else_try), (eq, ":faction_ai_state", sfai_attacking_enemies_around_center), (call_script, "script_party_set_ai_state", ":faction_marshall_party", spai_patrolling_around_center, ":faction_ai_object"), (party_set_ai_initiative, ":faction_marshall_party", 50), (else_try), (eq, ":faction_ai_state", sfai_attacking_enemy_army), (call_script, "script_party_set_ai_state", ":faction_marshall_party", spai_engaging_army, ":faction_ai_object"), (party_set_ai_initiative, ":faction_marshall_party", 50), (try_end), (party_set_slot, ":faction_marshall_party", slot_party_commander_party, -1), (try_end), (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (try_begin), (store_troop_faction, ":troop_faction", ":troop_no"), (neg|faction_slot_eq, ":troop_faction", slot_faction_marshall, ":troop_no"), (troop_get_slot, ":troop_party", ":troop_no", slot_troop_leaded_party), (gt, ":troop_party", 0), (party_is_active, ":troop_party"), (party_set_ai_initiative, ":troop_party", 100), (try_end), (call_script, "script_calculate_troop_ai", ":troop_no"), (try_end), (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (call_script, "script_calculate_troop_ai_under_command", ":troop_no"), (try_end), ]), # script_party_decide_next_ai_state_under_command # Input: arg1 = party_no # Output: none #called from triggers ("party_decide_next_ai_state_under_command", [ (store_script_param_1, ":party_no"), (party_get_slot, ":commander_party", ":party_no", slot_party_commander_party), (try_begin), (party_is_active, ":commander_party"), (party_get_slot, ":commander_ai_state", ":commander_party", slot_party_ai_state), (party_get_slot, ":commander_ai_object", ":commander_party", slot_party_ai_object), (store_faction_of_party, ":faction_no", ":party_no"), (store_distance_to_party_from_party, ":distance_to_commander", ":party_no", ":commander_party"), (try_begin), (gt, ":distance_to_commander", 5), (call_script, "script_party_set_ai_state", ":party_no", spai_accompanying_army, ":commander_party"), (else_try), (try_begin), (eq, ":commander_party", "p_main_party"), (call_script, "script_party_set_ai_state", ":party_no", spai_accompanying_army, "p_main_party"), (else_try), (eq, ":commander_ai_state", spai_besieging_center), (store_distance_to_party_from_party, ":distance_to_object", ":party_no", ":commander_ai_object"), (le, ":distance_to_object", 5), (call_script, "script_party_set_ai_state", ":party_no", spai_besieging_center, ":commander_ai_object"), (else_try), #find current center (party_get_attached_to, ":cur_center_no", ":commander_party"), (assign, ":handled", 0), (try_begin), (lt, ":cur_center_no", 0), (party_get_cur_town, ":cur_center_no", ":commander_party"), (try_end), (try_begin), (eq, ":commander_ai_state", spai_holding_center), (call_script, "script_party_set_ai_state", ":party_no", spai_holding_center, ":commander_ai_object"), (assign, ":handled", 1), (else_try), (eq, ":commander_ai_state", spai_undefined), (is_between, ":cur_center_no", centers_begin, centers_end), (call_script, "script_party_set_ai_state", ":party_no", spai_holding_center, ":cur_center_no"), (assign, ":handled", 1), (try_end), (eq, ":handled", 1), (else_try), (faction_get_slot, ":faction_marshall", ":faction_no", slot_faction_marshall), (ge, ":faction_marshall", 0), (troop_slot_eq, ":faction_marshall", slot_troop_leaded_party, ":commander_party"), (call_script, "script_party_set_ai_state", ":party_no", spai_accompanying_army, ":commander_party"), (else_try), (this_or_next|eq, ":commander_ai_state", spai_patrolling_around_center), (this_or_next|eq, ":commander_ai_state", spai_raiding_around_center), (eq, ":commander_ai_state", spai_engaging_army), (call_script, "script_party_set_ai_state", ":party_no", spai_accompanying_army, ":commander_party"), (else_try), #Commander doesn't need accompany. Cancel (call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1), (party_set_slot, ":party_no", slot_party_commander_party, -1), (try_end), (try_end), (try_end), ]), # script_kingdom_hero_decide_next_ai_state_follow_or_not # Input: arg1 = troop_no # Output: none #called from triggers ("kingdom_hero_decide_next_ai_state_follow_or_not", [ (store_script_param_1, ":troop_no"), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (try_begin), (party_get_slot, ":old_ai_state", ":party_no", slot_party_ai_state), (assign, ":cancel", 0), (try_begin), #if we are retreating to a center keep retreating (eq, ":old_ai_state", spai_retreating_to_center), (neg|party_is_in_any_town, ":party_no"), (assign, ":cancel", 1), (try_end), (eq, ":cancel", 0), (party_get_slot, ":our_strength", ":party_no", slot_party_cached_strength), (store_div, ":min_strength_behind", ":our_strength", 2), (assign, ":under_siege", 0), #find current center (party_get_attached_to, ":cur_center_no", ":party_no"), (try_begin), (lt, ":cur_center_no", 0), (party_get_cur_town, ":cur_center_no", ":party_no"), (try_end), (try_begin), (neg|is_between, ":cur_center_no", centers_begin, centers_end), (assign, ":cur_center_no", -1), (assign, ":cur_center_nearby_strength", 0), (store_sub, ":cur_center_left_strength", 1000000),#must be higher than our strength (else_try), (party_get_slot, ":cur_center_nearby_strength", ":cur_center_no", slot_party_nearby_friend_strength), (store_sub, ":cur_center_left_strength", ":cur_center_nearby_strength", ":our_strength"), (party_get_slot, ":besieger_party", ":cur_center_no", slot_center_is_besieged_by), (gt, ":besieger_party", 0), (party_is_active, ":besieger_party"), (assign, ":under_siege", 1), (try_end), (store_troop_faction, ":faction_no", ":troop_no"), (faction_get_slot, ":faction_ai_state", ":faction_no", slot_faction_ai_state), (party_get_slot, ":commander_party", ":party_no", slot_party_commander_party), (try_begin), (ge, ":commander_party", 0), (try_begin), (party_is_active, ":commander_party"), (try_begin), (store_faction_of_party, ":commander_faction", ":commander_party"), (neq, ":faction_no", ":commander_faction"), (assign, ":continue", 0), (try_begin), (neq, ":commander_party", "p_main_party"), (assign, ":continue", 1), (else_try), (neq, "$players_kingdom", ":faction_no"), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (assign, ":commander_party", -1), (try_end), (else_try), (assign, ":commander_party", -1), (try_end), (try_end), (faction_get_slot, ":num_towns", ":faction_no", slot_faction_num_towns), (store_mul, ":faction_center_value", ":num_towns", 2), (faction_get_slot, ":num_castles", ":faction_no", slot_faction_num_castles), (val_add, ":faction_center_value", ":num_castles"), (val_mul, ":faction_center_value", 10), (val_max, ":faction_center_value", 5), (troop_get_slot, ":readiness", ":troop_no", slot_troop_readiness_to_join_army), (assign, ":chance_to_follow_other_party", 0), (assign, ":target_to_follow_other_party", -1), (try_begin), #follow other party (eq, ":under_siege", 0), (ge, ":cur_center_left_strength", ":min_strength_behind"), (assign, ":continue", 0), (try_begin), (ge, ":commander_party", 0), (gt, "$party_relative_strength", 30), (assign, ":continue", 1), (else_try), (gt, "$party_relative_strength", 50), (lt, "$ratio_of_prisoners", 50), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (try_begin), (eq, ":faction_no", "fac_player_supporters_faction"), (neg|troop_slot_eq, ":troop_no", slot_troop_player_order_state, spai_undefined), (assign, ":continue", 0), (try_end), (eq, ":continue", 1), (faction_get_slot, ":faction_marshall", ":faction_no", slot_faction_marshall), (ge, ":faction_marshall", 0), #(troop_slot_eq, ":faction_marshall", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":faction_marshall", slot_troop_prisoner_of_party, 0), (troop_get_slot, ":faction_marshall_party", ":faction_marshall", slot_troop_leaded_party), (neq, ":faction_marshall", ":troop_no"), (ge, ":faction_marshall_party", 0), (try_begin), (eq, ":faction_ai_state", sfai_gathering_army), (assign, ":old_target_to_follow_other_party", -1), (try_begin), (ge, ":commander_party", 0), (assign, ":old_target_to_follow_other_party", ":commander_party"), (try_end), (assign, ":continue", 0), (try_begin), (ge, ":readiness", 60), (assign, ":continue", 1), (else_try), (ge, ":readiness", 10), (eq, ":old_target_to_follow_other_party", ":faction_marshall_party"), (assign, ":continue", 1), (try_end), (try_begin), (eq, ":continue", 1), (store_distance_to_party_from_party, ":dist", ":faction_marshall_party", ":party_no"), (store_sub, ":chance", 120, ":dist"), ## (val_mul, ":chance", 3), ## (val_div, ":chance", 2), (val_min, ":chance", 100), (val_max, ":chance", 20), (store_sub, ":faction_advantage_effect", "$g_average_center_value_per_faction", ":faction_center_value"), (val_mul, ":faction_advantage_effect", 2), (val_add, ":chance", ":faction_advantage_effect"), (val_max, ":chance", 10), (assign, ":target_to_follow_other_party", ":faction_marshall_party"), (assign, ":chance_to_follow_other_party", ":chance"), (try_begin), (eq, ":old_target_to_follow_other_party", ":target_to_follow_other_party"), (val_mul, ":chance_to_follow_other_party", 1000), (try_end), (try_end), (else_try), (this_or_next|eq, ":faction_ai_state", sfai_attacking_center), (this_or_next|eq, ":faction_ai_state", sfai_raiding_village), (this_or_next|eq, ":faction_ai_state", sfai_attacking_enemies_around_center), (eq, ":faction_ai_state", sfai_attacking_enemy_army), (eq, ":commander_party", ":faction_marshall_party"), (ge, ":readiness", 10), (assign, ":target_to_follow_other_party", ":faction_marshall_party"), (assign, ":chance_to_follow_other_party", 100000), (try_end), (try_end), (try_begin), #follow other party with initiative (le, ":chance_to_follow_other_party", 0), (eq, ":under_siege", 0), (ge, ":cur_center_left_strength", ":min_strength_behind"), (assign, ":continue", 0), (try_begin), (ge, ":commander_party", 0), (gt, "$party_relative_strength", 40), (assign, ":continue", 1), (else_try), (gt, "$party_relative_strength", 75), (lt, "$ratio_of_prisoners", 50), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (try_begin), (eq, ":faction_no", "fac_player_supporters_faction"), (neg|troop_slot_eq, ":troop_no", slot_troop_player_order_state, spai_undefined), (neg|troop_slot_eq, ":troop_no", slot_troop_player_order_state, spai_accompanying_army), (assign, ":continue", 0), (try_end), (eq, ":continue", 1), (neg|faction_slot_eq, ":faction_no", slot_faction_leader, ":troop_no"), (assign, ":old_target_to_follow_other_party", -1), (try_begin), (ge, ":commander_party", 0), (assign, ":old_target_to_follow_other_party", ":commander_party"), (try_end), (troop_get_slot, ":hero_renown", ":troop_no", slot_troop_renown), (assign, ":num_available_to_follow", 0), (try_begin), (eq, "p_main_party", ":old_target_to_follow_other_party"), (val_add, ":num_available_to_follow", 1), (eq, "p_main_party", ":old_target_to_follow_other_party"), (val_add, ":num_available_to_follow", 999), (try_end), (try_for_range, ":other_hero", kingdom_heroes_begin, kingdom_heroes_end), (neq, ":other_hero", ":troop_no"), (store_troop_faction, ":troop_faction", ":other_hero"), (eq, ":troop_faction", ":faction_no"), (troop_get_slot, ":other_party", ":other_hero", slot_troop_leaded_party), (ge, ":other_party", 0), (troop_get_slot, ":other_hero_renown", ":other_hero", slot_troop_renown), (lt, ":hero_renown", ":other_hero_renown"), (neg|party_slot_ge, ":other_party", slot_party_commander_party, 0), #other party is not under command itself. (store_distance_to_party_from_party, ":dist", ":other_party", ":party_no"), (lt, ":dist", 25), (party_slot_eq, ":other_party", slot_party_follow_me, 1), (val_add, ":num_available_to_follow", 1), (eq, ":other_party", ":old_target_to_follow_other_party"), (val_add, ":num_available_to_follow", 999), (try_end), (gt, ":num_available_to_follow", 0), (store_random_in_range, ":random_party_to_follow", 0, ":num_available_to_follow"), (try_begin), (eq, "p_main_party", ":old_target_to_follow_other_party"), (val_sub, ":random_party_to_follow", 1), (try_begin), (eq, "p_main_party", ":old_target_to_follow_other_party"), (val_sub, ":random_party_to_follow", 999), (try_end), (lt, ":random_party_to_follow", 0), (store_mul, ":chance", 100, "$g_average_center_value_per_faction"),#this value is calculated at the beginning of the game (val_div, ":chance", ":faction_center_value"), (val_max, ":chance", 10), (assign, ":chance_to_follow_other_party", ":chance"), (val_mul, ":chance_to_follow_other_party", 2),#trp_player is always the leader (assign, ":target_to_follow_other_party", "p_main_party"), (eq, ":old_target_to_follow_other_party", ":target_to_follow_other_party"), (val_mul, ":chance_to_follow_other_party", 100), (try_end), (try_for_range, ":other_hero", kingdom_heroes_begin, kingdom_heroes_end), (eq, ":target_to_follow_other_party", -1), (neq, ":other_hero", ":troop_no"), (store_troop_faction, ":troop_faction", ":other_hero"), (eq, ":troop_faction", ":faction_no"), (troop_get_slot, ":other_party", ":other_hero", slot_troop_leaded_party), (ge, ":other_party", 0), (troop_get_slot, ":other_hero_renown", ":other_hero", slot_troop_renown), (lt, ":hero_renown", ":other_hero_renown"), (neg|party_slot_ge, ":other_party", slot_party_commander_party, 0), #other party is not under command itself. (store_distance_to_party_from_party, ":dist", ":other_party", ":party_no"), (lt, ":dist", 25), (party_slot_eq, ":other_party", slot_party_follow_me, 1), (val_sub, ":random_party_to_follow", 1), (try_begin), (eq, ":other_party", ":old_target_to_follow_other_party"), (val_sub, ":random_party_to_follow", 999), (try_end), (lt, ":random_party_to_follow", 0), (store_mul, ":chance", 100, "$g_average_center_value_per_faction"),#this value is calculated at the beginning of the game (val_div, ":chance", ":faction_center_value"), (val_max, ":chance", 10), (assign, ":chance_to_follow_other_party", ":chance"), (try_begin), (faction_slot_eq, ":faction_no", slot_faction_leader, ":other_hero"), (val_mul, ":chance_to_follow_other_party", 2), (try_end), (assign, ":target_to_follow_other_party", ":other_party"), (eq, ":old_target_to_follow_other_party", ":target_to_follow_other_party"), (val_mul, ":chance_to_follow_other_party", 100), (try_end), (try_end), (assign, ":sum_chances", ":chance_to_follow_other_party"), (val_add, ":sum_chances", 600), (store_random_in_range, ":random_no", 0, ":sum_chances"), (try_begin), (val_sub, ":random_no", ":chance_to_follow_other_party"), (lt, ":random_no", 0), (party_set_slot, ":party_no", slot_party_commander_party, ":target_to_follow_other_party"), (else_try), (party_set_slot, ":party_no", slot_party_commander_party, -1), (try_end), (try_end), ]), # script_kingdom_hero_decide_next_ai_state # Input: arg1 = troop_no # Output: none #called from triggers ("kingdom_hero_decide_next_ai_state", [ (store_script_param_1, ":troop_no"), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (try_begin), (party_get_slot, ":our_strength", ":party_no", slot_party_cached_strength), (store_div, ":min_strength_behind", ":our_strength", 2), (party_get_slot, ":our_follower_strength", ":party_no", slot_party_follower_strength), (store_troop_faction, ":faction_no", ":troop_no"), #find current center (assign, ":besieger_party", -1), (party_get_attached_to, ":cur_center_no", ":party_no"), (try_begin), (lt, ":cur_center_no", 0), (party_get_cur_town, ":cur_center_no", ":party_no"), (try_end), (try_begin), (neg|is_between, ":cur_center_no", centers_begin, centers_end), (assign, ":cur_center_no", -1), (assign, ":cur_center_nearby_strength", 0), (store_sub, ":cur_center_left_strength", 1000000),#must be higher than our strength (else_try), (party_get_slot, ":cur_center_nearby_strength", ":cur_center_no", slot_party_nearby_friend_strength), (store_sub, ":cur_center_left_strength", ":cur_center_nearby_strength", ":our_strength"), (party_get_slot, ":besieger_party", ":cur_center_no", slot_center_is_besieged_by), (try_begin), (neg|party_is_active, ":besieger_party"), (assign, ":besieger_party", -1), (try_end), (store_faction_of_party, ":cur_center_faction", ":cur_center_no"), (store_relation, ":cur_center_relation", ":cur_center_faction", ":faction_no"), (try_end), (party_get_slot, ":old_ai_state", ":party_no", slot_party_ai_state), (party_get_slot, ":old_ai_object", ":party_no", slot_party_ai_object), (assign, ":cancel", 0), (try_begin), #if we are retreating to a center keep retreating (eq, ":old_ai_state", spai_retreating_to_center), (neg|party_is_in_any_town, ":party_no"), (assign, ":cancel", 1), (try_end), (eq, ":cancel", 0), ## (faction_get_slot, ":faction_ai_state", ":faction_no", slot_faction_ai_state), ## (faction_get_slot, ":faction_ai_object", ":faction_no", slot_faction_ai_object), (faction_get_slot, ":num_towns", ":faction_no", slot_faction_num_towns), (store_mul, ":faction_center_value", ":num_towns", 2), (faction_get_slot, ":num_castles", ":faction_no", slot_faction_num_castles), (val_add, ":faction_center_value", ":num_castles"), (val_mul, ":faction_center_value", 10), (val_max, ":faction_center_value", 5), (assign, ":chance_move_to_home_center", 0), (assign, ":target_move_to_home_center", -1), (assign, ":chance_move_to_other_center", 0), (assign, ":target_move_to_other_center", -1), (assign, ":chance_besiege_enemy_center", 0), (assign, ":target_besiege_enemy_center", -1), (assign, ":chance_patrol_around_center", 0), (assign, ":target_patrol_around_center", -1), (assign, ":chance_raid_around_center", 0), (assign, ":target_raid_around_center", -1), (assign, ":chance_recruit_troops", 0), (assign, ":target_recruit_troops", -1), (try_begin),#Moving to home center (eq, ":besieger_party", -1), (assign, ":old_target_move_to_home_center", -1), (try_begin), (eq, ":old_ai_state", spai_holding_center), (assign, ":old_target_move_to_home_center", ":old_ai_object"), (try_end), (try_begin), (is_between, ":cur_center_no", centers_begin, centers_end), #already in our center (party_slot_eq, ":cur_center_no", slot_town_lord, ":troop_no"), (assign, ":target_move_to_home_center", ":cur_center_no"), (assign, ":chance_move_to_home_center", 100), (try_end), (try_begin), (eq, ":target_move_to_home_center", -1), (this_or_next|gt, "$party_relative_strength", 20),#stay inside if strength is too low (eq, ":cur_center_no", -1), (ge, ":cur_center_left_strength", ":min_strength_behind"),#stay inside if center strength is too low (call_script, "script_cf_troop_get_random_leaded_walled_center_with_less_strength_priority", ":troop_no", ":old_target_move_to_home_center"),#Can fail (assign, ":target_move_to_home_center", reg0), (assign, ":chance_move_to_home_center", 50), (try_begin), (eq, ":old_target_move_to_home_center", ":target_move_to_home_center"), (val_mul, ":chance_move_to_home_center", 100), (try_end), (try_end), (try_end), (try_begin),#Moving to other center (try_begin), (ge, ":besieger_party", 0), (ge, ":cur_center_relation", 0), (assign, ":chance_move_to_other_center", 50000), (assign, ":target_move_to_other_center", ":cur_center_no"), (else_try), (assign, ":old_target_move_to_other_center", -1), (try_begin), (eq, ":old_ai_state", spai_holding_center), (assign, ":old_target_move_to_other_center", ":old_ai_object"), (try_end), ## (try_begin), ## (party_slot_eq, ":party_no", slot_party_ai_state, spai_holding_center), ## (party_get_slot, ":target_move_to_other_center", ":party_no", slot_party_ai_object), ## (try_begin), ## (call_script, "script_party_calculate_regular_strength", ":target_move_to_other_center"), ## (assign, ":strength", reg0), ## (le, ":strength", 10), ## (assign, ":chance_move_to_other_center", 500), ## (else_try), ## (assign, ":chance_move_to_other_center", 30), ## (try_end), ## (try_end), (try_begin), (eq, ":target_move_to_other_center", -1), (try_begin), (this_or_next|le, "$party_relative_strength", 20),#stay inside if strength is too low (lt, ":cur_center_left_strength", ":min_strength_behind"),#stay inside if center strength is too low (is_between, ":cur_center_no", centers_begin, centers_end), (ge, ":cur_center_relation", 0), (assign, ":chance_move_to_other_center", 500), (assign, ":target_move_to_other_center", ":cur_center_no"), (else_try), (call_script, "script_cf_select_random_walled_center_with_faction_and_less_strength_priority", ":faction_no", ":old_target_move_to_other_center"), (assign, ":target_move_to_other_center", reg0), (assign, ":chance_move_to_other_center", 10), (party_get_slot, ":lord_of_center", ":target_move_to_other_center", slot_town_lord), (try_begin), (call_script, "script_cf_troop_check_troop_is_enemy", ":troop_no", ":lord_of_center"), (assign, ":chance_move_to_other_center", 1), (try_end), (try_begin), (eq, ":old_target_move_to_other_center", ":target_move_to_other_center"), (val_mul, ":chance_move_to_other_center", 1000), (try_end), (try_end), (try_end), (try_end), (try_end), (try_begin), (lt, "$party_relative_strength", 50), (store_sub, ":factor", 100, "$party_relative_strength"), (try_begin), (gt, ":chance_move_to_home_center", 0), (val_mul, ":chance_move_to_home_center", 200), (val_div, ":chance_move_to_home_center", ":factor"), (else_try), (val_mul, ":chance_move_to_other_center", 200), (val_div, ":chance_move_to_other_center", ":factor"), (try_end), (try_end), (try_begin), (gt, "$ratio_of_prisoners", 50), (try_begin), (gt, ":chance_move_to_home_center", 0), (val_mul, ":chance_move_to_home_center", 2), (else_try), (val_mul, ":chance_move_to_other_center", 2), (try_end), (try_end), (try_begin), #Recruiting troops (eq, ":besieger_party", -1), (ge, ":cur_center_left_strength", ":min_strength_behind"),#stay inside if center strength is too low (assign, ":old_target_recruit_troops", -1), (try_begin), (eq, ":old_ai_state", spai_recruiting_troops), (assign, ":old_target_recruit_troops", ":old_ai_object"), (try_end), (troop_get_slot, ":original_faction", ":troop_no", slot_troop_original_faction), (faction_get_slot, ":original_faction_culture", ":original_faction", slot_faction_culture), (assign, ":num_villages", 0), (try_for_range, ":village_no", villages_begin, villages_end), (store_faction_of_party, ":village_faction_no", ":village_no"), (store_relation, ":reln", ":village_faction_no", ":faction_no"), (this_or_next|ge, ":reln", 0), (party_slot_eq, ":village_no", slot_center_culture, ":original_faction_culture"), (assign, ":faction_factor", 1), (try_begin), (eq, ":village_faction_no", ":faction_no"), (assign, ":faction_factor", 20), (try_end), (assign, ":amount_factor", 1), (party_get_slot, ":volunteer_amount", ":village_no", slot_center_npc_volunteer_troop_amount), (try_begin), (gt, ":volunteer_amount", 0), (val_add, ":volunteer_amount", 5), (val_add, ":amount_factor", ":volunteer_amount"), (try_end), (store_distance_to_party_from_party, ":dist", ":village_no", ":party_no"), (store_sub, ":dist_factor", 100, ":dist"), (val_max, ":dist_factor", 10), (assign, ":raid_factor", 100), (try_begin), (party_slot_eq, ":village_no", slot_village_state, svs_being_raided), (assign, ":raid_factor", 1), (try_end), (store_mul, ":village_point", ":faction_factor", ":dist_factor"), (val_mul, ":village_point", ":raid_factor"), (val_mul, ":village_point", ":amount_factor"), (try_begin), (eq, ":village_no", ":old_target_recruit_troops"), (val_mul, ":village_point", 100), (try_end), (val_add, ":num_villages", ":village_point"), (try_end), (gt, ":num_villages", 0), (store_random_in_range, ":random_village_no", 0, ":num_villages"), (try_for_range, ":village_no", villages_begin, villages_end), (eq, ":target_recruit_troops", -1), (store_faction_of_party, ":village_faction_no", ":village_no"), (store_relation, ":reln", ":village_faction_no", ":faction_no"), (this_or_next|ge, ":reln", 0), (party_slot_eq, ":village_no", slot_center_culture, ":original_faction_culture"), (assign, ":faction_factor", 1), (try_begin), (eq, ":village_faction_no", ":faction_no"), (assign, ":faction_factor", 20), (try_end), (assign, ":amount_factor", 1), (party_get_slot, ":volunteer_amount", ":village_no", slot_center_npc_volunteer_troop_amount), (try_begin), (gt, ":volunteer_amount", 0), (val_add, ":volunteer_amount", 5), (val_add, ":amount_factor", ":volunteer_amount"), (try_end), (store_distance_to_party_from_party, ":dist", ":village_no", ":party_no"), (store_sub, ":dist_factor", 100, ":dist"), (val_max, ":dist_factor", 10), (assign, ":raid_factor", 100), (try_begin), (party_slot_eq, ":village_no", slot_village_state, svs_being_raided), (assign, ":raid_factor", 1), (try_end), (store_mul, ":village_point", ":faction_factor", ":dist_factor"), (val_mul, ":village_point", ":raid_factor"), (val_mul, ":village_point", ":amount_factor"), (try_begin), (eq, ":village_no", ":old_target_recruit_troops"), (val_mul, ":village_point", 100), (try_end), (val_sub, ":random_village_no", ":village_point"), (lt, ":random_village_no", 0), (assign, ":target_recruit_troops", ":village_no"), (assign, ":chance_recruit_troops", 3), (try_begin), (eq, ":old_target_recruit_troops", ":target_recruit_troops"), (val_mul, ":chance_recruit_troops", 1000), (try_end), (try_end), (try_end), (try_begin), #raid villages (eq, ":besieger_party", -1), (ge, ":cur_center_left_strength", ":min_strength_behind"),#stay inside if center strength is too low (gt, "$party_relative_strength", 75), (lt, "$ratio_of_prisoners", 50), (assign, ":old_target_raid_around_center", -1), (try_begin), (eq, ":old_ai_state", spai_raiding_around_center), (assign, ":old_target_raid_around_center", ":old_ai_object"), (try_end), (assign, ":num_villages", 0), (try_for_range, ":enemy_village_no", villages_begin, villages_end), (call_script, "script_get_center_faction_relation_including_player", ":enemy_village_no", ":faction_no"), (lt, reg0, 0), (assign, ":raided_by_self", 0), (try_begin), (party_slot_eq, ":enemy_village_no", slot_village_state, svs_being_raided), (party_slot_eq, ":enemy_village_no", slot_village_raided_by, ":party_no"), (assign, ":raided_by_self", 1), (try_end), (this_or_next|party_slot_eq, ":enemy_village_no", slot_village_state, 0), #village is not already raided (eq, ":raided_by_self", 1), (store_distance_to_party_from_party, ":dist", ":enemy_village_no", ":party_no"), (store_sub, ":dist_factor", 75, ":dist"), (val_max, ":dist_factor", 3), (val_add, ":num_villages", ":dist_factor"), (eq, ":enemy_village_no", ":old_target_raid_around_center"), (val_add, ":num_villages", 10000), (try_end), (gt, ":num_villages", 0), (store_random_in_range, ":random_village_no", 0, ":num_villages"), (try_for_range, ":enemy_village_no", villages_begin, villages_end), (eq, ":target_raid_around_center", -1), (call_script, "script_get_center_faction_relation_including_player", ":enemy_village_no", ":faction_no"), (lt, reg0, 0), (assign, ":raided_by_self", 0), (try_begin), (party_slot_eq, ":enemy_village_no", slot_village_state, svs_being_raided), (party_slot_eq, ":enemy_village_no", slot_village_raided_by, ":party_no"), (assign, ":raided_by_self", 1), (try_end), (this_or_next|party_slot_eq, ":enemy_village_no", slot_village_state, 0), #village is not already raided (eq, ":raided_by_self", 1), (store_distance_to_party_from_party, ":dist", ":enemy_village_no", ":party_no"), (store_sub, ":dist_factor", 75, ":dist"), (val_max, ":dist_factor", 3), (val_sub, ":random_village_no", ":dist_factor"), (try_begin), (eq, ":enemy_village_no", ":old_target_raid_around_center"), (val_sub, ":random_village_no", 10000), (try_end), (lt, ":random_village_no", 0), (assign, ":target_raid_around_center", ":enemy_village_no"), (assign, ":chance_raid_around_center", 30), (try_begin), (eq, ":old_target_raid_around_center", ":target_raid_around_center"), (val_mul, ":chance_raid_around_center", 100), (try_end), (try_end), (try_end), (try_begin), #besiege center (eq, ":besieger_party", -1), (ge, ":cur_center_left_strength", ":min_strength_behind"),#stay inside if center strength is too low (assign, ":continue", 0), (try_begin), (eq, ":old_ai_state", spai_besieging_center), (gt, "$party_relative_strength", 30), (assign, ":continue", 1), (else_try), (gt, "$party_relative_strength", 75), (lt, "$ratio_of_prisoners", 50), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (assign, ":our_estimated_str", ":our_follower_strength"), (val_add, ":our_estimated_str", ":our_strength"), (assign, ":old_target_besiege_enemy_center", -1), (try_begin), (eq, ":old_ai_state", spai_besieging_center), (assign, ":old_target_besiege_enemy_center", ":old_ai_object"), (try_end), (assign, ":best_besiege_center", -1), (assign, ":best_besiege_center_score", 0), (try_for_range, ":enemy_walled_center", walled_centers_begin, walled_centers_end), (party_get_slot, ":other_besieger_party", ":enemy_walled_center", slot_center_is_besieged_by), (assign, ":besieger_own_faction", 0), (try_begin), (ge, ":other_besieger_party", 0), (party_is_active, ":other_besieger_party"), (store_faction_of_party, ":besieger_faction", ":other_besieger_party"), (eq, ":besieger_faction", ":faction_no"), (assign, ":besieger_own_faction", 1), (try_end), (this_or_next|eq, ":other_besieger_party", -1), (eq, ":besieger_own_faction", 1), (call_script, "script_get_center_faction_relation_including_player", ":enemy_walled_center", ":faction_no"), (assign, ":reln", reg0), (lt, ":reln", 0), (val_mul, ":reln", -1), (val_add, ":reln", 50), (store_distance_to_party_from_party, ":dist", ":enemy_walled_center", ":party_no"), (store_sub, ":dist_factor", 75, ":dist"), (val_max, ":dist_factor", 3), (party_get_slot, ":center_str", ":enemy_walled_center", slot_party_cached_strength), (party_get_slot, ":center_near_str", ":enemy_walled_center", slot_party_nearby_friend_strength), (val_add, ":center_str", ":center_near_str"), (store_mul, ":relative_center_str", ":center_str", 100), (val_div, ":relative_center_str", ":our_estimated_str"), (store_sub, ":center_score", 1000, ":relative_center_str"), (val_max, ":center_score", 1), (val_mul, ":center_score", ":reln"), (val_mul, ":center_score", ":dist_factor"), (try_begin), (party_slot_eq, ":enemy_walled_center", slot_town_lord, "trp_player"), (call_script, "script_troop_get_player_relation", ":troop_no"), (assign, ":player_relation", reg0), #(troop_get_slot, ":player_relation", ":troop_no", slot_troop_player_relation), (lt, ":player_relation", 0), (store_sub, ":multiplier", 50, ":player_relation"), (val_mul, ":center_score", ":multiplier"), (val_div, ":center_score", 50), (try_end), (try_begin), (eq, ":enemy_walled_center", ":old_target_besiege_enemy_center"), (val_mul, ":center_score", 100), (try_end), (try_begin), (gt, ":center_score", ":best_besiege_center_score"), (assign, ":best_besiege_center_score", ":center_score"), (assign, ":best_besiege_center", ":enemy_walled_center"), (try_end), (try_end), (ge, ":best_besiege_center", 0), (assign, ":chance_besiege_enemy_center", 20), (assign, ":target_besiege_enemy_center", ":best_besiege_center"), (try_begin), (eq, ":old_target_besiege_enemy_center", ":target_besiege_enemy_center"), (val_mul, ":chance_besiege_enemy_center", 100), (try_end), (try_end), (try_begin), #patrol alarmed center. (eq, ":besieger_party", -1), (ge, ":cur_center_left_strength", ":min_strength_behind"),#stay inside if center strength is too low (ge, "$party_relative_strength", 60), (try_begin), (party_slot_eq, ":party_no", slot_party_ai_state, spai_patrolling_around_center), (party_get_slot, ":target_patrol_around_center", ":party_no", slot_party_ai_object), (try_end), (assign, ":old_target_patrol_around_center", -1), (try_begin), (eq, ":old_ai_state", spai_patrolling_around_center), (assign, ":old_target_patrol_around_center", ":old_ai_object"), (try_end), (assign, ":best_patrol_score", 0), (assign, ":best_patrol_target", -1), (try_for_range, ":center_no", centers_begin, centers_end), #find closest center that has spotted enemies. (store_faction_of_party, ":center_faction", ":center_no"), (eq, ":center_faction", ":faction_no"), (store_distance_to_party_from_party, ":distance", ":party_no", ":center_no"), (store_sub, ":this_center_score", 100, ":distance"), (val_max, ":this_center_score", 1), (try_begin), (party_slot_ge, ":center_no", slot_center_last_spotted_enemy, 0), (val_mul, ":this_center_score", 100), (try_end), (try_begin), (party_slot_eq, ":center_no", slot_town_lord, ":troop_no"), (val_mul, ":this_center_score", 2), (try_end), (try_begin), (eq, ":center_no", ":old_target_patrol_around_center"), (val_mul, ":this_center_score", 1000), (try_end), (try_begin), (gt, ":this_center_score", ":best_patrol_score"), (assign, ":best_patrol_score", ":this_center_score"), (assign, ":best_patrol_target", ":center_no"), (try_end), (try_end), (try_begin), (gt, ":best_patrol_score", 0), (assign, ":target_patrol_around_center", ":best_patrol_target"), (try_end), (try_begin), (is_between, ":target_patrol_around_center", centers_begin, centers_end), (assign, ":chance_patrol_around_center", 80), (try_end), (try_begin), (troop_slot_ge, ":troop_no", slot_troop_change_to_faction, 1), (val_mul, ":chance_patrol_around_center", 10), (try_end), (try_begin), (eq, ":old_target_patrol_around_center", ":target_patrol_around_center"), (val_mul, ":chance_patrol_around_center", 100), (try_end), (try_end), ## (try_begin), #cancel actions ## (party_get_slot, ":ai_state", ":party_no", slot_party_ai_state), ## (party_get_slot, ":ai_object", ":party_no", slot_party_ai_object), ## (neq, ":ai_state", spai_undefined), ## (assign, ":cancel_cur_action", 0), ## (try_begin), ## (eq, ":ai_state", spai_patrolling_around_center), ## (neg|party_slot_ge, ":ai_object", slot_center_last_spotted_enemy, 0), ## (store_random_in_range, ":rand", 0, 100), ## (lt, ":rand", 25), ## (assign, ":cancel_cur_action", 1), ## (else_try), ## (this_or_next|eq, ":ai_state", spai_besieging_center), ## (eq, ":ai_state", spai_raiding_around_center), ## (store_faction_of_party, ":ai_object_faction", ":ai_object"), ## (store_relation, ":ai_object_relation", ":ai_object_faction", ":faction_no"), ## (ge, ":ai_object_relation", 0), ## (assign, ":cancel_cur_action", 1), ## (try_end), ## (eq, ":cancel_cur_action", 0), ## (assign, ":chance_stay", 100), ## (try_end), ## (try_begin), ## (eq, ":siege_going_badly", 1), ## (assign, ":chance_besiege_enemy_center", 0), ## (assign, ":chance_stay", 0), ## (try_end), ## (try_begin), ## (eq, ":siege_going_well", 1), ## (assign, ":chance_move_to_home_center", 0), ## (assign, ":chance_move_to_other_center", 0), ## (assign, ":chance_patrol_around_center", 0), ## (assign, ":chance_besiege_enemy_center", 0), ## (assign, ":chance_help_besieged_center", 0), ## (try_end), (assign, ":sum_chances", ":chance_move_to_home_center"), (val_add, ":sum_chances", ":chance_move_to_other_center"), (val_add, ":sum_chances", ":chance_recruit_troops"), (val_add, ":sum_chances", ":chance_raid_around_center"), (val_add, ":sum_chances", ":chance_besiege_enemy_center"), (val_add, ":sum_chances", ":chance_patrol_around_center"), ## (val_add, ":sum_chances", ":chance_stay"), (val_max, ":sum_chances", 1), (store_random_in_range, ":random_no", 0, ":sum_chances"), (try_begin), (val_sub, ":random_no", ":chance_move_to_home_center"), (lt, ":random_no", 0), (call_script, "script_party_set_ai_state", ":party_no", spai_holding_center, ":target_move_to_home_center"), (party_set_flags, ":party_no", pf_default_behavior, 1), (party_set_slot, ":party_no", slot_party_commander_party, -1), (else_try), (val_sub, ":random_no", ":chance_move_to_other_center"), (lt, ":random_no", 0), (call_script, "script_party_set_ai_state", ":party_no", spai_holding_center, ":target_move_to_other_center"), (party_set_slot, ":party_no", slot_party_commander_party, -1), (else_try), (val_sub, ":random_no", ":chance_recruit_troops"), (lt, ":random_no", 0), (call_script, "script_party_set_ai_state", ":party_no", spai_recruiting_troops, ":target_recruit_troops"), (party_set_slot, ":party_no", slot_party_commander_party, -1), (else_try), (val_sub, ":random_no", ":chance_raid_around_center"), (lt, ":random_no", 0), (call_script, "script_party_set_ai_state", ":party_no", spai_raiding_around_center, ":target_raid_around_center"), (party_set_slot, ":party_no", slot_party_commander_party, -1), (else_try), (val_sub, ":random_no", ":chance_besiege_enemy_center"), (lt, ":random_no", 0), (call_script, "script_party_set_ai_state", ":party_no", spai_besieging_center, ":target_besiege_enemy_center"), (else_try), (val_sub, ":random_no", ":chance_patrol_around_center"), (lt, ":random_no", 0), (call_script, "script_party_set_ai_state", ":party_no", spai_patrolling_around_center, ":target_patrol_around_center"), (party_set_slot, ":party_no", slot_party_commander_party, -1), (else_try), (call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1), (party_set_slot, ":party_no", slot_party_commander_party, -1), (try_end), (try_end), ]), # script_process_kingdom_parties_ai # This is called more frequently than decide_kingdom_parties_ai # Input: none # Output: none #called from triggers ("process_kingdom_parties_ai", [ (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (gt, ":party_no", 0), (call_script, "script_process_hero_ai", ":troop_no"), (try_end), ]), # script_process_hero_ai # This is called more frequently than script_decide_kingdom_party_ais # Input: none # Output: none #called from triggers ("process_hero_ai", [ (store_script_param_1, ":troop_no"), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (store_faction_of_party, ":faction_no", ":party_no"), (party_get_slot, ":ai_state", ":party_no", slot_party_ai_state), (party_get_slot, ":ai_object", ":party_no", slot_party_ai_object), (try_begin), (eq, ":ai_state", spai_besieging_center), (try_begin), (party_slot_eq, ":ai_object", slot_center_is_besieged_by, -1), (store_distance_to_party_from_party, ":distance", ":party_no", ":ai_object"), (lt, ":distance", 3), (try_begin), (party_slot_ge, ":party_no", slot_party_commander_party, 0), (party_get_slot, ":commander_party", ":party_no", slot_party_commander_party), (party_set_slot, ":ai_object", slot_center_is_besieged_by, ":commander_party"), (else_try), (party_set_slot, ":ai_object", slot_center_is_besieged_by, ":party_no"), (try_end), (store_current_hours, ":cur_hours"), (party_set_slot, ":ai_object", slot_center_siege_begin_hours, ":cur_hours"), (str_store_party_name_link, s1, ":ai_object"), (str_store_troop_name_link, s2, ":troop_no"), (str_store_faction_name_link, s3, ":faction_no"), (display_log_message, "@{s1} has been besieged by {s2} of {s3}."), (try_begin), (store_faction_of_party, ":ai_object_faction", ":ai_object"), (this_or_next|party_slot_eq, ":ai_object", slot_town_lord, "trp_player"), (eq, ":ai_object_faction", "fac_player_supporters_faction"), (call_script, "script_add_notification_menu", "mnu_notification_center_under_siege", ":ai_object", ":troop_no"), (try_end), (call_script, "script_village_set_state", ":ai_object", svs_under_siege), (assign, "$g_recalculate_ais", 1), (try_end), (else_try), (eq, ":ai_state", spai_recruiting_troops), (try_begin), (store_distance_to_party_from_party, ":distance", ":party_no", ":ai_object"), (lt, ":distance", 3), (store_current_hours, ":cur_hours"), (party_get_slot, ":substate", ":party_no", slot_party_ai_substate), (val_add, ":substate", 1), (party_set_slot, ":party_no", slot_party_ai_substate, ":substate"), (try_begin), (ge, ":substate", 4), (party_set_slot, ":party_no", slot_party_ai_substate, ":cur_hours"), (call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1), (party_set_flags, ":party_no", pf_default_behavior, 0), (party_set_slot, ":party_no", slot_party_commander_party, -1), (party_get_slot, ":troop_type", ":ai_object", slot_center_npc_volunteer_troop_type), (party_get_slot, ":troop_amount", ":ai_object", slot_center_npc_volunteer_troop_amount), (party_set_slot, ":ai_object", slot_center_npc_volunteer_troop_amount, -1), (party_add_members, ":party_no", ":troop_type", ":troop_amount"), (try_end), (try_end), (else_try), (eq, ":ai_state", spai_raiding_around_center), (party_slot_eq, ":party_no", slot_party_ai_substate, 0), (assign, ":selected_village", 0), (try_for_range, ":enemy_village_no", villages_begin, villages_end), (eq, ":selected_village", 0), (store_faction_of_party, ":enemy_village_faction", ":enemy_village_no"), (try_begin), (party_slot_eq, ":enemy_village_no", slot_town_lord, "trp_player"), (store_relation, ":reln", "fac_player_supporters_faction", ":faction_no"), (else_try), (store_relation, ":reln", ":enemy_village_faction", ":faction_no"), (try_end), (lt, ":reln", 0), (store_distance_to_party_from_party, ":dist", ":enemy_village_no", ":party_no"), (lt, ":dist", 15), (party_slot_eq, ":enemy_village_no", slot_village_state, 0), #village is not already raided #CHANGE STATE TO RAID THIS VILLAGE (assign, ":selected_village", ":enemy_village_no"), (try_end), (try_begin), (eq, ":selected_village", 0), (is_between, ":ai_object", villages_begin, villages_end), (assign, ":selected_village", ":ai_object"), (try_end), (try_begin), (gt, ":selected_village", 0), (call_script, "script_party_set_ai_state", ":party_no", spai_raiding_around_center, ":selected_village"), (try_begin), (faction_slot_eq, ":faction_no", slot_faction_marshall, ":troop_no"), (faction_slot_eq, ":faction_no", slot_faction_ai_state, sfai_raiding_village), (faction_set_slot, ":faction_no", slot_faction_ai_object, ":selected_village"), (try_end), (party_get_position, pos1, ":selected_village"), (map_get_random_position_around_position, pos2, pos1, 1), (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_point), (party_set_ai_target_position, ":party_no", pos2), (party_set_ai_object, ":party_no", ":selected_village"), (party_set_slot, ":party_no", slot_party_ai_substate, 1), (try_end), (else_try), (eq, ":ai_state", spai_raiding_around_center),#substate is 1 (try_begin), (store_distance_to_party_from_party, ":distance", ":party_no", ":ai_object"), (lt, ":distance", 2), (try_begin), (party_slot_eq, ":ai_object", slot_village_state, 0), (call_script, "script_village_set_state", ":ai_object", svs_being_raided), (party_set_slot, ":ai_object", slot_village_raided_by, ":party_no"), (try_begin), (store_faction_of_party, ":village_faction", ":ai_object"), (this_or_next|party_slot_eq, ":ai_object", slot_town_lord, "trp_player"), (eq, ":village_faction", "fac_player_supporters_faction"), (store_distance_to_party_from_party, ":dist", "p_main_party", ":ai_object"), (this_or_next|lt, ":dist", 30), (party_slot_eq, ":ai_object", slot_center_has_messenger_post, 1), (call_script, "script_add_notification_menu", "mnu_notification_village_raid_started", ":ai_object", ":troop_no"), (try_end), (else_try), (party_slot_eq, ":ai_object", slot_village_state, svs_being_raided), (else_try), #if anything other than being_raided leave (party_set_slot, ":party_no", slot_party_ai_substate, 0), (try_end), (try_end), (else_try), (eq, ":ai_state", spai_retreating_to_center), (try_begin), (party_get_battle_opponent, ":enemy_party", ":party_no"), (ge, ":enemy_party", 0), #we are in a battle! we may be caught in a loop! (call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1), (party_set_flags, ":party_no", pf_default_behavior, 0), (party_set_slot, ":party_no", slot_party_commander_party, -1), (try_end), (else_try), (eq, ":ai_state", spai_patrolling_around_center), (try_begin), (party_slot_eq, ":party_no", slot_party_ai_substate, 0), (store_distance_to_party_from_party, ":distance", ":party_no", ":ai_object"), (lt, ":distance", 3), (party_set_slot, ":party_no", slot_party_ai_substate, 1), (party_set_ai_behavior, ":party_no", ai_bhvr_patrol_party), (party_set_ai_object, ":party_no", ":ai_object"), (try_end), (else_try), (eq, ":ai_state", spai_holding_center), (party_get_attached_to, ":cur_town", ":party_no"), # Make the party sortie outside, so that it will drive away any enemies?? (try_begin), (is_between, ":cur_town", walled_centers_begin, walled_centers_end), (assign, ":sortie_chance", 50), (try_begin), (party_get_attached_to, ":cur_town", ":party_no"), (party_slot_ge, ":party_no", slot_center_is_besieged_by, 0), #town is under siege (assign, ":sortie_chance", 5), (try_end), (store_random_in_range, ":rand", 0, 100), (lt, ":rand", ":sortie_chance"), (assign, ":enemies_nearby", 0), (call_script, "script_party_calculate_regular_strength", ":party_no"), (assign, ":our_strength", reg0), (try_for_range, ":enemy_hero", kingdom_heroes_begin, kingdom_heroes_end), (store_troop_faction, ":enemy_hero_faction", ":enemy_hero"), (store_relation, ":reln", ":enemy_hero_faction", ":faction_no"), (lt, ":reln", 0), (troop_get_slot, ":enemy_party", ":enemy_hero", slot_troop_leaded_party), (gt, ":enemy_party", 0), (party_is_active, ":enemy_party"), (store_distance_to_party_from_party, ":dist", ":enemy_party", ":party_no"), (lt, ":dist", 7), (call_script, "script_party_calculate_regular_strength", "p_collective_enemy"), (gt, reg0, ":our_strength"), (assign, ":enemies_nearby", 1), (try_end), (eq, ":enemies_nearby", 0), (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party), (party_set_ai_object, ":party_no", ":ai_object"), (party_set_flags, ":party_no", pf_default_behavior, 0), (party_detach, ":party_no"), (try_end), (try_end), ]), # script_select_faction_marshall # Input: arg1: faction_no # Output: none #called from triggers ("select_faction_marshall", [ (store_script_param_1, ":faction_no"), (faction_get_slot, ":faction_leader", ":faction_no", slot_faction_leader), (faction_get_slot, ":old_faction_marshall", ":faction_no", slot_faction_marshall), (assign, ":total_renown", 0), (try_for_range, ":loop_var", "trp_kingdom_heroes_including_player_begin", kingdom_heroes_end), (assign, ":cur_troop", ":loop_var"), (assign, ":continue", 0), (try_begin), (eq, ":loop_var", "trp_kingdom_heroes_including_player_begin"), (assign, ":cur_troop", "trp_player"), (try_begin), (eq, ":faction_no", "$players_kingdom"), (assign, ":continue", 1), (try_end), (else_try), (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero), (store_troop_faction, ":cur_faction", ":cur_troop"), (eq, ":cur_faction", ":faction_no"), (troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party), (gt, ":cur_party", 0), (party_is_active, ":cur_party"), (call_script, "script_party_count_fit_for_battle", ":cur_party"), (assign, ":party_fit_for_battle", reg0), (call_script, "script_party_get_ideal_size", ":cur_party"), (assign, ":ideal_size", reg0), (store_mul, ":relative_strength", ":party_fit_for_battle", 100), (val_div, ":relative_strength", ":ideal_size"), (ge, ":relative_strength", 25), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (troop_get_slot, ":renown", ":cur_troop", slot_troop_renown), (try_begin), (eq, ":cur_troop", "trp_player"), (neq, ":old_faction_marshall", "trp_player"), (assign, ":renown", 0), (try_end), (try_begin), (eq, ":cur_troop", ":faction_leader"), (val_mul, ":renown", 3), (val_div, ":renown", 4), (try_end), (try_begin), (eq, ":cur_troop", ":old_faction_marshall"), (val_mul, ":renown", 1000), (try_end), (val_add, ":total_renown", ":renown"), (try_end), (assign, ":result", -1), (try_begin), (gt, ":total_renown", 0), (store_random_in_range, ":random_renown", 0, ":total_renown"), (try_for_range, ":loop_var", "trp_kingdom_heroes_including_player_begin", kingdom_heroes_end), (eq, ":result", -1), (assign, ":cur_troop", ":loop_var"), (assign, ":continue", 0), (try_begin), (eq, ":loop_var", "trp_kingdom_heroes_including_player_begin"), (assign, ":cur_troop", "trp_player"), (try_begin), (eq, ":faction_no", "$players_kingdom"), (assign, ":continue", 1), (try_end), (else_try), (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero), (store_troop_faction, ":cur_faction", ":cur_troop"), (eq, ":cur_faction", ":faction_no"), (troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party), (gt, ":cur_party", 0), (party_is_active, ":cur_party"), (call_script, "script_party_count_fit_for_battle", ":cur_party"), (assign, ":party_fit_for_battle", reg0), (call_script, "script_party_get_ideal_size", ":cur_party"), (assign, ":ideal_size", reg0), (store_mul, ":relative_strength", ":party_fit_for_battle", 100), (val_div, ":relative_strength", ":ideal_size"), (ge, ":relative_strength", 25), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (troop_get_slot, ":renown", ":cur_troop", slot_troop_renown), (try_begin), (eq, ":cur_troop", "trp_player"), (neq, ":old_faction_marshall", "trp_player"), (assign, ":renown", 0), (try_end), (try_begin), (eq, ":cur_troop", ":faction_leader"), (val_mul, ":renown", 3), (val_div, ":renown", 4), (try_end), (try_begin), (eq, ":cur_troop", ":old_faction_marshall"), (val_mul, ":renown", 1000), (try_end), (val_sub, ":random_renown", ":renown"), (lt, ":random_renown", 0), (assign, ":result", ":cur_troop"), (try_end), (try_end), (try_begin), (eq, "$cheat_mode", 1), (ge, ":result", 0), (str_store_troop_name, s1, ":result"), (str_store_faction_name, s2, ":faction_no"), (display_message, "@{s1} is chosen as the marshall of {s2}."), (try_end), (assign, reg0, ":result"), ]), # script_get_center_faction_relation_including_player # Input: arg1: center_no, arg2: target_faction_no # Output: reg0: relation #called from triggers ("get_center_faction_relation_including_player", [ (store_script_param, ":center_no", 1), (store_script_param, ":target_faction_no", 2), (store_faction_of_party, ":center_faction", ":center_no"), (store_relation, ":reln", ":center_faction", ":target_faction_no"), (try_begin), (party_slot_eq, ":center_no", slot_town_lord, "trp_player"), (store_relation, ":reln", "fac_player_supporters_faction", ":target_faction_no"), (try_end), (assign, reg0, ":reln"), ]), # script_decide_faction_ai # Input: arg1: faction_no # Output: none #called from triggers ("decide_faction_ai", [ (store_script_param_1, ":faction_no"), (faction_get_slot, ":old_faction_ai_state", ":faction_no", slot_faction_ai_state), (faction_get_slot, ":old_faction_ai_object", ":faction_no", slot_faction_ai_object), (faction_get_slot, ":old_faction_ai_last_offensive_time", ":faction_no", slot_faction_ai_last_offensive_time), (assign, ":faction_marshall_party", -1), (assign, ":faction_marshall_army_strength", 1),#0 might cause division by zero problems (assign, ":faction_marshall_num_followers", 1), (call_script, "script_select_faction_marshall", ":faction_no"), (assign, ":faction_marshall", reg0), (assign, ":marshall_changed", 0), (try_begin), (neg|faction_slot_eq, ":faction_no", slot_faction_marshall, ":faction_marshall"), (assign, ":marshall_changed", 1), (eq, "$players_kingdom", ":faction_no"), (str_store_troop_name_link, s1, ":faction_marshall"), (str_store_faction_name_link, s2, ":faction_no"), (display_message, "@{s1} is the new marshall of {s2}."), (call_script, "script_check_and_finish_active_army_quests_for_faction", ":faction_no"), (try_end), (faction_set_slot, ":faction_no", slot_faction_marshall, ":faction_marshall"), (try_begin), (gt, ":faction_marshall", 0), (troop_get_slot, ":faction_marshall_party", ":faction_marshall", slot_troop_leaded_party), (gt, ":faction_marshall_party", 0), (party_get_slot, ":faction_marshall_army_strength", ":faction_marshall_party", slot_party_cached_strength), (party_get_slot, ":follower_strength", ":faction_marshall_party", slot_party_follower_strength), (val_add, ":faction_marshall_army_strength", ":follower_strength"), (try_for_range, ":cur_troop", kingdom_heroes_begin, kingdom_heroes_end), (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), (party_is_active, ":cur_party"), (party_slot_eq, ":cur_party", slot_party_commander_party, ":faction_marshall_party"), (val_add, ":faction_marshall_num_followers", 1), (try_end), (try_end), (faction_get_slot, ":marshall_num_old_followers", ":faction_no", slot_faction_ai_offensive_max_followers), (val_max, ":marshall_num_old_followers", 1), (store_mul, ":offensive_rating", ":faction_marshall_num_followers", 100), (val_mul, ":offensive_rating", ":faction_marshall_num_followers"), (val_div, ":offensive_rating", ":marshall_num_old_followers"), (val_div, ":offensive_rating", ":marshall_num_old_followers"), (val_min, ":offensive_rating", 100),#Max 100% efficiency (faction_get_slot, ":num_armies", ":faction_no", slot_faction_num_armies), (faction_get_slot, ":num_castles", ":faction_no", slot_faction_num_castles), (faction_get_slot, ":num_towns", ":faction_no", slot_faction_num_towns), (store_current_hours, ":cur_hours"), (store_sub, ":offensive_hours", ":cur_hours", ":old_faction_ai_last_offensive_time"), (assign, ":num_enemies", 0), (try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active), (store_relation, ":reln", ":cur_kingdom", ":faction_no"), (lt, ":reln", 0), (val_add, ":num_enemies", 1), (try_end), (assign, ":chance_defend", 0), (assign, ":chance_gathering_army", 0), (assign, ":chance_attacking_center", 0), (assign, ":chance_raiding_village", 0), (assign, ":chance_attacking_enemy_army", 0), (assign, ":chance_attacking_enemies_around_center", 0), (assign, ":target_attacking_center", -1), (assign, ":target_raiding_village", -1), (assign, ":target_attacking_enemy_army", -1), (assign, ":target_attacking_enemies_around_center", -1), (try_begin),#Defend (eq, ":old_faction_ai_state", sfai_default), (assign, ":chance_defend", 100), (else_try), (eq, ":old_faction_ai_state", sfai_gathering_army), (gt, ":offensive_hours", 180), (assign, ":chance_defend", 10000),#army can not be gathered, cancel #else, keep it as 0 (else_try), (store_div, ":chance_defend", ":offensive_hours", 10), (store_mul, ":marshall_change_effect", ":marshall_changed", 300), (val_add, ":chance_defend", ":marshall_change_effect"), (try_end), (try_begin),#Gathering army (eq, ":old_faction_ai_state", sfai_default), (gt, ":faction_marshall_party", 0), (try_begin), #No chance of gathering an army if there are no enemies (gt, ":num_enemies", 0), (store_mul, ":num_enemies_effect", ":num_enemies", 20), (val_add, ":chance_gathering_army", ":num_enemies_effect"), #Last offensive (store_sub, ":last_offensive_effect", ":offensive_hours", 24 * 4), (val_min, ":last_offensive_effect", 200), (val_add, ":chance_gathering_army", ":last_offensive_effect"), #Number of walled centers (inversely related) (store_mul, ":center_value", ":num_towns", 2), (val_add, ":center_value", ":num_castles"), (val_mul, ":center_value", 10), (val_max, ":center_value", 5), (store_sub, ":num_centers_effect", "$g_average_center_value_per_faction", ":center_value"), (val_add, ":chance_gathering_army", ":num_centers_effect"), #Number of armies (inversely related) (store_mul, ":num_armies_effect", ":num_armies", 4), (store_sub, ":num_armies_effect", 80, ":num_armies_effect"), (val_add, ":chance_gathering_army", ":num_armies_effect"), #Number of walled centers under siege (assign, ":num_centers_under_siege", 0), (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end), (party_slot_ge, ":cur_center", slot_center_is_besieged_by, 0), (store_faction_of_party, ":center_faction", ":cur_center"), (eq, ":center_faction", ":faction_no"), (val_add, ":num_centers_under_siege", 1), (try_end), (store_mul, ":num_centers_under_siege_effect", ":num_centers_under_siege", 100), (val_add, ":chance_gathering_army", ":num_centers_under_siege_effect"), (try_end), (else_try), (eq, ":old_faction_ai_state", sfai_gathering_army), (this_or_next|lt, ":offensive_hours", 60), (lt, ":faction_marshall_num_followers", 4), (assign, ":chance_gathering_army", 3000), (try_end), (try_begin),#Attacking center (neq, ":old_faction_ai_state", sfai_default), (gt, ":faction_marshall_party", 0), (assign, ":old_target_attacking_center", -1), (try_begin), (eq, ":old_faction_ai_state", sfai_attacking_center), (assign, ":old_target_attacking_center", ":old_faction_ai_object"), (try_end), (assign, ":best_besiege_center", -1), (assign, ":best_besiege_center_score", 0), (try_for_range, ":enemy_walled_center", walled_centers_begin, walled_centers_end), (party_get_slot, ":besieger_party", ":enemy_walled_center", slot_center_is_besieged_by), (assign, ":besieger_own_faction", 0), (try_begin), (ge, ":besieger_party", 0), (party_is_active, ":besieger_party"), (store_faction_of_party, ":besieger_faction", ":besieger_party"), (eq, ":besieger_faction", ":faction_no"), (assign, ":besieger_own_faction", 1), (try_end), (this_or_next|eq, ":besieger_party", -1), (eq, ":besieger_own_faction", 1), (call_script, "script_get_center_faction_relation_including_player", ":enemy_walled_center", ":faction_no"), (assign, ":reln", reg0), (lt, ":reln", 0), (val_mul, ":reln", -1), (val_add, ":reln", 50), (store_distance_to_party_from_party, ":dist", ":enemy_walled_center", ":faction_marshall_party"), (val_add, ":dist", 20), (party_get_slot, ":center_str", ":enemy_walled_center", slot_party_cached_strength), (party_get_slot, ":center_near_str", ":enemy_walled_center", slot_party_nearby_friend_strength), (val_add, ":center_str", ":center_near_str"), (val_add, ":center_str", 1), (store_mul, ":center_score", 1000, ":faction_marshall_army_strength"), (val_div, ":center_score", ":center_str"), (gt, ":center_score", 1500), (val_min, ":center_score", 20000),#20 times stronger means an easy victory, distance is more important (try_begin), (party_slot_eq, ":enemy_walled_center", slot_town_lord, "trp_player"), (call_script, "script_troop_get_player_relation", ":faction_marshall"), (assign, ":player_relation", reg0), #(troop_get_slot, ":player_relation", ":faction_marshall", slot_troop_player_relation), (lt, ":player_relation", 0), (store_sub, ":multiplier", 50, ":player_relation"), (val_mul, ":center_score", ":multiplier"), (val_div, ":center_score", 50), (try_end), (try_begin), (party_slot_eq, ":enemy_walled_center", slot_center_original_faction, ":faction_no"), (val_mul, ":center_score", 2), (try_end), (try_begin), (party_slot_eq, ":enemy_walled_center", slot_center_ex_faction, ":faction_no"), (val_mul, ":center_score", 2), (try_end), (val_mul, ":center_score", ":reln"), (val_div, ":center_score", ":dist"), (try_begin), (eq, ":enemy_walled_center", ":old_target_attacking_center"), (val_mul, ":center_score", 100), (try_end), (try_begin), (gt, ":center_score", ":best_besiege_center_score"), (assign, ":best_besiege_center_score", ":center_score"), (assign, ":best_besiege_center", ":enemy_walled_center"), (try_end), (try_end), (ge, ":best_besiege_center", 0), #Center with equal strength at 30 kms away will have a center_score of 1300 (with -40 reln) (store_div, ":chance_attacking_center", ":best_besiege_center_score", 15), (val_min, ":chance_attacking_center", 1000), (assign, ":target_attacking_center", ":best_besiege_center"), (try_begin), (eq, ":old_target_attacking_center", ":target_attacking_center"), (val_mul, ":chance_attacking_center", 100), (try_end), (val_mul, ":chance_attacking_center", ":offensive_rating"), (val_div, ":chance_attacking_center", 100), (try_end), (try_begin),#Raiding village (neq, ":old_faction_ai_state", sfai_default), (gt, ":faction_marshall_party", 0), (assign, ":old_target_raiding_village", -1), (try_begin), (eq, ":old_faction_ai_state", sfai_raiding_village), (assign, ":old_target_raiding_village", ":old_faction_ai_object"), (try_end), (assign, ":num_village_points", 0), (try_for_range, ":enemy_village_no", villages_begin, villages_end), (call_script, "script_get_center_faction_relation_including_player", ":enemy_village_no", ":faction_no"), (lt, reg0, 0), (store_distance_to_party_from_party, ":dist", ":enemy_village_no", ":faction_marshall_party"), (lt, ":dist", 120), (this_or_next|party_slot_eq, ":enemy_village_no", slot_village_state, 0), #village is not already raided (party_slot_eq, ":enemy_village_no", slot_village_state, svs_being_raided), (store_sub, ":dist_point", 150, ":dist"), (val_add, ":num_village_points", ":dist_point"), (eq, ":enemy_village_no", ":old_target_raiding_village"), (val_add, ":num_village_points", 10000), (try_end), (gt, ":num_village_points", 0), (store_random_in_range, ":random_village_no", 0, ":num_village_points"), (try_for_range, ":enemy_village_no", villages_begin, villages_end), (eq, ":target_raiding_village", -1), (call_script, "script_get_center_faction_relation_including_player", ":enemy_village_no", ":faction_no"), (lt, reg0, 0), (store_distance_to_party_from_party, ":dist", ":enemy_village_no", ":faction_marshall_party"), (lt, ":dist", 120), (this_or_next|party_slot_eq, ":enemy_village_no", slot_village_state, 0), #village is not already raided (party_slot_eq, ":enemy_village_no", slot_village_state, svs_being_raided), (store_sub, ":dist_point", 150, ":dist"), (val_sub, ":random_village_no", ":dist_point"), (try_begin), (eq, ":enemy_village_no", ":old_target_raiding_village"), (val_sub, ":random_village_no", 10000), (try_end), (lt, ":random_village_no", 0), (assign, ":target_raiding_village", ":enemy_village_no"), (assign, ":chance_raiding_village", 20), (try_begin), (eq, ":old_target_raiding_village", ":target_raiding_village"), (val_mul, ":chance_raiding_village", 100), (try_end), (val_mul, ":chance_raiding_village", ":offensive_rating"), (val_div, ":chance_raiding_village", 100), (try_end), (try_end), (try_begin),#Attacking enemy army (neq, ":old_faction_ai_state", sfai_default), (gt, ":faction_marshall_party", 0), (assign, ":old_target_attacking_enemy_army", -1), (try_begin), (eq, ":old_faction_ai_state", sfai_attacking_enemy_army), (assign, ":old_target_attacking_enemy_army", ":old_faction_ai_object"), (try_end), (assign, ":best_attack_army", -1), (assign, ":best_attack_army_score", 0), (try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active), (faction_get_slot, ":cur_kingdom_marshall", ":cur_kingdom", slot_faction_marshall), (ge, ":cur_kingdom_marshall", 0), (troop_slot_eq, ":cur_kingdom_marshall", slot_troop_occupation, slto_kingdom_hero), (troop_get_slot, ":cur_kingdom_marshall_party", ":cur_kingdom_marshall", slot_troop_leaded_party), (ge, ":cur_kingdom_marshall_party", 0), (party_is_active, ":cur_kingdom_marshall_party"), (store_troop_faction, ":cur_kingdom_marshall_faction", ":cur_kingdom_marshall"), (store_relation, ":rel", ":cur_kingdom_marshall_faction", ":faction_no"), (lt, ":rel", 0), (this_or_next|faction_slot_eq, ":cur_kingdom_marshall_faction", slot_faction_ai_state, sfai_attacking_center), (faction_slot_eq, ":cur_kingdom_marshall_faction", slot_faction_ai_state, sfai_raiding_village), (party_get_slot, ":cur_kingdom_marshall_party_follower_strength", ":cur_kingdom_marshall_party", slot_party_follower_strength), (party_get_slot, ":cur_kingdom_marshall_party_strength", ":cur_kingdom_marshall_party", slot_party_cached_strength), (val_add, ":cur_kingdom_marshall_party_strength", ":cur_kingdom_marshall_party_follower_strength"), (store_mul, ":attack_army_score", ":cur_kingdom_marshall_party_strength", 1000), (val_div, ":attack_army_score", ":faction_marshall_army_strength"), (try_begin), (gt, ":attack_army_score", 850), (store_sub, ":attack_army_score", 1700, ":attack_army_score"), (try_end), (gt, ":attack_army_score", 0), (val_mul, ":attack_army_score", 2), (try_begin), (faction_slot_eq, ":cur_kingdom_marshall_faction", slot_faction_ai_state, sfai_attacking_center), (val_mul, ":attack_army_score", 10), (else_try), (faction_slot_eq, ":cur_kingdom_marshall_faction", slot_faction_ai_state, sfai_raiding_village), (val_mul, ":attack_army_score", 3), (try_end), (try_begin), (eq, ":old_target_attacking_enemy_army", ":cur_kingdom_marshall_party"), (val_mul, ":attack_army_score", 100), (try_end), (store_distance_to_party_from_party, ":dist", ":cur_kingdom_marshall_party", ":faction_marshall_party"), (val_add, ":dist", 20), (val_div, ":attack_army_score", ":dist"), (gt, ":attack_army_score", ":best_attack_army_score"), (assign, ":best_attack_army", ":cur_kingdom_marshall_party"), (assign, ":best_attack_army_score", ":attack_army_score"), (try_end), (ge, ":best_attack_army", 0), #Army having with equal strength and 30 kms away will have a best_attack_army_score of 28 (store_mul, ":chance_attacking_enemy_army", ":best_attack_army_score", 2), (val_min, ":chance_attacking_enemy_army", 1500), (assign, ":target_attacking_enemy_army", ":best_attack_army"), (try_begin), (eq, ":old_target_attacking_enemy_army", ":target_attacking_enemy_army"), (val_mul, ":chance_attacking_enemy_army", 100), (try_end), (val_mul, ":chance_attacking_enemy_army", ":offensive_rating"), (val_div, ":chance_attacking_enemy_army", 100), (try_end), (try_begin),#Attacking enemies around center (neq, ":old_faction_ai_state", sfai_default), (gt, ":faction_marshall_party", 0), (assign, ":old_target_attacking_enemies_around_center", -1), (try_begin), (eq, ":old_faction_ai_state", sfai_attacking_enemies_around_center), (assign, ":old_target_attacking_enemies_around_center", ":old_faction_ai_object"), (try_end), (assign, ":best_attack_army_center", -1), (assign, ":best_attack_army_score", 0), (try_for_range, ":center_no", centers_begin, centers_end), (store_faction_of_party, ":center_faction", ":center_no"), (eq, ":center_faction", ":faction_no"), (party_get_slot, ":nearby_enemy_strength", ":center_no", slot_party_nearby_enemy_strength), (store_mul, ":attack_army_score", ":nearby_enemy_strength", 1000), (val_div, ":attack_army_score", ":faction_marshall_army_strength"), (try_begin), (gt, ":attack_army_score", 850), (store_sub, ":attack_army_score", 1700, ":attack_army_score"), (try_end), (gt, ":attack_army_score", 0), (val_mul, ":attack_army_score", 4), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_village), (try_begin), (party_slot_eq, ":center_no", slot_village_state, svs_being_raided), (val_mul, ":attack_army_score", 3), (try_end), (else_try), (try_begin), (party_slot_ge, ":center_no", slot_center_is_besieged_by, 0), (val_mul, ":attack_army_score", 10), (try_end), (try_end), (try_begin), (eq, ":old_target_attacking_enemies_around_center", ":center_no"), (val_mul, ":attack_army_score", 100), (try_end), (store_distance_to_party_from_party, ":dist", ":center_no", ":faction_marshall_party"), (val_add, ":dist", 20), (val_div, ":attack_army_score", ":dist"), (gt, ":attack_army_score", ":best_attack_army_score"), (assign, ":best_attack_army_center", ":center_no"), (assign, ":best_attack_army_score", ":attack_army_score"), (try_end), (ge, ":best_attack_army_center", 0), #Center having enemies at equal strength and 30 kms away will have a best_attack_army_score of 56 (store_mul, ":chance_attacking_enemies_around_center", ":best_attack_army_score", 2), (val_min, ":chance_attacking_enemies_around_center", 2000), (assign, ":target_attacking_enemies_around_center", ":best_attack_army_center"), (try_begin), (eq, ":old_target_attacking_enemies_around_center", ":target_attacking_enemies_around_center"), (val_mul, ":chance_attacking_enemies_around_center", 1000), (try_end), (val_mul, ":chance_attacking_enemies_around_center", ":offensive_rating"), (val_div, ":chance_attacking_enemies_around_center", 100), (try_begin), (gt, ":chance_attacking_enemies_around_center", ":chance_attacking_enemy_army"), (assign, ":end_cond", kingdoms_end), (try_for_range, ":cur_kingdom", kingdoms_begin, ":end_cond"), (faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active), (faction_get_slot, ":cur_kingdom_marshall", ":cur_kingdom", slot_faction_marshall), (ge, ":cur_kingdom_marshall", 0), (troop_slot_eq, ":cur_kingdom_marshall", slot_troop_occupation, slto_kingdom_hero), (troop_get_slot, ":cur_kingdom_marshall_party", ":cur_kingdom_marshall", slot_troop_leaded_party), (ge, ":cur_kingdom_marshall_party", 0), (party_is_active, ":cur_kingdom_marshall_party"), (store_troop_faction, ":cur_kingdom_marshall_faction", ":cur_kingdom_marshall"), (store_relation, ":rel", ":cur_kingdom_marshall_faction", ":faction_no"), (lt, ":rel", 0), (store_distance_to_party_from_party, ":distance", ":cur_kingdom_marshall_party", ":target_attacking_enemies_around_center"), (lt, ":distance", 10), (assign, ":chance_attacking_enemy_army", ":chance_attacking_enemies_around_center"), (assign, ":target_attacking_enemy_army", ":cur_kingdom_marshall_party"), (assign, ":chance_attacking_enemies_around_center", 0), (assign, ":target_attacking_enemies_around_center", -1), (assign, ":end_cond", 0),#break (try_end), (try_end), (try_end), (assign, ":sum_weights", 0), (val_add, ":sum_weights", ":chance_defend"), (val_add, ":sum_weights", ":chance_gathering_army"), (val_add, ":sum_weights", ":chance_attacking_center"), (val_add, ":sum_weights", ":chance_raiding_village"), (val_add, ":sum_weights", ":chance_attacking_enemy_army"), (val_add, ":sum_weights", ":chance_attacking_enemies_around_center"), (store_random_in_range, ":random_no", 0, ":sum_weights"), (val_sub, ":random_no", ":chance_defend"), (try_begin), (lt, ":random_no", 0), (faction_set_slot, ":faction_no", slot_faction_ai_state, sfai_default), (faction_set_slot, ":faction_no", slot_faction_ai_object, -1), (try_begin), (neq, ":old_faction_ai_state", sfai_default), (call_script, "script_check_and_finish_active_army_quests_for_faction", ":faction_no"), (faction_set_slot, ":faction_no", slot_faction_ai_last_offensive_time, ":cur_hours"), (try_end), (try_begin), (eq, "$cheat_mode", 1), (str_store_faction_name, s1, ":faction_no"), (display_message, "@{s1} decided to do nothing."), (try_end), (else_try), (val_sub, ":random_no", ":chance_gathering_army"), (lt, ":random_no", 0), (faction_set_slot, ":faction_no", slot_faction_ai_state, sfai_gathering_army), (faction_set_slot, ":faction_no", slot_faction_ai_object, -1), (try_begin), (neq, ":old_faction_ai_state", sfai_gathering_army), (faction_set_slot, ":faction_no", slot_faction_ai_last_offensive_time, ":cur_hours"), (faction_set_slot, ":faction_no", slot_faction_ai_offensive_max_followers, 1), (try_end), (try_begin), (eq, "$cheat_mode", 1), (str_store_faction_name, s1, ":faction_no"), (display_message, "@{s1} decided to gather army."), (try_end), (else_try), (val_sub, ":random_no", ":chance_attacking_center"), (lt, ":random_no", 0), (faction_set_slot, ":faction_no", slot_faction_ai_state, sfai_attacking_center), (faction_set_slot, ":faction_no", slot_faction_ai_object, ":target_attacking_center"), (try_begin), (gt, ":faction_marshall_num_followers", ":marshall_num_old_followers"), (faction_set_slot, ":faction_no", slot_faction_ai_offensive_max_followers, ":faction_marshall_num_followers"), (try_end), (try_begin), (eq, "$cheat_mode", 1), (str_store_faction_name, s1, ":faction_no"), (str_store_party_name, s2, ":target_attacking_center"), (display_message, "@{s1} decided to besiege {s2}."), (try_end), (else_try), (val_sub, ":random_no", ":chance_raiding_village"), (lt, ":random_no", 0), (faction_set_slot, ":faction_no", slot_faction_ai_state, sfai_raiding_village), (faction_set_slot, ":faction_no", slot_faction_ai_object, ":target_raiding_village"), (try_begin), (gt, ":faction_marshall_num_followers", ":marshall_num_old_followers"), (faction_set_slot, ":faction_no", slot_faction_ai_offensive_max_followers, ":faction_marshall_num_followers"), (try_end), (try_begin), (eq, "$cheat_mode", 1), (str_store_faction_name, s1, ":faction_no"), (str_store_party_name, s2, ":target_raiding_village"), (display_message, "@{s1} decided to raid {s2}."), (try_end), (else_try), (val_sub, ":random_no", ":chance_attacking_enemy_army"), (lt, ":random_no", 0), (faction_set_slot, ":faction_no", slot_faction_ai_state, sfai_attacking_enemy_army), (faction_set_slot, ":faction_no", slot_faction_ai_object, ":target_attacking_enemy_army"), (try_begin), (gt, ":faction_marshall_num_followers", ":marshall_num_old_followers"), (faction_set_slot, ":faction_no", slot_faction_ai_offensive_max_followers, ":faction_marshall_num_followers"), (try_end), (try_begin), (eq, "$cheat_mode", 1), (str_store_faction_name, s1, ":faction_no"), (str_store_party_name, s2, ":target_attacking_enemy_army"), (display_message, "@{s1} decided to attack {s2}."), (try_end), (else_try), (val_sub, ":random_no", ":chance_attacking_enemies_around_center"), (lt, ":random_no", 0), (faction_set_slot, ":faction_no", slot_faction_ai_state, sfai_attacking_enemies_around_center), (faction_set_slot, ":faction_no", slot_faction_ai_object, ":target_attacking_enemies_around_center"), (try_begin), (gt, ":faction_marshall_num_followers", ":marshall_num_old_followers"), (faction_set_slot, ":faction_no", slot_faction_ai_offensive_max_followers, ":faction_marshall_num_followers"), (try_end), (try_begin), (eq, "$cheat_mode", 1), (str_store_faction_name, s1, ":faction_no"), (str_store_party_name, s2, ":target_attacking_enemies_around_center"), (display_message, "@{s1} decided to attack enemies around {s2}."), (try_end), (try_end), (try_begin), (eq, "$players_kingdom", ":faction_no"), (neg|faction_slot_eq, ":faction_no", slot_faction_ai_state, sfai_attacking_center), (check_quest_active, "qst_join_siege_with_army"), (call_script, "script_abort_quest", "qst_join_siege_with_army", 0), (try_end), ]), # script_check_and_finish_active_army_quests_for_faction # Input: faction_no # Output: none ("check_and_finish_active_army_quests_for_faction", [ (store_script_param_1, ":faction_no"), (try_begin), (eq, "$players_kingdom", ":faction_no"), (try_begin), (check_quest_active, "qst_report_to_army"), (call_script, "script_cancel_quest", "qst_report_to_army"), (try_end), (assign, ":one_active", 0), (try_for_range, ":quest_no", army_quests_begin, army_quests_end), (check_quest_active, ":quest_no"), (call_script, "script_cancel_quest", ":quest_no"), (assign, ":one_active", 1), (try_end), (try_begin), (check_quest_active, "qst_follow_army"), (assign, ":one_active", 1), (call_script, "script_end_quest", "qst_follow_army"), (try_end), (eq, ":one_active", 1), (faction_get_slot, ":last_offensive_time", ":faction_no", slot_faction_ai_last_offensive_time), (store_current_hours, ":cur_hours"), (store_sub, ":total_time_served", ":cur_hours", ":last_offensive_time"), (store_mul, ":xp_reward", ":total_time_served", 5), (val_div, ":xp_reward", 50), (val_mul, ":xp_reward", 50), (val_add, ":xp_reward", 50), (add_xp_as_reward, ":xp_reward"), (try_end), ]), # script_troop_get_player_relation # Input: arg1 = troop_no # Output: reg0 = effective relation (modified by troop reputation, honor, etc.) ("troop_get_player_relation", [ (store_script_param_1, ":troop_no"), (troop_get_slot, ":reputation", ":troop_no", slot_lord_reputation_type), (troop_get_slot, ":effective_relation", ":troop_no", slot_troop_player_relation), (assign, ":honor_bonus", 0), (try_begin), (eq, ":reputation", lrep_quarrelsome), (val_add, ":effective_relation", -3), (try_end), (try_begin), (ge, "$player_honor", 0), (try_begin), (this_or_next|eq, ":reputation", lrep_upstanding), ( eq, ":reputation", lrep_goodnatured), (store_div, ":honor_bonus", "$player_honor", 3), (try_end), (try_end), (try_begin), (lt, "$player_honor", 0), (try_begin), (this_or_next|eq, ":reputation", lrep_upstanding), ( eq, ":reputation", lrep_goodnatured), (store_div, ":honor_bonus", "$player_honor", 3), (else_try), (eq, ":reputation", lrep_martial), (store_div, ":honor_bonus", "$player_honor", 5), (try_end), (try_end), (val_add, ":effective_relation", ":honor_bonus"), (assign, reg0, ":effective_relation"), ]), # script_change_troop_renown # Input: arg1 = troop_no, arg2 = relation difference # Output: none ("change_troop_renown", [ (store_script_param_1, ":troop_no"), (store_script_param_2, ":renown_change"), (troop_get_slot, ":old_renown", ":troop_no", slot_troop_renown), (store_add, ":new_renown", ":old_renown", ":renown_change"), (val_max, ":new_renown", 0), (troop_set_slot, ":troop_no", slot_troop_renown, ":new_renown"), (try_begin), (eq, ":troop_no", "trp_player"), (str_store_troop_name, s1, ":troop_no"), (assign, reg12, ":renown_change"), (val_abs, reg12), (try_begin), (gt, ":renown_change", 0), (display_message, "@You gained {reg12} renown."), (else_try), (lt, ":renown_change", 0), (display_message, "@You lose {reg12} renown."), (try_end), (try_end), (call_script, "script_update_troop_notes", ":troop_no"), ]), # script_change_player_relation_with_troop # Input: arg1 = troop_no, arg2 = relation difference # Output: none ("change_player_relation_with_troop", [ (store_script_param_1, ":troop_no"), (store_script_param_2, ":difference"), (try_begin), (neq, ":troop_no", "trp_player"), (neg|is_between, ":troop_no", soldiers_begin, soldiers_end), (neq, ":difference", 0), (call_script, "script_troop_get_player_relation", ":troop_no"), (assign, ":old_effective_relation", reg0), (troop_get_slot, ":player_relation", ":troop_no", slot_troop_player_relation), (val_add, ":player_relation", ":difference"), (val_clamp, ":player_relation", -100, 101), (try_begin), (troop_set_slot, ":troop_no", slot_troop_player_relation, ":player_relation"), (str_store_troop_name_link, s1, ":troop_no"), (call_script, "script_troop_get_player_relation", ":troop_no"), (assign, ":new_effective_relation", reg0), (neq, ":old_effective_relation", ":new_effective_relation"), (assign, reg1, ":old_effective_relation"), (assign, reg2, ":new_effective_relation"), (try_begin), (gt, ":difference", 0), (display_message, "str_troop_relation_increased"), (else_try), (lt, ":difference", 0), (display_message, "str_troop_relation_detoriated"), (try_end), (try_begin), (eq, ":troop_no", "$g_talk_troop"), (assign, "$g_talk_troop_relation", ":new_effective_relation"), (call_script, "script_setup_talk_info"), (try_end), (call_script, "script_update_troop_notes", ":troop_no"), (try_end), (try_end), ]), # script_change_player_relation_with_center # Input: arg1 = party_no, arg2 = relation difference # Output: none ("change_player_relation_with_center", [ (store_script_param_1, ":center_no"), (store_script_param_2, ":difference"), (party_get_slot, ":player_relation", ":center_no", slot_center_player_relation), (assign, reg1, ":player_relation"), (val_add, ":player_relation", ":difference"), (val_clamp, ":player_relation", -100, 100), (assign, reg2, ":player_relation"), (party_set_slot, ":center_no", slot_center_player_relation, ":player_relation"), (str_store_party_name_link, s1, ":center_no"), (try_begin), (gt, ":difference", 0), (display_message, "@Your relation with {s1} has improved."), (else_try), (lt, ":difference", 0), (display_message, "@Your relation with {s1} has deteriorated."), (try_end), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_village), (call_script, "script_update_volunteer_troops_in_village", ":center_no"), (try_end), (try_begin), (this_or_next|is_between, "$g_talk_troop", village_elders_begin, village_elders_end), (is_between, "$g_talk_troop", mayors_begin, mayors_end), (assign, "$g_talk_troop_relation", ":player_relation"), (call_script, "script_setup_talk_info"), (try_end), ]), # script_change_player_relation_with_faction # Input: arg1 = faction_no, arg2 = relation difference # Output: none ("change_player_relation_with_faction", [ (store_script_param_1, ":faction_no"), (store_script_param_2, ":difference"), (store_relation, ":player_relation", ":faction_no", "fac_player_supporters_faction"), (assign, reg1, ":player_relation"), (val_add, ":player_relation", ":difference"), (assign, reg2, ":player_relation"), (set_relation, ":faction_no", "fac_player_faction", ":player_relation"), (set_relation, ":faction_no", "fac_player_supporters_faction", ":player_relation"), (str_store_faction_name_link, s1, ":faction_no"), (try_begin), (gt, ":difference", 0), (display_message, "str_faction_relation_increased"), (else_try), (lt, ":difference", 0), (display_message, "str_faction_relation_detoriated"), (try_end), (call_script, "script_update_all_notes"), ]), # script_set_player_relation_with_faction # Input: arg1 = faction_no, arg2 = relation # Output: none ("set_player_relation_with_faction", [ (store_script_param_1, ":faction_no"), (store_script_param_2, ":relation"), (store_relation, ":player_relation", ":faction_no", "fac_player_supporters_faction"), (store_sub, ":reln_dif", ":relation", ":player_relation"), (call_script, "script_change_player_relation_with_faction", ":faction_no", ":reln_dif"), ]), # script_change_player_relation_with_faction_ex # changes relations with other factions also (according to their relations between each other) # Input: arg1 = faction_no, arg2 = relation difference # Output: none ("change_player_relation_with_faction_ex", [ (store_script_param_1, ":faction_no"), (store_script_param_2, ":difference"), (store_relation, ":player_relation", ":faction_no", "fac_player_supporters_faction"), (assign, reg1, ":player_relation"), (val_add, ":player_relation", ":difference"), (assign, reg2, ":player_relation"), (set_relation, ":faction_no", "fac_player_faction", ":player_relation"), (set_relation, ":faction_no", "fac_player_supporters_faction", ":player_relation"), (str_store_faction_name_link, s1, ":faction_no"), (try_begin), (gt, ":difference", 0), (display_message, "str_faction_relation_increased"), (else_try), (lt, ":difference", 0), (display_message, "str_faction_relation_detoriated"), (try_end), (try_for_range, ":other_faction", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":other_faction", slot_faction_state, sfs_active), (neq, ":faction_no", ":other_faction"), (store_relation, ":other_faction_relation", ":faction_no", ":other_faction"), (store_relation, ":player_relation", ":other_faction", "fac_player_supporters_faction"), (store_mul, ":relation_change", ":difference", ":other_faction_relation"), (val_div, ":relation_change", 100), (val_add, ":player_relation", ":relation_change"), (set_relation, ":other_faction", "fac_player_faction", ":player_relation"), (set_relation, ":other_faction", "fac_player_supporters_faction", ":player_relation"), (try_end), (try_begin), (faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active), (try_for_range, ":kingdom_no", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":kingdom_no", slot_faction_state, sfs_active), (call_script, "script_update_faction_notes", ":kingdom_no"), (try_end), (try_end), ]), # script_cf_get_random_active_faction_except_player_faction_and_faction # Input: arg1 = except_faction_no # Output: reg0 = random_faction ("cf_get_random_active_faction_except_player_faction_and_faction", [ (store_script_param_1, ":except_faction_no"), (assign, ":num_factions", 0), (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end), (neq, ":faction_no", "fac_player_supporters_faction"), (neq, ":faction_no", ":except_faction_no"), (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active), (val_add, ":num_factions", 1), (try_end), (gt, ":num_factions", 0), (assign, ":selected_faction", -1), (store_random_in_range, ":random_faction", 0, ":num_factions"), (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end), (ge, ":random_faction", 0), (neq, ":faction_no", "fac_player_supporters_faction"), (neq, ":faction_no", ":except_faction_no"), (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active), (val_sub, ":random_faction", 1), (lt, ":random_faction", 0), (assign, ":selected_faction", ":faction_no"), (try_end), (assign, reg0, ":selected_faction"), ]), # script_make_kingdom_hostile_to_player # Input: arg1 = faction_no, arg2 = relation difference # Output: none ("make_kingdom_hostile_to_player", [ (store_script_param_1, ":kingdom_no"), (store_script_param_2, ":difference"), (try_begin), (lt, ":difference", 0), (store_relation, ":player_relation", ":kingdom_no", "fac_player_supporters_faction"), (val_min, ":player_relation", 0), (val_add, ":player_relation", ":difference"), (call_script, "script_set_player_relation_with_faction", ":kingdom_no", ":player_relation"), (try_end), ]), # script_change_player_honor # Input: arg1 = honor difference # Output: none ("change_player_honor", [ (store_script_param_1, ":honor_dif"), (val_add, "$player_honor", ":honor_dif"), (try_begin), (gt, ":honor_dif", 0), (display_message, "@You gain honour."), (else_try), (lt, ":honor_dif", 0), (display_message, "@You lose honour."), (try_end), ## (val_mul, ":honor_dif", 1000), ## (assign, ":temp_honor", 0), ## (assign, ":num_nonlinear_steps", 10), ## (try_begin), ## (gt, "$player_honor", 0), ## (lt, ":honor_dif", 0), ## (assign, ":num_nonlinear_steps", 0), ## (else_try), ## (lt, "$player_honor", 0), ## (gt, ":honor_dif", 0), ## (assign, ":num_nonlinear_steps", 3), ## (try_end), ## ## (try_begin), ## (ge, "$player_honor", 0), ## (assign, ":temp_honor", "$player_honor"), ## (else_try), ## (val_sub, ":temp_honor", "$player_honor"), ## (try_end), ## (try_for_range, ":unused",0,":num_nonlinear_steps"), ## (ge, ":temp_honor", 10000), ## (val_div, ":temp_honor", 2), ## (val_div, ":honor_dif", 2), ## (try_end), ## (val_add, "$player_honor", ":honor_dif"), ]), # script_change_player_party_morale # Input: arg1 = morale difference # Output: none ("change_player_party_morale", [ (store_script_param_1, ":morale_dif"), (party_get_morale, ":cur_morale", "p_main_party"), (store_add, ":new_morale", ":cur_morale", ":morale_dif"), (val_clamp, ":new_morale", 0, 100), (party_set_morale, "p_main_party", ":new_morale"), (try_begin), (lt, ":new_morale", ":cur_morale"), (store_sub, reg1, ":cur_morale", ":new_morale"), (display_message, "str_party_lost_morale"), (else_try), (gt, ":new_morale", ":cur_morale"), (store_sub, reg1, ":new_morale", ":cur_morale"), (display_message, "str_party_gained_morale"), (try_end), ]), # script_cf_player_has_item_without_modifier # Input: arg1 = item_id, arg2 = modifier # Output: none (can_fail) ("cf_player_has_item_without_modifier", [ (store_script_param, ":item_id", 1), (store_script_param, ":modifier", 2), (player_has_item, ":item_id"), #checking if any of the meat is not rotten (assign, ":has_without_modifier", 0), (troop_get_inventory_capacity, ":inv_size", "trp_player"), (try_for_range, ":i_slot", 0, ":inv_size"), (troop_get_inventory_slot, ":cur_item", "trp_player", ":i_slot"), (eq, ":cur_item", ":item_id"), (troop_get_inventory_slot_modifier, ":cur_modifier", "trp_player", ":i_slot"), (neq, ":cur_modifier", ":modifier"), (assign, ":has_without_modifier", 1), (assign, ":inv_size", 0), #break (try_end), (eq, ":has_without_modifier", 1), ]), # script_get_player_party_morale_values # Output: reg0 = player_party_morale_target ("get_player_party_morale_values", [ (party_get_num_companion_stacks, ":num_stacks","p_main_party"), (assign, ":num_men", 0), (try_for_range, ":i_stack", 1, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"), (try_begin), (troop_is_hero, ":stack_troop"), (val_add, ":num_men", 3), (else_try), (party_stack_get_size, ":stack_size","p_main_party",":i_stack"), (val_add, ":num_men", ":stack_size"), (try_end), (try_end), ############################### # Changed by Form Ranks kit # (party_get_num_attached_parties, ":arrays", "p_main_party"), (try_for_range, ":i", 0, ":arrays"), (party_get_attached_party_with_rank, ":array_party", "p_main_party", ":i"), (store_party_size, ":array_size", ":array_party"), (val_div, ":array_size", 2), (val_add, ":num_men", ":array_size"), (try_end), # # Change of Form Ranks kit end ############################### (assign, "$g_player_party_morale_modifier_party_size", ":num_men"), (store_skill_level, ":player_leadership", "skl_leadership", "trp_player"), (store_mul, "$g_player_party_morale_modifier_leadership", ":player_leadership", 7), (assign, ":new_morale", "$g_player_party_morale_modifier_leadership"), (val_sub, ":new_morale", "$g_player_party_morale_modifier_party_size"), (val_add, ":new_morale", 50), (assign, "$g_player_party_morale_modifier_food", 0), (try_for_range, ":cur_edible", food_begin, food_end), (call_script, "script_cf_player_has_item_without_modifier", ":cur_edible", imod_rotten), (item_get_slot, ":food_bonus", ":cur_edible", slot_item_food_bonus), (val_add, "$g_player_party_morale_modifier_food", ":food_bonus"), (try_end), (val_add, ":new_morale", "$g_player_party_morale_modifier_food"), (try_begin), (eq, "$g_player_party_morale_modifier_food", 0), (assign, "$g_player_party_morale_modifier_no_food", 30), (val_sub, ":new_morale", "$g_player_party_morale_modifier_no_food"), (else_try), (assign, "$g_player_party_morale_modifier_no_food", 0), (try_end), (assign, "$g_player_party_morale_modifier_debt", 0), (try_begin), (gt, "$g_player_debt_to_party_members", 0), (call_script, "script_calculate_player_faction_wage"), (assign, ":total_wages", reg0), (store_mul, "$g_player_party_morale_modifier_debt", "$g_player_debt_to_party_members", 10), (val_div, "$g_player_party_morale_modifier_debt", ":total_wages"), (val_clamp, "$g_player_party_morale_modifier_debt", 1, 31), (val_sub, ":new_morale", "$g_player_party_morale_modifier_debt"), (try_end), (val_clamp, ":new_morale", 0, 100), (assign, reg0, ":new_morale"), ]), # script_diplomacy_start_war_between_kingdoms # Input: arg1 = kingdom_1, arg2 = kingdom_2, arg3 = initializing_war_peace_cond # Output: none ("diplomacy_start_war_between_kingdoms", #sets relations between two kingdoms and their vassals. [ (store_script_param, ":kingdom_a", 1), (store_script_param, ":kingdom_b", 2), (store_script_param, ":initializing_war_peace_cond", 3), (store_relation, ":relation", ":kingdom_a", ":kingdom_b"), (val_min, ":relation", -10), (val_add, ":relation", -30), (set_relation, ":kingdom_a", ":kingdom_b", ":relation"), (try_begin), (eq, "$players_kingdom", ":kingdom_a"), (store_relation, ":relation", "fac_player_supporters_faction", ":kingdom_b"), (val_min, ":relation", -30), (call_script, "script_set_player_relation_with_faction", ":kingdom_b", ":relation"), (else_try), (eq, "$players_kingdom", ":kingdom_b"), (store_relation, ":relation", "fac_player_supporters_faction", ":kingdom_a"), (val_min, ":relation", -30), (call_script, "script_set_player_relation_with_faction", ":kingdom_a", ":relation"), (try_end), (try_begin), (eq, ":initializing_war_peace_cond", 1), (try_begin), (store_random_in_range, ":random_no", 0, 2), (this_or_next|eq, ":kingdom_a", "fac_player_supporters_faction"), (eq, ":random_no", 0), (assign, ":local_temp", ":kingdom_a"), (assign, ":kingdom_a", ":kingdom_b"), (assign, ":kingdom_b", ":local_temp"), (try_end), (str_store_faction_name_link, s1, ":kingdom_a"), (str_store_faction_name_link, s2, ":kingdom_b"), (display_log_message, "@{s1} has declared war against {s2}."), (call_script, "script_add_notification_menu", "mnu_notification_war_declared", ":kingdom_a", ":kingdom_b"), (call_script, "script_update_faction_notes", ":kingdom_a"), (call_script, "script_update_faction_notes", ":kingdom_b"), (assign, "$g_recalculate_ais", 1), (try_end), ]), # script_party_calculate_and_set_nearby_friend_strength # Input: party_no # Output: none ("party_calculate_and_set_nearby_friend_strength", [ (store_script_param, ":party_no", 1), (assign, ":follower_strength", 0), (assign, ":friend_strength", 0), (assign, ":enemy_strength", 0), (store_faction_of_party, ":party_faction", ":party_no"), (store_add, ":end_cond", kingdom_heroes_end, 1), (try_for_range, ":iteration", kingdom_heroes_begin, ":end_cond"), (try_begin), (eq, ":iteration", kingdom_heroes_end), (assign, ":cur_troop", "trp_player"), (else_try), (assign, ":cur_troop", ":iteration"), (try_end), (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero), (troop_get_slot, ":cur_troop_party", ":cur_troop", slot_troop_leaded_party), (ge, ":cur_troop_party", 0), (party_is_active, ":cur_troop_party"), (neq, ":party_no", ":cur_troop_party"), (party_get_slot, ":str", ":cur_troop_party", slot_party_cached_strength), (try_begin), (party_get_slot, ":commander_party", ":cur_troop_party", slot_party_commander_party), (eq, ":commander_party", ":party_no"), (val_add, ":follower_strength", ":str"), (try_end), (store_distance_to_party_from_party, ":distance", ":cur_troop_party", ":party_no"), (lt, ":distance", 10), (store_troop_faction, ":army_faction", ":cur_troop"), (store_relation, ":rel", ":army_faction", ":party_faction"), (try_begin), (this_or_next|eq, ":army_faction", ":party_faction"), (gt, ":rel", 0), (val_add, ":friend_strength", ":str"), (else_try), (lt, ":rel", 0), (val_add, ":enemy_strength", ":str"), (try_end), (try_end), (party_set_slot, ":party_no", slot_party_follower_strength, ":follower_strength"), (party_set_slot, ":party_no", slot_party_nearby_friend_strength, ":friend_strength"), (party_set_slot, ":party_no", slot_party_nearby_enemy_strength, ":enemy_strength"), ]), # script_init_ai_calculation # Input: none # Output: none ("init_ai_calculation", [ (try_for_range, ":cur_troop", heroes_begin, heroes_end), (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero), (troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party), (ge, ":cur_party", 0), (call_script, "script_party_calculate_strength", ":cur_party", 0), #will update slot_party_cached_strength (try_end), (call_script, "script_party_calculate_strength", "p_main_party", 0), #will update slot_party_cached_strength (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end), (call_script, "script_party_calculate_strength", ":cur_center", 0), #will update slot_party_cached_strength (try_end), (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end), (call_script, "script_party_calculate_and_set_nearby_friend_strength", ":cur_center"), (try_end), (try_for_range, ":cur_troop", heroes_begin, heroes_end), (troop_get_slot, ":cur_troop_party", ":cur_troop", slot_troop_leaded_party), (gt, ":cur_troop_party", 0), (call_script, "script_party_calculate_and_set_nearby_friend_strength", ":cur_troop_party"), (try_end), (call_script, "script_party_calculate_and_set_nearby_friend_strength", "p_main_party"), ]), # script_recalculate_ais # Input: none # Output: none ("recalculate_ais", [ (call_script, "script_init_ai_calculation"), (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active), (neg|faction_slot_eq, ":faction_no", slot_faction_marshall, "trp_player"), (call_script, "script_decide_faction_ai", ":faction_no"), (try_end), (call_script, "script_decide_kingdom_party_ais"), ]), # script_recalculate_ai_for_troop # Input: none # Output: none ("recalculate_ai_for_troop", [ (store_script_param, ":troop_no", 1), (call_script, "script_init_ai_calculation"), (call_script, "script_calculate_troop_ai", ":troop_no"), (call_script, "script_calculate_troop_ai_under_command", ":troop_no"), ]), # script_calculate_troop_ai # Input: troop_no # Output: none ("calculate_troop_ai", [ (store_script_param, ":troop_no", 1), (try_begin), (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (gt, ":party_no", 0), (party_slot_eq, ":party_no", slot_party_following_player, 0), (store_faction_of_party, ":faction_no", ":party_no"), (assign, ":continue", 1), (try_begin), (faction_slot_eq, ":faction_no", slot_faction_marshall, ":troop_no"), # do not calculate AI if troop is marshall. (neg|faction_slot_eq, ":faction_no", slot_faction_ai_state, sfai_default), (assign, ":continue", 0), (try_end), (eq, ":continue", 1), (call_script, "script_party_count_fit_for_battle", ":party_no"), (assign, ":party_fit_for_battle", reg0), (call_script, "script_party_get_ideal_size", ":party_no"), (assign, ":ideal_size", reg0), (store_mul, "$party_relative_strength", ":party_fit_for_battle", 100), (val_div, "$party_relative_strength", ":ideal_size"), (try_begin), (faction_slot_eq, ":faction_no", slot_faction_num_towns, 0), (faction_slot_eq, ":faction_no", slot_faction_num_castles, 0), (assign, "$ratio_of_prisoners", 0), #do not let prisoners have an effect on ai calculation (else_try), (party_get_num_prisoners, ":num_prisoners", ":party_no"), (store_div, "$ratio_of_prisoners", ":num_prisoners", ":party_fit_for_battle"), (try_end), (call_script, "script_kingdom_hero_decide_next_ai_state_follow_or_not", ":troop_no"), (party_slot_eq, ":party_no", slot_party_commander_party, -1), (call_script, "script_kingdom_hero_decide_next_ai_state", ":troop_no"), (try_end), ]), # script_calculate_troop_ai_under_command # Input: troop_no # Output: none ("calculate_troop_ai_under_command", [ (store_script_param, ":troop_no", 1), (try_begin), (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (gt, ":party_no", 0), (party_slot_ge, ":party_no", slot_party_commander_party, 0), (party_set_ai_initiative, ":party_no", 50), (call_script, "script_party_decide_next_ai_state_under_command", ":party_no"), (try_end), ]), # script_diplomacy_start_peace_between_kingdoms # Input: arg1 = kingdom_1, arg2 = kingdom_2, arg3 = initializing_war_peace_cond # Output: none ("diplomacy_start_peace_between_kingdoms", #sets relations between two kingdoms [ (store_script_param, ":kingdom_a", 1), (store_script_param, ":kingdom_b", 2), (store_script_param, ":initializing_war_peace_cond", 3), (store_relation, ":relation", ":kingdom_a", ":kingdom_b"), (val_max, ":relation", 0), (set_relation, ":kingdom_a", ":kingdom_b", ":relation"), (call_script, "script_exchange_prisoners_between_factions", ":kingdom_a", ":kingdom_b"), (try_begin), (eq, "$players_kingdom", ":kingdom_a"), (store_relation, ":relation", "fac_player_supporters_faction", ":kingdom_b"), (val_max, ":relation", 0), (call_script, "script_set_player_relation_with_faction", ":kingdom_b", ":relation"), (call_script, "script_event_kingdom_make_peace_with_kingdom", ":kingdom_b", "fac_player_supporters_faction"), (else_try), (eq, "$players_kingdom", ":kingdom_b"), (store_relation, ":relation", "fac_player_supporters_faction", ":kingdom_a"), (val_max, ":relation", 0), (call_script, "script_set_player_relation_with_faction", ":kingdom_a", ":relation"), (call_script, "script_event_kingdom_make_peace_with_kingdom", ":kingdom_a", "fac_player_supporters_faction"), (try_end), (try_begin), (eq, ":initializing_war_peace_cond", 1), (str_store_faction_name_link, s1, ":kingdom_a"), (str_store_faction_name_link, s2, ":kingdom_b"), (display_log_message, "@{s1} and {s2} have made peace with each other."), (call_script, "script_update_faction_notes", ":kingdom_a"), (call_script, "script_update_faction_notes", ":kingdom_b"), (call_script, "script_add_notification_menu", "mnu_notification_peace_declared", ":kingdom_a", ":kingdom_b"), (call_script, "script_event_kingdom_make_peace_with_kingdom", ":kingdom_a", ":kingdom_b"), (call_script, "script_event_kingdom_make_peace_with_kingdom", ":kingdom_b", ":kingdom_a"), (assign, "$g_recalculate_ais", 1), (try_end), ]), # script_event_kingdom_make_peace_with_kingdom # Input: arg1 = source_kingdom, arg2 = target_kingdom # Output: none ("event_kingdom_make_peace_with_kingdom", [ (store_script_param_1, ":source_kingdom"), (store_script_param_2, ":target_kingdom"), (try_begin), (check_quest_active, "qst_capture_prisoners"), (try_begin), (eq, "$players_kingdom", ":source_kingdom"), (quest_slot_eq, "qst_capture_prisoners", slot_quest_target_faction, ":target_kingdom"), (call_script, "script_cancel_quest", "qst_capture_prisoners"), (else_try), (eq, "$players_kingdom", ":target_kingdom"), (quest_slot_eq, "qst_capture_prisoners", slot_quest_target_faction, ":source_kingdom"), (call_script, "script_cancel_quest", "qst_capture_prisoners"), (try_end), (try_end), ]), # script_randomly_start_war_peace # Input: arg1 = initializing_war_peace_cond (1 = true, 0 = false) # Output: none ("randomly_start_war_peace", [ (store_script_param_1, ":initializing_war_peace_cond"), (assign, ":total_resources", 0), (assign, ":total_active_kingdoms", 0), (try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active), (val_add, ":total_active_kingdoms", 1), (faction_get_slot, ":num_towns", ":cur_kingdom", slot_faction_num_towns), (store_mul, ":kingdom_resources_value", ":num_towns", 2), (faction_get_slot, ":num_castles", ":cur_kingdom", slot_faction_num_castles), (val_add, ":kingdom_resources_value", ":num_castles"), (val_mul, ":kingdom_resources_value", 10), (val_max, ":kingdom_resources_value", 1), (val_mul, ":kingdom_resources_value", 1000), (faction_get_slot, ":num_armies", ":cur_kingdom", slot_faction_num_armies), (val_max, ":num_armies", 1), (val_div, ":kingdom_resources_value", ":num_armies"), (val_add, ":total_resources", ":kingdom_resources_value"), (try_end), (val_max, ":total_active_kingdoms", 1), (store_div, ":average_resources", ":total_resources", ":total_active_kingdoms"), (try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end), ## (neq, ":cur_kingdom", "fac_player_supporters_faction"), (faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active), (assign, ":num_ongoing_wars", 0), (try_for_range, ":other_kingdom", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":other_kingdom", slot_faction_state, sfs_active), (store_relation, ":other_relation", ":cur_kingdom", ":other_kingdom"), (lt, ":other_relation", 0), (val_add, ":num_ongoing_wars", 1), (try_end), (faction_get_slot, ":num_towns", ":cur_kingdom", slot_faction_num_towns), (store_mul, ":kingdom_1_resources_value", ":num_towns", 2), (faction_get_slot, ":num_castles", ":cur_kingdom", slot_faction_num_castles), (val_add, ":kingdom_1_resources_value", ":num_castles"), (val_mul, ":kingdom_1_resources_value", 10), (val_max, ":kingdom_1_resources_value", 1), (val_mul, ":kingdom_1_resources_value", 1000), (faction_get_slot, ":num_armies", ":cur_kingdom", slot_faction_num_armies), (val_max, ":num_armies", 1), (val_div, ":kingdom_1_resources_value", ":num_armies"), (store_add, ":start_cond", ":cur_kingdom", 1), (try_for_range, ":cur_kingdom_2", ":start_cond", kingdoms_end), ## (neq, ":cur_kingdom", "fac_player_supporters_faction"), (faction_slot_eq, ":cur_kingdom_2", slot_faction_state, sfs_active), (assign, ":num_ongoing_wars_2", 0), (try_for_range, ":other_kingdom", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":other_kingdom", slot_faction_state, sfs_active), (store_relation, ":other_relation", ":cur_kingdom_2", ":other_kingdom"), (lt, ":other_relation", 0), (val_add, ":num_ongoing_wars_2", 1), (try_end), (store_add, ":total_ongoing_wars", ":num_ongoing_wars", ":num_ongoing_wars_2"), (faction_get_slot, ":num_towns", ":cur_kingdom_2", slot_faction_num_towns), (store_mul, ":kingdom_2_resources_value", ":num_towns", 2), (faction_get_slot, ":num_castles", ":cur_kingdom_2", slot_faction_num_castles), (val_add, ":kingdom_2_resources_value", ":num_castles"), (val_mul, ":kingdom_2_resources_value", 10), (val_max, ":kingdom_2_resources_value", 1), (val_mul, ":kingdom_2_resources_value", 1000), (faction_get_slot, ":num_armies", ":cur_kingdom_2", slot_faction_num_armies), (val_max, ":num_armies", 1), (val_div, ":kingdom_2_resources_value", ":num_armies"), (assign, ":max_resources_value", ":kingdom_1_resources_value"), (val_max, ":max_resources_value", ":kingdom_2_resources_value"), (val_mul, ":max_resources_value", 100), (val_div, ":max_resources_value", ":average_resources"), (assign, ":cur_king", -1), (try_begin), (eq, ":cur_kingdom", "fac_player_supporters_faction"), (faction_get_slot, ":cur_king", ":cur_kingdom_2", slot_faction_leader), (assign, ":cur_relation", reg0), (store_sub, ":relation_effect", 200, ":cur_relation"), (val_mul, ":kingdom_1_resources_value", ":relation_effect"), (val_div, ":kingdom_1_resources_value", 200), (else_try), (eq, ":cur_kingdom_2", "fac_player_supporters_faction"), (faction_get_slot, ":cur_king", ":cur_kingdom", slot_faction_leader), (try_end), (try_begin), (ge, ":cur_king", 0), (call_script, "script_troop_get_player_relation", ":cur_king"), (assign, ":cur_relation", reg0), (store_sub, ":relation_effect", 200, ":cur_relation"), (val_mul, ":max_resources_value", ":relation_effect"), (val_div, ":max_resources_value", 200), (try_end), #max_resources_value is the obtained value that gives us how tempting the kingdom's values are #average is 100 (val_clamp, ":max_resources_value", 20, 500), #not letting more than 5 times higher chance of declaring war or peace (store_random_in_range, ":random_no", 0, 10000), (store_relation, ":cur_relation", ":cur_kingdom", ":cur_kingdom_2"), (try_begin), (lt, ":cur_relation", 0), #AT WAR (store_mul, ":chance_to_make_peace", ":total_ongoing_wars", 50), (val_mul, ":chance_to_make_peace", 100), (val_div, ":chance_to_make_peace", ":max_resources_value"), (try_begin), #disable random peace for special conditions (this_or_next|eq, ":cur_kingdom", "fac_player_supporters_faction"), (eq, ":cur_kingdom_2", "fac_player_supporters_faction"), (assign, ":continue", 0), (try_begin), (gt, "$supported_pretender", 0), (this_or_next|eq, ":cur_kingdom", "$supported_pretender_old_faction"), (eq, ":cur_kingdom_2", "$supported_pretender_old_faction"), (assign, ":continue", 1), (else_try), (is_between, "$players_oath_renounced_against_kingdom", kingdoms_begin, kingdoms_end), (this_or_next|eq, ":cur_kingdom", "$players_oath_renounced_against_kingdom"), (eq, ":cur_kingdom_2", "$players_oath_renounced_against_kingdom"), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (assign, ":chance_to_make_peace", 0), (try_end), (try_begin), (lt, ":random_no", ":chance_to_make_peace"), (assign, ":continue", 1), (try_begin), (check_quest_active, "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_faction", "qst_persuade_lords_to_make_peace", slot_quest_object_faction), (this_or_next|eq, ":cur_kingdom", ":quest_target_faction"), (eq, ":cur_kingdom", ":quest_object_faction"), (this_or_next|eq, ":cur_kingdom_2", ":quest_target_faction"), (eq, ":cur_kingdom_2", ":quest_object_faction"), (assign, ":continue", 0), #Do not declare war if the quest is active for the specific kingdoms (try_end), (eq, ":continue", 1), (try_begin), (eq, ":cur_kingdom", "fac_player_supporters_faction"), (call_script, "script_add_notification_menu", "mnu_question_peace_offer", ":cur_kingdom_2", 0), (else_try), (eq, ":cur_kingdom_2", "fac_player_supporters_faction"), (call_script, "script_add_notification_menu", "mnu_question_peace_offer", ":cur_kingdom", 0), (else_try), (call_script, "script_diplomacy_start_peace_between_kingdoms", ":cur_kingdom", ":cur_kingdom_2", ":initializing_war_peace_cond"), (try_end), (try_end), (else_try), # AT PEACE (assign, ":chance_to_declare_war", 6), (val_sub, ":chance_to_declare_war", ":total_ongoing_wars"), (val_mul, ":chance_to_declare_war", 50), (val_mul, ":chance_to_declare_war", ":max_resources_value"), (val_div, ":chance_to_declare_war", 100), (try_begin), (lt, ":random_no", ":chance_to_declare_war"), (assign, ":continue", 1), (try_begin), (check_quest_active, "qst_raid_caravan_to_start_war"), (quest_get_slot, ":quest_target_faction", "qst_raid_caravan_to_start_war", slot_quest_target_faction), (quest_get_slot, ":quest_object_faction", "qst_raid_caravan_to_start_war", slot_quest_object_faction), (this_or_next|eq, ":cur_kingdom", ":quest_target_faction"), (eq, ":cur_kingdom", ":quest_object_faction"), (this_or_next|eq, ":cur_kingdom_2", ":quest_target_faction"), (eq, ":cur_kingdom_2", ":quest_object_faction"), (assign, ":continue", 0), #Do not declare war if the quest is active for the specific kingdoms (try_end), (eq, ":continue", 1), (call_script, "script_diplomacy_start_war_between_kingdoms", ":cur_kingdom", ":cur_kingdom_2", ":initializing_war_peace_cond"), (try_end), (try_end), (try_end), (try_end), ]), # script_exchange_prisoners_between_factions # Input: arg1 = faction_no_1, arg2 = faction_no_2 ("exchange_prisoners_between_factions", [ (store_script_param_1, ":faction_no_1"), (store_script_param_2, ":faction_no_2"), (assign, ":faction_no_3", -1), (assign, ":faction_no_4", -1), (try_begin), (this_or_next|eq, "$players_kingdom", ":faction_no_1"), (eq, "$players_kingdom", ":faction_no_2"), (assign, ":faction_no_3", "fac_player_faction"), (assign, ":faction_no_4", "fac_player_supporters_faction"), (try_end), (try_for_parties, ":party_no"), (store_faction_of_party, ":party_faction", ":party_no"), (this_or_next|eq, ":party_faction", ":faction_no_1"), (this_or_next|eq, ":party_faction", ":faction_no_2"), (this_or_next|eq, ":party_faction", ":faction_no_3"), (eq, ":party_faction", ":faction_no_4"), (party_get_num_prisoner_stacks, ":num_stacks", ":party_no"), (try_for_range_backwards, ":troop_iterator", 0, ":num_stacks"), (party_prisoner_stack_get_troop_id, ":cur_troop_id", ":party_no", ":troop_iterator"), (store_troop_faction, ":cur_faction", ":cur_troop_id"), (this_or_next|eq, ":cur_faction", ":faction_no_1"), (this_or_next|eq, ":cur_faction", ":faction_no_2"), (this_or_next|eq, ":cur_faction", ":faction_no_3"), (eq, ":cur_faction", ":faction_no_4"), (try_begin), (troop_is_hero, ":cur_troop_id"), (call_script, "script_remove_troop_from_prison", ":cur_troop_id"), (try_end), (party_prisoner_stack_get_size, ":stack_size", ":party_no", ":troop_iterator"), (party_remove_prisoners, ":party_no", ":cur_troop_id", ":stack_size"), (try_end), (try_end), ]), # script_add_notification_menu # Input: arg1 = menu_no, arg2 = menu_var_1, arg3 = menu_var_2 # Output: none ("add_notification_menu", [ (store_script_param, ":menu_no", 1), (store_script_param, ":menu_var_1", 2), (store_script_param, ":menu_var_2", 3), (assign, ":end_cond", 1), (try_for_range, ":cur_slot", 0, ":end_cond"), (try_begin), (troop_slot_ge, "trp_notification_menu_types", ":cur_slot", 1), (val_add, ":end_cond", 1), (else_try), (troop_set_slot, "trp_notification_menu_types", ":cur_slot", ":menu_no"), (troop_set_slot, "trp_notification_menu_var1", ":cur_slot", ":menu_var_1"), (troop_set_slot, "trp_notification_menu_var2", ":cur_slot", ":menu_var_2"), (try_end), (try_end), ]), # script_finish_quest # Input: arg1 = quest_no, arg2 = finish_percentage # Output: none ("finish_quest", [ (store_script_param_1, ":quest_no"), (store_script_param_2, ":finish_percentage"), (quest_get_slot, ":quest_giver", ":quest_no", slot_quest_giver_troop), (quest_get_slot, ":quest_importance", ":quest_no", slot_quest_importance), (quest_get_slot, ":quest_xp_reward", ":quest_no", slot_quest_xp_reward), (quest_get_slot, ":quest_gold_reward", ":quest_no", slot_quest_gold_reward), (try_begin), (lt, ":finish_percentage", 100), (val_mul, ":quest_xp_reward", ":finish_percentage"), (val_div, ":quest_xp_reward", 100), (val_mul, ":quest_gold_reward", ":finish_percentage"), (val_div, ":quest_gold_reward", 100), #Changing the relation factor. Negative relation if less than 75% of the quest is finished. #Positive relation if more than 75% of the quest is finished. (assign, ":importance_multiplier", ":finish_percentage"), (val_sub, ":importance_multiplier", 75), (val_mul, ":quest_importance", ":importance_multiplier"), (val_div, ":quest_importance", 100), (else_try), (val_div, ":quest_importance", 4), (val_add, ":quest_importance", 1), (call_script, "script_change_player_relation_with_troop", ":quest_giver", ":quest_importance"), (try_end), (add_xp_as_reward, ":quest_xp_reward"), (call_script, "script_troop_add_gold", "trp_player", ":quest_gold_reward"), (call_script, "script_end_quest", ":quest_no"), ]), # script_get_information_about_troops_position # Input: arg1 = troop_no, arg2 = time (0 if present tense, 1 if past tense) # Output: s1 = String, reg0 = knows-or-not ("get_information_about_troops_position", [ (store_script_param_1, ":troop_no"), (store_script_param_2, reg3), (troop_get_type, reg4, ":troop_no"), (str_store_troop_name, s2, ":troop_no"), (assign, ":found", 0), (troop_get_slot, ":center_no", ":troop_no", slot_troop_cur_center), (try_begin), (gt, ":center_no", 0), (is_between, ":center_no", centers_begin, centers_end), (str_store_party_name_link, s3, ":center_no"), (str_store_string, s1, "@{s2} {reg3?was:is currently} at {s3}."), (assign, ":found", 1), (else_try), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (gt, ":party_no", 0), (call_script, "script_get_troop_attached_party", ":troop_no"), (assign, ":center_no", reg0), (try_begin), (is_between, ":center_no", centers_begin, centers_end), (str_store_party_name_link, s3, ":center_no"), (str_store_string, s1, "@{s2} {reg3?was:is currently} at {s3}."), (assign, ":found", 1), (else_try), (get_party_ai_behavior, ":ai_behavior", ":party_no"), (eq, ":ai_behavior", ai_bhvr_travel_to_party), (get_party_ai_object, ":ai_object", ":party_no"), (is_between, ":ai_object", centers_begin, centers_end), (call_script, "script_get_closest_center", ":party_no"), (str_store_party_name_link, s4, reg0), (str_store_party_name_link, s3, ":ai_object"), (str_store_string, s1, "@{s2} {reg3?was:is} travelling to {s3} and {reg4?she:he} {reg3?was:should be} close to {s4}{reg3?: at the moment}."), (assign, ":found", 1), (else_try), (call_script, "script_get_closest_center", ":party_no"), (str_store_party_name_link, s3, reg0), (str_store_string, s1, "@{s2} {reg3?was:is} in wilderness and {reg4?she:he} {reg3?was:should be} close to {s3}{reg3?: at the moment}."), (assign, ":found", 1), (try_end), (else_try), #(troop_slot_ge, ":troop_no", slot_troop_is_prisoner, 1), (troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), (party_count_prisoners_of_type, ":num_prisoners", ":center_no", ":troop_no"), (gt, ":num_prisoners", 0), (assign, ":found", 1), (str_store_party_name_link, s3, ":center_no"), (str_store_string, s1, "@{s2} {reg3?was:is} being held captive at {s3}."), (try_end), (try_begin), (eq, ":found", 0), (str_store_string, s1, "@{s2} {reg3?was:has been} taken captive by {reg4?her:his} enemies."), (assign, ":found", 1), (try_end), (try_end), (try_begin), (eq, ":found", 0), (str_store_string, s1, "@{reg3?{s2}'s location was unknown:I don't know where {s2} is}."), (try_end), (assign, reg0, ":found"), ]), # script_recruit_troop_as_companion # Input: arg1 = troop_no, # Output: none ("recruit_troop_as_companion", [ (store_script_param_1, ":troop_no"), (troop_set_slot, ":troop_no", slot_troop_occupation, slto_player_companion), (troop_set_slot, ":troop_no", slot_troop_cur_center, -1), (troop_set_auto_equip, ":troop_no",0), (party_add_members, "p_main_party", ":troop_no", 1), (str_store_troop_name, s6, ":troop_no"), (display_message, "@{s6} has joined your party"), ]), # script_setup_random_scene # Input: arg1 = center_no, arg2 = mission_template_no # Output: none ("setup_random_scene", [ (party_get_current_terrain, ":terrain_type", "p_main_party"), (assign, ":scene_to_use", "scn_random_scene"), (try_begin), (eq, ":terrain_type", rt_steppe), (assign, ":scene_to_use", "scn_random_scene_steppe"), (else_try), (eq, ":terrain_type", rt_plain), (assign, ":scene_to_use", "scn_random_scene_plain"), (else_try), (eq, ":terrain_type", rt_snow), (assign, ":scene_to_use", "scn_random_scene_snow"), (else_try), (eq, ":terrain_type", rt_desert), (assign, ":scene_to_use", "scn_random_scene_desert"), (else_try), (eq, ":terrain_type", rt_steppe_forest), (assign, ":scene_to_use", "scn_random_scene_steppe_forest"), (else_try), (eq, ":terrain_type", rt_forest), (assign, ":scene_to_use", "scn_random_scene_plain_forest"), (else_try), (eq, ":terrain_type", rt_snow_forest), (assign, ":scene_to_use", "scn_random_scene_snow_forest"), (else_try), (eq, ":terrain_type", rt_desert_forest), (assign, ":scene_to_use", "scn_random_scene_desert_forest"), (try_end), (jump_to_scene,":scene_to_use"), ]), # script_enter_dungeon # Input: arg1 = center_no, arg2 = mission_template_no # Output: none ("enter_dungeon", [ (store_script_param_1, ":center_no"), (store_script_param_2, ":mission_template_no"), (set_jump_mission,":mission_template_no"), (party_get_slot, ":dungeon_scene", ":center_no", slot_town_prison), (modify_visitors_at_site,":dungeon_scene"),(reset_visitors), (assign, ":cur_pos", 16), (call_script, "script_get_heroes_attached_to_center_as_prisoner", ":center_no", "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"), (lt, ":cur_pos", 32), # spawn up to entry point 32 (set_visitor, ":cur_pos", ":stack_troop"), (val_add,":cur_pos", 1), (try_end), (set_jump_entry, 0), (jump_to_scene,":dungeon_scene"), (scene_set_slot, ":dungeon_scene", slot_scene_visited, 1), (change_screen_mission), ]), # script_enter_court # Input: arg1 = center_no # Output: none ("enter_court", [ (store_script_param_1, ":center_no"), (assign, "$talk_context", tc_court_talk), (set_jump_mission,"mt_visit_town_castle"), (party_get_slot, ":castle_scene", ":center_no", slot_town_castle), (modify_visitors_at_site,":castle_scene"), (reset_visitors), #Adding guards (store_faction_of_party, ":center_faction", ":center_no"), (faction_get_slot, ":guard_troop", ":center_faction", slot_faction_guard_troop), (try_begin), (le, ":guard_troop", 0), (assign, ":guard_troop", "trp_swadian_sergeant"), (try_end), (set_visitor, 6, ":guard_troop"), (set_visitor, 7, ":guard_troop"), (assign, ":cur_pos", 16), (call_script, "script_get_heroes_attached_to_center", ":center_no", "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"), (lt, ":cur_pos", 32), # spawn up to entry point 32 (set_visitor, ":cur_pos", ":stack_troop"), (val_add,":cur_pos", 1), (try_end), (try_for_range, ":cur_troop", heroes_begin, heroes_end), (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_lady), (troop_slot_eq, ":cur_troop", slot_troop_cur_center, ":center_no"), (lt, ":cur_pos", 32), # spawn up to entry point 32 (set_visitor, ":cur_pos", ":cur_troop"), (val_add,":cur_pos", 1), (try_end), (jump_to_scene,":castle_scene"), (scene_set_slot, ":castle_scene", slot_scene_visited, 1), (change_screen_mission), ]), # script_find_high_ground_around_pos1 # Input: pos1 should hold center_position_no # arg1: team_no # arg2: search_radius (in meters) # Output: pos52 contains highest ground within <search_radius> meters of team leader # Destroys position registers: pos10, pos11, pos15 ("find_high_ground_around_pos1", [ (store_script_param, ":team_no", 1), (store_script_param, ":search_radius", 2), (val_mul, ":search_radius", 100), (get_scene_boundaries, pos10,pos11), (team_get_leader, ":ai_leader", ":team_no"), (agent_get_position, pos1, ":ai_leader"), (set_fixed_point_multiplier, 100), (position_get_x, ":o_x", pos1), (position_get_y, ":o_y", pos1), (store_sub, ":min_x", ":o_x", ":search_radius"), (store_sub, ":min_y", ":o_y", ":search_radius"), (store_add, ":max_x", ":o_x", ":search_radius"), (store_add, ":max_y", ":o_y", ":search_radius"), (position_get_x, ":scene_min_x", pos10), (position_get_x, ":scene_max_x", pos11), (position_get_y, ":scene_min_y", pos10), (position_get_y, ":scene_max_y", pos11), (val_max, ":min_x", ":scene_min_x"), (val_max, ":min_y", ":scene_min_y"), (val_min, ":max_x", ":scene_max_x"), (val_min, ":max_y", ":scene_max_y"), (store_div, ":min_x_meters", ":min_x", 100), (store_div, ":min_y_meters", ":min_y", 100), (store_div, ":max_x_meters", ":max_x", 100), (store_div, ":max_y_meters", ":max_y", 100), (assign, ":highest_pos_z", -10000), (copy_position, pos52, pos1), (init_position, pos15), (try_for_range, ":i_x", ":min_x_meters", ":max_x_meters"), (store_mul, ":i_x_cm", ":i_x", 100), (try_for_range, ":i_y", ":min_y_meters", ":max_y_meters"), (store_mul, ":i_y_cm", ":i_y", 100), (position_set_x, pos15, ":i_x_cm"), (position_set_y, pos15, ":i_y_cm"), (position_set_z, pos15, 10000), (position_set_z_to_ground_level, pos15), (position_get_z, ":cur_pos_z", pos15), (try_begin), (gt, ":cur_pos_z", ":highest_pos_z"), (copy_position, pos52, pos15), (assign, ":highest_pos_z", ":cur_pos_z"), (try_end), (try_end), (try_end), ]), # script_select_battle_tactic # Input: none # Output: none ("select_battle_tactic", [ (assign, "$ai_team_1_battle_tactic", 0), (get_player_agent_no, ":player_agent"), (agent_get_team, ":player_team", ":player_agent"), (try_begin), (num_active_teams_le, 2), (try_begin), (eq, ":player_team", 0), (assign, "$ai_team_1", 1), (else_try), (assign, "$ai_team_1", 0), (try_end), (assign, "$ai_team_2", -1), (else_try), (try_begin), (eq, ":player_team", 0), (assign, "$ai_team_1", 1), (else_try), (assign, "$ai_team_1", 0), (try_end), (store_add, "$ai_team_2", ":player_team", 2), (try_end), (call_script, "script_select_battle_tactic_aux", "$ai_team_1"), (assign, "$ai_team_1_battle_tactic", reg0), (try_begin), (ge, "$ai_team_2", 0), (call_script, "script_select_battle_tactic_aux", "$ai_team_2"), (assign, "$ai_team_2_battle_tactic", reg0), (try_end), ]), # script_select_battle_tactic_aux # Input: team_no # Output: battle_tactic ("select_battle_tactic_aux", [ (store_script_param, ":team_no", 1), (assign, ":battle_tactic", 0), (assign, ":defense_not_an_option", 0), (get_player_agent_no, ":player_agent"), (agent_get_team, ":player_team", ":player_agent"), (try_begin), (eq, "$cant_leave_encounter", 1), (teams_are_enemies, ":team_no", ":player_team"), (assign, ":defense_not_an_option", 1), (try_end), (call_script, "script_team_get_class_percentages", ":team_no", 0), # (assign, ":ai_perc_infantry", reg0), (assign, ":ai_perc_archers", reg1), (assign, ":ai_perc_cavalry", reg2), (call_script, "script_team_get_class_percentages", ":team_no", 1),#enemies of the ai_team # (assign, ":enemy_perc_infantry", reg0), # (assign, ":enemy_perc_archers", reg1), # (assign, ":enemy_perc_cavalry", reg2), (store_random_in_range, ":rand", 0, 100), (try_begin), (this_or_next|lt, ":rand", 20), (assign, ":continue", 0), (try_begin), (teams_are_enemies, ":team_no", ":player_team"), (party_slot_eq, "$g_enemy_party", slot_party_type, spt_kingdom_hero_party), (assign, ":continue", 1), (else_try), (neg|teams_are_enemies, ":team_no", ":player_team"), (gt, "$g_ally_party", 0), (party_slot_eq, "$g_ally_party", slot_party_type, spt_kingdom_hero_party), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (try_begin), (eq, ":defense_not_an_option", 0), (gt, ":ai_perc_archers", 50), (lt, ":ai_perc_cavalry", 35), (assign, ":battle_tactic", btactic_hold), (else_try), (lt, ":rand", 80), (assign, ":battle_tactic", btactic_follow_leader), (try_end), (try_end), (assign, reg0, ":battle_tactic"), ]), # script_battle_tactic_init # Input: none # Output: none ("battle_tactic_init", [ (call_script, "script_battle_tactic_init_aux", "$ai_team_1", "$ai_team_1_battle_tactic"), (try_begin), (ge, "$ai_team_2", 0), (call_script, "script_battle_tactic_init_aux", "$ai_team_2", "$ai_team_2_battle_tactic"), (try_end), ]), # script_battle_tactic_init_aux # Input: team_no, battle_tactic # Output: none ("battle_tactic_init_aux", [ (store_script_param, ":team_no", 1), (store_script_param, ":battle_tactic", 2), (team_get_leader, ":ai_leader", ":team_no"), (try_begin), (eq, ":battle_tactic", btactic_hold), (agent_get_position, pos1, ":ai_leader"), (call_script, "script_find_high_ground_around_pos1", ":team_no", 30), (copy_position, pos1, pos52), (call_script, "script_find_high_ground_around_pos1", ":team_no", 30), # call again just in case we are not at peak point. (copy_position, pos1, pos52), (call_script, "script_find_high_ground_around_pos1", ":team_no", 30), # call again just in case we are not at peak point. (team_give_order, ":team_no", grc_everyone, mordr_hold), (team_set_order_position, ":team_no", grc_everyone, pos52), (team_give_order, ":team_no", grc_archers, mordr_advance), (team_give_order, ":team_no", grc_archers, mordr_advance), (else_try), (eq, ":battle_tactic", btactic_follow_leader), (team_get_leader, ":ai_leader", ":team_no"), (agent_set_speed_limit, ":ai_leader", 8), (agent_get_position, pos60, ":ai_leader"), (team_give_order, ":team_no", grc_everyone, mordr_hold), (team_set_order_position, ":team_no", grc_everyone, pos60), (try_end), ]), # script_battle_tactic_apply # Input: none # Output: none ("battle_tactic_apply", [ (call_script, "script_battle_tactic_apply_aux", "$ai_team_1", "$ai_team_1_battle_tactic"), (assign, "$ai_team_1_battle_tactic", reg0), (try_begin), (ge, "$ai_team_2", 0), (call_script, "script_battle_tactic_apply_aux", "$ai_team_2", "$ai_team_2_battle_tactic"), (assign, "$ai_team_2_battle_tactic", reg0), (try_end), ]), # script_battle_tactic_apply_aux # Input: team_no, battle_tactic # Output: battle_tactic ("battle_tactic_apply_aux", [ (store_script_param, ":team_no", 1), (store_script_param, ":battle_tactic", 2), (store_mission_timer_a, ":mission_time"), (try_begin), (eq, ":battle_tactic", btactic_hold), (copy_position, pos1, pos52), (call_script, "script_get_closest3_distance_of_enemies_at_pos1", ":team_no", 1), (assign, ":avg_dist", reg0), (assign, ":min_dist", reg1), (try_begin), (this_or_next|lt, ":min_dist", 1000), (lt, ":avg_dist", 4000), (assign, ":battle_tactic", 0), (team_give_order, ":team_no", grc_everyone, mordr_charge), (try_end), (else_try), (eq, ":battle_tactic", btactic_follow_leader), (team_get_leader, ":ai_leader", ":team_no"), (agent_set_speed_limit, ":ai_leader", 9), (call_script, "script_team_get_average_position_of_enemies", ":team_no"), (copy_position, pos60, pos0), (agent_get_position, pos61, ":ai_leader"), (position_transform_position_to_local, pos62, pos61, pos60), #pos62 = vector to enemy w.r.t leader (position_normalize_origin, ":distance_to_enemy", pos62), (convert_from_fixed_point, ":distance_to_enemy"), (assign, reg17, ":distance_to_enemy"), (position_get_x, ":dir_x", pos62), (position_get_y, ":dir_y", pos62), (val_mul, ":dir_x", 23), (val_mul, ":dir_y", 23), #move 23 meters (position_set_x, pos62, ":dir_x"), (position_set_y, pos62, ":dir_y"), (position_transform_position_to_parent, pos63, pos61, pos62), #pos63 is 23m away from leader in the direction of the enemy. (position_set_z_to_ground_level, pos63), (team_give_order, ":team_no", grc_everyone, mordr_hold), (team_set_order_position, ":team_no", grc_everyone, pos63), # (team_give_order, ":team_no", grc_everyone, mordr_follow), (agent_get_position, pos1, ":ai_leader"), # (call_script, "script_get_closest3_distance_of_enemies_at_pos1", ":team_no"), # (assign, ":avg_dist", reg0), # (assign, ":min_dist", reg1), (try_begin), (lt, ":distance_to_enemy", 50), (ge, ":mission_time", 30), (assign, ":battle_tactic", 0), (team_give_order, ":team_no", grc_everyone, mordr_charge), (agent_set_speed_limit, ":ai_leader", 60), (try_end), (try_end), (try_begin), # charge everyone after a while (neq, ":battle_tactic", 0), (ge, ":mission_time", 300), (assign, ":battle_tactic", 0), (team_give_order, ":team_no", grc_everyone, mordr_charge), (team_get_leader, ":ai_leader", ":team_no"), (agent_set_speed_limit, ":ai_leader", 60), (try_end), (assign, reg0, ":battle_tactic"), ]), ## # script_siege_defender_tactic_apply ## # Input: none ## # Output: none ## ("siege_defender_tactic_apply", ## [ ## (try_begin), ## (eq, "$defender_team", 1), ## (ge, "$belfry_positioned", 2), ## ## (assign, ":enemy_too_weak", 0), ## (try_begin), ## (ge, "$attacker_reinforcement_stage", 2), ## (call_script, "script_calculate_team_strength", "$defender_team"), ## (assign, ":defender_strength", reg0), ## (call_script, "script_calculate_team_strength", "$attacker_team"), ## (assign, ":attacker_strength", reg0), ## (store_mul, ":attacker_strength_multiplied", ":attacker_strength", 2), ## (ge, ":defender_strength", ":attacker_strength_multiplied"), ## (assign, ":enemy_too_weak", 1), ## (try_end), ## ## (try_begin), ## (eq, ":enemy_too_weak", 1), ## (neq, "$ai_battle_tactic", btactic_charge), ## (assign, "$ai_battle_tactic", btactic_charge), ## (team_give_order, "$defender_team", grc_infantry, mordr_charge), ## (else_try), ## (neq, "$ai_battle_tactic", btactic_charge), ## (neq, "$ai_battle_tactic", btactic_hold), ## (assign, "$ai_battle_tactic", btactic_hold), ## (team_give_order, "$defender_team", grc_infantry, mordr_hold), ## (team_give_order, "$defender_team", grc_heroes, mordr_hold), ## (entry_point_get_position,pos1,10), ## (team_set_order_position, "$defender_team", grc_infantry, pos1), ## (team_set_order_position, "$defender_team", grc_heroes, pos1), ## (try_end), ## (try_end), ## ]), # script_team_get_class_percentages # Input: arg1: team_no, arg2: try for team's enemies # Output: reg0: percentage infantry, reg1: percentage archers, reg2: percentage cavalry ("team_get_class_percentages", [ (assign, ":num_infantry", 0), (assign, ":num_archers", 0), (assign, ":num_cavalry", 0), (assign, ":num_total", 0), (store_script_param, ":team_no", 1), (store_script_param, ":negate", 2), (try_for_agents,":cur_agent"), (agent_is_alive, ":cur_agent"), (agent_is_human, ":cur_agent"), (agent_get_team, ":agent_team", ":cur_agent"), (assign, ":continue", 0), (try_begin), (eq, ":negate", 1), (teams_are_enemies, ":agent_team", ":team_no"), (assign, ":continue", 1), (else_try), (eq, ":agent_team", ":team_no"), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (val_add, ":num_total", 1), (agent_get_class, ":agent_class", ":cur_agent"), (try_begin), (eq, ":agent_class", grc_infantry), (val_add, ":num_infantry", 1), (else_try), (eq, ":agent_class", grc_archers), (val_add, ":num_archers", 1), (else_try), (eq, ":agent_class", grc_cavalry), (val_add, ":num_cavalry", 1), (try_end), (try_end), (try_begin), (eq, ":num_total", 0), (assign, ":num_total", 1), (try_end), (store_mul, ":perc_infantry",":num_infantry",100), (val_div, ":perc_infantry",":num_total"), (store_mul, ":perc_archers",":num_archers",100), (val_div, ":perc_archers",":num_total"), (store_mul, ":perc_cavalry",":num_cavalry",100), (val_div, ":perc_cavalry",":num_total"), (assign, reg0, ":perc_infantry"), (assign, reg1, ":perc_archers"), (assign, reg2, ":perc_cavalry"), ]), # script_get_closest3_distance_of_enemies_at_pos1 # Input: arg1: team_no, pos1 # Output: reg0: distance in cms. ("get_closest3_distance_of_enemies_at_pos1", [ (assign, ":min_distance_1", 100000), (assign, ":min_distance_2", 100000), (assign, ":min_distance_3", 100000), (store_script_param, ":team_no", 1), (try_for_agents,":cur_agent"), (agent_is_alive, ":cur_agent"), (agent_is_human, ":cur_agent"), (agent_get_team, ":agent_team", ":cur_agent"), (teams_are_enemies, ":agent_team", ":team_no"), (agent_get_position, pos2, ":cur_agent"), (get_distance_between_positions,":cur_dist",pos2,pos1), (try_begin), (lt, ":cur_dist", ":min_distance_1"), (assign, ":min_distance_3", ":min_distance_2"), (assign, ":min_distance_2", ":min_distance_1"), (assign, ":min_distance_1", ":cur_dist"), (else_try), (lt, ":cur_dist", ":min_distance_2"), (assign, ":min_distance_3", ":min_distance_2"), (assign, ":min_distance_2", ":cur_dist"), (else_try), (lt, ":cur_dist", ":min_distance_3"), (assign, ":min_distance_3", ":cur_dist"), (try_end), (try_end), (assign, ":total_distance", 0), (assign, ":total_count", 0), (try_begin), (lt, ":min_distance_1", 100000), (val_add, ":total_distance", ":min_distance_1"), (val_add, ":total_count", 1), (try_end), (try_begin), (lt, ":min_distance_2", 100000), (val_add, ":total_distance", ":min_distance_2"), (val_add, ":total_count", 1), (try_end), (try_begin), (lt, ":min_distance_3", 100000), (val_add, ":total_distance", ":min_distance_3"), (val_add, ":total_count", 1), (try_end), (assign, ":average_distance", 100000), (try_begin), (gt, ":total_count", 0), (store_div, ":average_distance", ":total_distance", ":total_count"), (try_end), (assign, reg0, ":average_distance"), (assign, reg1, ":min_distance_1"), (assign, reg2, ":min_distance_2"), (assign, reg3, ":min_distance_3"), ]), # script_team_get_average_position_of_enemies # Input: arg1: team_no, # Output: pos0: average position. ("team_get_average_position_of_enemies", [ (store_script_param_1, ":team_no"), (init_position, pos0), (assign, ":num_enemies", 0), (assign, ":accum_x", 0), (assign, ":accum_y", 0), (assign, ":accum_z", 0), (try_for_agents,":enemy_agent"), (agent_is_alive, ":enemy_agent"), (agent_is_human, ":enemy_agent"), (agent_get_team, ":enemy_team", ":enemy_agent"), (teams_are_enemies, ":team_no", ":enemy_team"), (agent_get_position, pos62, ":enemy_agent"), (position_get_x, ":x", pos62), (position_get_y, ":y", pos62), (position_get_z, ":z", pos62), (val_add, ":accum_x", ":x"), (val_add, ":accum_y", ":y"), (val_add, ":accum_z", ":z"), (val_add, ":num_enemies", 1), (try_end), (store_div, ":average_x", ":accum_x", ":num_enemies"), (store_div, ":average_y", ":accum_y", ":num_enemies"), (store_div, ":average_z", ":accum_z", ":num_enemies"), (position_set_x, pos0, ":average_x"), (position_set_y, pos0, ":average_y"), (position_set_z, pos0, ":average_z"), (assign, reg0, ":num_enemies"), ]), # script_search_troop_prisoner_of_party # Input: arg1 = troop_no # Output: reg0 = party_no (-1 if troop is not a prisoner.) ("search_troop_prisoner_of_party", [ (store_script_param_1, ":troop_no"), (assign, ":prisoner_of", -1), (try_for_parties, ":party_no"), (eq, ":prisoner_of", -1), (this_or_next|eq, ":party_no", "p_main_party"), (ge, ":party_no", centers_begin), (party_count_prisoners_of_type, ":troop_found", ":party_no", ":troop_no"), (gt, ":troop_found", 0), (assign, ":prisoner_of", ":party_no"), (try_end), (assign, reg0, ":prisoner_of"), ]), ## # script_clear_last_quest ## # Input: arg1 = troop_no ## # Output: none ## ("clear_last_quest", ## [ ## (store_script_param_1, ":troop_no"), ## ## (troop_set_slot, ":troop_no",slot_troop_last_quest, 0), ## (troop_set_slot, ":troop_no",slot_troop_last_quest_betrayed, 0) ## ]), # script_change_debt_to_troop # Input: arg1 = troop_no, arg2 = new debt amount # Output: none ("change_debt_to_troop", [ (store_script_param_1, ":troop_no"), (store_script_param_2, ":new_debt"), (troop_get_slot, ":cur_debt", ":troop_no", slot_troop_player_debt), (assign, reg1, ":cur_debt"), (val_add, ":cur_debt", ":new_debt"), (assign, reg2, ":cur_debt"), (troop_set_slot, ":troop_no", slot_troop_player_debt, ":cur_debt"), (str_store_troop_name_link, s1, ":troop_no"), (display_message, "@You now owe {reg2} denars to {s1}."), ]), # script_abort_quest # Input: arg1 = quest_no, arg2 = apply relation penalty # Output: none ("abort_quest", [ (store_script_param_1, ":quest_no"), (store_script_param_2, ":abort_type"), #0=aborted by event, 1=abort by talking 2=abort by expire (assign, ":quest_return_penalty", -1), (assign, ":quest_expire_penalty", -2), # (quest_get_slot, ":quest_object_troop", ":quest_no", slot_quest_object_troop), (try_begin), (this_or_next|eq, ":quest_no", "qst_deliver_message"), (eq, ":quest_no", "qst_deliver_message_to_enemy_lord"), (assign, ":quest_return_penalty", -2), (assign, ":quest_expire_penalty", -3), (else_try), (eq, ":quest_no", "qst_escort_lady"), (quest_get_slot, ":quest_object_troop", "qst_escort_lady", slot_quest_object_troop), (party_remove_members, "p_main_party", ":quest_object_troop", 1), (assign, ":quest_return_penalty", -2), (assign, ":quest_expire_penalty", -3), ## (else_try), ## (eq, ":quest_no", "qst_rescue_lady_under_siege"), ## (party_remove_members, "p_main_party", ":quest_object_troop", 1), ## (else_try), ## (eq, ":quest_no", "qst_deliver_message_to_lover"), ## (else_try), ## (eq, ":quest_no", "qst_bring_prisoners_to_enemy"), ## (try_begin), ## (check_quest_succeeded, ":quest_no"), ## (quest_get_slot, ":quest_target_amount", ":quest_no", slot_quest_target_amount), ## (quest_get_slot, ":quest_object_troop", ":quest_no", slot_quest_object_troop), ## (quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop), ## (call_script, "script_game_get_join_cost", ":quest_object_troop"), ## (assign, ":reward", reg0), ## (val_mul, ":reward", ":quest_target_amount"), ## (val_div, ":reward", 2), ## (else_try), ## (quest_get_slot, ":reward", ":quest_no", slot_quest_target_amount), ## (try_end), ## (call_script, "script_change_debt_to_troop", ":quest_giver_troop", ":reward"), ## (else_try), ## (eq, ":quest_no", "qst_bring_reinforcements_to_siege"), ## (quest_get_slot, ":quest_target_amount", ":quest_no", slot_quest_target_amount), ## (quest_get_slot, ":quest_object_troop", ":quest_no", slot_quest_object_troop), ## (quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop), ## (call_script, "script_game_get_join_cost", ":quest_object_troop"), ## (assign, ":reward", reg0), ## (val_mul, ":reward", ":quest_target_amount"), ## (val_mul, ":reward", 2), ## (call_script, "script_change_debt_to_troop", ":quest_giver_troop", ":reward"), ## (else_try), ## (eq, ":quest_no", "qst_deliver_supply_to_center_under_siege"), ## (quest_get_slot, ":quest_target_amount", ":quest_no", slot_quest_target_amount), ## (quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop), ## (store_item_value, ":reward", "itm_siege_supply"), ## (val_mul, ":reward", ":quest_target_amount"), ## (call_script, "script_change_debt_to_troop", ":quest_giver_troop", ":reward"), (else_try), (eq, ":quest_no", "qst_raise_troops"), (quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop), (call_script, "script_change_debt_to_troop", ":quest_giver_troop", 100), (assign, ":quest_return_penalty", -4), (assign, ":quest_expire_penalty", -5), (else_try), (eq, ":quest_no", "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), (assign, ":quest_return_penalty", -4), (assign, ":quest_expire_penalty", -5), (else_try), (eq, ":quest_no", "qst_deal_with_bandits_at_lords_village"), (quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop), (call_script, "script_change_debt_to_troop", ":quest_giver_troop", 200), (assign, ":quest_return_penalty", -5), (assign, ":quest_expire_penalty", -6), (else_try), (eq, ":quest_no", "qst_collect_taxes"), (quest_get_slot, ":gold_reward", ":quest_no", slot_quest_gold_reward), (quest_set_slot, ":quest_no", slot_quest_gold_reward, 0), (quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop), (call_script, "script_change_debt_to_troop", ":quest_giver_troop", ":gold_reward"), (assign, ":quest_return_penalty", -4), (assign, ":quest_expire_penalty", -6), ## (else_try), ## (eq, ":quest_no", "qst_capture_messenger"), ## (else_try), ## (eq, ":quest_no", "qst_bring_back_deserters"), (else_try), (eq, ":quest_no", "qst_hunt_down_fugitive"), (assign, ":quest_return_penalty", -3), (assign, ":quest_expire_penalty", -4), (else_try), (eq, ":quest_no", "qst_kill_local_merchant"), (else_try), (eq, ":quest_no", "qst_bring_back_runaway_serfs"), (assign, ":quest_return_penalty", -1), (assign, ":quest_expire_penalty", -1), (else_try), (eq, ":quest_no", "qst_lend_companion"), (else_try), (eq, ":quest_no", "qst_collect_debt"), (try_begin), (quest_slot_eq, "qst_collect_debt", slot_quest_current_state, 1), #debt collected but not delivered (quest_get_slot, ":debt", "qst_collect_debt", slot_quest_target_amount), (quest_get_slot, ":quest_giver", "qst_collect_debt", slot_quest_giver_troop), (call_script, "script_change_debt_to_troop", ":quest_giver", ":debt"), (assign, ":quest_return_penalty", -3), (assign, ":quest_expire_penalty", -6), (else_try), (assign, ":quest_return_penalty", -3), (assign, ":quest_expire_penalty", -4), (try_end), (else_try), (eq, ":quest_no", "qst_deal_with_bandits_at_lords_village"), (assign, ":quest_return_penalty", -6), (assign, ":quest_expire_penalty", -6), (else_try), (eq, ":quest_no", "qst_raid_caravan_to_start_war"), (assign, ":quest_return_penalty", -10), (assign, ":quest_expire_penalty", -13), (else_try), (eq, ":quest_no", "qst_persuade_lords_to_make_peace"), (assign, ":quest_return_penalty", -10), (assign, ":quest_expire_penalty", -13), (else_try), (eq, ":quest_no", "qst_deal_with_night_bandits"), (assign, ":quest_return_penalty", -1), (assign, ":quest_expire_penalty", -1), (else_try), (eq, ":quest_no", "qst_follow_spy"), (assign, ":quest_return_penalty", -2), (assign, ":quest_expire_penalty", -3), (try_begin), (party_is_active, "$qst_follow_spy_spy_party"), (remove_party, "$qst_follow_spy_spy_party"), (try_end), (try_begin), (party_is_active, "$qst_follow_spy_spy_partners_party"), (remove_party, "$qst_follow_spy_spy_partners_party"), (try_end), (else_try), (eq, ":quest_no", "qst_capture_enemy_hero"), (assign, ":quest_return_penalty", -3), (assign, ":quest_expire_penalty", -4), ## (else_try), ## (eq, ":quest_no", "qst_lend_companion"), ## (quest_get_slot, ":quest_target_troop", "qst_lend_companion", slot_quest_target_troop), ## (party_add_members, "p_main_party", ":quest_target_troop", 1), ## (else_try), ## (eq, ":quest_no", "qst_capture_conspirators"), ## (else_try), ## (eq, ":quest_no", "qst_defend_nobles_against_peasants"), (else_try), (eq, ":quest_no", "qst_incriminate_loyal_commander"), (assign, ":quest_return_penalty", -5), (assign, ":quest_expire_penalty", -6), ## (else_try), ## (eq, ":quest_no", "qst_hunt_down_raiders"), ## (else_try), ## (eq, ":quest_no", "qst_capture_prisoners"), ## #Enemy lord quests (else_try), (eq, ":quest_no", "qst_lend_surgeon"), #Kingdom lady quests (else_try), (eq, ":quest_no", "qst_rescue_lord_by_replace"), (assign, ":quest_return_penalty", -1), (assign, ":quest_expire_penalty", -1), (else_try), (eq, ":quest_no", "qst_deliver_message_to_prisoner_lord"), (assign, ":quest_return_penalty", 0), (assign, ":quest_expire_penalty", -1), (else_try), (eq, ":quest_no", "qst_duel_for_lady"), (assign, ":quest_return_penalty", -1), (assign, ":quest_expire_penalty", -1), #Kingdom Army quests (else_try), (eq, ":quest_no", "qst_follow_army"), (assign, ":quest_return_penalty", -4), (assign, ":quest_expire_penalty", -5), (else_try), (eq, ":quest_no", "qst_deliver_cattle_to_army"), (assign, ":quest_return_penalty", -1), (assign, ":quest_expire_penalty", -2), (else_try), (eq, ":quest_no", "qst_join_siege_with_army"), (assign, ":quest_return_penalty", -1), (assign, ":quest_expire_penalty", -2), (else_try), (eq, ":quest_no", "qst_scout_waypoints"), (assign, ":quest_return_penalty", -1), (assign, ":quest_expire_penalty", -2), #Village Elder quests (else_try), (eq, ":quest_no", "qst_deliver_grain"), (assign, ":quest_return_penalty", -6), (assign, ":quest_expire_penalty", -7), (else_try), (eq, ":quest_no", "qst_deliver_cattle"), (assign, ":quest_return_penalty", -3), (assign, ":quest_expire_penalty", -4), (else_try), (eq, ":quest_no", "qst_train_peasants_against_bandits"), (assign, ":quest_return_penalty", -4), (assign, ":quest_expire_penalty", -5), #Mayor quests (else_try), (eq, ":quest_no", "qst_deliver_wine"), (assign, ":quest_return_penalty", -1), (assign, ":quest_expire_penalty", -3), (val_add, "$debt_to_merchants_guild", "$qst_deliver_wine_debt"), (else_try), (eq, ":quest_no", "qst_move_cattle_herd"), (assign, ":quest_return_penalty", -1), (assign, ":quest_expire_penalty", -3), (else_try), (eq, ":quest_no", "qst_escort_merchant_caravan"), (assign, ":quest_return_penalty", -1), (assign, ":quest_expire_penalty", -3), (else_try), (eq, ":quest_no", "qst_troublesome_bandits"), (assign, ":quest_return_penalty", -1), (assign, ":quest_expire_penalty", -2), #Other quests (else_try), (eq, ":quest_no", "qst_join_faction"), (assign, ":quest_return_penalty", -3), (assign, ":quest_expire_penalty", -3), (try_begin), (call_script, "script_get_number_of_hero_centers", "trp_player"), (gt, reg0, 0), (call_script, "script_change_player_relation_with_faction", "$g_invite_faction", -10), (try_end), (assign, "$g_invite_faction", 0), (assign, "$g_invite_faction_lord", 0), (assign, "$g_invite_offered_center", 0), (else_try), (eq, ":quest_no", "qst_eliminate_bandits_infesting_village"), (assign, ":quest_return_penalty", -3), (assign, ":quest_expire_penalty", -3), (try_end), (try_begin), (gt, ":abort_type", 0), (quest_get_slot, ":quest_giver", ":quest_no", slot_quest_giver_troop), (assign, ":relation_penalty", ":quest_return_penalty"), (try_begin), (eq, ":abort_type", 2), (assign, ":relation_penalty", ":quest_expire_penalty"), (try_end), (try_begin), (this_or_next|is_between, ":quest_giver", village_elders_begin, village_elders_end), (is_between, ":quest_giver", mayors_begin, mayors_end), (quest_get_slot, ":quest_giver_center", ":quest_no", slot_quest_giver_center), (call_script, "script_change_player_relation_with_center", ":quest_giver_center", ":relation_penalty"), (else_try), (call_script, "script_change_player_relation_with_troop", ":quest_giver", ":relation_penalty"), (try_end), (try_end), (fail_quest, ":quest_no"), #NPC companion changes begin (try_begin), (gt, ":abort_type", 0), (call_script, "script_objectionable_action", tmt_honest, "str_fail_quest"), (try_end), #NPC companion changes end (call_script, "script_end_quest", ":quest_no"), ]), ## # script_event_center_captured ## # Input: arg1 = center_no, arg2 = old_faction_no ## # Output: none ## ("event_center_captured", ## [ ## # (store_script_param_1, ":center_no"), ## # (store_script_param_2, ":old_faction_no"), ## # (store_faction_of_party, ":faction_no"), ## ## (try_begin), ## (check_quest_active, "qst_deliver_message"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_escort_lady"), ## (quest_slot_eq, "qst_escort_lady", slot_quest_target_center, ":center_no"), ## (call_script, "script_abort_quest", "qst_escort_lady"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_rescue_lady_under_siege"), ## (quest_slot_eq, "qst_rescue_lady_under_siege", slot_quest_target_center, ":center_no"), ## (quest_slot_eq, "qst_rescue_lady_under_siege", slot_quest_current_state, 0), ## (call_script, "script_abort_quest", "qst_rescue_lady_under_siege", 1), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_deliver_message_to_lover"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_deliver_message_to_enemy_lord"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_bring_prisoners_to_enemy"), ## (quest_slot_eq, "qst_bring_prisoners_to_enemy", slot_quest_target_center, ":center_no"), ## (neg|check_quest_succeeded, "qst_bring_prisoners_to_enemy"), ## (call_script, "script_abort_quest", "qst_bring_prisoners_to_enemy"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_bring_reinforcements_to_siege"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_deliver_supply_to_center_under_siege"), ## (quest_slot_eq, "qst_deliver_supply_to_center_under_siege", slot_quest_target_center, ":center_no"), ## (call_script, "script_abort_quest", "qst_deliver_supply_to_center_under_siege", 1), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_raise_troops"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_capture_messenger"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_bring_back_deserters"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_kill_local_merchant"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_bring_back_runaway_serfs"), ## (quest_slot_eq, "qst_bring_back_runaway_serfs", slot_quest_object_center, ":center_no"), ## (neg|check_quest_succeeded, "qst_bring_back_runaway_serfs"), ## (neg|check_quest_failed, "qst_bring_back_runaway_serfs"), ## (call_script, "script_abort_quest", "qst_bring_back_runaway_serfs"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_follow_spy"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_capture_enemy_hero"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_lend_companion"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_capture_conspirators"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_defend_nobles_against_peasants"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_incriminate_loyal_commander"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_hunt_down_raiders"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_capture_prisoners"), ## (try_end), ## #Enemy lord quests ## (try_begin), ## (check_quest_active, "qst_lend_surgeon"), ## (try_end), ## #Kingdom lady quests ## (try_begin), ## (check_quest_active, "qst_rescue_lord_by_replace"), ## (quest_get_slot, ":quest_target_troop", "qst_rescue_lord_by_replace", slot_quest_target_troop), ## (troop_slot_eq, ":quest_target_troop", slot_troop_is_prisoner, 0), ## (neg|check_quest_succeeded, "qst_rescue_lord_by_replace"), ## (call_script, "script_abort_quest", "qst_rescue_lord_by_replace"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_deliver_message_to_prisoner_lord"), ## (try_end), ## (try_begin), ## (check_quest_active, "qst_duel_for_lady"), ## (try_end), ## ]), # script_cf_is_quest_troop # Input: arg1 = troop_no # Output: none (can fail) ("cf_is_quest_troop", [ (store_script_param_1, ":troop_no"), (assign, ":is_quest_troop", 0), (try_for_range, ":cur_quest", all_quests_begin, all_quests_end), (check_quest_active, ":cur_quest"), (quest_get_slot, ":quest_troop_1", ":cur_quest", slot_quest_target_troop), (quest_get_slot, ":quest_troop_2", ":cur_quest", slot_quest_object_troop), (quest_get_slot, ":quest_troop_3", ":cur_quest", slot_quest_giver_troop), (this_or_next|eq, ":quest_troop_1", ":troop_no"), (this_or_next|eq, ":quest_troop_2", ":troop_no"), (eq, ":quest_troop_3", ":troop_no"), (assign, ":is_quest_troop", 1), (try_end), (eq, ":is_quest_troop", 1), ]), ## # script_calculate_team_strength ## # Input: arg1 = team_no ## # Output: strength ## ("calculate_team_strength", ## [ ## (store_script_param_1, ":team_no"), ## (assign, ":total_strength", 0), ## (try_for_agents, ":cur_agent"), ## (agent_get_team, ":agent_team", ":cur_agent"), ## (eq, ":team_no", ":agent_team"), ## (agent_is_human, ":cur_agent"), ## (agent_is_alive, ":cur_agent"), ## ## (agent_get_troop_id, ":cur_troop", ":cur_agent"), ## (store_character_level, ":cur_level", ":cur_troop"), ## (val_add, ":cur_level", 5), ## (try_begin), ## (troop_is_hero, ":cur_troop"), ## (val_add, ":cur_level", 5), ## (try_end), ## (val_add, ":total_strength", ":cur_level"), ## (try_end), ## (assign, reg0, ":total_strength"), ## ]), # script_check_friendly_kills # Input: none # Output: none (changes the morale of the player's party) ("check_friendly_kills", [(get_player_agent_own_troop_kill_count, ":count"), (try_begin), (neq, "$g_player_current_own_troop_kills", ":count"), (val_sub, ":count", "$g_player_current_own_troop_kills"), (val_add, "$g_player_current_own_troop_kills", ":count"), (val_mul, ":count", -1), (call_script, "script_change_player_party_morale", ":count"), (try_end), ]), # script_simulate_retreat # Input: arg1 = players_side_damage, arg2 = enemy_side_damage, s5 = title_string # Output: none ("simulate_retreat", [ (call_script, "script_music_set_situation_with_culture", mtf_sit_killed), (set_show_messages, 0), (store_script_param, ":players_side_damage", 1), (store_script_param, ":enemy_side_damage", 2), (assign, ":players_side_strength", 0), (assign, ":enemy_side_strength", 0), (assign, ":do_calculate", 1), (try_begin), (try_for_agents, ":cur_agent"), (agent_is_human, ":cur_agent"), (agent_is_alive, ":cur_agent"), (agent_set_slot, ":cur_agent", slot_agent_is_alive_before_retreat, 1),#needed for simulation (agent_get_troop_id, ":cur_troop", ":cur_agent"), (store_character_level, ":cur_level", ":cur_troop"), (val_add, ":cur_level", 5), (try_begin), (troop_is_hero, ":cur_troop"), (val_add, ":cur_level", 5), (try_end), (try_begin), (agent_is_ally, ":cur_agent"), (val_add, ":players_side_strength", ":cur_level"), (else_try), (val_add, ":enemy_side_strength", ":cur_level"), (try_end), (try_end), (eq, "$pin_player_fallen", 0), (lt, ":enemy_side_strength", ":players_side_strength"), (assign, ":do_calculate", 0), (try_end), (try_begin), (eq, ":do_calculate", 1), (assign, "$g_last_mission_player_damage", 0), (party_clear, "p_temp_party"), (party_clear, "p_temp_party_2"), (call_script, "script_simulate_battle_with_agents_aux", 0, ":players_side_damage"), (call_script, "script_simulate_battle_with_agents_aux", 1, ":enemy_side_damage"), (assign, ":display_casualties", 0), (try_begin), (gt, "$g_last_mission_player_damage", 0), (assign, ":display_casualties", 1), (assign, reg1, "$g_last_mission_player_damage"), (str_store_string, s12, "str_casualty_display_hp"), (else_try), (str_clear, s12), (try_end), (call_script, "script_print_casualties_to_s0", "p_temp_party", 1), (try_begin), (party_get_num_companion_stacks, ":num_stacks", "p_temp_party"), (gt, ":num_stacks", 0), (assign, ":display_casualties", 1), (try_end), (str_store_string_reg, s10, s0), (call_script, "script_print_casualties_to_s0", "p_temp_party_2", 1), (try_begin), (party_get_num_companion_stacks, ":num_stacks", "p_temp_party_2"), (gt, ":num_stacks", 0), (assign, ":display_casualties", 1), (try_end), (str_store_string_reg, s11, s0), (try_begin), (eq, ":display_casualties", 1), (dialog_box,"str_casualty_display", s5), (try_end), (try_end), (set_show_messages, 1), #Calculating morale penalty (can be between 0-30) (assign, ":ally_casualties", 0), (assign, ":enemy_casualties", 0), (assign, ":total_allies", 0), (try_for_agents, ":cur_agent"), (agent_is_human, ":cur_agent"), (try_begin), (agent_is_ally, ":cur_agent"), (val_add, ":total_allies", 1), (try_begin), (neg|agent_is_alive, ":cur_agent"), (val_add, ":ally_casualties", 1), (try_end), (else_try), (neg|agent_is_alive, ":cur_agent"), (val_add, ":enemy_casualties", 1), (try_end), (try_end), (store_add, ":total_casualties", ":ally_casualties", ":enemy_casualties"), (try_begin), (gt, ":total_casualties", 0), (store_mul, ":morale_adder", ":ally_casualties", 100), (val_div, ":morale_adder", ":total_casualties"), (val_mul, ":morale_adder", ":ally_casualties"), (val_div, ":morale_adder", ":total_allies"), (val_mul, ":morale_adder", -30), (val_div, ":morale_adder", 100), (call_script, "script_change_player_party_morale", ":morale_adder"), (try_end), ]), # script_simulate_battle_with_agents_aux # For internal use only # Input: arg1 = attacker_side (0 = ally, 1 = enemy), arg2 = damage amount # Output: none ("simulate_battle_with_agents_aux", [ (store_script_param_1, ":attacker_side"), (store_script_param_2, ":damage"), (get_player_agent_no, ":player_agent"), (try_for_agents, ":cur_agent"), (neq, ":player_agent", ":cur_agent"), (agent_is_human, ":cur_agent"), #do not check agent_is_alive, check slot_agent_is_alive_before_retreat instead, so that dead agents can still hit enemies (agent_slot_eq, ":cur_agent", slot_agent_is_alive_before_retreat, 1), (try_begin), (agent_is_ally, ":cur_agent"), (assign, ":cur_agents_side", 0), (else_try), (assign, ":cur_agents_side", 1), (try_end), (eq, ":cur_agents_side", ":attacker_side"), (agent_get_position, pos2, ":cur_agent"), (assign, ":closest_agent", -1), (assign, ":min_distance", 100000), (try_for_agents, ":cur_agent_2"), (agent_is_human, ":cur_agent_2"), (agent_is_alive, ":cur_agent_2"), (try_begin), (agent_is_ally, ":cur_agent_2"), (assign, ":cur_agents_side_2", 0), (else_try), (assign, ":cur_agents_side_2", 1), (try_end), (this_or_next|neq, ":cur_agent_2", ":player_agent"), (eq, "$pin_player_fallen", 0), (neq, ":attacker_side", ":cur_agents_side_2"), (agent_get_position, pos3, ":cur_agent_2"), (get_distance_between_positions, ":cur_distance", pos2, pos3), (lt, ":cur_distance", ":min_distance"), (assign, ":min_distance", ":cur_distance"), (assign, ":closest_agent", ":cur_agent_2"), (try_end), (ge, ":closest_agent", 0), #Fight (agent_get_class, ":agent_class", ":cur_agent"), (assign, ":agents_speed", 1), (assign, ":agents_additional_hit", 0), (try_begin), (eq, ":agent_class", grc_archers), (assign, ":agents_additional_hit", 2), (else_try), (eq, ":agent_class", grc_cavalry), (assign, ":agents_speed", 2), (try_end), (agent_get_class, ":agent_class", ":closest_agent"), (assign, ":agents_speed_2", 1), (try_begin), (eq, ":agent_class", grc_cavalry), (assign, ":agents_speed_2", 2), (try_end), (assign, ":agents_hit", 18000), (val_add, ":min_distance", 3000), (val_div, ":agents_hit", ":min_distance"), (val_mul, ":agents_hit", 2),# max 10, min 2 hits within 150 meters (val_mul, ":agents_hit", ":agents_speed"), (val_div, ":agents_hit", ":agents_speed_2"), (val_add, ":agents_hit", ":agents_additional_hit"), (assign, ":cur_damage", ":damage"), (agent_get_troop_id, ":closest_troop", ":closest_agent"), (agent_get_troop_id, ":cur_troop", ":cur_agent"), (store_character_level, ":closest_level", ":closest_troop"), (store_character_level, ":cur_level", ":cur_troop"), (store_sub, ":level_dif", ":cur_level", ":closest_level"), (val_div, ":level_dif", 5), (val_add, ":cur_damage", ":level_dif"), (try_begin), (eq, ":closest_agent", ":player_agent"), (val_div, ":cur_damage", 2), (store_agent_hit_points, ":init_player_hit_points", ":player_agent", 1), (try_end), (try_for_range, ":unused", 0, ":agents_hit"), (store_random_in_range, ":random_damage", 0, 100), (lt, ":random_damage", ":cur_damage"), (agent_deliver_damage_to_agent, ":cur_agent", ":closest_agent"), (try_end), (try_begin), (eq, ":closest_agent", ":player_agent"), (store_agent_hit_points, ":final_player_hit_points", ":player_agent", 1), (store_sub, ":hit_points_difference", ":init_player_hit_points", ":final_player_hit_points"), (val_add, "$g_last_mission_player_damage", ":hit_points_difference"), (try_end), (neg|agent_is_alive, ":closest_agent"), (try_begin), (eq, ":attacker_side", 1), (party_add_members, "p_temp_party", ":closest_troop", 1), (try_begin), (agent_is_wounded, ":closest_agent"), (party_wound_members, "p_temp_party", ":closest_troop", 1), (try_end), (else_try), (party_add_members, "p_temp_party_2", ":closest_troop", 1), (try_begin), (agent_is_wounded, ":closest_agent"), (party_wound_members, "p_temp_party_2", ":closest_troop", 1), (try_end), (try_end), (try_end), ]), # script_map_get_random_position_around_position_within_range # Input: arg1 = minimum_distance in km, arg2 = maximum_distance in km, pos1 = origin position # Output: pos2 = result position ("map_get_random_position_around_position_within_range", [ (store_script_param_1, ":min_distance"), (store_script_param_2, ":max_distance"), (val_mul, ":min_distance", 100), (assign, ":continue", 1), (try_for_range, ":unused", 0, 20), (eq, ":continue", 1), (map_get_random_position_around_position, pos2, pos1, ":max_distance"), (get_distance_between_positions, ":distance", pos2, pos1), (ge, ":distance", ":min_distance"), (assign, ":continue", 0), (try_end), ]), # script_get_number_of_unclaimed_centers_by_player # Input: none # Output: reg0 = number of unclaimed centers, reg1 = last unclaimed center_no ("get_number_of_unclaimed_centers_by_player", [ (assign, ":unclaimed_centers", 0), (assign, reg1, -1), (try_for_range, ":center_no", centers_begin, centers_end), (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, 0), (party_get_num_companion_stacks, ":num_stacks", ":center_no"), (ge, ":num_stacks", 1), #castle is garrisoned (assign, reg1, ":center_no"), (val_add, ":unclaimed_centers", 1), (try_end), (assign, reg0, ":unclaimed_centers"), ]), # script_troop_count_number_of_enemy_troops # Input: arg1 = troop_no # Output: reg0 = number_of_enemy_troops ("troop_count_number_of_enemy_troops", [ (store_script_param_1, ":troop_no"), (assign, ":enemy_count", 0), (try_for_range, ":i_enemy_slot", slot_troop_enemies_begin, slot_troop_enemies_end), (troop_slot_ge, ":troop_no", ":i_enemy_slot", 1), (val_add, ":enemy_count", 1), (try_end), (assign, reg0, ":enemy_count"), ]), # script_cf_troop_check_troop_is_enemy # Input: arg1 = troop_no, arg2 = checked_troop_no # Output: none (Can fail) ("cf_troop_check_troop_is_enemy", [ (store_script_param_1, ":troop_no"), (store_script_param_2, ":checked_troop_no"), (assign, ":result", 0), (try_for_range, ":i_enemy_slot", slot_troop_enemies_begin, slot_troop_enemies_end), (troop_slot_eq, ":troop_no", ":i_enemy_slot", ":checked_troop_no"), (assign, ":result", 1), (try_end), (eq, ":result", 1), ]), # script_troop_get_leaded_center_with_index # Input: arg1 = troop_no, arg2 = center index within range between zero and the number of centers that troop owns # Output: reg0 = center_no ("troop_get_leaded_center_with_index", [ (store_script_param_1, ":troop_no"), (store_script_param_2, ":random_center"), (assign, ":result", -1), (assign, ":center_count", 0), (try_for_range, ":center_no", centers_begin, centers_end), (eq, ":result", -1), (party_slot_eq, ":center_no", slot_town_lord, ":troop_no"), (val_add, ":center_count", 1), (gt, ":center_count", ":random_center"), (assign, ":result", ":center_no"), (try_end), (assign, reg0, ":result"), ]), # script_cf_troop_get_random_leaded_walled_center_with_less_strength_priority # Input: arg1 = troop_no, arg2 = preferred_center_no # Output: reg0 = center_no (Can fail) ("cf_troop_get_random_leaded_walled_center_with_less_strength_priority", [ (store_script_param, ":troop_no", 1), (store_script_param, ":preferred_center_no", 2), (assign, ":num_centers", 0), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), (party_slot_eq, ":center_no", slot_town_lord, ":troop_no"), (party_slot_eq, ":center_no", slot_center_is_besieged_by, -1), (val_add, ":num_centers", 1), (try_begin), (eq, ":center_no", ":preferred_center_no"), (val_add, ":num_centers", 99), (try_end), ## (call_script, "script_party_calculate_regular_strength", ":center_no"), ## (assign, ":strength", reg0), ## (lt, ":strength", 80), ## (store_sub, ":strength", 100, ":strength"), ## (val_div, ":strength", 20), ## (val_add, ":num_centers", ":strength"), (try_end), (gt, ":num_centers", 0), (store_random_in_range, ":random_center", 0, ":num_centers"), (assign, ":result", -1), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), (eq, ":result", -1), (party_slot_eq, ":center_no", slot_town_lord, ":troop_no"), (party_slot_eq, ":center_no", slot_center_is_besieged_by, -1), (val_sub, ":random_center", 1), (try_begin), (eq, ":center_no", ":preferred_center_no"), (val_sub, ":random_center", 99), (try_end), ## (try_begin), ## (call_script, "script_party_calculate_regular_strength", ":center_no"), ## (assign, ":strength", reg0), ## (lt, ":strength", 80), ## (store_sub, ":strength", 100, ":strength"), ## (val_div, ":strength", 20), ## (val_sub, ":random_center", ":strength"), ## (try_end), (lt, ":random_center", 0), (assign, ":result", ":center_no"), (try_end), (assign, reg0, ":result"), ]), # script_cf_troop_get_random_leaded_town_or_village_except_center # Input: arg1 = troop_no, arg2 = except_center_no # Output: reg0 = center_no (Can fail) ("cf_troop_get_random_leaded_town_or_village_except_center", [ (store_script_param_1, ":troop_no"), (store_script_param_2, ":except_center_no"), (assign, ":num_centers", 0), (try_for_range, ":center_no", centers_begin, centers_end), (neg|party_slot_eq, ":center_no", slot_party_type, spt_castle), (party_slot_eq, ":center_no", slot_town_lord, ":troop_no"), (neq, ":center_no", ":except_center_no"), (val_add, ":num_centers", 1), (try_end), (gt, ":num_centers", 0), (store_random_in_range, ":random_center", 0, ":num_centers"), (assign, ":end_cond", centers_end), (try_for_range, ":center_no", centers_begin, ":end_cond"), (neg|party_slot_eq, ":center_no", slot_party_type, spt_castle), (party_slot_eq, ":center_no", slot_town_lord, ":troop_no"), (neq, ":center_no", ":except_center_no"), (val_sub, ":random_center", 1), (lt, ":random_center", 0), (assign, ":target_center", ":center_no"), (assign, ":end_cond", 0), (try_end), (assign, reg0, ":target_center"), ]), # script_troop_write_owned_centers_to_s2 # Input: arg1 = troop_no # Output: none ("troop_write_owned_centers_to_s2", [ (store_script_param_1, ":troop_no"), (call_script, "script_get_number_of_hero_centers", ":troop_no"), (assign, ":no_centers", reg0), (str_store_troop_name, s5, ":troop_no"), (try_begin), (gt, ":no_centers", 1), (try_for_range, ":i_center", 1, ":no_centers"), (call_script, "script_troop_get_leaded_center_with_index", ":troop_no", ":i_center"), (str_store_party_name_link, s50, reg0), (try_begin), (eq, ":i_center", 1), (call_script, "script_troop_get_leaded_center_with_index", ":troop_no", 0), (str_store_party_name_link, s51, reg0), (str_store_string, s51, "str_s50_and_s51"), (else_try), (str_store_string, s51, "str_s50_comma_s51"), (try_end), (try_end), (str_store_string, s2, "str_s5_is_the_ruler_of_s51"), (else_try), (eq, ":no_centers", 1), (call_script, "script_troop_get_leaded_center_with_index", ":troop_no", 0), (str_store_party_name_link, s51, reg0), (str_store_string, s2, "str_s5_is_the_ruler_of_s51"), (else_try), (store_troop_faction, ":faction_no", ":troop_no"), (str_store_faction_name_link, s6, ":faction_no"), (str_store_string, s2, "str_s5_is_a_nobleman_of_s6"), (try_end), ]), # script_troop_write_family_relations_to_s1 # Input: arg1 = troop_no # Output: none ("troop_write_family_relations_to_s1", [ (store_script_param_1, ":troop_no"), (assign, ":num_family", 0), (try_for_range, ":slot_no", slot_troop_family_begin, slot_troop_family_end), (troop_slot_ge, ":troop_no", ":slot_no", 1), (val_add, ":num_family", 1), (try_end), (troop_get_type, ":gender", ":troop_no"), (try_begin), (eq, ":gender", 0), (str_store_string, s5, "str_he"), (else_try), (str_store_string, s5, "str_she"), (try_end), (try_begin), (gt, ":num_family", 1), (try_for_range, ":i_family", 1, ":num_family"), (call_script, "script_write_family_relation_as_s3s_s2_to_s4", ":troop_no", ":i_family"), (str_store_string_reg, s50, s4), (try_begin), (eq, ":i_family", 1), (call_script, "script_write_family_relation_as_s3s_s2_to_s4", ":troop_no", 0), (str_store_string_reg, s51, s4), (str_store_string, s51, "str_s50_and_s51"), (else_try), (str_store_string, s51, "str_s50_comma_s51"), (try_end), (try_end), (str_store_string, s1, "str_s5_is_s51"), (else_try), (eq, ":num_family", 1), (call_script, "script_write_family_relation_as_s3s_s2_to_s4", ":troop_no", 0), (str_store_string_reg, s51, s4), (str_store_string, s1, "str_s5_is_s51"), (else_try), (str_store_string, s1, "str_blank_string"), (try_end), ]), # script_write_family_relation_as_s3s_s2_to_s4 # Inputs: arg1 = troop_no, arg2 = family_no (valid slot no after slot_troop_family_begin) # Outputs: s50 = s3s_s2 text ("write_family_relation_as_s3s_s2_to_s4", [ (store_script_param_1, ":troop_no"), (store_script_param_2, ":family_no"), (troop_get_type, ":gender", ":troop_no"), (assign, ":slot_no", slot_troop_family_begin), (try_for_range, ":unused", slot_troop_family_begin, slot_troop_family_end), (this_or_next|gt, ":family_no", 0), (troop_slot_eq, ":troop_no", ":slot_no", 0), (try_begin), (troop_slot_ge, ":troop_no", ":slot_no", 1), (val_sub, ":family_no", 1), (try_end), (val_add, ":slot_no", 1), (try_end), (try_begin), (eq, ":slot_no", slot_troop_spouse), (try_begin), (eq, ":gender", 0), (str_store_string, s2, "str_husband"), (else_try), (str_store_string, s2, "str_wife"), (try_end), (else_try), (this_or_next|eq, ":slot_no", slot_troop_son), (eq, ":slot_no", slot_troop_daughter), (try_begin), (eq, ":gender", 0), (str_store_string, s2, "str_father"), (else_try), (str_store_string, s2, "str_mother"), (try_end), (else_try), (this_or_next|eq, ":slot_no", slot_troop_father), (eq, ":slot_no", slot_troop_mother), (try_begin), (eq, ":gender", 0), (str_store_string, s2, "str_son"), (else_try), (str_store_string, s2, "str_daughter"), (try_end), (else_try), (eq, ":slot_no", slot_troop_sibling), (try_begin), (eq, ":gender", 0), (str_store_string, s2, "str_brother"), (else_try), (str_store_string, s2, "str_sister"), (try_end), (try_end), (troop_get_slot, ":cur_family", ":troop_no", ":slot_no"), (str_store_troop_name_link, s3, ":cur_family"), (str_store_string, s4, "str_s3s_s2"), ]), # script_complete_family_relations # Inputs: none # Outputs: none ("complete_family_relations", [ #Completing family relations (try_for_range, ":troop_id", heroes_begin, heroes_end), (troop_get_type, ":troop_gender", ":troop_id"), (try_begin), (troop_get_slot, ":cur_spouse", ":troop_id", slot_troop_spouse), (gt, ":cur_spouse", 0), (troop_set_slot, ":cur_spouse", slot_troop_spouse, ":troop_id"), #Adding children from troop to new spouse (troop_get_slot, ":cur_daughter", ":troop_id", slot_troop_daughter), (troop_get_slot, ":cur_son", ":troop_id", slot_troop_son), (try_begin), (gt, ":cur_daughter", 0), (troop_set_slot, ":cur_spouse", slot_troop_daughter, ":cur_daughter"), (try_end), (try_begin), (gt, ":cur_son", 0), (troop_set_slot, ":cur_spouse", slot_troop_son, ":cur_son"), (try_end), #Adding children from new spouse to troop (troop_get_slot, ":cur_daughter", ":cur_spouse", slot_troop_daughter), (troop_get_slot, ":cur_son", ":cur_spouse", slot_troop_son), (try_begin), (gt, ":cur_daughter", 0), (troop_set_slot, ":troop_id", slot_troop_daughter, ":cur_daughter"), (try_end), (try_begin), (gt, ":cur_son", 0), (troop_set_slot, ":troop_id", slot_troop_son, ":cur_son"), (try_end), (try_end), (try_begin), (troop_get_slot, ":cur_sibling", ":troop_id", slot_troop_sibling), (gt, ":cur_sibling", 0), (troop_set_slot, ":cur_sibling", slot_troop_sibling, ":troop_id"), #Adding parents from troop to new sibling (troop_get_slot, ":cur_mother", ":troop_id", slot_troop_mother), (troop_get_slot, ":cur_father", ":troop_id", slot_troop_father), (try_begin), (gt, ":cur_mother", 0), (troop_set_slot, ":cur_sibling", slot_troop_mother, ":cur_mother"), (try_end), (try_begin), (gt, ":cur_father", 0), (troop_set_slot, ":cur_sibling", slot_troop_father, ":cur_father"), (try_end), #Adding parents from new sibling to troop (troop_get_slot, ":cur_mother", ":cur_sibling", slot_troop_mother), (troop_get_slot, ":cur_father", ":cur_sibling", slot_troop_father), (try_begin), (gt, ":cur_mother", 0), (troop_set_slot, ":troop_id", slot_troop_mother, ":cur_mother"), (try_end), (try_begin), (gt, ":cur_father", 0), (troop_set_slot, ":troop_id", slot_troop_father, ":cur_father"), (try_end), (try_end), (try_begin), (troop_get_slot, ":cur_child", ":troop_id", slot_troop_son), (gt, ":cur_child", 0), (try_begin), (eq, ":troop_gender", 0), (troop_set_slot, ":cur_child", slot_troop_father, ":troop_id"), (else_try), (troop_set_slot, ":cur_child", slot_troop_mother, ":troop_id"), (try_end), #Adding mother/father and sibling from troop to new son (troop_get_slot, ":cur_mother_father", ":troop_id", slot_troop_spouse), (troop_get_slot, ":cur_sibling", ":troop_id", slot_troop_daughter), (try_begin), (gt, ":cur_mother_father", 0), (try_begin), (eq, ":troop_gender", 1), (troop_set_slot, ":cur_child", slot_troop_father, ":cur_mother_father"), (else_try), (troop_set_slot, ":cur_child", slot_troop_mother, ":cur_mother_father"), (try_end), (try_end), (try_begin), (gt, ":cur_sibling", 0), (troop_set_slot, ":cur_child", slot_troop_sibling, ":cur_sibling"), (try_end), #Adding son/daughter and spouse from new son to troop (try_begin), (eq, ":troop_gender", 0), (troop_get_slot, ":cur_spouse", ":cur_child", slot_troop_mother), (else_try), (troop_get_slot, ":cur_spouse", ":cur_child", slot_troop_father), (try_end), (troop_get_slot, ":cur_daughter", ":cur_child", slot_troop_sibling), (try_begin), (gt, ":cur_spouse", 0), (troop_set_slot, ":troop_id", slot_troop_spouse, ":cur_spouse"), (try_end), (try_begin), (gt, ":cur_daughter", 0), (troop_set_slot, ":troop_id", slot_troop_daughter, ":cur_daughter"), (try_end), (try_end), (try_begin), (troop_get_slot, ":cur_child", ":troop_id", slot_troop_daughter), (gt, ":cur_child", 0), (try_begin), (eq, ":troop_gender", 0), (troop_set_slot, ":cur_child", slot_troop_father, ":troop_id"), (else_try), (troop_set_slot, ":cur_child", slot_troop_mother, ":troop_id"), (try_end), #Adding mother/father and sibling from troop to new daughter (troop_get_slot, ":cur_mother_father", ":troop_id", slot_troop_spouse), (troop_get_slot, ":cur_sibling", ":troop_id", slot_troop_son), (try_begin), (gt, ":cur_mother_father", 0), (try_begin), (eq, ":troop_gender", 1), (troop_set_slot, ":cur_child", slot_troop_father, ":cur_mother_father"), (else_try), (troop_set_slot, ":cur_child", slot_troop_mother, ":cur_mother_father"), (try_end), (try_end), (try_begin), (gt, ":cur_sibling", 0), (troop_set_slot, ":cur_child", slot_troop_sibling, ":cur_sibling"), (try_end), #Adding son/daughter and spouse from new daughter to troop (try_begin), (eq, ":troop_gender", 0), (troop_get_slot, ":cur_spouse", ":cur_child", slot_troop_mother), (else_try), (troop_get_slot, ":cur_spouse", ":cur_child", slot_troop_father), (try_end), (troop_get_slot, ":cur_son", ":cur_child", slot_troop_sibling), (try_begin), (gt, ":cur_spouse", 0), (troop_set_slot, ":troop_id", slot_troop_spouse, ":cur_spouse"), (try_end), (try_begin), (gt, ":cur_son", 0), (troop_set_slot, ":troop_id", slot_troop_son, ":cur_son"), (try_end), (try_end), (try_begin), (troop_get_slot, ":cur_father", ":troop_id", slot_troop_father), (gt, ":cur_father", 0), (try_begin), (eq, ":troop_gender", 0), (troop_set_slot, ":cur_father", slot_troop_son, ":troop_id"), (else_try), (troop_set_slot, ":cur_father", slot_troop_daughter, ":troop_id"), (try_end), #Adding son/daughter and spouse from troop to new father (troop_get_slot, ":cur_spouse", ":troop_id", slot_troop_mother), (troop_get_slot, ":cur_son_daughter", ":troop_id", slot_troop_sibling), (try_begin), (gt, ":cur_spouse", 0), (troop_set_slot, ":cur_father", slot_troop_spouse, ":cur_spouse"), (try_end), (try_begin), (gt, ":cur_son_daughter", 0), (try_begin), (eq, ":troop_gender", 0), (troop_set_slot, ":cur_father", slot_troop_daughter, ":cur_son_daughter"), (else_try), (troop_set_slot, ":cur_father", slot_troop_son, ":cur_son_daughter"), (try_end), (try_end), #Adding mother/father and sibling from new father to troop (try_begin), (eq, ":troop_gender", 0), (troop_get_slot, ":cur_sibling", ":cur_father", slot_troop_daughter), (else_try), (troop_get_slot, ":cur_sibling", ":cur_father", slot_troop_son), (try_end), (troop_get_slot, ":cur_mother", ":cur_father", slot_troop_spouse), (try_begin), (gt, ":cur_sibling", 0), (troop_set_slot, ":troop_id", slot_troop_sibling, ":cur_sibling"), (try_end), (try_begin), (gt, ":cur_mother", 0), (troop_set_slot, ":troop_id", slot_troop_mother, ":cur_mother"), (try_end), (try_end), (try_begin), (troop_get_slot, ":cur_mother", ":troop_id", slot_troop_mother), (gt, ":cur_mother", 0), (try_begin), (eq, ":troop_gender", 0), (troop_set_slot, ":cur_mother", slot_troop_son, ":troop_id"), (else_try), (troop_set_slot, ":cur_mother", slot_troop_daughter, ":troop_id"), (try_end), #Adding son/daughter and spouse from troop to new mother (troop_get_slot, ":cur_spouse", ":troop_id", slot_troop_father), (troop_get_slot, ":cur_son_daughter", ":troop_id", slot_troop_sibling), (try_begin), (gt, ":cur_spouse", 0), (troop_set_slot, ":cur_mother", slot_troop_spouse, ":cur_spouse"), (try_end), (try_begin), (gt, ":cur_son_daughter", 0), (try_begin), (eq, ":troop_gender", 0), (troop_set_slot, ":cur_mother", slot_troop_daughter, ":cur_son_daughter"), (else_try), (troop_set_slot, ":cur_mother", slot_troop_son, ":cur_son_daughter"), (try_end), (try_end), #Adding mother/father and sibling from new mother to troop (try_begin), (eq, ":troop_gender", 0), (troop_get_slot, ":cur_sibling", ":cur_mother", slot_troop_daughter), (else_try), (troop_get_slot, ":cur_sibling", ":cur_mother", slot_troop_son), (try_end), (troop_get_slot, ":cur_father", ":cur_mother", slot_troop_spouse), (try_begin), (gt, ":cur_sibling", 0), (troop_set_slot, ":troop_id", slot_troop_sibling, ":cur_sibling"), (try_end), (try_begin), (gt, ":cur_father", 0), (troop_set_slot, ":troop_id", slot_troop_father, ":cur_father"), (try_end), (try_end), (try_end), ]), # script_collect_friendly_parties # Fills the party p_collective_friends with the members of parties attached to main_party and ally_party_no ("collect_friendly_parties", [ (party_collect_attachments_to_party, "p_main_party", "p_collective_friends"), (try_begin), (gt, "$g_ally_party", 0), (party_collect_attachments_to_party, "$g_ally_party", "p_temp_party"), (assign, "$g_move_heroes", 1), (call_script, "script_party_add_party", "p_collective_friends", "p_temp_party"), (try_end), ]), # script_encounter_calculate_fit # Input: arg1 = troop_no # Output: none ("encounter_calculate_fit", [ # (assign, "$g_enemy_fit_for_battle_old", "$g_enemy_fit_for_battle"), # (assign, "$g_friend_fit_for_battle_old", "$g_friend_fit_for_battle"), # (assign, "$g_main_party_fit_for_battle_old", "$g_main_party_fit_for_battle"), (call_script, "script_party_count_fit_for_battle", "p_main_party"), # (assign, "$g_main_party_fit_for_battle", reg(0)), (call_script, "script_collect_friendly_parties"), (call_script, "script_party_count_fit_for_battle", "p_collective_friends"), (assign, "$g_friend_fit_for_battle", reg(0)), (party_clear, "p_collective_ally"), (try_begin), (gt, "$g_ally_party", 0), (party_is_active, "$g_ally_party"), (party_collect_attachments_to_party, "$g_ally_party", "p_collective_ally"), # (call_script, "script_party_count_fit_for_battle", "p_collective_ally"), # (val_add, "$g_friend_fit_for_battle", reg(0)), (try_end), (party_clear, "p_collective_enemy"), (try_begin), (party_is_active, "$g_enemy_party"), (party_collect_attachments_to_party, "$g_enemy_party", "p_collective_enemy"), (try_end), (call_script, "script_party_count_fit_for_battle", "p_collective_enemy"), (assign, "$g_enemy_fit_for_battle", reg(0)), (assign, reg11, "$g_enemy_fit_for_battle"), (assign, reg10, "$g_friend_fit_for_battle"), ]), # script_encounter_init_variables # Input: arg1 = troop_no # Output: none ("encounter_init_variables", [ (assign, "$capture_screen_shown", 0), (assign, "$loot_screen_shown", 0), (assign, "$thanked_by_ally_leader", 0), (assign, "$g_battle_result", 0), (assign, "$cant_leave_encounter", 0), (assign, "$cant_talk_to_enemy", 0), (assign, "$last_defeated_hero", 0), (assign, "$last_freed_hero", 0), (call_script, "script_encounter_calculate_fit"), (call_script, "script_party_copy", "p_main_party_backup", "p_main_party"), (call_script, "script_party_calculate_strength", "p_main_party", 0), (assign, "$g_starting_strength_main_party", reg0), (call_script, "script_party_copy", "p_encountered_party_backup", "p_collective_enemy"), (call_script, "script_party_calculate_strength", "p_collective_enemy", 0), (assign, "$g_starting_strength_enemy_party", reg0), # (assign, "$g_starting_strength_ally_party", 0), (assign, "$g_strength_contribution_of_player", 100), (call_script, "script_party_copy", "p_collective_friends_backup", "p_collective_friends"), (call_script, "script_party_calculate_strength", "p_collective_friends", 0), (assign, "$g_starting_strength_friends", reg0), (store_mul, "$g_strength_contribution_of_player","$g_starting_strength_main_party", 100), # reduce contribution if we are helping someone. (val_div, "$g_strength_contribution_of_player","$g_starting_strength_friends"), # (try_begin), # (gt, "$g_ally_party", 0), # (call_script, "script_party_copy", "p_ally_party_backup", "p_collective_ally"), # (call_script, "script_party_calculate_strength", "p_collective_ally"), # (assign, "$g_starting_strength_ally_party", reg0), # (store_add, ":starting_strength_factor_combined","$g_starting_strength_ally_party","$g_starting_strength_main_party"), # (store_mul, "$g_strength_contribution_of_player","$g_starting_strength_main_party", 80), #reduce contribution if we are helping someone. # (val_div, "$g_strength_contribution_of_player",":starting_strength_factor_combined"), # (try_end), ]), # script_calculate_renown_value # Input: arg1 = troop_no # Output: fills $battle_renown_value ("calculate_renown_value", [ (call_script, "script_party_calculate_strength", "p_main_party", 0), (assign, ":main_party_strength", reg0), (call_script, "script_party_calculate_strength", "p_collective_enemy", 0), (assign, ":enemy_strength", reg0), (call_script, "script_party_calculate_strength", "p_collective_friends", 0), (assign, ":friends_strength", reg0), (val_add, ":friends_strength", 1), (store_mul, ":enemy_strength_ratio", ":enemy_strength", 100), (val_div, ":enemy_strength_ratio", ":friends_strength"), (assign, ":renown_val", ":enemy_strength"), (val_mul, ":renown_val", ":enemy_strength_ratio"), (val_div, ":renown_val", 100), (val_mul, ":renown_val", ":main_party_strength"), (val_div, ":renown_val",":friends_strength"), (store_div, "$battle_renown_value", ":renown_val", 5), (val_min, "$battle_renown_value", 2500), (convert_to_fixed_point, "$battle_renown_value"), (store_sqrt, "$battle_renown_value", "$battle_renown_value"), (convert_from_fixed_point, "$battle_renown_value"), (assign, reg8, "$battle_renown_value"), (display_message, "@Renown value for this battle is {reg8}.",0xFFFFFFFF), ]), ## # script_calculate_weekly_wage_for_player ## # Input: none ## # Output: none ## ("calculate_weekly_wage_for_player", ## [ ## (call_script, "script_calculate_weekly_party_wage", "p_main_party"), ## (assign, ":result", reg0), ## (try_for_parties, ":party_no"), ## (store_faction_of_party, ":party_faction", ":party_no"), ## (eq, ":party_faction", "fac_player_supporters_faction"), ## (call_script, "script_calculate_weekly_party_wage", ":party_no"), ## (val_add, ":result", reg0), ## (try_end), ## (assign, reg0, ":result"), ## ]), # script_get_first_agent_with_troop_id # Input: arg1 = troop_no # Output: agent_id ("cf_get_first_agent_with_troop_id", [ (store_script_param_1, ":troop_no"), # (store_script_param_2, ":agent_no_to_begin_searching_after"), (assign, ":result", -1), (try_for_agents, ":cur_agent"), (eq, ":result", -1), ## (try_begin), ## (eq, ":cur_agent", ":agent_no_to_begin_searching_after"), ## (assign, ":agent_no_to_begin_searching_after", -1), ## (try_end), ## (eq, ":agent_no_to_begin_searching_after", -1), (agent_get_troop_id, ":cur_troop_no", ":cur_agent"), (eq, ":cur_troop_no", ":troop_no"), (assign, ":result", ":cur_agent"), (try_end), (assign, reg0, ":result"), (neq, reg0, -1), ]), # script_cf_team_get_average_position_of_agents_with_type_to_pos1 # Input: arg1 = team_no, arg2 = class_no (grc_everyone, grc_infantry, grc_cavalry, grc_archers, grc_heroes) # Output: none, pos1 = average_position (0,0,0 if there are no matching agents) ("cf_team_get_average_position_of_agents_with_type_to_pos1", [ (store_script_param_1, ":team_no"), (store_script_param_2, ":class_no"), (assign, ":total_pos_x", 0), (assign, ":total_pos_y", 0), (assign, ":total_pos_z", 0), (assign, ":num_agents", 0), (set_fixed_point_multiplier, 100), (try_for_agents, ":cur_agent"), (agent_is_alive, ":cur_agent"), (agent_is_human, ":cur_agent"), (agent_get_team, ":cur_team_no", ":cur_agent"), (eq, ":cur_team_no", ":team_no"), (agent_get_class, ":cur_class_no", ":cur_agent"), (this_or_next|eq, ":class_no", grc_everyone), (eq, ":class_no", ":cur_class_no"), (agent_get_position, pos1, ":cur_agent"), (position_get_x, ":cur_pos_x", pos1), (val_add, ":total_pos_x", ":cur_pos_x"), (position_get_y, ":cur_pos_y", pos1), (val_add, ":total_pos_y", ":cur_pos_y"), (position_get_z, ":cur_pos_z", pos1), (val_add, ":total_pos_z", ":cur_pos_z"), (val_add, ":num_agents", 1), (try_end), (gt, ":num_agents", 1), (val_div, ":total_pos_x", ":num_agents"), (val_div, ":total_pos_y", ":num_agents"), (val_div, ":total_pos_z", ":num_agents"), (init_position, pos1), (position_move_x, pos1, ":total_pos_x"), (position_move_y, pos1, ":total_pos_y"), (position_move_z, pos1, ":total_pos_z"), ]), # script_cf_turn_windmill_fans # Input: arg1 = instance_no (none = 0) # Output: none ("cf_turn_windmill_fans", [(store_script_param_1, ":instance_no"), (scene_prop_get_instance, ":windmill_fan_object", "spr_windmill_fan_turning", ":instance_no"), (ge, ":windmill_fan_object", 0), (prop_instance_get_position, pos1, ":windmill_fan_object"), (position_rotate_y, pos1, 10), (prop_instance_animate_to_position, ":windmill_fan_object", pos1, 100), (val_add, ":instance_no", 1), (call_script, "script_cf_turn_windmill_fans", ":instance_no"), ]), # script_print_party_members # Input: arg1 = party_no # Output: s51 = output string. "noone" if the party is empty ("print_party_members", [(store_script_param_1, ":party_no"), (party_get_num_companion_stacks, ":num_stacks",":party_no"), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop",":party_no",":i_stack"), (troop_is_hero, ":stack_troop"), (try_begin), (eq, ":i_stack", 0), (str_store_troop_name, s51, ":stack_troop"), (try_end), (str_store_troop_name, s50, ":stack_troop"), (try_begin), (eq, ":i_stack", 1), (str_store_string, s51, "str_s50_and_s51"), (else_try), (gt, ":i_stack", 1), (str_store_string, s51, "str_s50_comma_s51"), (try_end), (try_end), (try_begin), (eq, ":num_stacks", 0), (str_store_string, s51, "str_noone"), (try_end), ]), # script_round_value # Input: arg1 = value # Output: reg0 = rounded_value ("round_value", [ (store_script_param_1, ":value"), (try_begin), (lt, ":value", 100), (neq, ":value", 0), (val_add, ":value", 5), (val_div, ":value", 10), (val_mul, ":value", 10), (try_begin), (eq, ":value", 0), (assign, ":value", 5), (try_end), (else_try), (lt, ":value", 300), (val_add, ":value", 25), (val_div, ":value", 50), (val_mul, ":value", 50), (else_try), (val_add, ":value", 50), (val_div, ":value", 100), (val_mul, ":value", 100), (try_end), (assign, reg0, ":value"), ]), ## # script_print_productions_above_or_below_50 ## # Input: arg1 = center_no, arg2 = sign of the production, 1 if produced goods, -1 if consumed goods ## # Output: s51 = output string. "nothing" if there are no productions above or below 50 ## ("print_productions_above_or_below_50", ## [(store_script_param_1, ":center_no"), ## (store_script_param_2, ":sign"), ## (store_sub, ":item_to_slot", slot_town_trade_good_productions_begin, trade_goods_begin), ## (assign, ":cur_print_index", 0), ## (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end), ## (store_add, ":cur_good_slot", ":cur_goods", ":item_to_slot"), ## (party_get_slot, ":cur_production", ":center_no", ":cur_good_slot"), ## (val_mul, ":cur_production", ":sign"), ## (ge, ":cur_production", 50), ## (try_begin), ## (eq, ":cur_print_index", 0), ## (str_store_item_name, s51, ":cur_goods"), ## (try_end), ## (str_store_item_name, s50, ":cur_goods"), ## (try_begin), ## (eq, ":cur_print_index", 1), ## (str_store_string, s51, "str_s50_and_s51"), ## (else_try), ## (gt, ":cur_print_index", 1), ## (str_store_string, s51, "str_s50_comma_s51"), ## (try_end), ## (val_add, ":cur_print_index", 1), ## (try_end), ## (try_begin), ## (eq, ":cur_print_index", 0), ## (str_store_string, s51, "str_nothing"), ## (try_end), ## ]), # script_change_banners_and_chest # Input: none # Output: none ("change_banners_and_chest", [(party_get_slot, ":cur_leader", "$g_encountered_party", slot_town_lord), (try_begin), (ge, ":cur_leader", 0), #normal_banner_begin (troop_get_slot, ":troop_banner_object", ":cur_leader", slot_troop_banner_scene_prop), (gt, ":troop_banner_object", 0), (replace_scene_props, banner_scene_props_begin, ":troop_banner_object"), (else_try), (replace_scene_props, banner_scene_props_begin, "spr_empty"), #custom_banner_begin # (troop_get_slot, ":flag_spr", ":cur_leader", slot_troop_custom_banner_flag_type), # (ge, ":flag_spr", 0), # (val_add, ":flag_spr", custom_banner_flag_scene_props_begin), # (replace_scene_props, banner_scene_props_begin, ":flag_spr"), # (else_try), # (replace_scene_props, banner_scene_props_begin, "spr_empty"), (try_end), (try_begin), (neq, ":cur_leader", "trp_player"), (replace_scene_props, "spr_player_chest", "spr_locked_player_chest"), (try_end), ]), # script_remove_siege_objects # Input: none # Output: none ("remove_siege_objects", [ (replace_scene_props, "spr_battlement_a_destroyed", "spr_battlement_a"), (replace_scene_props, "spr_snowy_castle_battlement_a_destroyed", "spr_snowy_castle_battlement_a"), (replace_scene_props, "spr_castle_e_battlement_a_destroyed", "spr_castle_e_battlement_a"), (replace_scene_props, "spr_castle_battlement_a_destroyed", "spr_castle_battlement_a"), (replace_scene_props, "spr_castle_battlement_b_destroyed", "spr_castle_battlement_b"), (replace_scene_props, "spr_earth_wall_a2", "spr_earth_wall_a"), (replace_scene_props, "spr_earth_wall_b2", "spr_earth_wall_b"), (replace_scene_props, "spr_belfry_platform_b", "spr_empty"), (replace_scene_props, "spr_belfry_platform_a", "spr_empty"), (replace_scene_props, "spr_belfry_a", "spr_empty"), (replace_scene_props, "spr_belfry_wheel", "spr_empty"), (replace_scene_props, "spr_siege_ladder_12m", "spr_empty"), (replace_scene_props, "spr_siege_ladder_14m", "spr_empty"), (replace_scene_props, "spr_mangonel", "spr_empty"), (replace_scene_props, "spr_trebuchet_old", "spr_empty"), (replace_scene_props, "spr_trebuchet_new", "spr_empty"), (replace_scene_props, "spr_stone_ball", "spr_empty"), (replace_scene_props, "spr_Village_fire_big", "spr_empty"), ]), # script_describe_relation_to_s63 # Input: arg1 = relation (-100 .. 100) # Output: none ("describe_relation_to_s63", [(store_script_param_1, ":relation"), (store_add, ":normalized_relation", ":relation", 100), (val_add, ":normalized_relation", 5), (store_div, ":str_offset", ":normalized_relation", 10), (val_clamp, ":str_offset", 0, 20), (store_add, ":str_id", "str_relation_mnus_100", ":str_offset"), (str_store_string, s63, ":str_id"), ]), # script_describe_center_relation_to_s3 # Input: arg1 = relation (-100 .. 100) # Output: none ("describe_center_relation_to_s3", [(store_script_param_1, ":relation"), (store_add, ":normalized_relation", ":relation", 100), (val_add, ":normalized_relation", 5), (store_div, ":str_offset", ":normalized_relation", 10), (val_clamp, ":str_offset", 0, 20), (store_add, ":str_id", "str_center_relation_mnus_100", ":str_offset"), (str_store_string, s3, ":str_id"), ]), # script_center_ambiance_sounds # Input: none # Output: none # to be called every two seconds ("center_ambiance_sounds", [ (assign, ":sound_1", -1), (assign, ":sound_2", -1), (assign, ":sound_3", -1), (assign, ":sound_4", -1), (assign, ":sound_5", -1), (try_begin), (party_slot_eq, "$g_encountered_party", slot_party_type, spt_village), (try_begin), (neg|is_currently_night), (assign, ":sound_3", "snd_distant_dog_bark"), (assign, ":sound_3", "snd_distant_chicken"), (else_try), (assign, ":sound_1", "snd_distant_dog_bark"), (assign, ":sound_2", "snd_distant_owl"), (try_end), (else_try), (party_slot_eq, "$g_encountered_party", slot_party_type, spt_town), (try_begin), (neg|is_currently_night), (assign, ":sound_1", "snd_distant_carpenter"), (assign, ":sound_2", "snd_distant_blacksmith"), (assign, ":sound_3", "snd_distant_dog_bark"), (else_try), (assign, ":sound_1", "snd_distant_dog_bark"), (try_end), (try_end), (try_begin), (store_random_in_range, ":r", 0, 7), (try_begin), (eq, ":r", 1), (ge, ":sound_1", 0), (play_sound, ":sound_1"), (else_try), (eq, ":r", 2), (ge, ":sound_2", 0), (play_sound, ":sound_2"), (else_try), (eq, ":r", 3), (ge, ":sound_3", 0), (play_sound, ":sound_3"), (else_try), (eq, ":r", 4), (ge, ":sound_4", 0), (play_sound, ":sound_4"), (else_try), (eq, ":r", 5), (ge, ":sound_5", 0), (play_sound, ":sound_5"), (try_end), (try_end), ]), # script_center_set_walker_to_type # Input: arg1 = center_no, arg2 = walker_no, arg3 = walker_type, # Output: none ("center_set_walker_to_type", [ (store_script_param, ":center_no", 1), (store_script_param, ":walker_no", 2), (store_script_param, ":walker_type", 3), (store_add, ":type_slot", slot_center_walker_0_type, ":walker_no"), (party_set_slot, ":center_no", ":type_slot", ":walker_type"), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_village), (store_random_in_range, ":walker_troop_id", village_walkers_begin, village_walkers_end), (else_try), (store_random_in_range, ":walker_troop_id", town_walkers_begin, town_walkers_end), (try_end), (try_begin), (eq,":walker_type",walkert_spy), (assign,":original_walker",":walker_troop_id"), (val_add,":walker_troop_id",4), # select spy troop id # restore spy inventory (try_for_range,":item_no","itm_horse_meat","itm_wooden_stick"), (store_item_kind_count,":num_items",":item_no",":original_walker"), (ge,":num_items",1), (store_item_kind_count,":num_items",":item_no",":walker_troop_id"), (lt,":num_items",1), (troop_add_items,":walker_troop_id",":item_no",1), (try_end), # determine spy recognition item (store_random_in_range,":spy_item_type",itp_type_head_armor,itp_type_hand_armor), (assign,":num",0), (try_for_range,":item_no","itm_horse_meat","itm_wooden_stick"), (store_item_kind_count,":num_items",":item_no",":walker_troop_id"), (ge,":num_items",1), (item_get_type, ":itp", ":item_no"), (eq,":itp",":spy_item_type"), (val_add,":num",1), (troop_remove_items,":walker_troop_id",":item_no",":num_items"), (try_end), (store_random_in_range,":random_item",0,":num"), (assign,":num",-1), (try_for_range,":item_no","itm_horse_meat","itm_wooden_stick"), (store_item_kind_count,":num_items",":item_no",":original_walker"), (ge,":num_items",1), (item_get_type, ":itp", ":item_no"), (eq,":itp",":spy_item_type"), (val_add,":num",1), (eq,":num",":random_item"), (troop_add_items,":walker_troop_id",":item_no",1), (assign,":spy_item",":item_no"), (try_end), (assign,"$spy_item_worn",":spy_item"), (assign,"$spy_quest_troop",":walker_troop_id"), (troop_equip_items,":walker_troop_id"), (try_end), (store_add, ":troop_slot", slot_center_walker_0_troop, ":walker_no"), (party_set_slot, ":center_no", ":troop_slot", ":walker_troop_id"), (store_random_in_range, ":walker_dna", 0, 1000000), (store_add, ":dna_slot", slot_center_walker_0_dna, ":walker_no"), (party_set_slot, ":center_no", ":dna_slot", ":walker_dna"), ]), # script_cf_center_get_free_walker # Input: arg1 = center_no # Output: reg0 = walker no (can fail) ("cf_center_get_free_walker", [ (store_script_param, ":center_no", 1), (assign, ":num_free_walkers", 0), (try_for_range, ":walker_no", 0, num_town_walkers), (store_add, ":type_slot", slot_center_walker_0_type, ":walker_no"), (party_slot_eq, ":center_no", ":type_slot", walkert_default), (val_add, ":num_free_walkers", 1), (try_end), (gt, ":num_free_walkers", 0), (assign, reg0, -1), (store_random_in_range, ":random_rank", 0, ":num_free_walkers"), (try_for_range, ":walker_no", 0, num_town_walkers), (store_add, ":type_slot", slot_center_walker_0_type, ":walker_no"), (party_slot_eq, ":center_no", ":type_slot", walkert_default), (val_sub, ":num_free_walkers", 1), (eq, ":num_free_walkers", ":random_rank"), (assign, reg0, ":walker_no"), (try_end), ]), # script_center_remove_walker_type_from_walkers # Input: arg1 = center_no, arg2 = walker_type, # Output: reg0 = 1 if comment found, 0 otherwise; s61 will contain comment string if found ("center_remove_walker_type_from_walkers", [ (store_script_param, ":center_no", 1), (store_script_param, ":walker_type", 2), (try_for_range, ":walker_no", 0, num_town_walkers), (store_add, ":type_slot", slot_center_walker_0_type, ":walker_no"), (party_slot_eq, ":center_no", ":type_slot", ":walker_type"), (call_script, "script_center_set_walker_to_type", ":center_no", ":walker_no", walkert_default), (try_end), ]), # script_init_town_walkers # Input: none # Output: none ("init_town_walkers", [(try_begin), (eq, "$town_nighttime", 0), (try_for_range, ":walker_no", 0, num_town_walkers), (store_add, ":troop_slot", slot_center_walker_0_troop, ":walker_no"), (party_get_slot, ":walker_troop_id", "$current_town", ":troop_slot"), (gt, ":walker_troop_id", 0), (store_add, ":entry_no", town_walker_entries_start, ":walker_no"), (set_visitor, ":entry_no", ":walker_troop_id"), (try_end), ## (try_for_range, ":cur_walker", 0, 8), ## (try_begin), ## (lt, ":cur_walker", ":num_walkers"), ## (store_random_in_range, ":walker_troop", town_walkers_begin, town_walkers_end), ## (else_try), ## (assign, ":walker_troop", -1), ## (try_end), ## (try_begin), ## (eq, ":cur_walker", 0), ## (assign, reg0, ":walker_troop"), ## (else_try), ## (eq, ":cur_walker", 1), ## (assign, reg1, ":walker_troop"), ## (else_try), ## (eq, ":cur_walker", 2), ## (assign, reg2, ":walker_troop"), ## (else_try), ## (eq, ":cur_walker", 3), ## (assign, reg3, ":walker_troop"), ## (else_try), ## (eq, ":cur_walker", 4), ## (assign, reg4, ":walker_troop"), ## (else_try), ## (eq, ":cur_walker", 5), ## (assign, reg5, ":walker_troop"), ## (else_try), ## (eq, ":cur_walker", 6), ## (assign, reg6, ":walker_troop"), ## (else_try), ## (eq, ":cur_walker", 7), ## (assign, reg7, ":walker_troop"), ## (try_end), ## (try_end), ## (shuffle_range, 0, 8), ## (set_visitor, 32, reg0), ## (set_visitor, 33, reg1), ## (set_visitor, 34, reg2), ## (set_visitor, 35, reg3), ## (set_visitor, 36, reg4), ## (set_visitor, 37, reg5), ## (set_visitor, 38, reg6), ## (set_visitor, 39, reg7), ## (try_end), ]), # script_cf_enter_center_location_bandit_check # Input: none # Output: none ("cf_enter_center_location_bandit_check", [ (neq, "$town_nighttime", 0), (party_slot_ge, "$current_town", slot_center_has_bandits, 1), (eq, "$g_defending_against_siege", 0),#Skip if the center is under siege (because of resting) (eq, "$sneaked_into_town", 0),#Skip if sneaked (try_begin), (party_slot_eq, "$current_town", slot_party_type, spt_village), (party_get_slot, ":cur_scene", "$current_town", slot_castle_exterior), (else_try), (party_get_slot, ":cur_scene", "$current_town", slot_town_center), (try_end), (modify_visitors_at_site, ":cur_scene"), (reset_visitors), (party_get_slot, ":bandit_troop", "$current_town", slot_center_has_bandits), (store_character_level, ":level", "trp_player"), (set_jump_mission, "mt_bandits_at_night"), (try_begin), (party_slot_eq, "$current_town", slot_party_type, spt_village), (assign, ":spawn_amount", 2), (store_div, ":level_fac", ":level", 10), (val_add, ":spawn_amount", ":level_fac"), (try_for_range, ":unused", 0, 3), (gt, ":level", 10), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", ":level"), (val_add, ":spawn_amount", 1), (try_end), (set_visitors, 4, ":bandit_troop", ":spawn_amount"), (assign, "$num_center_bandits", ":spawn_amount"), (set_jump_entry, 2), (else_try), (assign, ":spawn_amount", 1), (assign, "$num_center_bandits", 0), (try_begin), (gt, ":level", 15), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", ":level"), (assign, ":spawn_amount", 2), (try_end), (val_add, "$num_center_bandits", ":spawn_amount"), (set_visitors, 11, ":bandit_troop", ":spawn_amount"), (assign, ":spawn_amount", 1), (try_begin), (gt, ":level", 20), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", ":level"), (assign, ":spawn_amount", 2), (try_end), (set_visitors, 27, ":bandit_troop", ":spawn_amount"), (val_add, "$num_center_bandits", ":spawn_amount"), (try_begin), (gt, ":level", 9), (assign, ":spawn_amount", 1), (try_begin), (gt, ":level", 25), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", ":level"), (assign, ":spawn_amount", 2), (try_end), (set_visitors, 28, ":bandit_troop", ":spawn_amount"), (val_add, "$num_center_bandits", ":spawn_amount"), (try_end), (assign, "$town_entered", 1), (assign, "$all_doors_locked", 1), (try_end), (display_message, "@You have run into a trap!", 0xFFFF2222), (display_message, "@You are attacked by a group of bandits!", 0xFFFF2222), (jump_to_scene, ":cur_scene"), (change_screen_mission), ]), # script_init_town_agent # Input: none # Output: none ("init_town_agent", [ (store_script_param, ":agent_no", 1), (agent_get_troop_id, ":troop_no", ":agent_no"), (set_fixed_point_multiplier, 100), (assign, ":stand_animation", -1), (try_begin), (this_or_next|is_between, ":troop_no", armor_merchants_begin, armor_merchants_end), (is_between, ":troop_no", weapon_merchants_begin, weapon_merchants_end), (try_begin), (troop_get_type, ":cur_troop_gender", ":troop_no"), (eq, ":cur_troop_gender", 0), (agent_set_animation, ":agent_no", "anim_stand_townguard"), (else_try), (agent_set_animation, ":agent_no", "anim_stand_townguard"), (end_try), (else_try), (is_between, ":troop_no", kingdom_ladies_begin, kingdom_ladies_end), (assign, ":stand_animation", "anim_stand_lady"), (else_try), (is_between, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (assign, ":stand_animation", "anim_stand_lord"), (else_try), (is_between, ":troop_no", soldiers_begin, soldiers_end), (assign, ":stand_animation", "anim_stand_townguard"), (try_end), (try_begin), (ge, ":stand_animation", 0), (agent_set_stand_animation, ":agent_no", ":stand_animation"), (agent_set_animation, ":agent_no", ":stand_animation"), (store_random_in_range, ":random_no", 0, 100), (agent_set_animation_progress, ":agent_no", ":random_no"), (try_end), ]), # script_init_town_walker_agents # Input: none # Output: none ("init_town_walker_agents", [(assign, ":num_walkers", 0), (try_for_agents, ":cur_agent"), (agent_get_troop_id, ":cur_troop", ":cur_agent"), (is_between, ":cur_troop", walkers_begin, walkers_end), (val_add, ":num_walkers", 1), (agent_get_position, pos1, ":cur_agent"), (try_for_range, ":i_e_p", 9, 40),#Entry points (entry_point_get_position, pos2, ":i_e_p"), (get_distance_between_positions, ":distance", pos1, pos2), (lt, ":distance", 200), (agent_set_slot, ":cur_agent", 0, ":i_e_p"), (try_end), (call_script, "script_set_town_walker_destination", ":cur_agent"), (try_end), ]), # script_agent_get_town_walker_details # This script assumes this is one of town walkers. # Input: agent_id # Output: reg0: town_walker_type, reg1: town_walker_dna ("agent_get_town_walker_details", [(store_script_param, ":agent_no", 1), (agent_get_entry_no, ":entry_no", ":agent_no"), (store_sub, ":walker_no", ":entry_no", town_walker_entries_start), (store_add, ":type_slot", slot_center_walker_0_type, ":walker_no"), (party_get_slot, ":walker_type", "$current_town", ":type_slot"), (store_add, ":dna_slot", slot_center_walker_0_dna, ":walker_no"), (party_get_slot, ":walker_dna", "$current_town", ":dna_slot"), (assign, reg0, ":walker_type"), (assign, reg1, ":walker_dna"), (assign, reg2, ":walker_no"), ]), # script_tick_town_walkers # Input: none # Output: none ("tick_town_walkers", [(try_for_agents, ":cur_agent"), (agent_get_troop_id, ":cur_troop", ":cur_agent"), (is_between, ":cur_troop", walkers_begin, walkers_end), (agent_get_slot, ":target_entry_point", ":cur_agent", 0), (entry_point_get_position, pos1, ":target_entry_point"), (try_begin), (lt, ":target_entry_point", 32), (init_position, pos2), (position_set_y, pos2, 250), (position_transform_position_to_parent, pos1, pos1, pos2), (try_end), (agent_get_position, pos2, ":cur_agent"), (get_distance_between_positions, ":distance", pos1, pos2), (lt, ":distance", 400), (assign, ":random_no", 0), (try_begin), (lt, ":target_entry_point", 32), (store_random_in_range, ":random_no", 0, 100), (try_end), (lt, ":random_no", 20), (call_script, "script_set_town_walker_destination", ":cur_agent"), (try_end), ]), # script_set_town_walker_destination # Input: arg1 = agent_no # Output: none ("set_town_walker_destination", [(store_script_param_1, ":agent_no"), (assign, reg0, 9), (assign, reg1, 10), (assign, reg2, 12), (assign, reg3, 32), (assign, reg4, 33), (assign, reg5, 34), (assign, reg6, 35), (assign, reg7, 36), (assign, reg8, 37), (assign, reg9, 38), (assign, reg10, 39), (try_for_agents, ":cur_agent"), (agent_get_troop_id, ":cur_troop", ":cur_agent"), (is_between, ":cur_troop", walkers_begin, walkers_end), (agent_get_slot, ":target_entry_point", ":cur_agent", 0), (try_begin), (eq, ":target_entry_point", 9), (assign, reg0, 0), (else_try), (eq, ":target_entry_point", 10), (assign, reg1, 0), (else_try), (eq, ":target_entry_point", 12), (assign, reg2, 0), (else_try), (eq, ":target_entry_point", 32), (assign, reg3, 0), (else_try), (eq, ":target_entry_point", 33), (assign, reg4, 0), (else_try), (eq, ":target_entry_point", 34), (assign, reg5, 0), (else_try), (eq, ":target_entry_point", 35), (assign, reg6, 0), (else_try), (eq, ":target_entry_point", 36), (assign, reg7, 0), (else_try), (eq, ":target_entry_point", 37), (assign, reg8, 0), (else_try), (eq, ":target_entry_point", 38), (assign, reg9, 0), (else_try), (eq, ":target_entry_point", 39), (assign, reg10, 0), (try_end), (try_end), (assign, ":try_limit", 100), (assign, ":target_entry_point", 0), (try_for_range, ":unused", 0, ":try_limit"), (shuffle_range, 0, 11), (gt, reg0, 0), (assign, ":target_entry_point", reg0), (assign, ":try_limit", 0), (try_end), (try_begin), (gt, ":target_entry_point", 0), (agent_set_slot, ":agent_no", 0, ":target_entry_point"), (entry_point_get_position, pos1, ":target_entry_point"), (try_begin), (lt, ":target_entry_point", 32), (init_position, pos2), (position_set_y, pos2, 250), (position_transform_position_to_parent, pos1, pos1, pos2), (try_end), (agent_set_scripted_destination, ":agent_no", pos1, 0), (agent_set_speed_limit, ":agent_no", 5), (try_end), ]), # script_town_init_doors # Input: door_state (-1 = closed, 1 = open, 0 = use $town_nighttime) # Output: none (required for siege mission templates) ("town_init_doors", [(store_script_param, ":door_state", 1), (try_begin), (assign, ":continue", 0), (try_begin), (eq, ":door_state", 1), (assign, ":continue", 1), (else_try), (eq, ":door_state", 0), (eq, "$town_nighttime", 0), (assign, ":continue", 1), (try_end), (eq, ":continue", 1),# open doors (assign, ":end_cond", 1), (try_for_range, ":i_instance", 0, ":end_cond"), (scene_prop_get_instance, ":object", "spr_towngate_door_left", ":i_instance"), (ge, ":object", 0), (val_add, ":end_cond", 1), (prop_instance_get_position, pos1, ":object"), (position_rotate_z, pos1, -100), (prop_instance_animate_to_position, ":object", pos1, 1), (try_end), (assign, ":end_cond", 1), (try_for_range, ":i_instance", 0, ":end_cond"), (scene_prop_get_instance, ":object", "spr_towngate_rectangle_door_left", ":i_instance"), (ge, ":object", 0), (val_add, ":end_cond", 1), (prop_instance_get_position, pos1, ":object"), (position_rotate_z, pos1, -80), (prop_instance_animate_to_position, ":object", pos1, 1), (try_end), (assign, ":end_cond", 1), (try_for_range, ":i_instance", 0, ":end_cond"), (scene_prop_get_instance, ":object", "spr_towngate_door_right", ":i_instance"), (ge, ":object", 0), (val_add, ":end_cond", 1), (prop_instance_get_position, pos1, ":object"), (position_rotate_z, pos1, 100), (prop_instance_animate_to_position, ":object", pos1, 1), (try_end), (assign, ":end_cond", 1), (try_for_range, ":i_instance", 0, ":end_cond"), (scene_prop_get_instance, ":object", "spr_towngate_rectangle_door_right", ":i_instance"), (ge, ":object", 0), (val_add, ":end_cond", 1), (prop_instance_get_position, pos1, ":object"), (position_rotate_z, pos1, 80), (prop_instance_animate_to_position, ":object", pos1, 1), (try_end), (try_end), ]), # script_siege_init_ai_and_belfry # Input: none # Output: none (required for siege mission templates) ("siege_init_ai_and_belfry", [(assign, "$cur_belfry_pos", 50), (assign, ":cur_belfry_object_pos", slot_scene_belfry_props_begin), (store_current_scene, ":cur_scene"), #Collecting belfry objects (try_for_range, ":i_belfry_instance", 0, 3), (scene_prop_get_instance, ":belfry_object", "spr_belfry_a", ":i_belfry_instance"), (ge, ":belfry_object", 0), (scene_set_slot, ":cur_scene", ":cur_belfry_object_pos", ":belfry_object"), (val_add, ":cur_belfry_object_pos", 1), (try_end), (try_for_range, ":i_belfry_instance", 0, 3), (scene_prop_get_instance, ":belfry_object", "spr_belfry_platform_a", ":i_belfry_instance"), (ge, ":belfry_object", 0), (scene_set_slot, ":cur_scene", ":cur_belfry_object_pos", ":belfry_object"), (val_add, ":cur_belfry_object_pos", 1), (try_end), (try_for_range, ":i_belfry_instance", 0, 3), (scene_prop_get_instance, ":belfry_object", "spr_belfry_platform_b", ":i_belfry_instance"), (ge, ":belfry_object", 0), (scene_set_slot, ":cur_scene", ":cur_belfry_object_pos", ":belfry_object"), (val_add, ":cur_belfry_object_pos", 1), (try_end), (assign, "$belfry_rotating_objects_begin", ":cur_belfry_object_pos"), (try_for_range, ":i_belfry_instance", 0, 5), (scene_prop_get_instance, ":belfry_object", "spr_belfry_wheel", ":i_belfry_instance"), (ge, ":belfry_object", 0), (scene_set_slot, ":cur_scene", ":cur_belfry_object_pos", ":belfry_object"), (val_add, ":cur_belfry_object_pos", 1), (try_end), (assign, "$last_belfry_object_pos", ":cur_belfry_object_pos"), #Lifting up the platform at the beginning (scene_prop_get_instance, ":belfry_object_to_rotate", "spr_belfry_platform_a", 0), #Moving the belfry objects to their starting position (entry_point_get_position,pos1,55), (entry_point_get_position,pos3,50), (try_for_range, ":i_belfry_object_pos", slot_scene_belfry_props_begin, "$last_belfry_object_pos"), (assign, ":pos_no", pos_belfry_begin), (val_add, ":pos_no", ":i_belfry_object_pos"), (val_sub, ":pos_no", slot_scene_belfry_props_begin), (scene_get_slot, ":cur_belfry_object", ":cur_scene", ":i_belfry_object_pos"), (prop_instance_get_position, pos2, ":cur_belfry_object"), (try_begin), (eq, ":cur_belfry_object", ":belfry_object_to_rotate"), (position_rotate_x, pos2, 90), (try_end), (position_transform_position_to_local, ":pos_no", pos1, pos2), (position_transform_position_to_parent, pos4, pos3, ":pos_no"), (prop_instance_animate_to_position, ":cur_belfry_object", pos4, 1), (try_end), (assign, "$belfry_positioned", 0), (assign, "$belfry_num_slots_positioned", 0), (assign, "$belfry_num_men_pushing", 0), ]), # script_cf_siege_move_belfry # Input: none # Output: none (required for siege mission templates) ("cf_siege_move_belfry", [(neq, "$last_belfry_object_pos", slot_scene_belfry_props_begin), (entry_point_get_position,pos1,50), (entry_point_get_position,pos4,55), (get_distance_between_positions, ":total_distance", pos4, pos1), (store_current_scene, ":cur_scene"), (scene_get_slot, ":first_belfry_object", ":cur_scene", slot_scene_belfry_props_begin), (prop_instance_get_position, pos2, ":first_belfry_object"), (entry_point_get_position,pos1,"$cur_belfry_pos"), (position_transform_position_to_parent, pos3, pos1, pos_belfry_begin), (position_transform_position_to_parent, pos5, pos4, pos_belfry_begin), (get_distance_between_positions, ":cur_distance", pos2, pos3), (get_distance_between_positions, ":distance_left", pos2, pos5), (try_begin), (le, ":cur_distance", 10), (val_add, "$cur_belfry_pos", 1), (entry_point_get_position,pos1,"$cur_belfry_pos"), (position_transform_position_to_parent, pos3, pos1, pos_belfry_begin), (get_distance_between_positions, ":cur_distance", pos2, pos3), (try_end), (neq, "$cur_belfry_pos", 50), (assign, ":base_speed", 20), (store_div, ":slow_range", ":total_distance", 60), (store_sub, ":distance_moved", ":total_distance", ":distance_left"), (try_begin), (lt, ":distance_moved", ":slow_range"), (store_mul, ":base_speed", ":distance_moved", -60), (val_div, ":base_speed", ":slow_range"), (val_add, ":base_speed", 80), (else_try), (lt, ":distance_left", ":slow_range"), (store_mul, ":base_speed", ":distance_left", -60), (val_div, ":base_speed", ":slow_range"), (val_add, ":base_speed", 80), (try_end), (store_mul, ":belfry_speed", ":cur_distance", ":base_speed"), (try_begin), (eq, "$belfry_num_men_pushing", 0), (assign, ":belfry_speed", 1000000), (else_try), (val_div, ":belfry_speed", "$belfry_num_men_pushing"), (try_end), (try_begin), (le, "$cur_belfry_pos", 55), (init_position, pos3), (position_rotate_x, pos3, ":distance_moved"), (scene_get_slot, ":base_belfry_object", ":cur_scene", slot_scene_belfry_props_begin), (prop_instance_get_position, pos4, ":base_belfry_object"), (entry_point_get_position,pos1,"$cur_belfry_pos"), (try_for_range, ":i_belfry_object_pos", slot_scene_belfry_props_begin, "$last_belfry_object_pos"), (scene_get_slot, ":cur_belfry_object", ":cur_scene", ":i_belfry_object_pos"), (try_begin), (ge, ":i_belfry_object_pos", "$belfry_rotating_objects_begin"), (prop_instance_get_starting_position, pos5, ":base_belfry_object"), (prop_instance_get_starting_position, pos6, ":cur_belfry_object"), (position_transform_position_to_local, pos7, pos5, pos6), (position_transform_position_to_parent, pos5, pos4, pos7), (position_transform_position_to_parent, pos6, pos5, pos3), (prop_instance_set_position, ":cur_belfry_object", pos6), (else_try), (assign, ":pos_no", pos_belfry_begin), (val_add, ":pos_no", ":i_belfry_object_pos"), (val_sub, ":pos_no", slot_scene_belfry_props_begin), (position_transform_position_to_parent, pos2, pos1, ":pos_no"), (prop_instance_animate_to_position, ":cur_belfry_object", pos2, ":belfry_speed"), (try_end), (try_end), (try_end), (gt, "$cur_belfry_pos", 55), (assign, "$belfry_positioned", 1), ]), # script_cf_siege_rotate_belfry_platform # Input: none # Output: none (required for siege mission templates) ("cf_siege_rotate_belfry_platform", [(eq, "$belfry_positioned", 1), (scene_prop_get_instance, ":belfry_object", "spr_belfry_platform_a", 0), (prop_instance_get_position, pos1, ":belfry_object"), (position_rotate_x, pos1, -90), (prop_instance_animate_to_position, ":belfry_object", pos1, 400), (assign, "$belfry_positioned", 2), ]), # script_cf_siege_assign_men_to_belfry # Input: none # Output: none (required for siege mission templates) ("cf_siege_assign_men_to_belfry", [ (store_mission_timer_a, ":cur_seconds"), (neq, "$last_belfry_object_pos", slot_scene_belfry_props_begin), (assign, ":end_trigger", 0), (try_begin), (lt, "$belfry_positioned", 3), (get_player_agent_no, ":player_agent"), (store_current_scene, ":cur_scene"), (scene_get_slot, ":first_belfry_object", ":cur_scene", slot_scene_belfry_props_begin), (prop_instance_get_position, pos2, ":first_belfry_object"), (assign, ":slot_1_positioned", 0), (assign, ":slot_2_positioned", 0), (assign, ":slot_3_positioned", 0), (assign, ":slot_4_positioned", 0), (assign, ":slot_5_positioned", 0), (assign, ":slot_6_positioned", 0), (assign, "$belfry_num_slots_positioned", 0), (assign, "$belfry_num_men_pushing", 0), (try_for_agents, ":cur_agent"), (agent_is_alive, ":cur_agent"), (agent_is_human, ":cur_agent"), (try_begin), (agent_get_slot, ":x_pos", ":cur_agent", slot_agent_target_x_pos), (neq, ":x_pos", 0), (agent_get_slot, ":y_pos", ":cur_agent", slot_agent_target_y_pos), (try_begin), (eq, ":x_pos", -600), (try_begin), (eq, ":y_pos", 0), (assign, ":slot_1_positioned", 1), (else_try), (eq, ":y_pos", -200), (assign, ":slot_2_positioned", 1), (else_try), (assign, ":slot_3_positioned", 1), (try_end), (else_try), (try_begin), (eq, ":y_pos", 0), (assign, ":slot_4_positioned", 1), (else_try), (eq, ":y_pos", -200), (assign, ":slot_5_positioned", 1), (else_try), (assign, ":slot_6_positioned", 1), (try_end), (try_end), (val_add, "$belfry_num_slots_positioned", 1), (init_position, pos1), (position_move_x, pos1, ":x_pos"), (position_move_y, pos1, ":y_pos"), (init_position, pos3), (position_move_x, pos3, ":x_pos"), (position_move_y, pos3, -1000), (position_transform_position_to_parent, pos4, pos2, pos1), (position_transform_position_to_parent, pos5, pos2, pos3), (agent_get_position, pos6, ":cur_agent"), (get_distance_between_positions, ":target_distance", pos6, pos4), (get_distance_between_positions, ":waypoint_distance", pos6, pos5), (try_begin), (this_or_next|lt, ":target_distance", ":waypoint_distance"), (lt, ":waypoint_distance", 600), (agent_set_scripted_destination, ":cur_agent", pos4, 1), (else_try), (agent_set_scripted_destination, ":cur_agent", pos5, 1), (try_end), (try_begin), (le, ":target_distance", 300), (val_add, "$belfry_num_men_pushing", 1), (try_end), (else_try), (agent_get_team, ":cur_agent_team", ":cur_agent"), (this_or_next|eq, "$attacker_team", ":cur_agent_team"), ( eq, "$attacker_team_2", ":cur_agent_team"), (try_begin), (gt, ":cur_seconds", 20), (agent_get_position, pos1, ":cur_agent"), (agent_set_scripted_destination, ":cur_agent", pos1, 0), (else_try), (try_begin), (team_get_movement_order, ":order1", "$attacker_team", grc_infantry), (team_get_movement_order, ":order2", "$attacker_team", grc_cavalry), (team_get_movement_order, ":order3", "$attacker_team", grc_archers), (this_or_next|neq, ":order1", mordr_stand_ground), (this_or_next|neq, ":order2", mordr_stand_ground), (neq, ":order3", mordr_stand_ground), (set_show_messages, 0), (team_give_order, "$attacker_team", grc_everyone, mordr_stand_ground), (set_show_messages, 1), (try_end), (try_end), (try_end), (try_end), (try_begin), (lt, "$belfry_num_slots_positioned", 6), (try_for_agents, ":cur_agent"), (agent_is_alive, ":cur_agent"), (agent_get_team, ":cur_agent_team", ":cur_agent"), (this_or_next|eq, "$attacker_team", ":cur_agent_team"), ( eq, "$attacker_team_2", ":cur_agent_team"), (neq, ":player_agent", ":cur_agent"), (agent_get_class, ":agent_class", ":cur_agent"), (this_or_next|eq, ":agent_class", grc_infantry), (eq, ":agent_class", grc_cavalry), (agent_get_slot, ":x_pos", ":cur_agent", 1), (eq, ":x_pos", 0), (assign, ":y_pos", 0), (try_begin), (eq, ":slot_1_positioned", 0), (assign, ":x_pos", -600), (assign, ":y_pos", 0), (val_add, ":slot_1_positioned", 1), (else_try), (eq, ":slot_2_positioned", 0), (assign, ":x_pos", -600), (assign, ":y_pos", -200), (val_add, ":slot_2_positioned", 1), (else_try), (eq, ":slot_3_positioned", 0), (assign, ":x_pos", -600), (assign, ":y_pos", -400), (val_add, ":slot_3_positioned", 1), (else_try), (eq, ":slot_4_positioned", 0), (assign, ":x_pos", 600), (assign, ":y_pos", 0), (val_add, ":slot_4_positioned", 1), (else_try), (eq, ":slot_5_positioned", 0), (assign, ":x_pos", 600), (assign, ":y_pos", -200), (val_add, ":slot_5_positioned", 1), (else_try), (eq, ":slot_6_positioned", 0), (assign, ":x_pos", 600), (assign, ":y_pos", -400), (val_add, ":slot_6_positioned", 1), (try_end), (val_add, "$belfry_num_slots_positioned", 1), (agent_set_slot, ":cur_agent", 1, ":x_pos"), (agent_set_slot, ":cur_agent", 2, ":y_pos"), (try_end), (try_end), (try_begin), (store_mission_timer_a, ":cur_timer"), (gt, ":cur_timer", 20), (lt, "$belfry_num_slots_positioned", 6), (try_for_agents, ":cur_agent"), (agent_is_alive, ":cur_agent"), (agent_get_team, ":cur_agent_team", ":cur_agent"), (this_or_next|eq, "$attacker_team", ":cur_agent_team"), ( eq, "$attacker_team_2", ":cur_agent_team"), (neq, ":player_agent", ":cur_agent"), (agent_get_slot, ":x_pos", ":cur_agent", 1), (eq, ":x_pos", 0), (assign, ":y_pos", 0), (try_begin), (eq, ":slot_1_positioned", 0), (assign, ":x_pos", -600), (assign, ":y_pos", 0), (val_add, ":slot_1_positioned", 1), (else_try), (eq, ":slot_2_positioned", 0), (assign, ":x_pos", -600), (assign, ":y_pos", -200), (val_add, ":slot_2_positioned", 1), (else_try), (eq, ":slot_3_positioned", 0), (assign, ":x_pos", -600), (assign, ":y_pos", -400), (val_add, ":slot_3_positioned", 1), (else_try), (eq, ":slot_4_positioned", 0), (assign, ":x_pos", 600), (assign, ":y_pos", 0), (val_add, ":slot_4_positioned", 1), (else_try), (eq, ":slot_5_positioned", 0), (assign, ":x_pos", 600), (assign, ":y_pos", -200), (val_add, ":slot_5_positioned", 1), (else_try), (eq, ":slot_6_positioned", 0), (assign, ":x_pos", 600), (assign, ":y_pos", -400), (val_add, ":slot_6_positioned", 1), (try_end), (val_add, "$belfry_num_slots_positioned", 1), (agent_set_slot, ":cur_agent", 1, ":x_pos"), (agent_set_slot, ":cur_agent", 2, ":y_pos"), (try_end), (try_end), (else_try), (assign, ":end_trigger", 1), (try_for_agents, ":cur_agent"), (agent_clear_scripted_mode, ":cur_agent"), (try_end), (set_show_messages, 0), (team_give_order, "$attacker_team", grc_everyone, mordr_charge), (set_show_messages, 1), (try_end), (eq, ":end_trigger", 1), ]), # script_siege_move_archers_to_archer_positions # Input: none # Output: none ("siege_move_archers_to_archer_positions", [ (try_for_agents, ":agent_no"), (agent_is_alive, ":agent_no"), (agent_slot_eq, ":agent_no", slot_agent_is_not_reinforcement, 0), (agent_is_defender, ":agent_no"), (agent_get_class, ":agent_class", ":agent_no"), (agent_get_troop_id, ":agent_troop", ":agent_no"), (eq, ":agent_class", grc_archers), (try_begin), (agent_slot_eq, ":agent_no", slot_agent_target_entry_point, 0), (store_random_in_range, ":random_entry_point", 40, 44), (agent_set_slot, ":agent_no", slot_agent_target_entry_point, ":random_entry_point"), (try_end), (try_begin), (agent_get_position, pos0, ":agent_no"), (entry_point_get_position, pos1, ":random_entry_point"), (get_distance_between_positions, ":dist", pos0, pos1), (lt, ":dist", 300), (agent_clear_scripted_mode, ":agent_no"), (agent_set_slot, ":agent_no", slot_agent_is_in_scripted_mode, 0), (agent_set_slot, ":agent_no", slot_agent_is_not_reinforcement, 1), (str_store_troop_name, s1, ":agent_troop"), (assign, reg0, ":agent_no"), # (display_message, "@{s1} ({reg0}) reached pos"), (else_try), (agent_get_simple_behavior, ":agent_sb", ":agent_no"), (agent_get_combat_state, ":agent_cs", ":agent_no"), (this_or_next|eq, ":agent_sb", aisb_ranged), (eq, ":agent_sb", aisb_go_to_pos),#scripted mode (eq, ":agent_cs", 7), # 7 = no visible targets (state for ranged units) (try_begin), (agent_slot_eq, ":agent_no", slot_agent_is_in_scripted_mode, 0), (agent_set_scripted_destination, ":agent_no", pos1, 0), (agent_set_slot, ":agent_no", slot_agent_is_in_scripted_mode, 1), (str_store_troop_name, s1, ":agent_troop"), (assign, reg0, ":agent_no"), # (display_message, "@{s1} ({reg0}) moving to pos"), (try_end), (else_try), (try_begin), (agent_slot_eq, ":agent_no", slot_agent_is_in_scripted_mode, 1), (agent_clear_scripted_mode, ":agent_no"), (agent_set_slot, ":agent_no", slot_agent_is_in_scripted_mode, 0), (str_store_troop_name, s1, ":agent_troop"), (assign, reg0, ":agent_no"), # (display_message, "@{s1} ({reg0}) seeing target or changed mode"), (try_end), (try_end), (try_end), ]), # script_store_movement_order_name_to_s1 # Input: arg1 = team_no, arg2 = class_no # Output: s1 = order_name ("store_movement_order_name_to_s1", [(store_script_param_1, ":team_no"), (store_script_param_2, ":class_no"), (team_get_movement_order, ":cur_order", ":team_no", ":class_no"), (try_begin), (eq, ":cur_order", mordr_hold), (str_store_string, s1, "@Holding"), (else_try), (eq, ":cur_order", mordr_follow), (str_store_string, s1, "@Following"), (else_try), (eq, ":cur_order", mordr_charge), (str_store_string, s1, "@Charging"), (else_try), (eq, ":cur_order", mordr_advance), (str_store_string, s1, "@Advancing"), (else_try), (eq, ":cur_order", mordr_fall_back), (str_store_string, s1, "@Falling Back"), (else_try), (eq, ":cur_order", mordr_stand_closer), (str_store_string, s1, "@Standing Closer"), (else_try), (eq, ":cur_order", mordr_spread_out), (str_store_string, s1, "@Spreading Out"), (else_try), (eq, ":cur_order", mordr_stand_ground), (str_store_string, s1, "@Standing"), (else_try), (str_store_string, s1, "@N/A"), (try_end), ]), # script_store_riding_order_name_to_s1 # Input: arg1 = team_no, arg2 = class_no # Output: s1 = order_name ("store_riding_order_name_to_s1", [(store_script_param_1, ":team_no"), (store_script_param_2, ":class_no"), (team_get_riding_order, ":cur_order", ":team_no", ":class_no"), (try_begin), (eq, ":cur_order", rordr_free), (str_store_string, s1, "@Free"), (else_try), (eq, ":cur_order", rordr_mount), (str_store_string, s1, "@Mount"), (else_try), (eq, ":cur_order", rordr_dismount), (str_store_string, s1, "@Dismount"), (else_try), (str_store_string, s1, "@N/A"), (try_end), ]), # script_store_weapon_usage_order_name_to_s1 # Input: arg1 = team_no, arg2 = class_no # Output: s1 = order_name ("store_weapon_usage_order_name_to_s1", [(store_script_param_1, ":team_no"), (store_script_param_2, ":class_no"), (team_get_weapon_usage_order, ":cur_order", ":team_no", ":class_no"), (team_get_hold_fire_order, ":cur_hold_fire", ":team_no", ":class_no"), (try_begin), (eq, ":cur_order", wordr_use_any_weapon), (eq, ":cur_hold_fire", aordr_fire_at_will), (str_store_string, s1, "@Any Weapon"), (else_try), (eq, ":cur_order", wordr_use_blunt_weapons), (eq, ":cur_hold_fire", aordr_fire_at_will), (str_store_string, s1, "@Blunt Weapons"), (else_try), (eq, ":cur_order", wordr_use_any_weapon), (eq, ":cur_hold_fire", aordr_hold_your_fire), (str_store_string, s1, "str_hold_fire"), (else_try), (eq, ":cur_order", wordr_use_blunt_weapons), (eq, ":cur_hold_fire", aordr_hold_your_fire), (str_store_string, s1, "str_blunt_hold_fire"), (else_try), (str_store_string, s1, "@N/A"), (try_end), ]), # script_team_give_order_from_order_panel # Input: arg1 = leader_agent_no, arg2 = class_no # Output: none ("team_give_order_from_order_panel", [(store_script_param_1, ":leader_agent_no"), (store_script_param_2, ":order"), (agent_get_team, ":team_no", ":leader_agent_no"), (set_show_messages, 0), (try_begin), (eq, "$g_formation_infantry_selected", 1), (team_give_order, ":team_no", grc_infantry, ":order"), (try_end), (try_begin), (eq, "$g_formation_archers_selected", 1), (team_give_order, ":team_no", grc_archers, ":order"), (try_end), (try_begin), (eq, "$g_formation_cavalry_selected", 1), (team_give_order, ":team_no", grc_cavalry, ":order"), (try_end), (try_begin), (eq, ":order", mordr_hold), (agent_get_position, pos1, ":leader_agent_no"), (try_begin), (eq, "$g_formation_infantry_selected", 1), (team_set_order_position, ":team_no", grc_infantry, pos1), (try_end), (try_begin), (eq, "$g_formation_archers_selected", 1), (team_set_order_position, ":team_no", grc_archers, pos1), (try_end), (try_begin), (eq, "$g_formation_cavalry_selected", 1), (team_set_order_position, ":team_no", grc_cavalry, pos1), (try_end), (try_end), (set_show_messages, 1), ]), # script_update_order_panel # Input: arg1 = team_no # Output: none ("update_order_panel", [(store_script_param_1, ":team_no"), (set_fixed_point_multiplier, 1000), (assign, ":old_is_infantry_listening", 0), (try_begin), (class_is_listening_order, ":team_no", grc_infantry), (assign, ":old_is_infantry_listening", 1), (try_end), (assign, ":old_is_archers_listening", 0), (try_begin), (class_is_listening_order, ":team_no", grc_archers), (assign, ":old_is_archers_listening", 1), (try_end), (assign, ":old_is_cavalry_listening", 0), (try_begin), (class_is_listening_order, ":team_no", grc_cavalry), (assign, ":old_is_cavalry_listening", 1), (try_end), (call_script, "script_store_movement_order_name_to_s1", ":team_no", grc_infantry), (overlay_set_text, "$g_presentation_infantry_movement", s1), (call_script, "script_store_riding_order_name_to_s1", ":team_no", grc_infantry), (overlay_set_text, "$g_presentation_infantry_riding", s1), (call_script, "script_store_weapon_usage_order_name_to_s1", ":team_no", grc_infantry), (overlay_set_text, "$g_presentation_infantry_weapon_usage", s1), (call_script, "script_store_movement_order_name_to_s1", ":team_no", grc_archers), (overlay_set_text, "$g_presentation_archers_movement", s1), (call_script, "script_store_riding_order_name_to_s1", ":team_no", grc_archers), (overlay_set_text, "$g_presentation_archers_riding", s1), (call_script, "script_store_weapon_usage_order_name_to_s1", ":team_no", grc_archers), (overlay_set_text, "$g_presentation_archers_weapon_usage", s1), (call_script, "script_store_movement_order_name_to_s1", ":team_no", grc_cavalry), (overlay_set_text, "$g_presentation_cavalry_movement", s1), (call_script, "script_store_riding_order_name_to_s1", ":team_no", grc_cavalry), (overlay_set_text, "$g_presentation_cavalry_riding", s1), (call_script, "script_store_weapon_usage_order_name_to_s1", ":team_no", grc_cavalry), (overlay_set_text, "$g_presentation_cavalry_weapon_usage", s1), (try_begin), (eq, ":old_is_infantry_listening", 1), (eq, ":old_is_archers_listening", 1), (eq, ":old_is_cavalry_listening", 1), (team_set_order_listener, ":team_no", grc_everyone), (else_try), (eq, ":old_is_infantry_listening", 1), (team_set_order_listener, ":team_no", grc_infantry), (else_try), (eq, ":old_is_archers_listening", 1), (team_set_order_listener, ":team_no", grc_archers), (else_try), (eq, ":old_is_cavalry_listening", 1), (team_set_order_listener, ":team_no", grc_cavalry), (try_end), (position_set_y, pos1, 660), (position_set_x, pos1, 250), (overlay_set_position, "$g_presentation_infantry_movement", pos1), (position_set_x, pos1, 400), (overlay_set_position, "$g_presentation_infantry_riding", pos1), (position_set_x, pos1, 550), (overlay_set_position, "$g_presentation_infantry_weapon_usage", pos1), (position_set_y, pos1, 620), (position_set_x, pos1, 250), (overlay_set_position, "$g_presentation_archers_movement", pos1), (position_set_x, pos1, 400), (overlay_set_position, "$g_presentation_archers_riding", pos1), (position_set_x, pos1, 550), (overlay_set_position, "$g_presentation_archers_weapon_usage", pos1), (position_set_y, pos1, 580), (position_set_x, pos1, 250), (overlay_set_position, "$g_presentation_cavalry_movement", pos1), (position_set_x, pos1, 400), (overlay_set_position, "$g_presentation_cavalry_riding", pos1), (position_set_x, pos1, 550), (overlay_set_position, "$g_presentation_cavalry_weapon_usage", pos1), ]), # script_update_agent_position_on_map # Input: arg1 = agent_no, pos2 = map_size_pos # Output: none ("update_agent_position_on_map", [(store_script_param_1, ":agent_no"), (agent_get_slot, ":agent_overlay", ":agent_no", slot_agent_map_overlay_id), (get_player_agent_no, ":player_agent"), (try_begin), (le, ":agent_overlay", 0), (set_fixed_point_multiplier, 1000), (try_begin), (eq, ":agent_no", ":player_agent"), (create_mesh_overlay, reg1, "mesh_player_dot"), (position_set_x, pos1, 500), (position_set_y, pos1, 500), (overlay_set_size, reg1, pos1), (else_try), (create_mesh_overlay, reg1, "mesh_white_dot"), (position_set_x, pos1, 200), (position_set_y, pos1, 200), (overlay_set_size, reg1, pos1), (try_end), (overlay_set_alpha, reg1, 0x88), (agent_set_slot, ":agent_no", slot_agent_map_overlay_id, reg1), (assign, ":agent_overlay", reg1), (try_end), (try_begin), (neq, ":agent_no", ":player_agent"), (agent_get_party_id, ":agent_party", ":agent_no"), ############################### # Changed by Form Ranks kit # (try_begin), (assign, ":continue", 0), (try_for_range, ":i", 1, "$formation_max_array_no"), (store_add, ":slot", slot_party_array_parties_begin, ":i"), (party_get_slot, ":array_party", "p_main_party", ":slot"), (eq, ":array_party", ":agent_party"), (assign, ":continue", 1), (try_end), (this_or_next|eq, ":agent_party", "p_main_party"), (eq, ":continue", 1), # # Change of Form Ranks kit end ############################### (agent_get_class, ":agent_class", ":agent_no"), (try_begin), (eq, ":agent_class", grc_archers), (overlay_set_color, ":agent_overlay", 0x34c6e4), (else_try), (eq, ":agent_class", grc_cavalry), (overlay_set_color, ":agent_overlay", 0x569619), (else_try), #grc_infantry (overlay_set_color, ":agent_overlay", 0x8d5220), (try_end), (else_try), (agent_is_ally, ":agent_no"), (overlay_set_color, ":agent_overlay", 0x5555FF), (else_try), (overlay_set_color, ":agent_overlay", 0xFF0000), (try_end), (try_end), (try_begin), (eq, ":agent_no", ":player_agent"), (agent_get_look_position, pos1, ":agent_no"), (position_get_rotation_around_z, ":rot", pos1), (init_position, pos10), (position_rotate_z, pos10, ":rot"), (overlay_set_mesh_rotation, ":agent_overlay", pos10), (call_script, "script_convert_3d_pos_to_map_pos"), (else_try), (agent_get_position, pos1, ":agent_no"), (call_script, "script_convert_3d_pos_to_map_pos"), (try_end), (overlay_set_position, ":agent_overlay", pos0), ]), # script_convert_3d_pos_to_map_pos # Input: pos1 = 3d_pos, pos2 = map_size_pos # Output: pos0 = map_pos ("convert_3d_pos_to_map_pos", [(set_fixed_point_multiplier, 1000), (position_transform_position_to_local, pos3, pos2, pos1), (position_get_x, ":agent_x_pos", pos3), (position_get_y, ":agent_y_pos", pos3), (val_div, ":agent_x_pos", "$g_battle_map_scale"), (val_div, ":agent_y_pos", "$g_battle_map_scale"), (set_fixed_point_multiplier, 1000), (store_sub, ":map_x", 980, "$g_battle_map_width"), (store_sub, ":map_y", 730, "$g_battle_map_height"), (val_add, ":agent_x_pos", ":map_x"), (val_add, ":agent_y_pos", ":map_y"), (position_set_x, pos0, ":agent_x_pos"), (position_set_y, pos0, ":agent_y_pos"), ]), # further follow-up needed... # script_update_order_flags_on_map # Input: none # Output: none ("update_order_flags_on_map", [(set_fixed_point_multiplier, 1000), (get_player_agent_no, ":player_agent"), (agent_get_team, ":player_team", ":player_agent"), (assign, ":old_is_infantry_listening", 0), (try_begin), (class_is_listening_order, ":player_team", grc_infantry), (assign, ":old_is_infantry_listening", 1), (try_end), (assign, ":old_is_archers_listening", 0), (try_begin), (class_is_listening_order, ":player_team", grc_archers), (assign, ":old_is_archers_listening", 1), (try_end), (assign, ":old_is_cavalry_listening", 0), (try_begin), (class_is_listening_order, ":player_team", grc_cavalry), (assign, ":old_is_cavalry_listening", 1), (try_end), (get_scene_boundaries, pos2, pos3), (team_get_movement_order, ":cur_order", ":player_team", grc_infantry), (try_begin), (eq, ":cur_order", mordr_hold), (team_get_order_position, pos1, ":player_team", grc_infantry), (call_script, "script_convert_3d_pos_to_map_pos"), (overlay_set_alpha, "$g_battle_map_infantry_order_flag", 0xFF), (overlay_set_position, "$g_battle_map_infantry_order_flag", pos0), (else_try), (overlay_set_alpha, "$g_battle_map_infantry_order_flag", 0), (try_end), (team_get_movement_order, ":cur_order", ":player_team", grc_archers), (try_begin), (eq, ":cur_order", mordr_hold), (team_get_order_position, pos1, ":player_team", grc_archers), (call_script, "script_convert_3d_pos_to_map_pos"), (overlay_set_alpha, "$g_battle_map_archers_order_flag", 0xFF), (overlay_set_position, "$g_battle_map_archers_order_flag", pos0), (else_try), (overlay_set_alpha, "$g_battle_map_archers_order_flag", 0), (try_end), (team_get_movement_order, ":cur_order", ":player_team", grc_cavalry), (try_begin), (eq, ":cur_order", mordr_hold), (team_get_order_position, pos1, ":player_team", grc_cavalry), (call_script, "script_convert_3d_pos_to_map_pos"), (overlay_set_alpha, "$g_battle_map_cavalry_order_flag", 0xFF), (overlay_set_position, "$g_battle_map_cavalry_order_flag", pos0), (else_try), (overlay_set_alpha, "$g_battle_map_cavalry_order_flag", 0), (try_end), (try_begin), (eq, ":old_is_infantry_listening", 1), (eq, ":old_is_archers_listening", 1), (eq, ":old_is_cavalry_listening", 1), (team_set_order_listener, ":player_team", grc_everyone), (else_try), (eq, ":old_is_infantry_listening", 1), (team_set_order_listener, ":player_team", grc_infantry), (else_try), (eq, ":old_is_archers_listening", 1), (team_set_order_listener, ":player_team", grc_archers), (else_try), (eq, ":old_is_cavalry_listening", 1), (team_set_order_listener, ":player_team", grc_cavalry), (try_end), ]), # script_update_order_panel_checked_classes # Input: none # Output: none ("update_order_panel_checked_classes", [(get_player_agent_no, ":player_agent"), (agent_get_team, ":player_team", ":player_agent"), (try_begin), (class_is_listening_order, ":player_team", grc_infantry), (overlay_set_val, "$g_presentation_obj_4", 1), (assign, "$g_formation_infantry_selected", 1), (overlay_animate_to_alpha, "$g_presentation_obj_1", 250, 0x44), (else_try), (overlay_set_val, "$g_presentation_obj_4", 0), (assign, "$g_formation_infantry_selected", 0), (overlay_animate_to_alpha, "$g_presentation_obj_1", 250, 0), (try_end), (try_begin), (class_is_listening_order, ":player_team", grc_archers), (overlay_set_val, "$g_presentation_obj_5", 1), (assign, "$g_formation_archers_selected", 1), (overlay_animate_to_alpha, "$g_presentation_obj_2", 250, 0x44), (else_try), (overlay_set_val, "$g_presentation_obj_5", 0), (assign, "$g_formation_archers_selected", 0), (overlay_animate_to_alpha, "$g_presentation_obj_2", 250, 0), (try_end), (try_begin), (class_is_listening_order, ":player_team", grc_cavalry), (overlay_set_val, "$g_presentation_obj_6", 1), (assign, "$g_formation_cavalry_selected", 1), (overlay_animate_to_alpha, "$g_presentation_obj_3", 250, 0x44), (else_try), (overlay_set_val, "$g_presentation_obj_6", 0), (assign, "$g_formation_cavalry_selected", 0), (overlay_animate_to_alpha, "$g_presentation_obj_3", 250, 0), (try_end), ]), # script_update_order_panel_statistics_and_map # Input: none # Output: none ("update_order_panel_statistics_and_map", #TODO: Call this in every battle mission template, once per second [(set_fixed_point_multiplier, 1000), (assign, ":num_us_ready_infantry", 0), (assign, ":num_us_ready_archers", 0), (assign, ":num_us_ready_cavalry", 0), (assign, ":num_us_wounded_infantry", 0), (assign, ":num_us_wounded_archers", 0), (assign, ":num_us_wounded_cavalry", 0), (assign, ":num_us_dead_infantry", 0), (assign, ":num_us_dead_archers", 0), (assign, ":num_us_dead_cavalry", 0), (assign, ":num_allies_ready_men", 0), (assign, ":num_allies_wounded_men", 0), (assign, ":num_allies_dead_men", 0), (assign, ":num_enemies_ready_men", 0), (assign, ":num_enemies_wounded_men", 0), (assign, ":num_enemies_dead_men", 0), (get_player_agent_no, ":player_agent"), (agent_get_team, ":player_team", ":player_agent"), (assign, ":old_is_infantry_listening", 0), (try_begin), (class_is_listening_order, ":player_team", grc_infantry), (assign, ":old_is_infantry_listening", 1), (try_end), (assign, ":old_is_archers_listening", 0), (try_begin), (class_is_listening_order, ":player_team", grc_archers), (assign, ":old_is_archers_listening", 1), (try_end), (assign, ":old_is_cavalry_listening", 0), (try_begin), (class_is_listening_order, ":player_team", grc_cavalry), (assign, ":old_is_cavalry_listening", 1), (try_end), (get_scene_boundaries, pos2, pos3), (try_for_agents,":cur_agent"), (agent_is_human, ":cur_agent"), (agent_get_class, ":agent_class", ":cur_agent"), (agent_get_party_id, ":agent_party", ":cur_agent"), (agent_get_slot, ":agent_overlay", ":cur_agent", slot_agent_map_overlay_id), (try_begin), (eq, ":agent_party", "p_main_party"), (try_begin), (agent_is_alive, ":cur_agent"), (call_script, "script_update_agent_position_on_map", ":cur_agent"), (try_begin), (eq, ":agent_class", grc_archers), (val_add, ":num_us_ready_archers", 1), (else_try), (eq, ":agent_class", grc_cavalry), (val_add, ":num_us_ready_cavalry", 1), (else_try), #infantry (val_add, ":num_us_ready_infantry", 1), (try_end), (else_try), (overlay_set_alpha, ":agent_overlay", 0), (agent_is_wounded, ":cur_agent"), (try_begin), (eq, ":agent_class", grc_archers), (val_add, ":num_us_wounded_archers", 1), (else_try), (eq, ":agent_class", grc_cavalry), (val_add, ":num_us_wounded_cavalry", 1), (else_try), #infantry (val_add, ":num_us_wounded_infantry", 1), (try_end), (else_try), (try_begin), (eq, ":agent_class", grc_archers), (val_add, ":num_us_dead_archers", 1), (else_try), (eq, ":agent_class", grc_cavalry), (val_add, ":num_us_dead_cavalry", 1), (else_try), #infantry (val_add, ":num_us_dead_infantry", 1), (try_end), (try_end), (else_try), (agent_is_ally, ":cur_agent"), (try_begin), (agent_is_alive, ":cur_agent"), (call_script, "script_update_agent_position_on_map", ":cur_agent"), (val_add, ":num_allies_ready_men", 1), (else_try), (overlay_set_alpha, ":agent_overlay", 0), (agent_is_wounded, ":cur_agent"), (val_add, ":num_allies_wounded_men", 1), (else_try), (val_add, ":num_allies_dead_men", 1), (try_end), (else_try), (try_begin), (agent_is_alive, ":cur_agent"), (call_script, "script_update_agent_position_on_map", ":cur_agent"), (val_add, ":num_enemies_ready_men", 1), (else_try), (overlay_set_alpha, ":agent_overlay", 0), (agent_is_wounded, ":cur_agent"), (val_add, ":num_enemies_wounded_men", 1), (else_try), (val_add, ":num_enemies_dead_men", 1), (try_end), (try_end), (try_end), (assign, reg1, ":num_us_ready_infantry"), (assign, reg2, ":num_us_ready_archers"), (assign, reg3, ":num_us_ready_cavalry"), (store_add, ":num_us_ready_men", ":num_us_ready_infantry", ":num_us_ready_archers"), (val_add, ":num_us_ready_men", ":num_us_ready_cavalry"), (store_add, ":num_us_wounded_men", ":num_us_wounded_infantry", ":num_us_wounded_archers"), (val_add, ":num_us_wounded_men", ":num_us_wounded_cavalry"), (store_add, ":num_us_dead_men", ":num_us_dead_infantry", ":num_us_dead_archers"), (val_add, ":num_us_dead_men", ":num_us_dead_cavalry"), (assign, reg4, ":num_us_ready_men"), (assign, reg5, ":num_us_wounded_men"), (assign, reg6, ":num_us_dead_men"), (assign, reg7, ":num_allies_ready_men"), (assign, reg8, ":num_allies_wounded_men"), (assign, reg9, ":num_allies_dead_men"), (assign, reg10, ":num_enemies_ready_men"), (assign, reg11, ":num_enemies_wounded_men"), (assign, reg12, ":num_enemies_dead_men"), (overlay_set_text, "$g_presentation_obj_7", "@Infantry ({reg1})"), (overlay_set_text, "$g_presentation_obj_8", "@Archers ({reg2})"), (overlay_set_text, "$g_presentation_obj_9", "@Cavalry ({reg3})"), (overlay_set_text, "$g_battle_us_ready", "@{reg4}"), (overlay_set_text, "$g_battle_us_wounded", "@{reg5}"), (overlay_set_text, "$g_battle_us_dead", "@{reg6}"), (overlay_set_text, "$g_battle_allies_ready", "@{reg7}"), (overlay_set_text, "$g_battle_allies_wounded", "@{reg8}"), (overlay_set_text, "$g_battle_allies_dead", "@{reg9}"), (overlay_set_text, "$g_battle_enemies_ready", "@{reg10}"), (overlay_set_text, "$g_battle_enemies_wounded", "@{reg11}"), (overlay_set_text, "$g_battle_enemies_dead", "@{reg12}"), (assign, ":stat_position_x", 100), (assign, ":stat_position_y", 100), (val_add, ":stat_position_x", 150), (val_add, ":stat_position_y", 80), (position_set_x, pos1, ":stat_position_x"), (position_set_y, pos1, ":stat_position_y"), (overlay_set_position, "$g_battle_us_ready", pos1), (val_add, ":stat_position_x", 150), (position_set_x, pos1, ":stat_position_x"), (overlay_set_position, "$g_battle_us_wounded", pos1), (val_add, ":stat_position_x", 150), (position_set_x, pos1, ":stat_position_x"), (overlay_set_position, "$g_battle_us_dead", pos1), (val_add, ":stat_position_x", -300), (val_add, ":stat_position_y", -40), (position_set_x, pos1, ":stat_position_x"), (position_set_y, pos1, ":stat_position_y"), (overlay_set_position, "$g_battle_allies_ready", pos1), (val_add, ":stat_position_x", 150), (position_set_x, pos1, ":stat_position_x"), (overlay_set_position, "$g_battle_allies_wounded", pos1), (val_add, ":stat_position_x", 150), (position_set_x, pos1, ":stat_position_x"), (overlay_set_position, "$g_battle_allies_dead", pos1), (val_add, ":stat_position_x", -300), (val_add, ":stat_position_y", -40), (position_set_x, pos1, ":stat_position_x"), (position_set_y, pos1, ":stat_position_y"), (overlay_set_position, "$g_battle_enemies_ready", pos1), (val_add, ":stat_position_x", 150), (position_set_x, pos1, ":stat_position_x"), (overlay_set_position, "$g_battle_enemies_wounded", pos1), (val_add, ":stat_position_x", 150), (position_set_x, pos1, ":stat_position_x"), (overlay_set_position, "$g_battle_enemies_dead", pos1), (call_script, "script_update_order_flags_on_map"), (try_begin), (eq, ":old_is_infantry_listening", 1), (eq, ":old_is_archers_listening", 1), (eq, ":old_is_cavalry_listening", 1), (team_set_order_listener, ":player_team", grc_everyone), (else_try), (eq, ":old_is_infantry_listening", 1), (team_set_order_listener, ":player_team", grc_infantry), (else_try), (eq, ":old_is_archers_listening", 1), (team_set_order_listener, ":player_team", grc_archers), (else_try), (eq, ":old_is_cavalry_listening", 1), (team_set_order_listener, ":player_team", grc_cavalry), (try_end), ]), # script_consume_food # Input: arg1: order of the food to be consumed # Output: none ("consume_food", [(store_script_param, ":selected_food", 1), (troop_get_inventory_capacity, ":capacity", "trp_player"), (try_for_range, ":cur_slot", 0, ":capacity"), (troop_get_inventory_slot, ":cur_item", "trp_player", ":cur_slot"), (is_between, ":cur_item", food_begin, food_end), (troop_get_inventory_slot_modifier, ":item_modifier", "trp_player", ":cur_slot"), (neq, ":item_modifier", imod_rotten), (item_slot_eq, ":cur_item", slot_item_is_checked, 0), (item_set_slot, ":cur_item", slot_item_is_checked, 1), (val_sub, ":selected_food", 1), (lt, ":selected_food", 0), (assign, ":capacity", 0), (troop_inventory_slot_get_item_amount, ":cur_amount", "trp_player", ":cur_slot"), (val_sub, ":cur_amount", 1), (troop_inventory_slot_set_item_amount, "trp_player", ":cur_slot", ":cur_amount"), (try_end), ]), # script_calculate_troop_score_for_center # Input: arg1 = troop_no, arg2 = center_no # Output: reg0 = score ("calculate_troop_score_for_center", [(store_script_param, ":troop_no", 1), (store_script_param, ":center_no", 2), (assign, ":num_center_points", 1), (try_for_range, ":cur_center", centers_begin, centers_end), (assign, ":center_owned", 0), (try_begin), (eq, ":troop_no", "trp_player"), (party_slot_eq, ":cur_center", slot_town_lord, stl_reserved_for_player), (assign, ":center_owned", 1), (try_end), (this_or_next|party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"), (eq, ":center_owned", 1), (try_begin), (party_slot_eq, ":cur_center", slot_party_type, spt_town), (val_add, ":num_center_points", 4), (else_try), (party_slot_eq, ":cur_center", slot_party_type, spt_castle), (val_add, ":num_center_points", 2), (else_try), (val_add, ":num_center_points", 1), (try_end), (try_end), (troop_get_slot, ":troop_renown", ":troop_no", slot_troop_renown), (store_add, ":score", 500, ":troop_renown"), (val_div, ":score", ":num_center_points"), (store_random_in_range, ":random", 50, 100), (val_mul, ":score", ":random"), (try_begin), (party_slot_eq, ":center_no", slot_center_last_taken_by_troop, ":troop_no"), (val_mul, ":score", 3), (val_div, ":score", 2), (try_end), (try_begin), (eq, ":troop_no", "trp_player"), (faction_get_slot, ":faction_leader", "$players_kingdom"), (call_script, "script_troop_get_player_relation", ":faction_leader"), (assign, ":leader_relation", reg0), #(troop_get_slot, ":leader_relation", ":faction_leader", slot_troop_player_relation), (val_mul, ":leader_relation", 2), (val_add, ":score", ":leader_relation"), (try_end), (assign, reg0, ":score"), ]), # script_assign_lords_to_empty_centers # Input: none # Output: none ("assign_lords_to_empty_centers", [(try_for_range, ":cur_center", centers_begin, centers_end), (party_get_slot, ":center_lord", ":cur_center", slot_town_lord), (this_or_next|eq, ":center_lord", stl_unassigned), (eq, ":center_lord", stl_rejected_by_player), (store_faction_of_party, ":center_faction", ":cur_center"), (is_between, ":center_faction", kingdoms_begin, kingdoms_end), (neg|faction_slot_eq, ":center_faction", slot_faction_leader, "trp_player"), (assign, ":best_lord", -1), (assign, ":best_lord_score", -1), (try_begin), (eq, ":center_lord", stl_unassigned), (try_begin), (eq, "$players_kingdom", ":center_faction"), (eq, "$player_has_homage", 1), (assign, ":best_lord", stl_reserved_for_player), (call_script, "script_calculate_troop_score_for_center", "trp_player", ":cur_center"), (assign, ":best_lord_score", reg0), (try_end), (try_end), (try_for_range, ":cur_troop", kingdom_heroes_begin, kingdom_heroes_end), (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero), (store_troop_faction, ":troop_faction", ":cur_troop"), (eq, ":troop_faction", ":center_faction"), (call_script, "script_calculate_troop_score_for_center", ":cur_troop", ":cur_center"), (assign, ":score", reg0), (gt, ":score", ":best_lord_score"), (assign, ":best_lord_score", ":score"), (assign, ":best_lord", ":cur_troop"), (try_end), (try_begin), (ge, ":best_lord", 0), (call_script, "script_give_center_to_lord", ":cur_center", ":best_lord", 1), (else_try), (eq, ":best_lord", stl_reserved_for_player), (party_set_slot, ":cur_center", slot_town_lord, stl_reserved_for_player), (try_begin), (party_slot_eq, ":cur_center", slot_party_type, spt_castle), (try_for_range, ":cur_village", villages_begin, villages_end), (party_slot_eq, ":cur_village", slot_village_bound_center, ":cur_center"), (party_set_slot, ":cur_village", slot_town_lord, stl_reserved_for_player), (try_end), (try_end), (try_end), (try_end), ]), # script_create_village_farmer_party # Input: arg1 = village_no # Output: reg0 = party_no ("create_village_farmer_party", [(store_script_param, ":village_no", 1), (party_get_slot, ":town_no", ":village_no", slot_village_market_town), (store_faction_of_party, ":party_faction", ":town_no"), (set_spawn_radius, 0), (spawn_around_party, ":village_no", "pt_village_farmers"), (assign, ":new_party", reg0), (party_set_faction, ":new_party", ":party_faction"), (party_set_slot, ":new_party", slot_party_home_center, ":village_no"), (party_set_slot, ":new_party", slot_party_type, spt_village_farmer), (party_set_slot, ":new_party", slot_party_ai_state, spai_trading_with_town), (party_set_slot, ":new_party", slot_party_ai_object, ":town_no"), (party_set_ai_behavior, ":new_party", ai_bhvr_travel_to_party), (party_set_ai_object, ":new_party", ":town_no"), (party_set_flags, ":new_party", pf_default_behavior, 0), (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin), (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end), (store_add, ":cur_good_price_slot", ":cur_goods", ":item_to_price_slot"), (party_get_slot, ":cur_village_price", ":village_no", ":cur_good_price_slot"), (party_set_slot, ":new_party", ":cur_good_price_slot", ":cur_village_price"), (try_end), (assign, reg0, ":new_party"), ]), #script_do_party_center_trade # INPUT: arg1 = party_no, arg2 = center_no, arg3 = percentage_change_in_center # OUTPUT: reg0 = total_change ("do_party_center_trade", [ (store_script_param, ":party_no", 1), (store_script_param, ":center_no", 2), (store_script_param, ":percentage_change", 3), (assign, ":total_change", 0), (store_sub, ":item_to_price_slot", slot_town_trade_good_prices_begin, trade_goods_begin), (try_for_range, ":cur_good", trade_goods_begin, trade_goods_end), (store_add, ":cur_good_price_slot", ":cur_good", ":item_to_price_slot"), (party_get_slot, ":cur_merchant_price", ":party_no", ":cur_good_price_slot"), (party_get_slot, ":cur_center_price", ":center_no", ":cur_good_price_slot"), (store_sub, ":price_dif", ":cur_merchant_price", ":cur_center_price"), (assign, ":cur_change", ":price_dif"), (val_abs, ":cur_change"), (val_add, ":total_change", ":cur_change"), (val_mul, ":cur_change", ":percentage_change"), (val_div, ":cur_change", 100), (try_begin), (lt, ":price_dif", 0), (val_mul, ":cur_change", -1), (try_end), (val_add, ":cur_center_price", ":cur_change"), (party_set_slot, ":center_no", ":cur_good_price_slot", ":cur_center_price"), (party_set_slot, ":party_no", ":cur_good_price_slot", ":cur_center_price"), (try_end), (assign, reg0, ":total_change"), ]), #script_player_join_faction # INPUT: arg1 = faction_no # OUTPUT: none ("player_join_faction", [ (store_script_param, ":faction_no", 1), (assign,"$players_kingdom",":faction_no"), (faction_set_slot, "fac_player_supporters_faction", slot_faction_ai_state, sfai_default), ## (try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end), ## (store_troop_faction, ":kingdom_hero_faction", ":kingdom_hero"), ## (eq, ":kingdom_hero_faction", "fac_player_supporters_faction"), ## (call_script, "script_change_troop_faction", ":kingdom_hero", ":faction_no"), ## (try_end), (assign, "$players_oath_renounced_against_kingdom", 0), (assign, "$players_oath_renounced_given_center", 0), (assign, "$players_oath_renounced_begin_time", 0), (try_for_range,":other_kingdom",kingdoms_begin,kingdoms_end), (faction_slot_eq, ":other_kingdom", slot_faction_state, sfs_active), (neq, ":other_kingdom", "fac_player_supporters_faction"), (try_begin), (neq, ":other_kingdom", ":faction_no"), (store_relation, ":other_kingdom_reln", ":other_kingdom", ":faction_no"), (else_try), (store_relation, ":other_kingdom_reln", "fac_player_supporters_faction", ":other_kingdom"), (val_max, ":other_kingdom_reln", 12), (try_end), (call_script, "script_set_player_relation_with_faction", ":other_kingdom", ":other_kingdom_reln"), (try_end), (try_for_range, ":cur_center", centers_begin, centers_end), #Give center to kingdom if player is the owner (party_slot_eq, ":cur_center", slot_town_lord, "trp_player"), (party_set_faction, ":cur_center", ":faction_no"), (try_end), (try_for_range, ":quest_no", lord_quests_begin, lord_quests_end), (check_quest_active, ":quest_no"), (quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop), (store_troop_faction, ":quest_giver_faction", ":quest_giver_troop"), (store_relation, ":quest_giver_faction_relation", "fac_player_supporters_faction", ":quest_giver_faction"), (lt, ":quest_giver_faction_relation", 0), (call_script, "script_abort_quest", ":quest_no", 0), (try_end), (try_begin), (neq, ":faction_no", "fac_player_supporters_faction"), (faction_set_slot, "fac_player_supporters_faction", slot_faction_state, sfs_inactive), (faction_set_slot, "fac_player_supporters_faction", slot_faction_leader, "trp_player"), (try_end), (call_script, "script_store_average_center_value_per_faction"), (call_script, "script_update_all_notes"), (assign, "$g_recalculate_ais", 1), ]), #script_player_leave_faction # INPUT: arg1 = give_back_fiefs # OUTPUT: none ("player_leave_faction", [ (store_script_param, ":give_back_fiefs", 1), (call_script, "script_check_and_finish_active_army_quests_for_faction", "$players_kingdom"), (assign, ":old_kingdom", "$players_kingdom"), (assign, ":old_has_homage", "$player_has_homage"), (assign, "$players_kingdom", 0), (assign, "$player_has_homage", 0), (try_begin), (neq, ":give_back_fiefs", 0), (try_for_range, ":cur_center", centers_begin, centers_end), (party_slot_eq, ":cur_center", slot_town_lord, "trp_player"), (call_script, "script_give_center_to_faction", ":cur_center", ":old_kingdom"), (try_end), (else_try), (try_for_range, ":cur_center", centers_begin, centers_end), (party_slot_eq, ":cur_center", slot_town_lord, "trp_player"), (call_script, "script_give_center_to_faction", ":cur_center", "fac_player_supporters_faction"), (try_end), (try_for_range, ":cur_center", villages_begin, villages_end), (party_get_slot, ":cur_bound_center", ":cur_center", slot_village_bound_center), (party_slot_eq, ":cur_center", slot_town_lord, "trp_player"), (neg|party_slot_eq, ":cur_bound_center", slot_town_lord, "trp_player"), (call_script, "script_give_center_to_faction", ":cur_center", ":old_kingdom"), (try_end), (store_relation, ":reln", "fac_player_supporters_faction", ":old_kingdom"), (store_sub, ":req_dif", -40, ":reln"), (call_script, "script_change_player_relation_with_faction", ":old_kingdom", ":req_dif"), (try_end), (try_begin), (eq, ":old_has_homage", 1), (faction_get_slot, ":faction_leader", ":old_kingdom", slot_faction_leader), (call_script, "script_change_player_relation_with_troop", ":faction_leader", -20), (try_end), (call_script, "script_update_all_notes"), (assign, "$g_recalculate_ais", 1), ]), #script_activate_deactivate_player_faction # INPUT: arg1 = last_interaction_with_faction # OUTPUT: none ("activate_deactivate_player_faction", [ (store_script_param, ":last_interaction_with_faction", 1), (try_begin), (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), (try_begin), (eq, ":has_center", 1), (neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active), (faction_set_slot, "fac_player_supporters_faction", slot_faction_state, sfs_active), (faction_set_slot, "fac_player_supporters_faction", slot_faction_leader, "trp_player"), (str_store_faction_name, s1, ":last_interaction_with_faction"), (faction_set_name, "fac_player_supporters_faction", "@{s1} Rebels"), (faction_set_color, "fac_player_supporters_faction", 0xAAAAAA), (assign, "$players_kingdom", "fac_player_supporters_faction"), (assign, "$g_player_banner_granted", 1), (call_script, "script_store_average_center_value_per_faction"), (call_script, "script_update_all_notes"), (call_script, "script_add_notification_menu", "mnu_notification_player_faction_active", 0, 0), (else_try), (eq, ":has_center", 0), (faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active), (le, "$supported_pretender", 0), (faction_set_slot, "fac_player_supporters_faction", slot_faction_state, sfs_inactive), (faction_set_slot, "fac_player_supporters_faction", slot_faction_leader, "trp_player"), (assign, "$players_kingdom", 0), (assign, "$players_oath_renounced_against_kingdom", 0), (assign, "$players_oath_renounced_given_center", 0), (assign, "$players_oath_renounced_begin_time", 0), (call_script, "script_store_average_center_value_per_faction"), (call_script, "script_update_all_notes"), (call_script, "script_add_notification_menu", "mnu_notification_player_faction_deactive", 0, 0), (try_end), (try_end), ]), #script_agent_reassign_team # INPUT: arg1 = agent_no # OUTPUT: none ("agent_reassign_team", [ (store_script_param, ":agent_no", 1), (get_player_agent_no, ":player_agent"), (try_begin), (ge, ":player_agent", 0), (agent_is_human, ":agent_no"), (agent_is_ally, ":agent_no"), (agent_get_party_id, ":party_no", ":agent_no"), (neq, ":party_no", "p_main_party"), (assign, ":continue", 1), (store_faction_of_party, ":party_faction", ":party_no"), (try_begin), (eq, ":party_faction", "$players_kingdom"), (is_between, "$players_kingdom", kingdoms_begin, kingdoms_end), (faction_slot_eq, "$players_kingdom", slot_faction_marshall, "trp_player"), (assign, ":continue", 0), (else_try), (party_stack_get_troop_id, ":leader_troop_id", ":party_no", 0), (neg|is_between, ":leader_troop_id", kingdom_heroes_begin, kingdom_heroes_end), (assign, ":continue", 0), (try_end), (eq, ":continue", 1), (agent_get_team, ":player_team", ":player_agent"), (val_add, ":player_team", 2), (agent_set_team, ":agent_no", ":player_team"), (try_end), ]), #script_start_quest # INPUT: arg1 = quest_no, arg2 = giver_troop_no, s2 = description_text # OUTPUT: none ("start_quest", [(store_script_param, ":quest_no", 1), (store_script_param, ":giver_troop_no", 2), (try_begin), (is_between, ":giver_troop_no", kingdom_heroes_begin, kingdom_heroes_end), (str_store_troop_name_link, s62, ":giver_troop_no"), (else_try), (str_store_troop_name, s62, ":giver_troop_no"), (try_end), (str_store_string, s63, "@Given by: {s62}"), (store_current_hours, ":cur_hours"), (str_store_date, s60, ":cur_hours"), (str_store_string, s60, "@Given on: {s60}"), (add_quest_note_from_sreg, ":quest_no", 0, s60, 0), (add_quest_note_from_sreg, ":quest_no", 1, s63, 0), (add_quest_note_from_sreg, ":quest_no", 2, s2, 0), (try_begin), (quest_slot_ge, ":quest_no", slot_quest_expiration_days, 1), (quest_get_slot, reg0, ":quest_no", slot_quest_expiration_days), (add_quest_note_from_sreg, ":quest_no", 7, "@You have {reg0} days to finish this quest.", 0), (try_end), #Adding dont_give_again_for_days value (try_begin), (quest_slot_ge, ":quest_no", slot_quest_dont_give_again_period, 1), (quest_get_slot, ":dont_give_again_period", ":quest_no", slot_quest_dont_give_again_period), (quest_set_slot, ":quest_no", slot_quest_dont_give_again_remaining_days, ":dont_give_again_period"), (try_end), (start_quest, ":quest_no", ":giver_troop_no"), (display_message, "str_quest_log_updated"), ]), #script_conclude_quest # INPUT: arg1 = quest_no # OUTPUT: none ("conclude_quest", [(store_script_param, ":quest_no", 1), (conclude_quest, ":quest_no"), (quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop), (str_store_troop_name, s59, ":quest_giver_troop"), (add_quest_note_from_sreg, ":quest_no", 7, "@This quest has been concluded. Talk to {s59} to finish it.", 0), ]), #script_succeed_quest # INPUT: arg1 = quest_no # OUTPUT: none ("succeed_quest", [(store_script_param, ":quest_no", 1), (succeed_quest, ":quest_no"), (quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop), (str_store_troop_name, s59, ":quest_giver_troop"), (add_quest_note_from_sreg, ":quest_no", 7, "@This quest has been successfully completed. Talk to {s59} to claim your reward.", 0), ]), #script_fail_quest # INPUT: arg1 = quest_no # OUTPUT: none ("fail_quest", [(store_script_param, ":quest_no", 1), (fail_quest, ":quest_no"), (quest_get_slot, ":quest_giver_troop", ":quest_no", slot_quest_giver_troop), (str_store_troop_name, s59, ":quest_giver_troop"), (add_quest_note_from_sreg, ":quest_no", 7, "@This quest has failed. Talk to {s59} to explain the situation.", 0), ]), #script_report_quest_troop_positions # INPUT: arg1 = quest_no, arg2 = troop_no, arg3 = note_index # OUTPUT: none ("report_quest_troop_positions", [(store_script_param, ":quest_no", 1), (store_script_param, ":troop_no", 2), (store_script_param, ":note_index", 3), (call_script, "script_get_information_about_troops_position", ":troop_no", 1), (str_store_string, s5, "@At the time quest was given:^{s1}"), (add_quest_note_from_sreg, ":quest_no", ":note_index", s5, 1), (call_script, "script_update_troop_location_notes", ":troop_no", 1), ]), #script_end_quest # INPUT: arg1 = quest_no # OUTPUT: none ("end_quest", [(store_script_param, ":quest_no", 1), (str_clear, s1), (add_quest_note_from_sreg, ":quest_no", 0, s1, 0), (add_quest_note_from_sreg, ":quest_no", 1, s1, 0), (add_quest_note_from_sreg, ":quest_no", 2, s1, 0), (add_quest_note_from_sreg, ":quest_no", 3, s1, 0), (add_quest_note_from_sreg, ":quest_no", 4, s1, 0), (add_quest_note_from_sreg, ":quest_no", 5, s1, 0), (add_quest_note_from_sreg, ":quest_no", 6, s1, 0), (add_quest_note_from_sreg, ":quest_no", 7, s1, 0), (try_begin), (neg|check_quest_failed, ":quest_no"), (val_add, "$g_total_quests_completed", 1), (try_end), (complete_quest, ":quest_no"), (try_begin), (is_between, ":quest_no", mayor_quests_begin, mayor_quests_end), (assign, "$merchant_quest_last_offerer", -1), (assign, "$merchant_offered_quest", -1), (try_end), ]), #script_cancel_quest # INPUT: arg1 = quest_no # OUTPUT: none ("cancel_quest", [(store_script_param, ":quest_no", 1), (str_clear, s1), (add_quest_note_from_sreg, ":quest_no", 0, s1, 0), (add_quest_note_from_sreg, ":quest_no", 1, s1, 0), (add_quest_note_from_sreg, ":quest_no", 2, s1, 0), (add_quest_note_from_sreg, ":quest_no", 3, s1, 0), (add_quest_note_from_sreg, ":quest_no", 4, s1, 0), (add_quest_note_from_sreg, ":quest_no", 5, s1, 0), (add_quest_note_from_sreg, ":quest_no", 6, s1, 0), (add_quest_note_from_sreg, ":quest_no", 7, s1, 0), (cancel_quest, ":quest_no"), (try_begin), (is_between, ":quest_no", mayor_quests_begin, mayor_quests_end), (assign, "$merchant_quest_last_offerer", -1), (assign, "$merchant_offered_quest", -1), (try_end), ]), ## #script_get_available_mercenary_troop_and_amount_of_center ## # INPUT: arg1 = center_no ## # OUTPUT: reg0 = mercenary_troop_type, reg1 = amount ## ("get_available_mercenary_troop_and_amount_of_center", ## [(store_script_param, ":center_no", 1), ## (party_get_slot, ":mercenary_troop", ":center_no", slot_center_mercenary_troop_type), ## (party_get_slot, ":mercenary_amount", ":center_no", slot_center_mercenary_troop_amount), ## (party_get_free_companions_capacity, ":free_capacity", "p_main_party"), ## (val_min, ":mercenary_amount", ":free_capacity"), ## (store_troop_gold, ":cur_gold", "trp_player"), ## (call_script, "script_game_get_join_cost", ":mercenary_troop"), ## (assign, ":join_cost", reg0), ## (try_begin), ## (gt, ":join_cost", 0), ## (val_div, ":cur_gold", ":join_cost"), ## (val_min, ":mercenary_amount", ":cur_gold"), ## (try_end), ## (assign, reg0, ":mercenary_troop"), ## (assign, reg1, ":mercenary_amount"), ## ]), ## #script_update_village_market_towns # INPUT: none # OUTPUT: none ("update_village_market_towns", [(try_for_range, ":cur_village", villages_begin, villages_end), (store_faction_of_party, ":village_faction", ":cur_village"), (assign, ":min_dist", 999999), (assign, ":min_dist_town", -1), (try_for_range, ":cur_town", towns_begin, towns_end), (store_faction_of_party, ":town_faction", ":cur_town"), (eq, ":town_faction", ":village_faction"), (store_distance_to_party_from_party, ":cur_dist", ":cur_village", ":cur_town"), (lt, ":cur_dist", ":min_dist"), (assign, ":min_dist", ":cur_dist"), (assign, ":min_dist_town", ":cur_town"), (try_end), (gt, ":min_dist_town", -1), (party_set_slot, ":cur_village", slot_village_market_town, ":min_dist_town"), (try_end), ]), #script_update_mercenary_units_of_towns # INPUT: none # OUTPUT: none ("update_mercenary_units_of_towns", [(try_for_range, ":town_no", towns_begin, towns_end), (store_random_in_range, ":troop_no", mercenary_troops_begin, mercenary_troops_end), (party_set_slot, ":town_no", slot_center_mercenary_troop_type, ":troop_no"), (store_random_in_range, ":amount", 3, 8), (party_set_slot, ":town_no", slot_center_mercenary_troop_amount, ":amount"), (try_end), ]), #script_update_volunteer_troops_in_village # INPUT: arg1 = center_no # OUTPUT: none ("update_volunteer_troops_in_village", [ (store_script_param, ":center_no", 1), (party_get_slot, ":player_relation", ":center_no", slot_center_player_relation), (party_get_slot, ":center_culture", ":center_no", slot_center_culture), (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop), (assign, ":volunteer_troop_tier", 1), (store_div, ":tier_upgrades", ":player_relation", 10), (try_for_range, ":unused", 0, ":tier_upgrades"), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 10), (store_random_in_range, ":random_no", 0, 2), (troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", ":random_no"), (try_begin), (le, ":upgrade_troop_no", 0), (troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", 0), (try_end), (gt, ":upgrade_troop_no", 0), (val_add, ":volunteer_troop_tier", 1), (assign, ":volunteer_troop", ":upgrade_troop_no"), (try_end), (assign, ":upper_limit", 7), (try_begin), (ge, ":player_relation", 5), (assign, ":upper_limit", ":player_relation"), (val_div, ":upper_limit", 2), (val_add, ":upper_limit", 10), (else_try), (lt, ":player_relation", 0), (assign, ":upper_limit", 0), (try_end), (val_mul, ":upper_limit", 3), (store_add, ":amount_random_divider", 2, ":volunteer_troop_tier"), (val_div, ":upper_limit", ":amount_random_divider"), (store_random_in_range, ":amount", 0, ":upper_limit"), (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"), (party_set_slot, ":center_no", slot_center_volunteer_troop_amount, ":amount"), ]), #script_update_npc_volunteer_troops_in_village # INPUT: arg1 = center_no # OUTPUT: none ("update_npc_volunteer_troops_in_village", [ (store_script_param, ":center_no", 1), (party_get_slot, ":center_culture", ":center_no", slot_center_culture), (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop), (assign, ":volunteer_troop_tier", 1), (try_for_range, ":unused", 0, 5), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 10), (store_random_in_range, ":random_no", 0, 2), (troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", ":random_no"), (try_begin), (le, ":upgrade_troop_no", 0), (troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", 0), (try_end), (gt, ":upgrade_troop_no", 0), (val_add, ":volunteer_troop_tier", 1), (assign, ":volunteer_troop", ":upgrade_troop_no"), (try_end), (assign, ":upper_limit", 12), (store_add, ":amount_random_divider", 2, ":volunteer_troop_tier"), (val_div, ":upper_limit", ":amount_random_divider"), (store_random_in_range, ":amount", 0, ":upper_limit"), (party_set_slot, ":center_no", slot_center_npc_volunteer_troop_type, ":volunteer_troop"), (party_set_slot, ":center_no", slot_center_npc_volunteer_troop_amount, ":amount"), ]), #script_update_companion_candidates_in_taverns # INPUT: none # OUTPUT: none ("update_companion_candidates_in_taverns", [ (try_for_range, ":troop_no", companions_begin, companions_end), (troop_set_slot, ":troop_no", slot_troop_cur_center, -1), (troop_slot_eq, ":troop_no", slot_troop_occupation, 0), (store_random_in_range, ":town_no", towns_begin, towns_end), (try_begin), (neg|troop_slot_eq, ":troop_no", slot_troop_home, ":town_no"), (neg|troop_slot_eq, ":troop_no", slot_troop_first_encountered, ":town_no"), (troop_set_slot, ":troop_no", slot_troop_cur_center, ":town_no"), (try_begin), (eq, "$cheat_mode", 1), (str_store_troop_name, 4, ":troop_no"), (str_store_party_name, 5, ":town_no"), (display_message, "@{s4} is in {s5}"), (try_end), (try_end), (try_end), ]), #script_update_ransom_brokers # INPUT: none # OUTPUT: none ("update_ransom_brokers", [(try_for_range, ":town_no", towns_begin, towns_end), (party_set_slot, ":town_no", slot_center_ransom_broker, 0), (try_end), (try_for_range, ":troop_no", ransom_brokers_begin, ransom_brokers_end), (store_random_in_range, ":town_no", towns_begin, towns_end), (party_set_slot, ":town_no", slot_center_ransom_broker, ":troop_no"), (try_end), (party_set_slot,"p_town_2",slot_center_ransom_broker,"trp_ramun_the_slave_trader"), ]), #script_update_tavern_travelers # INPUT: none # OUTPUT: none ("update_tavern_travelers", [(try_for_range, ":town_no", towns_begin, towns_end), (party_set_slot, ":town_no", slot_center_tavern_traveler, 0), (try_end), (try_for_range, ":troop_no", tavern_travelers_begin, tavern_travelers_end), (store_random_in_range, ":town_no", towns_begin, towns_end), (party_set_slot, ":town_no", slot_center_tavern_traveler, ":troop_no"), (assign, ":end_cond", 15), (try_for_range, ":unused", 0, ":end_cond"), (store_random_in_range, ":info_faction", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":info_faction", slot_faction_state, sfs_active), (neq, ":info_faction", "$players_kingdom"), (neq, ":info_faction", "fac_player_supporters_faction"), (party_set_slot, ":town_no", slot_center_traveler_info_faction, ":info_faction"), (assign, ":end_cond", 0), (try_end), (try_end), ]), #script_update_villages_infested_by_bandits # INPUT: none # OUTPUT: none ("update_villages_infested_by_bandits", [(try_for_range, ":village_no", villages_begin, villages_end), (try_begin), (check_quest_active, "qst_eliminate_bandits_infesting_village"), (quest_slot_eq, "qst_eliminate_bandits_infesting_village", slot_quest_target_center, ":village_no"), (quest_get_slot, ":cur_state", "qst_eliminate_bandits_infesting_village", slot_quest_current_state), (val_add, ":cur_state", 1), (try_begin), (lt, ":cur_state", 3), (quest_set_slot, "qst_eliminate_bandits_infesting_village", slot_quest_current_state, ":cur_state"), (else_try), (party_set_slot, ":village_no", slot_village_infested_by_bandits, 0), (call_script, "script_abort_quest", "qst_eliminate_bandits_infesting_village", 2), (try_end), (else_try), (check_quest_active, "qst_deal_with_bandits_at_lords_village"), (quest_slot_eq, "qst_deal_with_bandits_at_lords_village", slot_quest_target_center, ":village_no"), (quest_get_slot, ":cur_state", "qst_deal_with_bandits_at_lords_village", slot_quest_current_state), (val_add, ":cur_state", 1), (try_begin), (lt, ":cur_state", 3), (quest_set_slot, "qst_deal_with_bandits_at_lords_village", slot_quest_current_state, ":cur_state"), (else_try), (party_set_slot, ":village_no", slot_village_infested_by_bandits, 0), (call_script, "script_abort_quest", "qst_deal_with_bandits_at_lords_village", 2), (try_end), (else_try), (party_set_slot, ":village_no", slot_village_infested_by_bandits, 0), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 3), (store_random_in_range, ":random_no", 0, 3), (try_begin), (eq, ":random_no", 0), (assign, ":bandit_troop", "trp_bandit"), (else_try), (eq, ":random_no", 1), (assign, ":bandit_troop", "trp_mountain_bandit"), (else_try), (assign, ":bandit_troop", "trp_forest_bandit"), (try_end), (party_set_slot, ":village_no", slot_village_infested_by_bandits, ":bandit_troop"), #Reduce prosperity of the village by 3 (call_script, "script_change_center_prosperity", ":village_no", -3), (try_begin), (eq, "$cheat_mode", 1), (str_store_party_name, s1, ":village_no"), (display_message, "@{s1} is infested by bandits."), (try_end), (try_end), (try_end), ]), #script_update_booksellers # INPUT: none # OUTPUT: none ("update_booksellers", [(try_for_range, ":town_no", towns_begin, towns_end), (party_set_slot, ":town_no", slot_center_tavern_bookseller, 0), (try_end), (try_for_range, ":troop_no", tavern_booksellers_begin, tavern_booksellers_end), (store_random_in_range, ":town_no", towns_begin, towns_end), (party_set_slot, ":town_no", slot_center_tavern_bookseller, ":troop_no"), (try_end), ]), #script_update_tavern_minstels # INPUT: none # OUTPUT: none ("update_tavern_minstels", [(try_for_range, ":town_no", towns_begin, towns_end), (party_set_slot, ":town_no", slot_center_tavern_minstrel, 0), (try_end), (try_for_range, ":troop_no", tavern_minstrels_begin, tavern_minstrels_end), (store_random_in_range, ":town_no", towns_begin, towns_end), (party_set_slot, ":town_no", slot_center_tavern_minstrel, ":troop_no"), (try_end), ]), #script_update_faction_notes # INPUT: faction_no # OUTPUT: none ("update_faction_notes", [(store_script_param, ":faction_no", 1), (try_begin), (is_between, ":faction_no", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active), (faction_get_slot, ":faction_leader", ":faction_no", slot_faction_leader), (str_store_faction_name, s5, ":faction_no"), (str_store_troop_name_link, s6, ":faction_leader"), (assign, ":num_centers", 0), (str_store_string, s8, "@nowhere"), (try_for_range_backwards, ":cur_center", centers_begin, centers_end), (store_faction_of_party, ":center_faction", ":cur_center"), (eq, ":center_faction", ":faction_no"), (try_begin), (eq, ":num_centers", 0), (str_store_party_name_link, s8, ":cur_center"), (else_try), (eq, ":num_centers", 1), (str_store_party_name_link, s7, ":cur_center"), (str_store_string, s8, "@{s7} and {s8}"), (else_try), (str_store_party_name_link, s7, ":cur_center"), (str_store_string, s8, "@{s7}, {s8}"), (try_end), (val_add, ":num_centers", 1), (try_end), (assign, ":num_members", 0), (str_store_string, s10, "@noone"), (try_for_range_backwards, ":loop_var", "trp_kingdom_heroes_including_player_begin", kingdom_heroes_end), (assign, ":cur_troop", ":loop_var"), (try_begin), (eq, ":loop_var", "trp_kingdom_heroes_including_player_begin"), (assign, ":cur_troop", "trp_player"), (assign, ":troop_faction", "$players_kingdom"), (else_try), (store_troop_faction, ":troop_faction", ":cur_troop"), (try_end), (eq, ":troop_faction", ":faction_no"), (neq, ":cur_troop", ":faction_leader"), (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero), (try_begin), (eq, ":num_members", 0), (str_store_troop_name_link, s10, ":cur_troop"), (else_try), (eq, ":num_members", 1), (str_store_troop_name_link, s9, ":cur_troop"), (str_store_string, s10, "@{s9} and {s10}"), (else_try), (str_store_troop_name_link, s9, ":cur_troop"), (str_store_string, s10, "@{s9}, {s10}"), (try_end), (val_add, ":num_members", 1), (try_end), (str_store_string, s12, "@noone"), (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", ":faction_no"), (lt, ":cur_relation", 0), (try_begin), (eq, ":num_enemies", 0), (str_store_faction_name_link, s12, ":cur_faction"), (else_try), (eq, ":num_enemies", 1), (str_store_faction_name_link, s11, ":cur_faction"), (str_store_string, s12, "@{s11} and {s12}"), (else_try), (str_store_faction_name_link, s11, ":cur_faction"), (str_store_string, s12, "@{s11}, {s12}"), (try_end), (val_add, ":num_enemies", 1), (try_end), (add_faction_note_from_sreg, ":faction_no", 0, "@{s5} is ruled by {s6}.^It occupies {s8}.^Its vassals are {s10}.^{s5} is at war with {s12}.", 0), (else_try), (is_between, ":faction_no", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":faction_no", slot_faction_state, sfs_defeated), (str_store_faction_name, s5, ":faction_no"), (add_faction_note_from_sreg, ":faction_no", 0, "@{s5} has been defeated!", 0), (str_clear, s1), (add_faction_note_from_sreg, ":faction_no", 1, s1, 0), (else_try), (str_clear, s1), (add_faction_note_from_sreg, ":faction_no", 0, s1, 0), (add_faction_note_from_sreg, ":faction_no", 1, s1, 0), (try_end), (try_begin), (is_between, ":faction_no", "fac_kingdom_1", kingdoms_end), #Excluding player kingdom (add_faction_note_tableau_mesh, ":faction_no", "tableau_faction_note_mesh"), (else_try), (add_faction_note_tableau_mesh, ":faction_no", "tableau_faction_note_mesh_banner"), (try_end), ]), #script_update_faction_traveler_notes # INPUT: faction_no # OUTPUT: none ("update_faction_traveler_notes", [(store_script_param, ":faction_no", 1), (assign, ":total_men", 0), (try_for_parties, ":cur_party"), (store_faction_of_party, ":center_faction", ":cur_party"), (eq, ":center_faction", ":faction_no"), (party_get_num_companions, ":num_men", ":cur_party"), (val_add, ":total_men", ":num_men"), (try_end), (str_store_faction_name, s5, ":faction_no"), (assign, reg1, ":total_men"), (add_faction_note_from_sreg, ":faction_no", 1, "@{s5} has a strength of {reg1} men in total.", 1), ]), #script_update_troop_notes # INPUT: troop_no # OUTPUT: none ("update_troop_notes", [(store_script_param, ":troop_no", 1), (str_store_troop_name, s54, ":troop_no"), (try_begin), (eq, ":troop_no", "trp_player"), (this_or_next|eq, "$player_has_homage", 1), ( eq, "$players_kingdom", "fac_player_supporters_faction"), (assign, ":troop_faction", "$players_kingdom"), (else_try), (store_troop_faction, ":troop_faction", ":troop_no"), (try_end), (try_begin), (neq, ":troop_no", "trp_player"), (neg|is_between, ":troop_faction", kingdoms_begin, kingdoms_end), (str_clear, s54), (add_troop_note_from_sreg, ":troop_no", 0, s54, 0), (add_troop_note_from_sreg, ":troop_no", 1, s54, 0), (add_troop_note_from_sreg, ":troop_no", 2, s54, 0), (else_try), (is_between, ":troop_no", kingdom_ladies_begin, kingdom_ladies_end), (str_clear, s54), (add_troop_note_from_sreg, ":troop_no", 0, s54, 0), (add_troop_note_from_sreg, ":troop_no", 1, s54, 0), (add_troop_note_from_sreg, ":troop_no", 2, s54, 0), (else_try), (is_between, ":troop_no", pretenders_begin, pretenders_end), (neg|troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), (neq, ":troop_no", "$supported_pretender"), (troop_get_slot, ":orig_faction", ":troop_no", slot_troop_original_faction), (try_begin), (faction_slot_eq, ":orig_faction", slot_faction_state, sfs_active), (faction_slot_eq, ":orig_faction", slot_faction_has_rebellion_chance, 1), (str_store_faction_name_link, s56, ":orig_faction"), (add_troop_note_from_sreg, ":troop_no", 0, "@{s54} is a claimant to the throne of {s56}.", 0), (add_troop_note_tableau_mesh, ":troop_no", "tableau_troop_note_mesh"), (else_try), (str_clear, s54), (add_troop_note_from_sreg, ":troop_no", 0, s54, 0), (add_troop_note_from_sreg, ":troop_no", 1, s54, 0), (add_troop_note_from_sreg, ":troop_no", 2, s54, 0), (try_end), (else_try), (faction_get_slot, ":faction_leader", ":troop_faction", slot_faction_leader), (str_store_troop_name_link, s55, ":faction_leader"), (str_store_faction_name_link, s56, ":troop_faction"), (assign, reg4, 0), (assign, reg6, 0), (try_begin), (eq, ":troop_faction", "fac_player_faction"), (assign, reg6, 1), (else_try), (eq, ":faction_leader", ":troop_no"), (assign, reg4, 1), (try_end), (assign, ":num_centers", 0), (str_store_string, s58, "@nowhere"), (try_for_range_backwards, ":cur_center", centers_begin, centers_end), (party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"), (try_begin), (eq, ":num_centers", 0), (str_store_party_name_link, s58, ":cur_center"), (else_try), (eq, ":num_centers", 1), (str_store_party_name_link, s57, ":cur_center"), (str_store_string, s58, "@{s57} and {s58}"), (else_try), (str_store_party_name_link, s57, ":cur_center"), (str_store_string, s58, "@{s57}, {s58}"), (try_end), (val_add, ":num_centers", 1), (try_end), (troop_get_type, reg3, ":troop_no"), (troop_get_slot, reg5, ":troop_no", slot_troop_renown), (str_clear, s59), (try_begin), # (troop_get_slot, ":relation", ":troop_no", slot_troop_player_relation), (call_script, "script_troop_get_player_relation", ":troop_no"), (assign, ":relation", reg0), (store_add, ":normalized_relation", ":relation", 100), (val_add, ":normalized_relation", 5), (store_div, ":str_offset", ":normalized_relation", 10), (val_clamp, ":str_offset", 0, 20), (store_add, ":str_id", "str_relation_mnus_100_ns", ":str_offset"), (neq, ":str_id", "str_relation_plus_0_ns"), (str_store_string, s60, "@{reg3?She:He}"), (str_store_string, s59, ":str_id"), (str_store_string, s59, "@^{s59}"), (try_end), (assign, reg9, ":num_centers"), (add_troop_note_from_sreg, ":troop_no", 0, "@{reg6?:{reg4?{s54} is the ruler of {s56}.^:{s54} is a vassal of {s55} of {s56}.^}}Renown: {reg5}.^{reg9?{reg3?She:He} is the {reg3?lady:lord} of {s58}.:{reg3?She:He} has no fiefs.}{s59}", 0), (add_troop_note_tableau_mesh, ":troop_no", "tableau_troop_note_mesh"), (try_end), ]), #script_update_troop_location_notes # INPUT: troop_no # OUTPUT: none ("update_troop_location_notes", [(store_script_param, ":troop_no", 1), (store_script_param, ":see_or_hear", 2), (call_script, "script_get_information_about_troops_position", ":troop_no", 1), (try_begin), (neq, reg0, 0), (troop_get_type, reg1, ":troop_no"), (try_begin), (eq, ":see_or_hear", 0), (add_troop_note_from_sreg, ":troop_no", 2, "@The last time you saw {reg1?her:him}, {s1}", 1), (else_try), (add_troop_note_from_sreg, ":troop_no", 2, "@The last time you heard about {reg1?her:him}, {s1}", 1), (try_end), (try_end), ]), #script_update_center_notes # INPUT: center_no # OUTPUT: none ("update_center_notes", [(store_script_param, ":center_no", 1), (party_get_slot, ":lord_troop", ":center_no", slot_town_lord), (try_begin), (ge, ":lord_troop", 0), (store_troop_faction, ":lord_faction", ":lord_troop"), (str_store_troop_name_link, s1, ":lord_troop"), (try_begin), (eq, ":lord_troop", "trp_player"), (gt, "$players_kingdom", 0), (str_store_faction_name_link, s2, "$players_kingdom"), (else_try), (str_store_faction_name_link, s2, ":lord_faction"), (try_end), (str_store_party_name, s50, ":center_no"), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_town), (str_store_string, s51, "@The town of {s50}"), (else_try), (party_slot_eq, ":center_no", slot_party_type, spt_village), (party_get_slot, ":bound_center", ":center_no", slot_village_bound_center), (str_store_party_name_link, s52, ":bound_center"), (str_store_string, s51, "@The village of {s50} near {s52}"), (else_try), (str_store_string, s51, "@{s50}"), (try_end), (str_store_string, s2, "@{s51} belongs to {s1} of {s2}.^"), (else_try), (str_clear, s2), (try_end), (try_begin), (is_between, ":center_no", villages_begin, villages_end), (else_try), (assign, ":num_villages", 0), (try_for_range_backwards, ":village_no", villages_begin, villages_end), (party_slot_eq, ":village_no", slot_village_bound_center, ":center_no"), (try_begin), (eq, ":num_villages", 0), (str_store_party_name_link, s8, ":village_no"), (else_try), (eq, ":num_villages", 1), (str_store_party_name_link, s7, ":village_no"), (str_store_string, s8, "@{s7} and {s8}"), (else_try), (str_store_party_name_link, s7, ":village_no"), (str_store_string, s8, "@{s7}, {s8}"), (try_end), (val_add, ":num_villages", 1), (try_end), (try_begin), (eq, ":num_villages", 0), (str_store_string, s2, "@{s2}It has no villages.^"), (else_try), (store_sub, reg0, ":num_villages", 1), (str_store_string, s2, "@{s2}{reg0?Its villages are:Its village is} {s8}.^"), (try_end), (try_end), (call_script, "script_get_prosperity_text_to_s50", ":center_no"), (add_party_note_from_sreg, ":center_no", 0, "@{s2}Its prosperity is: {s50}", 0), (add_party_note_tableau_mesh, ":center_no", "tableau_center_note_mesh"), ]), #script_update_center_recon_notes # INPUT: center_no # OUTPUT: none ("update_center_recon_notes", [(store_script_param, ":center_no", 1), (try_begin), (this_or_next|is_between, ":center_no", towns_begin, towns_end), (is_between, ":center_no", castles_begin, castles_end), (party_get_slot, ":center_food_store", ":center_no", slot_party_food_store), (call_script, "script_center_get_food_consumption", ":center_no"), (assign, ":food_consumption", reg0), (store_div, reg6, ":center_food_store", ":food_consumption"), (party_collect_attachments_to_party, ":center_no", "p_collective_ally"), (party_get_num_companions, reg5, "p_collective_ally"), (add_party_note_from_sreg, ":center_no", 1, "@Current garrison consists of {reg5} men.^Has food stock for {reg6} days.", 1), (try_end), ]), #script_update_all_notes # INPUT: none # OUTPUT: none ("update_all_notes", [ (call_script, "script_update_troop_notes", "trp_player"), (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (call_script, "script_update_troop_notes", ":troop_no"), (try_end), (try_for_range, ":center_no", centers_begin, centers_end), (call_script, "script_update_center_notes", ":center_no"), (try_end), (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end), (call_script, "script_update_faction_notes", ":faction_no"), (try_end), ]), #script_shield_item_set_banner # INPUT: agent_no # OUTPUT: none ("shield_item_set_banner", [ (store_script_param, ":tableau_no",1), (store_script_param, ":agent_no", 2), (store_script_param, ":troop_no", 3), (assign, ":banner_troop", -1), (assign, ":banner_mesh", "mesh_banners_default_b"), (try_begin), (lt, ":agent_no", 0), (try_begin), (ge, ":troop_no", 0), (this_or_next|troop_slot_ge, ":troop_no", slot_troop_banner_scene_prop, 1), ( eq, ":troop_no", "trp_player"), (assign, ":banner_troop", ":troop_no"), (else_try), (is_between, ":troop_no", companions_begin, companions_end), (assign, ":banner_troop", "trp_player"), (else_try), (assign, ":banner_mesh", "mesh_banners_default_a"), (try_end), (else_try), (agent_get_troop_id, ":troop_id", ":agent_no"), (this_or_next|troop_slot_ge, ":troop_id", slot_troop_banner_scene_prop, 1), ( eq, ":troop_no", "trp_player"), (assign, ":banner_troop", ":troop_id"), (else_try), (agent_get_party_id, ":agent_party", ":agent_no"), # modified by formations here to ensure player troops' heraldry showed correctly (party_get_slot, ":num", "p_main_party", slot_party_array_parties_begin), (try_for_range, ":array", 1, ":num"), (store_add, ":array_slot", ":array", slot_party_array_parties_begin), (party_get_slot, ":array_party", "p_main_party", ":array_slot"), (eq, ":agent_party", ":array_party"), (assign, ":agent_party", "p_main_party"), (try_end), # formation changes end (try_begin), (lt, ":agent_party", 0), (is_between, ":troop_id", companions_begin, companions_end), (main_party_has_troop, ":troop_id"), (assign, ":agent_party", "p_main_party"), (try_end), (ge, ":agent_party", 0), (party_get_template_id, ":party_template", ":agent_party"), (try_begin), (eq, ":party_template", "pt_deserters"), (assign, ":banner_mesh", "mesh_banners_default_c"), (else_try), (is_between, ":agent_party", centers_begin, centers_end), (party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord), (ge, ":town_lord", 0), (assign, ":banner_troop", ":town_lord"), (else_try), (this_or_next|party_slot_eq, ":agent_party", slot_party_type, spt_kingdom_hero_party), ( eq, ":agent_party", "p_main_party"), (party_get_num_companion_stacks, ":num_stacks", ":agent_party"), (gt, ":num_stacks", 0), (party_stack_get_troop_id, ":leader_troop_id", ":agent_party", 0), (this_or_next|troop_slot_ge, ":leader_troop_id", slot_troop_banner_scene_prop, 1), ( eq, ":leader_troop_id", "trp_player"), (assign, ":banner_troop", ":leader_troop_id"), (try_end), (else_try), #Check if we are in a tavern (eq, "$talk_context", tc_tavern_talk), (neq, ":troop_no", "trp_player"), (assign, ":banner_mesh", "mesh_banners_default_d"), (else_try), #can't find party, this can be a town guard (neq, ":troop_no", "trp_player"), (is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end), (party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord), (ge, ":town_lord", 0), (assign, ":banner_troop", ":town_lord"), (try_end), (try_begin), (ge, ":banner_troop", 0), (try_begin), (neg|troop_slot_ge, ":banner_troop", slot_troop_banner_scene_prop, 1), (assign, ":banner_mesh", "mesh_banners_default_b"), (else_try), (troop_get_slot, ":banner_spr", ":banner_troop", slot_troop_banner_scene_prop), (store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1), (is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"), (val_sub, ":banner_spr", banner_scene_props_begin), (store_add, ":banner_mesh", ":banner_spr", arms_meshes_begin), (try_end), (try_end), (cur_item_set_tableau_material, ":tableau_no", ":banner_mesh"), ]), ## #script_shield_item_set_banner ## # INPUT: agent_no ## # OUTPUT: none ## ("shield_item_set_banner", ## [ ## (store_script_param, ":tableau_no",1), ## (store_script_param, ":agent_no", 2), ## (store_script_param, ":troop_no", 3), ## (assign, ":banner_troop", -1), ## (try_begin), ## (lt, ":agent_no", 0), ## (try_begin), ## (ge, ":troop_no", 0), ## (troop_slot_ge, ":troop_no", slot_troop_banner_scene_prop, 0), ## (assign, ":banner_troop", ":troop_no"), ## (else_try), ## (assign, ":banner_troop", -2), ## (try_end), ## (else_try), ## (agent_get_troop_id, ":troop_id", ":agent_no"), ## (troop_slot_ge, ":troop_id", slot_troop_custom_banner_flag_type, 0), ## (assign, ":banner_troop", ":troop_id"), ## (else_try), ## (agent_get_party_id, ":agent_party", ":agent_no"), ## (try_begin), ## (lt, ":agent_party", 0), ## (is_between, ":troop_id", companions_begin, companions_end), ## (main_party_has_troop, ":troop_id"), ## (assign, ":agent_party", "p_main_party"), ## (try_end), ## (ge, ":agent_party", 0), ## (party_get_template_id, ":party_template", ":agent_party"), ## (try_begin), ## (eq, ":party_template", "pt_deserters"), ## (assign, ":banner_troop", -3), ## (else_try), ## (is_between, ":agent_party", centers_begin, centers_end), ## (party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord), ## (ge, ":town_lord", 0), ## (assign, ":banner_troop", ":town_lord"), ## (else_try), ## (this_or_next|party_slot_eq, ":agent_party", slot_party_type, spt_kingdom_hero_party), ## ( eq, ":agent_party", "p_main_party"), ## (party_get_num_companion_stacks, ":num_stacks", ":agent_party"), ## (gt, ":num_stacks", 0), ## (party_stack_get_troop_id, ":leader_troop_id", ":agent_party", 0), ## (troop_slot_ge, ":leader_troop_id", slot_troop_banner_scene_prop, 1), ## (assign, ":banner_troop", ":leader_troop_id"), ## (try_end), ## (else_try), #Check if we are in a tavern ## (eq, "$talk_context", tc_tavern_talk), ## (neq, ":troop_no", "trp_player"), ## (assign, ":banner_troop", -4), ## (else_try), #can't find party, this can be a town guard ## (neq, ":troop_no", "trp_player"), ## (is_between, "$g_encountered_party", walled_centers_begin, walled_centers_end), ## (party_get_slot, ":town_lord", "$g_encountered_party", slot_town_lord), ## (ge, ":town_lord", 0), ## (assign, ":banner_troop", ":town_lord"), ## (try_end), ## (cur_item_set_tableau_material, ":tableau_no", ":banner_troop"), ## ]), #script_add_troop_to_cur_tableau # INPUT: troop_no # OUTPUT: none ("add_troop_to_cur_tableau", [ (store_script_param, ":troop_no",1), (set_fixed_point_multiplier, 100), (assign, ":banner_mesh", -1), (troop_get_slot, ":banner_spr", ":troop_no", slot_troop_banner_scene_prop), (store_add, ":banner_scene_props_end", banner_scene_props_end_minus_one, 1), (try_begin), (is_between, ":banner_spr", banner_scene_props_begin, ":banner_scene_props_end"), (val_sub, ":banner_spr", banner_scene_props_begin), (store_add, ":banner_mesh", ":banner_spr", banner_meshes_begin), (try_end), (cur_tableau_clear_override_items), # (cur_tableau_set_override_flags, af_override_fullhelm), (cur_tableau_set_override_flags, af_override_head|af_override_weapons), (init_position, pos2), (cur_tableau_set_camera_parameters, 1, 6, 6, 10, 10000), (init_position, pos5), (assign, ":eye_height", 162), (store_mul, ":camera_distance", ":troop_no", 87323), # (val_mod, ":camera_distance", 5), (assign, ":camera_distance", 139), (store_mul, ":camera_yaw", ":troop_no", 124337), (val_mod, ":camera_yaw", 50), (val_add, ":camera_yaw", -25), (store_mul, ":camera_pitch", ":troop_no", 98123), (val_mod, ":camera_pitch", 20), (val_add, ":camera_pitch", -14), (assign, ":animation", anim_stand_man), ## (troop_get_inventory_slot, ":horse_item", ":troop_no", ek_horse), ## (try_begin), ## (gt, ":horse_item", 0), ## (assign, ":eye_height", 210), ## (cur_tableau_add_horse, ":horse_item", pos2, anim_horse_stand, 0), ## (assign, ":animation", anim_ride_0), ## (position_set_z, pos5, 125), ## (try_begin), ## (is_between, ":camera_yaw", -10, 10), #make sure horse head doesn't obstruct face. ## (val_min, ":camera_pitch", -5), ## (try_end), ## (try_end), (position_set_z, pos5, ":eye_height"), # camera looks towards -z axis (position_rotate_x, pos5, -90), (position_rotate_z, pos5, 180), # now apply yaw and pitch (position_rotate_y, pos5, ":camera_yaw"), (position_rotate_x, pos5, ":camera_pitch"), (position_move_z, pos5, ":camera_distance", 0), (position_move_x, pos5, 5, 0), (try_begin), (ge, ":banner_mesh", 0), (init_position, pos1), (position_set_z, pos1, -1500), (position_set_x, pos1, 265), (position_set_y, pos1, 400), (position_transform_position_to_parent, pos3, pos5, pos1), (cur_tableau_add_mesh, ":banner_mesh", pos3, 400, 0), (try_end), (cur_tableau_add_troop, ":troop_no", pos2, ":animation" , 0), (cur_tableau_set_camera_position, pos5), (copy_position, pos8, pos5), (position_rotate_x, pos8, -90), #y axis aligned with camera now. z is up (position_rotate_z, pos8, 30), (position_rotate_x, pos8, -60), (cur_tableau_add_sun_light, pos8, 175,150,125), ]), #script_add_troop_to_cur_tableau_for_character # INPUT: troop_no # OUTPUT: none ("add_troop_to_cur_tableau_for_character", [ (store_script_param, ":troop_no",1), (set_fixed_point_multiplier, 100), (cur_tableau_clear_override_items), (cur_tableau_set_override_flags, af_override_fullhelm), ## (cur_tableau_set_override_flags, af_override_head|af_override_weapons), (init_position, pos2), (cur_tableau_set_camera_parameters, 1, 4, 8, 10, 10000), (init_position, pos5), (assign, ":cam_height", 150), # (val_mod, ":camera_distance", 5), (assign, ":camera_distance", 360), (assign, ":camera_yaw", -15), (assign, ":camera_pitch", -18), (assign, ":animation", anim_stand_man), (position_set_z, pos5, ":cam_height"), # camera looks towards -z axis (position_rotate_x, pos5, -90), (position_rotate_z, pos5, 180), # now apply yaw and pitch (position_rotate_y, pos5, ":camera_yaw"), (position_rotate_x, pos5, ":camera_pitch"), (position_move_z, pos5, ":camera_distance", 0), (position_move_x, pos5, 5, 0), (try_begin), (troop_is_hero, ":troop_no"), (cur_tableau_add_troop, ":troop_no", pos2, ":animation", -1), (else_try), (store_mul, ":random_seed", ":troop_no", 126233), (val_mod, ":random_seed", 1000), (val_add, ":random_seed", 1), (cur_tableau_add_troop, ":troop_no", pos2, ":animation", ":random_seed"), (try_end), (cur_tableau_set_camera_position, pos5), (copy_position, pos8, pos5), (position_rotate_x, pos8, -90), #y axis aligned with camera now. z is up (position_rotate_z, pos8, 30), (position_rotate_x, pos8, -60), (cur_tableau_add_sun_light, pos8, 175,150,125), ]), #script_add_troop_to_cur_tableau_for_inventory # INPUT: troop_no # OUTPUT: none ("add_troop_to_cur_tableau_for_inventory", [ (store_script_param, ":troop_no",1), (store_mod, ":side", ":troop_no", 4), #side flag is inside troop_no value (val_div, ":troop_no", 4), #removing the flag bit (val_mul, ":side", 90), #to degrees (set_fixed_point_multiplier, 100), (cur_tableau_clear_override_items), (init_position, pos2), (position_rotate_z, pos2, ":side"), (cur_tableau_set_camera_parameters, 1, 4, 6, 10, 10000), (init_position, pos5), (assign, ":cam_height", 105), # (val_mod, ":camera_distance", 5), (assign, ":camera_distance", 380), (assign, ":camera_yaw", -15), (assign, ":camera_pitch", -18), (assign, ":animation", anim_stand_man), (position_set_z, pos5, ":cam_height"), # camera looks towards -z axis (position_rotate_x, pos5, -90), (position_rotate_z, pos5, 180), # now apply yaw and pitch (position_rotate_y, pos5, ":camera_yaw"), (position_rotate_x, pos5, ":camera_pitch"), (position_move_z, pos5, ":camera_distance", 0), (position_move_x, pos5, 5, 0), (try_begin), (troop_is_hero, ":troop_no"), (cur_tableau_add_troop, ":troop_no", pos2, ":animation", -1), (else_try), (store_mul, ":random_seed", ":troop_no", 126233), (val_mod, ":random_seed", 1000), (val_add, ":random_seed", 1), (cur_tableau_add_troop, ":troop_no", pos2, ":animation", ":random_seed"), (try_end), (cur_tableau_set_camera_position, pos5), (copy_position, pos8, pos5), (position_rotate_x, pos8, -90), #y axis aligned with camera now. z is up (position_rotate_z, pos8, 30), (position_rotate_x, pos8, -60), (cur_tableau_add_sun_light, pos8, 175,150,125), ]), #script_add_troop_to_cur_tableau_for_party # INPUT: troop_no # OUTPUT: none ("add_troop_to_cur_tableau_for_party", [ (store_script_param, ":troop_no",1), (store_mod, ":hide_weapons", ":troop_no", 2), #hide_weapons flag is inside troop_no value (val_div, ":troop_no", 2), #removing the flag bit (set_fixed_point_multiplier, 100), (cur_tableau_clear_override_items), (try_begin), (eq, ":hide_weapons", 1), (cur_tableau_set_override_flags, af_override_fullhelm|af_override_head|af_override_weapons), (try_end), (init_position, pos2), (cur_tableau_set_camera_parameters, 1, 6, 6, 10, 10000), (init_position, pos5), (assign, ":cam_height", 105), # (val_mod, ":camera_distance", 5), (assign, ":camera_distance", 450), (assign, ":camera_yaw", 15), (assign, ":camera_pitch", -18), (assign, ":animation", anim_stand_man), (troop_get_inventory_slot, ":horse_item", ":troop_no", ek_horse), (try_begin), (gt, ":horse_item", 0), (eq, ":hide_weapons", 0), (cur_tableau_add_horse, ":horse_item", pos2, "anim_horse_stand", 0), (assign, ":animation", "anim_ride_0"), (assign, ":camera_yaw", 23), (assign, ":cam_height", 150), (assign, ":camera_distance", 550), (try_end), (position_set_z, pos5, ":cam_height"), # camera looks towards -z axis (position_rotate_x, pos5, -90), (position_rotate_z, pos5, 180), # now apply yaw and pitch (position_rotate_y, pos5, ":camera_yaw"), (position_rotate_x, pos5, ":camera_pitch"), (position_move_z, pos5, ":camera_distance", 0), (position_move_x, pos5, 5, 0), (try_begin), (troop_is_hero, ":troop_no"), (cur_tableau_add_troop, ":troop_no", pos2, ":animation", -1), (else_try), (store_mul, ":random_seed", ":troop_no", 126233), (val_mod, ":random_seed", 1000), (val_add, ":random_seed", 1), (cur_tableau_add_troop, ":troop_no", pos2, ":animation", ":random_seed"), (try_end), (cur_tableau_set_camera_position, pos5), (copy_position, pos8, pos5), (position_rotate_x, pos8, -90), #y axis aligned with camera now. z is up (position_rotate_z, pos8, 30), (position_rotate_x, pos8, -60), (cur_tableau_add_sun_light, pos8, 175,150,125), ]), #script_get_prosperity_text_to_s50 # INPUT: center_no # OUTPUT: none ("get_prosperity_text_to_s50", [(store_script_param, ":center_no", 1), (party_get_slot, ":prosperity", ":center_no", slot_town_prosperity), (val_div, ":prosperity", 20), (try_begin), (eq, ":prosperity", 0), (str_store_string, s50, "@Very Poor"), (else_try), (eq, ":prosperity", 1), (str_store_string, s50, "@Poor"), (else_try), (eq, ":prosperity", 2), (str_store_string, s50, "@Average"), (else_try), (eq, ":prosperity", 3), (str_store_string, s50, "@Rich"), (else_try), (str_store_string, s50, "@Very Rich"), (try_end), ]), #script_spawn_bandits # INPUT: none # OUTPUT: none ("spawn_bandits", [(set_spawn_radius,1), (try_begin), (store_num_parties_of_template, ":num_parties", "pt_mountain_bandits"), (lt,":num_parties",14), (store_random,":spawn_point",num_mountain_bandit_spawn_points), (val_add,":spawn_point","p_mountain_bandit_spawn_point"), (spawn_around_party,":spawn_point","pt_mountain_bandits"), (try_end), (try_begin), (store_num_parties_of_template, ":num_parties", "pt_forest_bandits"), (lt,":num_parties",14), (store_random,":spawn_point",num_mountain_bandit_spawn_points), (val_add,":spawn_point","p_forest_bandit_spawn_point"), (spawn_around_party,":spawn_point","pt_forest_bandits"), (try_end), (try_begin), (store_num_parties_of_template, ":num_parties", "pt_sea_raiders"), (lt,":num_parties",14), (store_random,":spawn_point",num_sea_raider_spawn_points), (val_add,":spawn_point","p_sea_raider_spawn_point_1"), (spawn_around_party,":spawn_point","pt_sea_raiders"), (try_end), (try_begin), (store_num_parties_of_template, ":num_parties", "pt_steppe_bandits"), (lt,":num_parties",14), (store_random,":spawn_point",num_steppe_bandit_spawn_points), (val_add,":spawn_point","p_steppe_bandit_spawn_point"), (spawn_around_party,":spawn_point","pt_steppe_bandits"), (try_end), (try_begin), (store_num_parties_of_template, ":num_parties", "pt_looters"), (lt,":num_parties",23), (store_random_in_range,":spawn_point",villages_begin,villages_end), #spawn looters twice to have lots of them at the beginning (spawn_around_party,":spawn_point","pt_looters"), (assign, ":spawned_party_id", reg0), (try_begin), (check_quest_active, "qst_deal_with_looters"), (party_set_flags, ":spawned_party_id", pf_quest_party, 1), (else_try), (party_set_flags, ":spawned_party_id", pf_quest_party, 0), (try_end), (try_end), (try_begin), (store_num_parties_of_template, ":num_parties", "pt_deserters"), (lt,":num_parties",15), (set_spawn_radius, 4), (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 5), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (store_troop_faction, ":troop_faction", ":troop_no"), (neq, ":troop_faction", "fac_player_supporters_faction"), (gt, ":party_no", 0), (neg|party_is_in_any_town, ":party_no"), ## (party_get_attached_to, ":attached_party_no", ":party_no"), ## (lt, ":attached_party_no", 0),#in wilderness (spawn_around_party, ":party_no", "pt_deserters"), (assign, ":new_party", reg0), (store_troop_faction, ":faction_no", ":troop_no"), (faction_get_slot, ":tier_1_troop", ":faction_no", slot_faction_tier_1_troop), (store_character_level, ":level", "trp_player"), (store_mul, ":max_number_to_add", ":level", 2), (val_add, ":max_number_to_add", 11), (store_random_in_range, ":number_to_add", 10, ":max_number_to_add"), (party_add_members, ":new_party", ":tier_1_troop", ":number_to_add"), (store_random_in_range, ":random_no", 1, 4), (try_for_range, ":unused", 0, ":random_no"), (party_upgrade_with_xp, ":new_party", 1000000, 0), (try_end), ## (str_store_party_name, s1, ":party_no"), ## (call_script, "script_get_closest_center", ":party_no"), ## (try_begin), ## (gt, reg0, 0), ## (str_store_party_name, s2, reg0), ## (else_try), ## (str_store_string, s2, "@unknown place"), ## (try_end), ## (assign, reg1, ":number_to_add"), ## (display_message, "@{reg1} Deserters spawned from {s1}, near {s2}."), (try_end), (try_end), ]), #script_count_mission_casualties_from_agents # INPUT: none # OUTPUT: none ("count_mission_casualties_from_agents", [(party_clear, "p_player_casualties"), (party_clear, "p_enemy_casualties"), (party_clear, "p_ally_casualties"), (assign, "$any_allies_at_the_last_battle", 0), (try_for_agents, ":cur_agent"), (agent_is_human, ":cur_agent"), # This section is added/modified to cope with the array system (assign, ":array", 0), (agent_get_party_id, ":agent_party", ":cur_agent"), (try_begin), (neq, ":agent_party", "p_main_party"), (agent_is_ally, ":cur_agent"), (party_get_slot, ":array_parties", "p_main_party", slot_party_array_parties_begin), (try_for_range, ":i", 1, ":array_parties"), (store_add, ":array_slot", slot_party_array_parties_begin, ":i"), (party_slot_eq, "p_main_party", ":array_slot", ":agent_party"), (assign, ":array", 1), (try_end), (neq, ":array", 1), (assign, "$any_allies_at_the_last_battle", 1), (try_end), (neg|agent_is_alive, ":cur_agent"), (agent_get_troop_id, ":agent_troop_id", ":cur_agent"), (try_begin), (this_or_next|eq, ":agent_party", "p_main_party"), (eq, ":array", 1), # array system changes end (party_add_members, "p_player_casualties", ":agent_troop_id", 1), (try_begin), (agent_is_wounded, ":cur_agent"), (party_wound_members, "p_player_casualties", ":agent_troop_id", 1), (try_end), (else_try), (agent_is_ally, ":cur_agent"), (party_add_members, "p_ally_casualties", ":agent_troop_id", 1), (try_begin), (agent_is_wounded, ":cur_agent"), (party_wound_members, "p_ally_casualties", ":agent_troop_id", 1), (try_end), (else_try), (party_add_members, "p_enemy_casualties", ":agent_troop_id", 1), (try_begin), (agent_is_wounded, ":cur_agent"), (party_wound_members, "p_enemy_casualties", ":agent_troop_id", 1), (try_end), (try_end), (try_end), ]), #script_get_max_skill_of_player_party # INPUT: arg1 = skill_no # OUTPUT: reg0 = max_skill, reg1 = skill_owner_troop_no ("get_max_skill_of_player_party", [(store_script_param, ":skill_no", 1), (party_get_num_companion_stacks, ":num_stacks","p_main_party"), (store_skill_level, ":max_skill", ":skill_no", "trp_player"), (assign, ":skill_owner", "trp_player"), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"), (troop_is_hero, ":stack_troop"), (neg|troop_is_wounded, ":stack_troop"), (store_skill_level, ":cur_skill", ":skill_no", ":stack_troop"), (gt, ":cur_skill", ":max_skill"), (assign, ":max_skill", ":cur_skill"), (assign, ":skill_owner", ":stack_troop"), (try_end), (assign, reg0, ":max_skill"), (assign, reg1, ":skill_owner"), ]), #script_upgrade_hero_party # INPUT: arg1 = party_id, arg2 = xp_amount ("upgrade_hero_party", [(store_script_param, ":party_no", 1), (store_script_param, ":xp_amount", 2), (party_upgrade_with_xp, ":party_no", ":xp_amount", 0), ]), #script_get_improvement_details # INPUT: arg1 = improvement # OUTPUT: reg0 = base_cost ("get_improvement_details", [(store_script_param, ":improvement_no", 1), (try_begin), (eq, ":improvement_no", slot_center_has_manor), (str_store_string, s0, "@Manor"), (str_store_string, s1, "@A manor lets you rest at the village and pay your troops half wages while you rest."), (assign, reg0, 8000), (else_try), (eq, ":improvement_no", slot_center_has_fish_pond), (str_store_string, s0, "@Mill"), (str_store_string, s1, "@A mill increases village prosperity by 5%."), (assign, reg0, 6000), (else_try), (eq, ":improvement_no", slot_center_has_watch_tower), (str_store_string, s0, "@Watch Tower"), (str_store_string, s1, "@A watch tower lets the villagers raise alarm earlier. The time it takes for enemies to loot the village increases by 25%."), (assign, reg0, 5000), (else_try), (eq, ":improvement_no", slot_center_has_school), (str_store_string, s0, "@School"), (str_store_string, s1, "@A shool increases the loyality of the villagers to you by +1 every month."), (assign, reg0, 9000), (else_try), (eq, ":improvement_no", slot_center_has_messenger_post), (str_store_string, s0, "@Messenger Post"), (str_store_string, s1, "@A messenger post lets the inhabitants send you a message whenever enemies are nearby, even if you are far away from here."), (assign, reg0, 4000), (else_try), (eq, ":improvement_no", slot_center_has_prisoner_tower), (str_store_string, s0, "@Prison Tower"), (str_store_string, s1, "@A prison tower reduces the chance of captives held here running away successfully."), (assign, reg0, 7000), (try_end), ]), #script_cf_troop_agent_is_alive # INPUT: arg1 = troop_id ("cf_troop_agent_is_alive", [(store_script_param, ":troop_no", 1), (assign, ":alive_count", 0), (try_for_agents, ":cur_agent"), (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"), (eq, ":troop_no", ":cur_agent_troop"), (agent_is_alive, ":cur_agent"), (val_add, ":alive_count", 1), (try_end), (gt, ":alive_count", 0), ]), #script_cf_village_recruit_volunteers_cond # INPUT: none # OUTPUT: none ("cf_village_recruit_volunteers_cond", [(neg|party_slot_eq, "$current_town", slot_village_state, svs_looted), (neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided), (neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1), (store_faction_of_party, ":village_faction", "$current_town"), (party_get_slot, ":center_relation", "$current_town", slot_center_player_relation), (store_relation, ":village_faction_relation", ":village_faction", "fac_player_faction"), (ge, ":center_relation", 0), (this_or_next|ge, ":center_relation", 5), (this_or_next|eq, ":village_faction", "$players_kingdom"), (this_or_next|ge, ":village_faction_relation", 0), (this_or_next|eq, ":village_faction", "$supported_pretender_old_faction"), ( eq, "$players_kingdom", 0), (party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0), (party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1), (party_get_free_companions_capacity, ":free_capacity", "p_main_party"), (ge, ":free_capacity", 1), ]), #script_village_recruit_volunteers_recruit # INPUT: none # OUTPUT: none ("village_recruit_volunteers_recruit", [(party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type), (party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount), (party_get_free_companions_capacity, ":free_capacity", "p_main_party"), (val_min, ":volunteer_amount", ":free_capacity"), (store_troop_gold, ":gold", "trp_player"), (store_div, ":gold_capacity", ":gold", 10),#10 denars per man (val_min, ":volunteer_amount", ":gold_capacity"), (party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"), (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1), (store_mul, ":cost", ":volunteer_amount", 10),#10 denars per man (troop_remove_gold, "trp_player", ":cost"), ]), #script_get_troop_item_amount # INPUT: arg1 = troop_no, arg2 = item_no # OUTPUT: reg0 = item_amount ("get_troop_item_amount", [(store_script_param, ":troop_no", 1), (store_script_param, ":item_no", 2), (troop_get_inventory_capacity, ":inv_cap", ":troop_no"), (assign, ":count", 0), (try_for_range, ":i_slot", 0, ":inv_cap"), (troop_get_inventory_slot, ":cur_item", ":troop_no", ":i_slot"), (eq, ":cur_item", ":item_no"), (val_add, ":count", 1), (try_end), (assign, reg0, ":count"), ]), #script_get_name_from_dna_to_s50 # INPUT: arg1 = dna # OUTPUT: s50 = name ("get_name_from_dna_to_s50", [(store_script_param, ":dna", 1), (store_sub, ":num_names", names_end, names_begin), (store_sub, ":num_surnames", surnames_end, surnames_begin), (assign, ":selected_name", ":dna"), (val_mod, ":selected_name", ":num_names"), (assign, ":selected_surname", ":dna"), (val_div, ":selected_surname", ":num_names"), (val_mod, ":selected_surname", ":num_surnames"), (val_add, ":selected_name", names_begin), (val_add, ":selected_surname", surnames_begin), (str_store_string, s50, ":selected_name"), (str_store_string, s50, ":selected_surname"), ]), #script_change_center_prosperity # INPUT: arg1 = center_no, arg2 = difference # OUTPUT: none ("change_center_prosperity", [(store_script_param, ":center_no", 1), (store_script_param, ":difference", 2), (party_get_slot, ":prosperity", ":center_no", slot_town_prosperity), (store_add, ":new_prosperity", ":prosperity", ":difference"), (val_clamp, ":new_prosperity", 0, 100), (store_div, ":old_state", ":prosperity", 20), (store_div, ":new_state", ":new_prosperity", 20), (try_begin), (neq, ":old_state", ":new_state"), (str_store_party_name_link, s2, ":center_no"), (call_script, "script_get_prosperity_text_to_s50", ":center_no"), (str_store_string, s3, s50), (party_set_slot, ":center_no", slot_town_prosperity, ":new_prosperity"), (call_script, "script_get_prosperity_text_to_s50", ":center_no"), (str_store_string, s4, s50), (display_message, "@Prosperity of {s2} has changed from {s3} to {s4}."), (call_script, "script_update_center_notes", ":center_no"), (else_try), (party_set_slot, ":center_no", slot_town_prosperity, ":new_prosperity"), (try_end), ]), #script_get_center_ideal_prosperity # INPUT: arg1 = center_no # OUTPUT: reg0 = ideal_prosperity ("get_center_ideal_prosperity", [(store_script_param, ":center_no", 1), (assign, ":ideal", 40), (try_begin), (is_between, ":center_no", villages_begin, villages_end), (try_begin), (party_slot_eq, ":center_no", slot_center_has_fish_pond, 1), (val_add, ":ideal", 5), (try_end), (party_get_slot, ":land_quality", ":center_no", slot_village_land_quality), (val_mul, ":land_quality", 3), (val_add, ":ideal", ":land_quality"), (party_get_slot, ":num_cattle", ":center_no", slot_village_number_of_cattle), (val_div, ":num_cattle", 20), (val_add, ":ideal", ":num_cattle"), (else_try), (try_for_range, ":village_no", villages_begin, villages_end), (party_slot_eq, ":village_no", slot_village_bound_center, ":center_no"), (party_get_slot, ":prosperity", ":village_no", slot_town_prosperity), (val_div, ":prosperity", 20), (val_add, ":ideal", ":prosperity"), (try_end), (try_end), (assign, reg0, ":ideal"), ]), #script_get_poorest_village_of_faction # INPUT: arg1 = center_no # OUTPUT: reg0 = ideal_prosperity ("get_poorest_village_of_faction", [(store_script_param, ":faction_no", 1), (assign, ":min_prosperity_village", -1), (assign, ":min_prosperity", 101), (try_for_range, ":village_no", villages_begin, villages_end), (store_faction_of_party, ":village_faction", ":village_no"), (eq, ":village_faction", ":faction_no"), (party_get_slot, ":prosperity", ":village_no", slot_town_prosperity), (lt, ":prosperity", ":min_prosperity"), (assign, ":min_prosperity", ":prosperity"), (assign, ":min_prosperity_village", ":village_no"), (try_end), (assign, reg0, ":min_prosperity_village"), ]), #script_troop_add_gold # INPUT: arg1 = troop_no, arg2 = amount # OUTPUT: none ("troop_add_gold", [(store_script_param, ":troop_no", 1), (store_script_param, ":amount", 2), (troop_add_gold, ":troop_no", ":amount"), (try_begin), (eq, ":troop_no", "trp_player"), (play_sound, "snd_money_received"), (try_end), ]), #NPC companion changes begin ("initialize_npcs", [ # set strings (troop_set_slot, "trp_npc1", slot_troop_morality_type, tmt_egalitarian), #borcha (troop_set_slot, "trp_npc1", slot_troop_morality_value, 4), #borcha (troop_set_slot, "trp_npc1", slot_troop_2ary_morality_type, tmt_aristocratic), #borcha (troop_set_slot, "trp_npc1", slot_troop_2ary_morality_value, -1), (troop_set_slot, "trp_npc1", slot_troop_personalityclash_object, "trp_npc7"), #borcha - deshavi (troop_set_slot, "trp_npc1", slot_troop_personalityclash2_object, "trp_npc16"), #borcha - klethi (troop_set_slot, "trp_npc1", slot_troop_personalitymatch_object, "trp_npc2"), #borcha - marnid (troop_set_slot, "trp_npc1", slot_troop_home, "p_village_71"), #Tshibtin (troop_set_slot, "trp_npc1", slot_troop_payment_request, 300), (troop_set_slot, "trp_npc2", slot_troop_morality_type, tmt_humanitarian), #marnid (troop_set_slot, "trp_npc2", slot_troop_morality_value, 2), (troop_set_slot, "trp_npc2", slot_troop_2ary_morality_type, tmt_honest), (troop_set_slot, "trp_npc2", slot_troop_2ary_morality_value, 1), (troop_set_slot, "trp_npc2", slot_troop_personalityclash_object, "trp_npc5"), #marnid - beheshtur (troop_set_slot, "trp_npc2", slot_troop_personalityclash2_object, "trp_npc9"), #marnid - alayen (troop_set_slot, "trp_npc2", slot_troop_personalitymatch_object, "trp_npc1"), #marnid - borcha (troop_set_slot, "trp_npc2", slot_troop_home, "p_town_1"), #Sargoth (troop_set_slot, "trp_npc2", slot_troop_payment_request, 0), # (troop_set_slot, "trp_npc3", slot_troop_morality_type, tmt_humanitarian), #Ymira (troop_set_slot, "trp_npc3", slot_troop_morality_value, 4), (troop_set_slot, "trp_npc3", slot_troop_2ary_morality_type, tmt_aristocratic), (troop_set_slot, "trp_npc3", slot_troop_2ary_morality_value, -1), (troop_set_slot, "trp_npc3", slot_troop_personalityclash_object, "trp_npc14"), #Ymira - artimenner (troop_set_slot, "trp_npc3", slot_troop_personalityclash2_object, "trp_npc8"), #Ymira - matheld (troop_set_slot, "trp_npc3", slot_troop_personalitymatch_object, "trp_npc9"), #Ymira - alayen (troop_set_slot, "trp_npc3", slot_troop_home, "p_town_3"), #Veluca (troop_set_slot, "trp_npc3", slot_troop_payment_request, 0), (troop_set_slot, "trp_npc4", slot_troop_morality_type, tmt_aristocratic), #Rolf (troop_set_slot, "trp_npc4", slot_troop_morality_value, 4), (troop_set_slot, "trp_npc4", slot_troop_2ary_morality_type, tmt_honest), (troop_set_slot, "trp_npc4", slot_troop_2ary_morality_value, -1), (troop_set_slot, "trp_npc4", slot_troop_personalityclash_object, "trp_npc10"), #Rolf - bunduk (troop_set_slot, "trp_npc4", slot_troop_personalityclash2_object, "trp_npc7"), #Rolf - deshavi (troop_set_slot, "trp_npc4", slot_troop_personalitymatch_object, "trp_npc5"), #Rolf - beheshtur (troop_set_slot, "trp_npc4", slot_troop_home, "p_village_34"), #Ehlerdah (troop_set_slot, "trp_npc4", slot_troop_payment_request, 300), (troop_set_slot, "trp_npc5", slot_troop_morality_type, tmt_egalitarian), #beheshtur (troop_set_slot, "trp_npc5", slot_troop_morality_value, 3), #beheshtur (troop_set_slot, "trp_npc5", slot_troop_2ary_morality_type, -1), (troop_set_slot, "trp_npc5", slot_troop_2ary_morality_value, 0), (troop_set_slot, "trp_npc5", slot_troop_personalityclash_object, "trp_npc2"), #beheshtur - marnid (troop_set_slot, "trp_npc5", slot_troop_personalityclash2_object, "trp_npc11"), #beheshtur- katrin (troop_set_slot, "trp_npc5", slot_troop_personalitymatch_object, "trp_npc4"), #beheshtur - rolf (troop_set_slot, "trp_npc5", slot_troop_home, "p_town_14"), #Halmar (troop_set_slot, "trp_npc5", slot_troop_payment_request, 400), (troop_set_slot, "trp_npc6", slot_troop_morality_type, tmt_humanitarian), #firenz (troop_set_slot, "trp_npc6", slot_troop_morality_value, 2), #beheshtur (troop_set_slot, "trp_npc6", slot_troop_2ary_morality_type, tmt_honest), (troop_set_slot, "trp_npc6", slot_troop_2ary_morality_value, 1), (troop_set_slot, "trp_npc6", slot_troop_personalityclash_object, "trp_npc11"), #firenz (troop_set_slot, "trp_npc6", slot_troop_personalityclash2_object, "trp_npc13"), #firenz - nizar (troop_set_slot, "trp_npc6", slot_troop_personalitymatch_object, "trp_npc12"), #firenz - jeremus (troop_set_slot, "trp_npc6", slot_troop_home, "p_town_4"), #Suno (troop_set_slot, "trp_npc6", slot_troop_payment_request, 0), (troop_set_slot, "trp_npc7", slot_troop_morality_type, tmt_egalitarian), #deshavi (troop_set_slot, "trp_npc7", slot_troop_morality_value, 3), #beheshtur (troop_set_slot, "trp_npc7", slot_troop_2ary_morality_type, -1), (troop_set_slot, "trp_npc7", slot_troop_2ary_morality_value, 0), (troop_set_slot, "trp_npc7", slot_troop_personalityclash_object, "trp_npc1"), #deshavi (troop_set_slot, "trp_npc7", slot_troop_personalityclash2_object, "trp_npc4"), #deshavi - rolf (troop_set_slot, "trp_npc7", slot_troop_personalitymatch_object, "trp_npc16"), #deshavi - klethi (troop_set_slot, "trp_npc7", slot_troop_home, "p_village_5"), #Kulum # (troop_set_slot, "trp_npc7", slot_troop_payment_request, 300), (troop_set_slot, "trp_npc8", slot_troop_morality_type, tmt_aristocratic), #matheld (troop_set_slot, "trp_npc8", slot_troop_morality_value, 3), #beheshtur (troop_set_slot, "trp_npc8", slot_troop_2ary_morality_type, -1), (troop_set_slot, "trp_npc8", slot_troop_2ary_morality_value, 0), (troop_set_slot, "trp_npc8", slot_troop_personalityclash_object, "trp_npc12"), #matheld (troop_set_slot, "trp_npc8", slot_troop_personalityclash2_object, "trp_npc3"), #matheld - ymira (troop_set_slot, "trp_npc8", slot_troop_personalitymatch_object, "trp_npc13"), #matheld - nizar (troop_set_slot, "trp_npc8", slot_troop_home, "p_sea_raider_spawn_point_2"), #Gundig's Point (troop_set_slot, "trp_npc8", slot_troop_payment_request, 500), (troop_set_slot, "trp_npc9", slot_troop_morality_type, tmt_aristocratic), #alayen (troop_set_slot, "trp_npc9", slot_troop_morality_value, 2), #beheshtur (troop_set_slot, "trp_npc9", slot_troop_2ary_morality_type, tmt_honest), (troop_set_slot, "trp_npc9", slot_troop_2ary_morality_value, 1), (troop_set_slot, "trp_npc9", slot_troop_personalityclash_object, "trp_npc13"), #alayen (troop_set_slot, "trp_npc9", slot_troop_personalityclash2_object, "trp_npc2"), #alayen - marnid (troop_set_slot, "trp_npc9", slot_troop_personalitymatch_object, "trp_npc3"), #alayen - ymira (troop_set_slot, "trp_npc9", slot_troop_home, "p_town_13"), #Rivacheg (troop_set_slot, "trp_npc9", slot_troop_payment_request, 300), (troop_set_slot, "trp_npc10", slot_troop_morality_type, tmt_humanitarian), #bunduk (troop_set_slot, "trp_npc10", slot_troop_morality_value, 2), (troop_set_slot, "trp_npc10", slot_troop_2ary_morality_type, tmt_egalitarian), (troop_set_slot, "trp_npc10", slot_troop_2ary_morality_value, 1), (troop_set_slot, "trp_npc10", slot_troop_personalityclash_object, "trp_npc4"), #bunduk (troop_set_slot, "trp_npc10", slot_troop_personalityclash2_object, "trp_npc14"), #bunduk - lazalet (troop_set_slot, "trp_npc10", slot_troop_personalitymatch_object, "trp_npc11"), #bunduk - katrin (troop_set_slot, "trp_npc10", slot_troop_home, "p_castle_28"), #Grunwalder Castle (troop_set_slot, "trp_npc10", slot_troop_payment_request, 200), (troop_set_slot, "trp_npc11", slot_troop_morality_type, tmt_egalitarian), #katrin (troop_set_slot, "trp_npc11", slot_troop_morality_value, 3), (troop_set_slot, "trp_npc11", slot_troop_2ary_morality_type, -1), (troop_set_slot, "trp_npc11", slot_troop_2ary_morality_value, 0), (troop_set_slot, "trp_npc11", slot_troop_personalityclash_object, "trp_npc6"), #katrin (troop_set_slot, "trp_npc11", slot_troop_personalityclash2_object, "trp_npc5"), #katrin - beheshtur (troop_set_slot, "trp_npc11", slot_troop_personalitymatch_object, "trp_npc10"), #bunduk - katrin (troop_set_slot, "trp_npc11", slot_troop_home, "p_town_6"), #Praven (troop_set_slot, "trp_npc11", slot_troop_payment_request, 100), (troop_set_slot, "trp_npc12", slot_troop_morality_type, tmt_humanitarian), #jerem (troop_set_slot, "trp_npc12", slot_troop_morality_value, 3), (troop_set_slot, "trp_npc12", slot_troop_2ary_morality_type, -1), (troop_set_slot, "trp_npc12", slot_troop_2ary_morality_value, 0), (troop_set_slot, "trp_npc12", slot_troop_personalityclash_object, "trp_npc8"), #jerem (troop_set_slot, "trp_npc12", slot_troop_personalityclash2_object, "trp_npc15"), #jeremus - artimenner (troop_set_slot, "trp_npc12", slot_troop_personalitymatch_object, "trp_npc6"), #jeremus - firenz (troop_set_slot, "trp_npc12", slot_troop_home, "p_castle_16"), #undetermined #University (troop_set_slot, "trp_npc12", slot_troop_payment_request, 0), (troop_set_slot, "trp_npc13", slot_troop_morality_type, tmt_aristocratic), #nizar (troop_set_slot, "trp_npc13", slot_troop_morality_value, 3), (troop_set_slot, "trp_npc13", slot_troop_2ary_morality_type, -1), (troop_set_slot, "trp_npc13", slot_troop_2ary_morality_value, 0), (troop_set_slot, "trp_npc13", slot_troop_personalityclash_object, "trp_npc9"), #nizar (troop_set_slot, "trp_npc13", slot_troop_personalityclash2_object, "trp_npc6"), #nizar - firenz (troop_set_slot, "trp_npc13", slot_troop_personalitymatch_object, "trp_npc8"), #nizar - matheld (troop_set_slot, "trp_npc13", slot_troop_home, "p_castle_15"), #Ergellon Castle (troop_set_slot, "trp_npc13", slot_troop_payment_request, 300), (troop_set_slot, "trp_npc14", slot_troop_morality_type, tmt_aristocratic), #lazalit (troop_set_slot, "trp_npc14", slot_troop_morality_value, 4), (troop_set_slot, "trp_npc14", slot_troop_2ary_morality_type, tmt_egalitarian), (troop_set_slot, "trp_npc14", slot_troop_2ary_morality_value, -1), (troop_set_slot, "trp_npc14", slot_troop_personalityclash_object, "trp_npc3"), #lazalit (troop_set_slot, "trp_npc14", slot_troop_personalityclash2_object, "trp_npc10"), #lazalit - bunduk (troop_set_slot, "trp_npc14", slot_troop_personalitymatch_object, "trp_npc15"), #lazalit - artimenner (troop_set_slot, "trp_npc14", slot_troop_home, "p_castle_18"), #Ismirala Castle (troop_set_slot, "trp_npc14", slot_troop_payment_request, 400), (troop_set_slot, "trp_npc15", slot_troop_morality_type, tmt_egalitarian), #artimenner (troop_set_slot, "trp_npc15", slot_troop_morality_value, 2), (troop_set_slot, "trp_npc15", slot_troop_2ary_morality_type, tmt_honest), (troop_set_slot, "trp_npc15", slot_troop_2ary_morality_value, 1), (troop_set_slot, "trp_npc15", slot_troop_personalityclash_object, "trp_npc16"), #artimenner - klethi (troop_set_slot, "trp_npc15", slot_troop_personalityclash2_object, "trp_npc12"), #artimenner - jeremus (troop_set_slot, "trp_npc15", slot_troop_personalitymatch_object, "trp_npc14"), #lazalit - artimenner (troop_set_slot, "trp_npc15", slot_troop_home, "p_castle_1"), #Culmarr Castle (troop_set_slot, "trp_npc15", slot_troop_payment_request, 300), (troop_set_slot, "trp_npc16", slot_troop_morality_type, tmt_aristocratic), #klethi (troop_set_slot, "trp_npc16", slot_troop_morality_value, 4), (troop_set_slot, "trp_npc16", slot_troop_2ary_morality_type, tmt_humanitarian), (troop_set_slot, "trp_npc16", slot_troop_2ary_morality_value, -1), (troop_set_slot, "trp_npc16", slot_troop_personalityclash_object, "trp_npc15"), #klethi (troop_set_slot, "trp_npc16", slot_troop_personalityclash2_object, "trp_npc1"), #klethi - borcha (troop_set_slot, "trp_npc16", slot_troop_personalitymatch_object, "trp_npc7"), #deshavi - klethi (troop_set_slot, "trp_npc16", slot_troop_home, "p_village_20"), #Uslum (troop_set_slot, "trp_npc16", slot_troop_payment_request, 200), (store_sub, "$number_of_npc_slots", slot_troop_strings_end, slot_troop_intro), (try_for_range, ":npc", companions_begin, companions_end), (try_for_range, ":slot_addition", 0, "$number_of_npc_slots"), (store_add, ":slot", ":slot_addition", slot_troop_intro), (store_mul, ":string_addition", ":slot_addition", 16), (store_add, ":string", "str_npc1_intro", ":string_addition"), (val_add, ":string", ":npc"), (val_sub, ":string", companions_begin), (troop_set_slot, ":npc", ":slot", ":string"), (try_end), (try_end), #Troop commentary changes begin (try_for_range, ":lord", "trp_knight_1_1", "trp_heroes_end"), (store_random_in_range, ":reputation", 0, 8), (try_begin), (eq, ":reputation", 0), (assign, ":reputation", 1), (try_end), (troop_set_slot, ":lord", slot_lord_reputation_type, ":reputation"), (try_end), #Troop commentary changes end #Post 0907 changes begin (call_script, "script_add_log_entry", logent_game_start, "trp_player", -1, -1, -1), #Post 0907 changes end #Rebellion changes begin (troop_set_slot, "trp_kingdom_1_pretender", slot_troop_original_faction, "fac_kingdom_1"), (troop_set_slot, "trp_kingdom_2_pretender", slot_troop_original_faction, "fac_kingdom_2"), (troop_set_slot, "trp_kingdom_3_pretender", slot_troop_original_faction, "fac_kingdom_3"), (troop_set_slot, "trp_kingdom_4_pretender", slot_troop_original_faction, "fac_kingdom_4"), (troop_set_slot, "trp_kingdom_5_pretender", slot_troop_original_faction, "fac_kingdom_5"), (troop_set_slot, "trp_kingdom_1_pretender", slot_troop_support_base, "p_town_4"), #suno (troop_set_slot, "trp_kingdom_2_pretender", slot_troop_support_base, "p_town_11"), #curaw (troop_set_slot, "trp_kingdom_3_pretender", slot_troop_support_base, "p_town_18"), #town_18 (troop_set_slot, "trp_kingdom_4_pretender", slot_troop_support_base, "p_town_12"), #wercheg (troop_set_slot, "trp_kingdom_5_pretender", slot_troop_support_base, "p_town_3"), #veluca (try_for_range, ":pretender", pretenders_begin, pretenders_end), (troop_set_slot, ":pretender", slot_lord_reputation_type, lrep_none), (try_end), #Rebellion changes end ]), ("objectionable_action", [ (store_script_param_1, ":action_type"), (store_script_param_2, ":action_string"), # (str_store_string, 12, ":action_string"), # (display_message, "@Objectionable action check: {s12}"), (assign, ":grievance_minimum", -2), (try_for_range, ":npc", companions_begin, companions_end), (main_party_has_troop, ":npc"), ###Primary morality check (try_begin), (troop_slot_eq, ":npc", slot_troop_morality_type, ":action_type"), (troop_get_slot, ":value", ":npc", slot_troop_morality_value), (try_begin), (troop_slot_eq, ":npc", slot_troop_morality_state, tms_acknowledged), # npc is betrayed, major penalty to player honor and morale (troop_get_slot, ":grievance", ":npc", slot_troop_morality_penalties), (val_mul, ":value", 2), (val_add, ":grievance", ":value"), (troop_set_slot, ":npc", slot_troop_morality_penalties, ":grievance"), (else_try), (this_or_next|troop_slot_eq, ":npc", slot_troop_morality_state, tms_dismissed), (eq, "$disable_npc_complaints", 1), # npc is quietly disappointed (troop_get_slot, ":grievance", ":npc", slot_troop_morality_penalties), (val_add, ":grievance", ":value"), (troop_set_slot, ":npc", slot_troop_morality_penalties, ":grievance"), (else_try), # npc raises the issue for the first time (troop_slot_eq, ":npc", slot_troop_morality_state, tms_no_problem), (gt, ":value", ":grievance_minimum"), (assign, "$npc_with_grievance", ":npc"), (assign, "$npc_grievance_string", ":action_string"), (assign, "$npc_grievance_slot", slot_troop_morality_state), (assign, ":grievance_minimum", ":value"), (assign, "$npc_praise_not_complaint", 0), (try_begin), (lt, ":value", 0), (assign, "$npc_praise_not_complaint", 1), (try_end), (try_end), ###Secondary morality check (else_try), (troop_slot_eq, ":npc", slot_troop_2ary_morality_type, ":action_type"), (troop_get_slot, ":value", ":npc", slot_troop_2ary_morality_value), (try_begin), (troop_slot_eq, ":npc", slot_troop_2ary_morality_state, tms_acknowledged), # npc is betrayed, major penalty to player honor and morale (troop_get_slot, ":grievance", ":npc", slot_troop_morality_penalties), (val_mul, ":value", 2), (val_add, ":grievance", ":value"), (troop_set_slot, ":npc", slot_troop_morality_penalties, ":grievance"), (else_try), (this_or_next|troop_slot_eq, ":npc", slot_troop_2ary_morality_state, tms_dismissed), (eq, "$disable_npc_complaints", 1), # npc is quietly disappointed (troop_get_slot, ":grievance", ":npc", slot_troop_morality_penalties), (val_add, ":grievance", ":value"), (troop_set_slot, ":npc", slot_troop_morality_penalties, ":grievance"), (else_try), # npc raises the issue for the first time (troop_slot_eq, ":npc", slot_troop_2ary_morality_state, tms_no_problem), (gt, ":value", ":grievance_minimum"), (assign, "$npc_with_grievance", ":npc"), (assign, "$npc_grievance_string", ":action_string"), (assign, "$npc_grievance_slot", slot_troop_2ary_morality_state), (assign, ":grievance_minimum", ":value"), (assign, "$npc_praise_not_complaint", 0), (try_begin), (lt, ":value", 0), (assign, "$npc_praise_not_complaint", 1), (try_end), (try_end), (try_end), (try_begin), (gt, "$npc_with_grievance", 0), (eq, "$npc_praise_not_complaint", 0), (str_store_troop_name, 4, "$npc_with_grievance"), (display_message, "@{s4} looks upset."), (try_end), (try_end), ]), ("post_battle_personality_clash_check", [ # (display_message, "@Post-victory personality clash check"), (try_for_range, ":npc", companions_begin, companions_end), (eq, "$disable_npc_complaints", 0), (main_party_has_troop, ":npc"), (neg|troop_is_wounded, ":npc"), (troop_get_slot, ":other_npc", ":npc", slot_troop_personalityclash2_object), (main_party_has_troop, ":other_npc"), (neg|troop_is_wounded, ":other_npc"), # (store_random_in_range, ":random", 0, 3), (try_begin), (troop_slot_eq, ":npc", slot_troop_personalityclash2_state, 0), (try_begin), # (eq, ":random", 0), (assign, "$npc_with_personality_clash_2", ":npc"), (try_end), (try_end), (try_end), (try_for_range, ":npc", companions_begin, companions_end), (troop_slot_eq, ":npc", slot_troop_personalitymatch_state, 0), (eq, "$disable_npc_complaints", 0), (main_party_has_troop, ":npc"), (neg|troop_is_wounded, ":npc"), (troop_get_slot, ":other_npc", ":npc", slot_troop_personalitymatch_object), (main_party_has_troop, ":other_npc"), (neg|troop_is_wounded, ":other_npc"), (assign, "$npc_with_personality_match", ":npc"), (try_end), (try_begin), (gt, "$npc_with_personality_clash_2", 0), (assign, "$npc_map_talk_context", slot_troop_personalityclash2_state), (start_map_conversation, "$npc_with_personality_clash_2"), (else_try), (gt, "$npc_with_personality_match", 0), (assign, "$npc_map_talk_context", slot_troop_personalitymatch_state), (start_map_conversation, "$npc_with_personality_match"), (try_end), ]), #script_event_player_defeated_enemy_party # INPUT: none # OUTPUT: none ("event_player_defeated_enemy_party", [(try_begin), (check_quest_active, "qst_raid_caravan_to_start_war"), (neg|check_quest_concluded, "qst_raid_caravan_to_start_war"), (party_slot_eq, "$g_enemy_party", slot_party_type, spt_kingdom_caravan), (store_faction_of_party, ":enemy_faction", "$g_enemy_party"), (quest_slot_eq, "qst_raid_caravan_to_start_war", slot_quest_target_faction, ":enemy_faction"), (quest_get_slot, ":cur_state", "qst_raid_caravan_to_start_war", slot_quest_current_state), (quest_get_slot, ":quest_target_amount", "qst_raid_caravan_to_start_war", slot_quest_target_amount), (val_add, ":cur_state", 1), (quest_set_slot, "qst_raid_caravan_to_start_war", slot_quest_current_state, ":cur_state"), (try_begin), (ge, ":cur_state", ":quest_target_amount"), (quest_get_slot, ":quest_target_faction", "qst_raid_caravan_to_start_war", slot_quest_target_faction), (quest_get_slot, ":quest_giver_troop", "qst_raid_caravan_to_start_war", slot_quest_giver_troop), (store_troop_faction, ":quest_giver_faction", ":quest_giver_troop"), (call_script, "script_diplomacy_start_war_between_kingdoms", ":quest_target_faction", ":quest_giver_faction", 1), (call_script, "script_succeed_quest", "qst_raid_caravan_to_start_war"), (try_end), (try_end), ]), #script_event_player_captured_as_prisoner # INPUT: none # OUTPUT: none ("event_player_captured_as_prisoner", [ (try_begin), (check_quest_active, "qst_raid_caravan_to_start_war"), (neg|check_quest_concluded, "qst_raid_caravan_to_start_war"), (quest_get_slot, ":quest_target_faction", "qst_raid_caravan_to_start_war", slot_quest_target_faction), (store_faction_of_party, ":capturer_faction", "$capturer_party"), (eq, ":quest_target_faction", ":capturer_faction"), (call_script, "script_fail_quest", "qst_raid_caravan_to_start_war"), (try_end), #Removing followers of the player (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (gt, ":party_no", 0), (party_slot_eq, ":party_no", slot_party_commander_party, "p_main_party"), (call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1), (party_set_slot, ":party_no", slot_party_commander_party, -1), (assign, "$g_recalculate_ais", 1), (try_end), ]), #NPC morale both returns a string and reg0 as the morale value ("npc_morale", [ (store_script_param_1, ":npc"), (troop_get_slot, ":morality_grievances", ":npc", slot_troop_morality_penalties), (troop_get_slot, ":personality_grievances", ":npc", slot_troop_personalityclash_penalties), (party_get_morale, ":party_morale", "p_main_party"), (store_sub, ":troop_morale", ":party_morale", ":morality_grievances"), (val_sub, ":troop_morale", ":personality_grievances"), (val_add, ":troop_morale", 50), (assign, reg8, ":troop_morale"), (val_mul, ":troop_morale", 3), (val_div, ":troop_morale", 4), (val_clamp, ":troop_morale", 0, 100), (assign, reg5, ":party_morale"), (assign, reg6, ":morality_grievances"), (assign, reg7, ":personality_grievances"), (assign, reg9, ":troop_morale"), # (str_store_troop_name, s11, ":npc"), # (display_message, "@{s11}'s morale = PM{reg5} + 50 - MG{reg6} - PG{reg7} = {reg8} x 0.75 = {reg9}"), (try_begin), (lt, ":morality_grievances", 3), (str_store_string, 7, "str_happy"), (else_try), (lt, ":morality_grievances", 15), (str_store_string, 7, "str_content"), (else_try), (lt, ":morality_grievances", 30), (str_store_string, 7, "str_concerned"), (else_try), (lt, ":morality_grievances", 45), (str_store_string, 7, "str_not_happy"), (else_try), (str_store_string, 7, "str_miserable"), (try_end), (try_begin), (lt, ":personality_grievances", 3), (str_store_string, 6, "str_happy"), (else_try), (lt, ":personality_grievances", 15), (str_store_string, 6, "str_content"), (else_try), (lt, ":personality_grievances", 30), (str_store_string, 6, "str_concerned"), (else_try), (lt, ":personality_grievances", 45), (str_store_string, 6, "str_not_happy"), (else_try), (str_store_string, 6, "str_miserable"), (try_end), (try_begin), (gt, ":troop_morale", 80), (str_store_string, 8, "str_happy"), (str_store_string, 63, "str_bar_enthusiastic"), (else_try), (gt, ":troop_morale", 60), (str_store_string, 8, "str_content"), (str_store_string, 63, "str_bar_content"), (else_try), (gt, ":troop_morale", 40), (str_store_string, 8, "str_concerned"), (str_store_string, 63, "str_bar_weary"), (else_try), (gt, ":troop_morale", 20), (str_store_string, 8, "str_not_happy"), (str_store_string, 63, "str_bar_disgruntled"), (else_try), (str_store_string, 8, "str_miserable"), (str_store_string, 63, "str_bar_miserable"), (try_end), (str_store_string, 21, "str_npc_morale_report"), (assign, reg0, ":troop_morale"), ]), #NPC morale both returns a string and reg0 as the morale value # ("retire_companion", [ (store_script_param_1, ":npc"), (store_script_param_2, ":length"), (remove_member_from_party, ":npc", "p_main_party"), (troop_set_slot, ":npc", slot_troop_personalityclash_penalties, 0), (troop_set_slot, ":npc", slot_troop_morality_penalties, 0), (troop_get_slot, ":renown", "trp_player", slot_troop_renown), (store_add, ":return_renown", ":renown", ":length"), (troop_set_slot, ":npc", slot_troop_occupation, slto_retirement), (troop_set_slot, ":npc", slot_troop_return_renown, ":return_renown"), ]), #NPC companion changes end #script_reduce_companion_morale_for_clash #script_calculate_ransom_amount_for_troop # INPUT: arg1 = troop_no for companion1 arg2 = troop_no for companion2 arg3 = slot_for_clash_state # slot_for_clash_state means: 1=give full penalty to companion1; 2=give full penalty to companion2; 3=give penalty equally ("reduce_companion_morale_for_clash", [ (store_script_param, ":companion_1", 1), (store_script_param, ":companion_2", 2), (store_script_param, ":slot_for_clash_state", 3), (troop_get_slot, ":clash_state", ":companion_1", ":slot_for_clash_state"), (troop_get_slot, ":grievance_1", ":companion_1", slot_troop_personalityclash_penalties), (troop_get_slot, ":grievance_2", ":companion_2", slot_troop_personalityclash_penalties), (try_begin), (eq, ":clash_state", pclash_penalty_to_self), (val_add, ":grievance_1", 5), (else_try), (eq, ":clash_state", pclash_penalty_to_other), (val_add, ":grievance_2", 5), (else_try), (eq, ":clash_state", pclash_penalty_to_both), (val_add, ":grievance_1", 3), (val_add, ":grievance_2", 3), (try_end), (troop_set_slot, ":companion_1", slot_troop_personalityclash_penalties, ":grievance_1"), (troop_set_slot, ":companion_2", slot_troop_personalityclash_penalties, ":grievance_2"), ]), #Hunting scripts end #script_calculate_ransom_amount_for_troop # INPUT: arg1 = troop_no # OUTPUT: reg0 = ransom_amount ("calculate_ransom_amount_for_troop", [(store_script_param, ":troop_no", 1), (store_troop_faction, ":faction_no", ":troop_no"), (assign, ":ransom_amount", 400), (try_begin), (faction_slot_eq, ":faction_no", slot_faction_leader, ":troop_no"), (val_add, ":ransom_amount", 4000), (try_end), (assign, ":num_center_points", 0), (try_for_range, ":cur_center", centers_begin, centers_end), (party_slot_eq, ":cur_center", slot_town_lord, ":troop_no"), (try_begin), (party_slot_eq, ":cur_center", slot_party_type, spt_town), (val_add, ":num_center_points", 4), (else_try), (party_slot_eq, ":cur_center", slot_party_type, spt_castle), (val_add, ":num_center_points", 2), (else_try), (val_add, ":num_center_points", 1), (try_end), (try_end), (val_mul, ":num_center_points", 500), (val_add, ":ransom_amount", ":num_center_points"), (troop_get_slot, ":renown", ":troop_no", slot_troop_renown), (val_mul, ":renown", 2), (val_add, ":ransom_amount", ":renown"), (store_mul, ":ransom_max_amount", ":ransom_amount", 3), (val_div, ":ransom_max_amount", 2), (store_random_in_range, ":random_ransom_amount", ":ransom_amount", ":ransom_max_amount"), (val_div, ":random_ransom_amount", 100), (val_mul, ":random_ransom_amount", 100), (assign, reg0, ":random_ransom_amount"), ]), #script_offer_ransom_amount_to_player_for_prisoners_in_party # INPUT: arg1 = party_no # OUTPUT: reg0 = result (1 = offered, 0 = not offered) ("offer_ransom_amount_to_player_for_prisoners_in_party", [(store_script_param, ":party_no", 1), (assign, ":result", 0), (party_get_num_prisoner_stacks, ":num_stacks", ":party_no"), (try_for_range, ":i_stack", 0, ":num_stacks"), (eq, ":result", 0), (party_prisoner_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"), (troop_is_hero, ":stack_troop"), (troop_slot_eq, ":stack_troop", slot_troop_occupation, slto_kingdom_hero), (store_troop_faction, ":stack_troop_faction", ":stack_troop"), (store_random_in_range, ":random_no", 0, 100), (try_begin), (faction_slot_eq, ":stack_troop_faction", slot_faction_state, sfs_active), (le, ":random_no", 5), (neq, "$g_ransom_offer_rejected", 1), (assign, ":num_stacks", 0), #break (assign, ":result", 1), (assign, "$g_ransom_offer_troop", ":stack_troop"), (assign, "$g_ransom_offer_party", ":party_no"), (jump_to_menu, "mnu_enemy_offer_ransom_for_prisoner"), (try_end), (try_end), (assign, reg0, ":result"), ]), # script_event_hero_taken_prisoner_by_player # Input: arg1 = troop_no # Output: none ("event_hero_taken_prisoner_by_player", [ (store_script_param_1, ":troop_no"), (try_begin), (check_quest_active, "qst_persuade_lords_to_make_peace"), (try_begin), (quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, ":troop_no"), (val_mul, ":troop_no", -1), (quest_set_slot, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, ":troop_no"), (val_mul, ":troop_no", -1), (else_try), (quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, ":troop_no"), (val_mul, ":troop_no", -1), (quest_set_slot, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, ":troop_no"), (val_mul, ":troop_no", -1), (try_end), (neg|check_quest_concluded, "qst_persuade_lords_to_make_peace"), (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"), (try_end), (call_script, "script_update_troop_location_notes", ":troop_no", 0), ]), # script_cf_check_hero_can_escape_from_player # Input: arg1 = troop_no # Output: none (can fail) ("cf_check_hero_can_escape_from_player", [ (store_script_param_1, ":troop_no"), (assign, ":quest_target", 0), (try_begin), (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, ":troop_no"), (quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, ":troop_no"), (assign, ":quest_target", 1), (try_end), (eq, ":quest_target", 0), (store_random_in_range, ":rand", 0, 100), (lt, ":rand", hero_escape_after_defeat_chance), ]), # script_cf_party_remove_random_regular_troop # Input: arg1 = party_no # Output: troop_id that has been removed (can fail) ("cf_party_remove_random_regular_troop", [(store_script_param_1, ":party_no"), (party_get_num_companion_stacks, ":num_stacks", ":party_no"), (assign, ":num_troops", 0), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"), (neg|troop_is_hero, ":stack_troop"), (party_stack_get_size, ":stack_size", ":party_no", ":i_stack"), (val_add, ":num_troops", ":stack_size"), (try_end), (assign, reg0, -1), (gt, ":num_troops", 0), (store_random_in_range, ":random_troop", 0, ":num_troops"), (try_for_range, ":i_stack", 0, ":num_stacks"), (party_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"), (neg|troop_is_hero, ":stack_troop"), (party_stack_get_size, ":stack_size", ":party_no", ":i_stack"), (val_sub, ":random_troop", ":stack_size"), (lt, ":random_troop", 0), (assign, ":num_stacks", 0), #break (party_remove_members, ":party_no", ":stack_troop", 1), (assign, reg0, ":stack_troop"), (try_end), ]), # script_place_player_banner_near_inventory # Input: none # Output: none ("place_player_banner_near_inventory", [ #normal_banner_begin (troop_get_slot, ":troop_banner_object", "trp_player", slot_troop_banner_scene_prop), #custom_banner_begin # (troop_get_slot, ":flag_spr", "trp_player", slot_troop_custom_banner_flag_type), (try_begin), #normal_banner_begin (gt, ":troop_banner_object", 0), (scene_prop_get_instance, ":flag_object", ":troop_banner_object", 0), #custom_banner_begin # (ge, ":flag_spr", 0), # (val_add, ":flag_spr", custom_banner_flag_scene_props_begin), # (scene_prop_get_instance, ":flag_object", ":flag_spr", 0), (try_begin), (ge, ":flag_object", 0), (get_player_agent_no, ":player_agent"), (agent_get_look_position, pos1, ":player_agent"), (position_move_y, pos1, -500), (position_rotate_z, pos1, 180), (position_set_z_to_ground_level, pos1), (position_move_z, pos1, 300), (prop_instance_set_position, ":flag_object", pos1), (try_end), (scene_prop_get_instance, ":pole_object", "spr_banner_pole", 0), (try_begin), (ge, ":pole_object", 0), (position_move_z, pos1, -320), (prop_instance_set_position, ":pole_object", pos1), (try_end), (else_try), (init_position, pos1), (position_move_z, pos1, -1000000), (scene_prop_get_instance, ":flag_object", banner_scene_props_begin, 0), (try_begin), (ge, ":flag_object", 0), (prop_instance_set_position, ":flag_object", pos1), (try_end), (scene_prop_get_instance, ":pole_object", "spr_banner_pole", 0), (try_begin), (ge, ":pole_object", 0), (prop_instance_set_position, ":pole_object", pos1), (try_end), (try_end), ]), # script_place_player_banner_near_inventory_bms # Input: none # Output: none ("place_player_banner_near_inventory_bms", [ #normal_banner_begin (troop_get_slot, ":troop_banner_object", "trp_player", slot_troop_banner_scene_prop), #custom_banner_begin # (troop_get_slot, ":flag_spr", "trp_player", slot_troop_custom_banner_flag_type), (try_begin), #normal_banner_begin (gt, ":troop_banner_object", 0), (replace_scene_props, banner_scene_props_begin, ":troop_banner_object"), #custom_banner_begin # (ge, ":flag_spr", 0), # (val_add, ":flag_spr", custom_banner_flag_scene_props_begin), # (replace_scene_props, banner_scene_props_begin, ":flag_spr"), (try_end), ]), # script_stay_captive_for_hours # Input: arg1 = num_hours # Output: none ("stay_captive_for_hours", [(store_script_param, ":num_hours", 1), (store_current_hours, ":cur_hours"), (val_add, ":cur_hours", ":num_hours"), (val_max, "$g_check_autos_at_hour", ":cur_hours"), (val_add, ":num_hours", 1), (rest_for_hours, ":num_hours", 0, 0), ]), # script_set_parties_around_player_ignore_player # Input: arg1 = ignore_range, arg2 = num_hours_to_ignore # Output: none ("set_parties_around_player_ignore_player", [(store_script_param, ":ignore_range", 1), (store_script_param, ":num_hours", 2), (try_for_parties, ":party_no"), (party_is_active, ":party_no"), (store_distance_to_party_from_party, ":dist", "p_main_party", ":party_no"), (lt, ":dist", ":ignore_range"), (party_ignore_player, ":party_no", ":num_hours"), (try_end), ]), # script_randomly_make_prisoner_heroes_escape_from_party # Input: arg1 = party_no, arg2 = escape_chance_mul_1000 # Output: none ("randomly_make_prisoner_heroes_escape_from_party", [(store_script_param, ":party_no", 1), (store_script_param, ":escape_chance", 2), (assign, ":quest_troop_1", -1), (assign, ":quest_troop_2", -1), (try_begin), (check_quest_active, "qst_rescue_lord_by_replace"), (quest_get_slot, ":quest_troop_1", "qst_rescue_lord_by_replace", slot_quest_target_troop), (try_end), (try_begin), (check_quest_active, "qst_deliver_message_to_prisoner_lord"), (quest_get_slot, ":quest_troop_2", "qst_deliver_message_to_prisoner_lord", slot_quest_target_troop), (try_end), (party_get_num_prisoner_stacks, ":num_stacks", ":party_no"), (try_for_range_backwards, ":i_stack", 0, ":num_stacks"), (party_prisoner_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"), (troop_is_hero, ":stack_troop"), (neq, ":stack_troop", ":quest_troop_1"), (neq, ":stack_troop", ":quest_troop_2"), (troop_slot_eq, ":stack_troop", slot_troop_occupation, slto_kingdom_hero), (store_random_in_range, ":random_no", 0, 1000), (lt, ":random_no", ":escape_chance"), (party_remove_prisoners, ":party_no", ":stack_troop", 1), (call_script, "script_remove_troop_from_prison", ":stack_troop"), (str_store_troop_name_link, s1, ":stack_troop"), (try_begin), (eq, ":party_no", "p_main_party"), (str_store_string, s2, "@your party"), (else_try), (str_store_party_name, s2, ":party_no"), (try_end), (assign, reg0, 0), (try_begin), (this_or_next|eq, ":party_no", "p_main_party"), (party_slot_eq, ":party_no", slot_town_lord, "trp_player"), (assign, reg0, 1), (try_end), (store_troop_faction, ":troop_faction", ":stack_troop"), (str_store_faction_name_link, s3, ":troop_faction"), (display_message, "@{reg0?One of your prisoners, :}{s1} of {s3} has escaped from captivity!"), (try_end), ]), # script_fill_tournament_participants_troop # Input: arg1 = center_no, arg2 = player_at_center # Output: none (fills trp_tournament_participants) ("fill_tournament_participants_troop", [(store_script_param, ":center_no", 1), (store_script_param, ":player_at_center", 2), (assign, ":cur_slot", 0), (try_begin), (eq, ":player_at_center", 1), (party_get_num_companion_stacks, ":num_stacks", "p_main_party"), (try_for_range, ":stack_no", 0, ":num_stacks"), (party_stack_get_troop_id, ":cur_troop", "p_main_party", ":stack_no"), (troop_is_hero, ":cur_troop"), (neq, ":cur_troop", "trp_kidnapped_girl"), (troop_set_slot, "trp_tournament_participants", ":cur_slot", ":cur_troop"), (val_add, ":cur_slot", 1), (try_end), (try_end), (party_collect_attachments_to_party, ":center_no", "p_temp_party"), (party_get_num_companion_stacks, ":num_stacks", "p_temp_party"), (try_for_range, ":stack_no", 0, ":num_stacks"), (party_stack_get_troop_id, ":cur_troop", "p_temp_party", ":stack_no"), (troop_is_hero, ":cur_troop"), (troop_set_slot, "trp_tournament_participants", ":cur_slot", ":cur_troop"), (val_add, ":cur_slot", 1), (try_end), (try_begin), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 50), (troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_xerina"), (val_add, ":cur_slot", 1), (try_end), (try_begin), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 50), (troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_dranton"), (val_add, ":cur_slot", 1), (try_end), (try_begin), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 50), (troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_kradus"), (val_add, ":cur_slot", 1), (try_end), (assign, ":begin_slot", ":cur_slot"), (try_for_range, ":cur_slot", ":begin_slot", 64), (store_random_in_range, ":random_no", 0, 6), (try_begin), (eq, ":random_no", 0), (troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_regular_fighter"), (else_try), (eq, ":random_no", 1), (troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_veteran_fighter"), (else_try), (eq, ":random_no", 2), (troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_champion_fighter"), (else_try), (eq, ":random_no", 3), (troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_sword_sister"), (else_try), (eq, ":random_no", 4), (troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_hired_blade"), (else_try), (troop_set_slot, "trp_tournament_participants", ":cur_slot", "trp_mercenary_swordsman"), (try_end), (try_end), ]), # script_get_num_tournament_participants # Input: none # Output: reg0 = num_participants ("get_num_tournament_participants", [(assign, ":num_participants", 0), (try_for_range, ":cur_slot", 0, 64), (troop_slot_ge, "trp_tournament_participants", ":cur_slot", 0), (val_add, ":num_participants", 1), (try_end), (assign, reg0, ":num_participants"), ]), # script_get_random_tournament_participant # Input: none # Output: reg0 = troop_no ("get_random_tournament_participant", [(call_script, "script_get_num_tournament_participants"), (assign, ":num_participants", reg0), (store_random_in_range, ":random_troop", 0, ":num_participants"), (assign, ":continue", 1), (try_for_range, ":cur_slot", 0, 64), (eq, ":continue", 1), (troop_slot_ge, "trp_tournament_participants", ":cur_slot", 0), (val_sub, ":random_troop", 1), (lt, ":random_troop", 0), (assign, ":continue", 0), (troop_get_slot, ":troop_no", "trp_tournament_participants", ":cur_slot"), (troop_set_slot, "trp_tournament_participants", ":cur_slot", -1), (try_end), (assign, reg0, ":troop_no"), ]), # script_add_tournament_participant # Input: arg1 = troop_no # Output: none ("add_tournament_participant", [(store_script_param, ":troop_no", 1), (assign, ":continue", 1), (try_for_range, ":cur_slot", 0, 64), (eq, ":continue", 1), (troop_slot_eq, "trp_tournament_participants", ":cur_slot", -1), (troop_set_slot, "trp_tournament_participants", ":cur_slot", ":troop_no"), (assign, ":continue", 0), (try_end), ]), # script_get_random_tournament_team_amount_and_size # Input: none # Output: reg0 = number_of_teams, reg1 = team_size ("get_random_tournament_team_amount_and_size", [ (call_script, "script_get_num_tournament_participants"), (assign, ":num_participants", reg0), (party_get_slot, ":town_max_teams", "$current_town", slot_town_tournament_max_teams), (val_add, ":town_max_teams", 1), (party_get_slot, ":town_max_team_size", "$current_town", slot_town_tournament_max_team_size), (val_add, ":town_max_team_size", 1), (assign, ":max_teams", ":num_participants"), (val_min, ":max_teams", ":town_max_teams"), (assign, ":max_size", ":num_participants"), (val_min, ":max_size", ":town_max_team_size"), (assign, ":min_size", 1), (try_begin), (ge, ":num_participants", 32), (assign, ":min_size", 2), (val_min, ":min_size", ":town_max_team_size"), (try_end), (assign, ":end_cond", 500), (try_for_range, ":unused", 0, ":end_cond"), (store_random_in_range, ":random_teams", 2, ":max_teams"), (store_random_in_range, ":random_size", ":min_size", ":max_size"), (store_mul, ":total_men", ":random_teams", ":random_size"), (le, ":total_men", ":num_participants"), (store_sub, ":left_men", ":num_participants", ":total_men"), (neq, ":left_men", 1), (assign, ":end_cond", 0), (try_end), (try_begin), (gt, ":end_cond", 0), (assign, ":random_teams", 2), (assign, ":random_size", 1), (try_end), (assign, reg0, ":random_teams"), (assign, reg1, ":random_size"), ]), # script_get_troop_priority_point_for_tournament # Input: arg1 = troop_no # Output: reg0 = troop_point ("get_troop_priority_point_for_tournament", [(store_script_param, ":troop_no", 1), (assign, ":troop_point", 0), (try_begin), (ge, ":troop_no", 0), (val_add, ":troop_point", 40000), (try_begin), (eq, ":troop_no", "trp_player"), (val_add, ":troop_point", 80000), (try_end), (try_begin), (troop_is_hero, ":troop_no"), (val_add, ":troop_point", 20000), (try_end), (try_begin), (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_player_companion), (val_add, ":troop_point", 10000), (else_try), (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), (troop_get_slot, ":renown", ":troop_no", slot_troop_renown), (val_add, ":troop_point", ":renown"), (val_add, ":troop_point", 1000), #in order to make it more prior than tournament heroes with higher levels (else_try), (store_character_level, ":level", ":troop_no"), (val_add, ":troop_point", ":level"), (try_end), (try_end), (assign, reg0, ":troop_point"), ]), # script_sort_tournament_participant_troops # Input: none # Output: none (sorts trp_tournament_participants) ("sort_tournament_participant_troops", [(try_for_range, ":cur_slot", 0, 63), (store_add, ":cur_slot_2_begin", ":cur_slot", 1), (try_for_range, ":cur_slot_2", ":cur_slot_2_begin", 64), (troop_get_slot, ":troop_1", "trp_tournament_participants", ":cur_slot"), (troop_get_slot, ":troop_2", "trp_tournament_participants", ":cur_slot_2"), (call_script, "script_get_troop_priority_point_for_tournament", ":troop_1"), (assign, ":troop_1_point", reg0), (call_script, "script_get_troop_priority_point_for_tournament", ":troop_2"), (assign, ":troop_2_point", reg0), (gt, ":troop_2_point", ":troop_1_point"), (troop_set_slot, "trp_tournament_participants", ":cur_slot", ":troop_2"), (troop_set_slot, "trp_tournament_participants", ":cur_slot_2", ":troop_1"), (try_end), (try_end), ]), # script_remove_tournament_participants_randomly # Input: arg1 = number_to_be_removed # Output: none ("remove_tournament_participants_randomly", [(store_script_param, ":number_to_be_removed", 1), (try_for_range, ":unused", 0, ":number_to_be_removed"), (assign, ":total_weight", 0), (try_for_range, ":cur_slot", 0, 64), (troop_get_slot, ":troop_no", "trp_tournament_participants", ":cur_slot"), (ge, ":troop_no", 0), (store_character_level, ":level", ":troop_no"), (val_min, ":level", 38), (store_sub, ":weight", 40, ":level"), (val_add, ":total_weight", ":weight"), (try_end), (store_random_in_range, ":random_weight", 0, ":total_weight"), (assign, ":continue", 1), (try_for_range, ":cur_slot", 0, 64), (eq, ":continue", 1), (troop_get_slot, ":troop_no", "trp_tournament_participants", ":cur_slot"), (ge, ":troop_no", 0), (store_character_level, ":level", ":troop_no"), (val_min, ":level", 38), (store_sub, ":weight", 40, ":level"), (val_sub, ":random_weight", ":weight"), (lt, ":random_weight", 0), (troop_set_slot, "trp_tournament_participants", ":cur_slot", -1), (assign, ":continue", 0), (try_end), (try_end), ]), # script_end_tournament_fight # Input: arg1 = player_team_won (1 or 0) # Output: none ("end_tournament_fight", [(store_script_param, ":player_team_won", 1), (call_script, "script_get_num_tournament_participants"), (assign, ":num_participants", reg0), (store_div, ":needed_to_remove_randomly", ":num_participants", 2), #Must remove other participants randomly earlier than adding the winners back to participants (call_script, "script_remove_tournament_participants_randomly", ":needed_to_remove_randomly"), (assign, ":num_needed", "$g_tournament_num_participants_for_fight"), (val_div, ":num_needed", 2), (get_player_agent_no, ":player_agent"), (agent_get_team, ":player_team", ":player_agent"), (try_for_agents, ":agent_no"), (agent_is_human, ":agent_no"), (agent_get_troop_id, ":troop_id", ":agent_no"), (neg|is_between, ":troop_id", arena_masters_begin, arena_masters_end),#omit tournament master (agent_get_team, ":agent_team", ":agent_no"), (assign, ":cur_point", 0), (try_begin), (eq, ":player_team_won", 1), (eq, ":agent_team", ":player_team"), (val_add, ":cur_point", 5000000),#Make sure that team members are chosen (try_end), (agent_get_kill_count, ":kill_count", ":agent_no", 1), #everyone is knocked unconscious (store_mul, ":kill_point", ":kill_count", 160000),#Make sure that kill count is the second most important variable (val_add, ":cur_point", ":kill_point"), (call_script, "script_get_troop_priority_point_for_tournament", ":troop_id"), (val_add, ":cur_point", reg0), (try_begin),#reset player's point if kill count is one after the first 2 rounds, or if it is zero (eq, ":agent_no", ":player_agent"), (eq, ":player_team_won", 0), (assign, ":not_passed", 1), (try_begin), (ge, ":kill_count", 2), (assign, ":not_passed", 0), (else_try), (eq, ":kill_count", 1), (le, "$g_tournament_cur_tier", 1), (assign, ":not_passed", 0), (try_end), (eq, ":not_passed", 1), (assign, ":cur_point", 0), (try_end), (agent_set_slot, ":agent_no", slot_agent_tournament_point, ":cur_point"), (try_end), (try_for_range, ":unused", 0, ":num_needed"), (assign, ":best_point", 0), (assign, ":best_agent_no", -1), (try_for_agents, ":agent_no"), (agent_is_human, ":agent_no"), (agent_get_slot, ":point", ":agent_no", slot_agent_tournament_point), (gt, ":point", ":best_point"), (assign, ":best_agent_no", ":agent_no"), (assign, ":best_point", ":point"), (try_end), (agent_set_slot, ":best_agent_no", slot_agent_tournament_point, 0),#Do not select the same agent again (agent_get_troop_id, ":troop_id", ":best_agent_no"), (call_script, "script_add_tournament_participant", ":troop_id"), (try_end), (assign, "$g_tournament_player_team_won", ":player_team_won"), (jump_to_menu, "mnu_town_tournament"), ]), # script_get_win_amount_for_tournament_bet # Input: none # Output: reg0 = win_amount_with_100_denars ("get_win_amount_for_tournament_bet", [ (party_get_slot, ":player_odds", "$current_town", slot_town_player_odds), (try_begin), (eq, "$g_tournament_cur_tier", 0), (assign, ":win_amount", 120), (else_try), (eq, "$g_tournament_cur_tier", 1), (assign, ":win_amount", 90), (else_try), (eq, "$g_tournament_cur_tier", 2), (assign, ":win_amount", 60), (else_try), (eq, "$g_tournament_cur_tier", 3), (assign, ":win_amount", 40), (else_try), (eq, "$g_tournament_cur_tier", 4), (assign, ":win_amount", 20), (else_try), (assign, ":win_amount", 8), (try_end), (val_mul, ":win_amount", ":player_odds"), (val_div, ":win_amount", 100), (val_add, ":win_amount", 100), #win amount when 100 denars is placed (assign, reg0, ":win_amount"), ]), # script_tournament_place_bet # Input: arg1 = bet_amount # Output: none ("tournament_place_bet", [ (store_script_param, ":bet_amount", 1), (call_script, "script_get_win_amount_for_tournament_bet"), (assign, ":win_amount", reg0), (val_mul, ":win_amount", ":bet_amount"), (val_div, ":win_amount", 100), (val_sub, ":win_amount", ":bet_amount"), (val_add, "$g_tournament_bet_placed", ":bet_amount"), (val_add, "$g_tournament_bet_win_amount", ":win_amount"), (troop_remove_gold, "trp_player", ":bet_amount"), (assign, "$g_tournament_last_bet_tier", "$g_tournament_cur_tier"), ]), # script_calculate_amount_of_cattle_can_be_stolen # Input: arg1 = village_no # Output: reg0 = max_amount ("calculate_amount_of_cattle_can_be_stolen", [ (store_script_param, ":village_no", 1), (call_script, "script_get_max_skill_of_player_party", "skl_looting"), (assign, ":max_skill", reg0), (store_mul, ":can_steal", ":max_skill", 2), (call_script, "script_party_count_fit_for_battle", "p_main_party"), (store_add, ":num_men_effect", reg0, 10), (val_div, ":num_men_effect", 10), (val_add, ":can_steal", ":num_men_effect"), (party_get_slot, ":num_cattle", ":village_no", slot_village_number_of_cattle), (val_min, ":can_steal", ":num_cattle"), (assign, reg0, ":can_steal"), ]), # script_draw_banner_to_region # Input: arg1 = troop_no, arg2 = center_pos_x, arg3 = center_pos_y, arg4 = width, arg5 = height, arg6 = stretch_width, arg7 = stretch_height, arg8 = default_scale, arg9 = max_charge_scale, arg10 = drawn_item_type # drawn_item_type is 0 for banners, 1 for shields, 2 for heater shield, 3 for armor # arguments will be used as fixed point values # Output: none ("draw_banner_to_region", [ (store_script_param, ":troop_no", 1), (store_script_param, ":center_pos_x", 2), (store_script_param, ":center_pos_y", 3), (store_script_param, ":width", 4), (store_script_param, ":height", 5), (store_script_param, ":stretch_width", 6), (store_script_param, ":stretch_height", 7), (store_script_param, ":default_scale", 8), (store_script_param, ":max_charge_scale", 9), (store_script_param, ":drawn_item_type", 10), (troop_get_slot, ":bg_type", ":troop_no", slot_troop_custom_banner_bg_type), (val_add, ":bg_type", custom_banner_backgrounds_begin), (troop_get_slot, ":bg_color_1", ":troop_no", slot_troop_custom_banner_bg_color_1), (troop_get_slot, ":bg_color_2", ":troop_no", slot_troop_custom_banner_bg_color_2), (troop_get_slot, ":num_charges", ":troop_no", slot_troop_custom_banner_num_charges), (troop_get_slot, ":positioning", ":troop_no", slot_troop_custom_banner_positioning), (call_script, "script_get_troop_custom_banner_num_positionings", ":troop_no"), (assign, ":num_positionings", reg0), (val_mod, ":positioning", ":num_positionings"), (init_position, pos2), (position_set_x, pos2, ":width"), (position_set_y, pos2, ":height"), (assign, ":default_value", 1), (convert_to_fixed_point, ":default_value"), (position_set_z, pos2, ":default_value"), (init_position, pos1), (position_set_x, pos1, ":center_pos_x"), (position_set_y, pos1, ":center_pos_y"), (position_move_z, pos1, -20), (init_position, pos3), (position_set_x, pos3, ":default_scale"), (position_set_y, pos3, ":default_scale"), (position_set_z, pos3, ":default_value"), (try_begin), (this_or_next|eq, ":bg_type", "mesh_custom_banner_bg"), (this_or_next|eq, ":bg_type", "mesh_custom_banner_fg01"), (this_or_next|eq, ":bg_type", "mesh_custom_banner_fg02"), (this_or_next|eq, ":bg_type", "mesh_custom_banner_fg03"), (this_or_next|eq, ":bg_type", "mesh_custom_banner_fg08"), (this_or_next|eq, ":bg_type", "mesh_custom_banner_fg09"), (this_or_next|eq, ":bg_type", "mesh_custom_banner_fg10"), (this_or_next|eq, ":bg_type", "mesh_custom_banner_fg11"), (this_or_next|eq, ":bg_type", "mesh_custom_banner_fg12"), (this_or_next|eq, ":bg_type", "mesh_custom_banner_fg13"), (this_or_next|eq, ":bg_type", "mesh_custom_banner_fg16"), (eq, ":bg_type", "mesh_custom_banner_fg17"), (cur_tableau_add_mesh_with_scale_and_vertex_color, ":bg_type", pos1, pos2, 0, ":bg_color_1"), (else_try), (cur_tableau_add_mesh_with_scale_and_vertex_color, ":bg_type", pos1, pos3, 0, ":bg_color_1"), (try_end), (position_move_z, pos1, -20), (position_move_x, pos2, ":width"), (position_move_y, pos2, ":height"), (cur_tableau_add_mesh_with_scale_and_vertex_color, "mesh_custom_banner_bg", pos1, pos2, 0, ":bg_color_2"), (assign, ":charge_stretch", ":stretch_width"), (val_min, ":charge_stretch", ":stretch_height"), (val_min, ":charge_stretch", ":max_charge_scale"), (call_script, "script_get_custom_banner_charge_type_position_scale_color", "trp_player", ":positioning"), (try_begin), (this_or_next|eq, ":drawn_item_type", 2), #heater shield (eq, ":drawn_item_type", 3), #armor (assign, ":change_center_pos", 0), (try_begin), (eq, ":num_charges", 1), (assign, ":change_center_pos", 1), (else_try), (eq, ":num_charges", 2), (eq, ":positioning", 1), (assign, ":change_center_pos", 1), (else_try), (eq, ":num_charges", 3), (eq, ":positioning", 1), (assign, ":change_center_pos", 1), (try_end), (try_begin), (eq, ":change_center_pos", 1), (val_add, ":center_pos_y", 30), (try_end), (try_end), (try_begin), (ge, ":num_charges", 1), (val_mul, reg1, ":charge_stretch"), (val_div, reg1, 10000), (position_get_x, ":x", pos0), (position_get_y, ":y", pos0), (val_mul, ":x", ":stretch_width"), (val_mul, ":y", ":stretch_height"), (val_div, ":x", 10000), (val_div, ":y", 10000), (val_add, ":x", ":center_pos_x"), (val_add, ":y", ":center_pos_y"), (position_set_x, pos0, ":x"), (position_set_y, pos0, ":y"), (assign, ":scale_value", reg1), (convert_to_fixed_point, ":scale_value"), (store_mul, ":scale_value_inverse", ":scale_value", -1), (init_position, pos4), (position_set_x, pos4, ":scale_value"), (position_set_y, pos4, ":scale_value"), (position_set_z, pos4, ":scale_value"), (store_div, ":orientation", reg0, 256), #orientation flags (try_begin), (this_or_next|eq, ":orientation", 1), (eq, ":orientation", 3), (position_set_x, pos4, ":scale_value_inverse"), (try_end), (try_begin), (this_or_next|eq, ":orientation", 2), (eq, ":orientation", 3), (position_set_y, pos4, ":scale_value_inverse"), (try_end), (val_mod, reg0, 256), #remove orientation flags (cur_tableau_add_mesh_with_scale_and_vertex_color, reg0, pos0, pos4, 0, reg2), (try_end), (try_begin), (ge, ":num_charges", 2), (val_mul, reg4, ":charge_stretch"), (val_div, reg4, 10000), (position_get_x, ":x", pos1), (position_get_y, ":y", pos1), (val_mul, ":x", ":stretch_width"), (val_mul, ":y", ":stretch_height"), (val_div, ":x", 10000), (val_div, ":y", 10000), (val_add, ":x", ":center_pos_x"), (val_add, ":y", ":center_pos_y"), (position_set_x, pos1, ":x"), (position_set_y, pos1, ":y"), (assign, ":scale_value", reg4), (convert_to_fixed_point, ":scale_value"), (store_mul, ":scale_value_inverse", ":scale_value", -1), (init_position, pos4), (position_set_x, pos4, ":scale_value"), (position_set_y, pos4, ":scale_value"), (position_set_z, pos4, ":scale_value"), (store_div, ":orientation", reg3, 256), #orientation flags (try_begin), (this_or_next|eq, ":orientation", 1), (eq, ":orientation", 3), (position_set_x, pos4, ":scale_value_inverse"), (try_end), (try_begin), (this_or_next|eq, ":orientation", 2), (eq, ":orientation", 3), (position_set_y, pos4, ":scale_value_inverse"), (try_end), (val_mod, reg3, 256), #remove orientation flags (cur_tableau_add_mesh_with_scale_and_vertex_color, reg3, pos1, pos4, 0, reg5), (try_end), (try_begin), (ge, ":num_charges", 3), (val_mul, reg7, ":charge_stretch"), (val_div, reg7, 10000), (position_get_x, ":x", pos2), (position_get_y, ":y", pos2), (val_mul, ":x", ":stretch_width"), (val_mul, ":y", ":stretch_height"), (val_div, ":x", 10000), (val_div, ":y", 10000), (val_add, ":x", ":center_pos_x"), (val_add, ":y", ":center_pos_y"), (position_set_x, pos2, ":x"), (position_set_y, pos2, ":y"), (assign, ":scale_value", reg7), (convert_to_fixed_point, ":scale_value"), (store_mul, ":scale_value_inverse", ":scale_value", -1), (init_position, pos4), (position_set_x, pos4, ":scale_value"), (position_set_y, pos4, ":scale_value"), (position_set_z, pos4, ":scale_value"), (store_div, ":orientation", reg6, 256), #orientation flags (try_begin), (this_or_next|eq, ":orientation", 1), (eq, ":orientation", 3), (position_set_x, pos4, ":scale_value_inverse"), (try_end), (try_begin), (this_or_next|eq, ":orientation", 2), (eq, ":orientation", 3), (position_set_y, pos4, ":scale_value_inverse"), (try_end), (val_mod, reg6, 256), #remove orientation flags (cur_tableau_add_mesh_with_scale_and_vertex_color, reg6, pos2, pos4, 0, reg8), (try_end), (try_begin), (ge, ":num_charges", 4), (val_mul, reg10, ":charge_stretch"), (val_div, reg10, 10000), (position_get_x, ":x", pos3), (position_get_y, ":y", pos3), (val_mul, ":x", ":stretch_width"), (val_mul, ":y", ":stretch_height"), (val_div, ":x", 10000), (val_div, ":y", 10000), (val_add, ":x", ":center_pos_x"), (val_add, ":y", ":center_pos_y"), (position_set_x, pos3, ":x"), (position_set_y, pos3, ":y"), (assign, ":scale_value", reg10), (convert_to_fixed_point, ":scale_value"), (store_mul, ":scale_value_inverse", ":scale_value", -1), (init_position, pos4), (position_set_x, pos4, ":scale_value"), (position_set_y, pos4, ":scale_value"), (position_set_z, pos4, ":scale_value"), (store_div, ":orientation", reg9, 256), #orientation flags (try_begin), (this_or_next|eq, ":orientation", 1), (eq, ":orientation", 3), (position_set_x, pos4, ":scale_value_inverse"), (try_end), (try_begin), (this_or_next|eq, ":orientation", 2), (eq, ":orientation", 3), (position_set_y, pos4, ":scale_value_inverse"), (try_end), (val_mod, reg9, 256), #remove orientation flags (cur_tableau_add_mesh_with_scale_and_vertex_color, reg9, pos3, pos4, 0, reg11), (try_end), ]), # script_get_troop_custom_banner_num_positionings # Input: arg1 = troop_no # Output: reg0 = num_positionings ("get_troop_custom_banner_num_positionings", [ (store_script_param, ":troop_no", 1), (troop_get_slot, ":num_charges", ":troop_no", slot_troop_custom_banner_num_charges), (try_begin), (eq, ":num_charges", 1), (assign, ":num_positionings", 2), (else_try), (eq, ":num_charges", 2), (assign, ":num_positionings", 4), (else_try), (eq, ":num_charges", 3), (assign, ":num_positionings", 6), (else_try), (assign, ":num_positionings", 2), (try_end), (assign, reg0, ":num_positionings"), ]), # script_get_custom_banner_charge_type_position_scale_color # Input: arg1 = troop_no, arg2 = positioning_index # Output: reg0 = type_1 # reg1 = scale_1 # reg2 = color_1 # reg3 = type_2 # reg4 = scale_2 # reg5 = color_2 # reg6 = type_3 # reg7 = scale_3 # reg8 = color_3 # reg9 = type_4 # reg10 = scale_4 # reg11 = color_4 ("get_custom_banner_charge_type_position_scale_color", [ (store_script_param, ":troop_no", 1), (store_script_param, ":positioning", 2), (troop_get_slot, ":num_charges", ":troop_no", slot_troop_custom_banner_num_charges), (init_position, pos0), (init_position, pos1), (init_position, pos2), (init_position, pos3), (troop_get_slot, reg0, ":troop_no", slot_troop_custom_banner_charge_type_1), (val_add, reg0, custom_banner_charges_begin), (troop_get_slot, reg2, ":troop_no", slot_troop_custom_banner_charge_color_1), (troop_get_slot, reg3, ":troop_no", slot_troop_custom_banner_charge_type_2), (val_add, reg3, custom_banner_charges_begin), (troop_get_slot, reg5, ":troop_no", slot_troop_custom_banner_charge_color_2), (troop_get_slot, reg6, ":troop_no", slot_troop_custom_banner_charge_type_3), (val_add, reg6, custom_banner_charges_begin), (troop_get_slot, reg8, ":troop_no", slot_troop_custom_banner_charge_color_3), (troop_get_slot, reg9, ":troop_no", slot_troop_custom_banner_charge_type_4), (val_add, reg9, custom_banner_charges_begin), (troop_get_slot, reg11, ":troop_no", slot_troop_custom_banner_charge_color_4), (try_begin), (eq, ":num_charges", 1), (try_begin), (eq, ":positioning", 0), (assign, reg1, 100), (else_try), (assign, reg1, 50), (try_end), (else_try), (eq, ":num_charges", 2), (try_begin), (eq, ":positioning", 0), (position_set_y, pos0, 25), (position_set_y, pos1, -25), (assign, reg1, 40), (assign, reg4, 40), (else_try), (eq, ":positioning", 1), (position_set_x, pos0, -25), (position_set_x, pos1, 25), (assign, reg1, 40), (assign, reg4, 40), (else_try), (eq, ":positioning", 2), (position_set_x, pos0, -25), (position_set_y, pos0, 25), (position_set_x, pos1, 25), (position_set_y, pos1, -25), (assign, reg1, 50), (assign, reg4, 50), (else_try), (position_set_x, pos0, -25), (position_set_y, pos0, -25), (position_set_x, pos1, 25), (position_set_y, pos1, 25), (assign, reg1, 50), (assign, reg4, 50), (try_end), (else_try), (eq, ":num_charges", 3), (try_begin), (eq, ":positioning", 0), (position_set_y, pos0, 33), (position_set_y, pos2, -33), (assign, reg1, 30), (assign, reg4, 30), (assign, reg7, 30), (else_try), (eq, ":positioning", 1), (position_set_x, pos0, -33), (position_set_x, pos2, 33), (assign, reg1, 30), (assign, reg4, 30), (assign, reg7, 30), (else_try), (eq, ":positioning", 2), (position_set_x, pos0, -30), (position_set_y, pos0, 30), (position_set_x, pos2, 30), (position_set_y, pos2, -30), (assign, reg1, 35), (assign, reg4, 35), (assign, reg7, 35), (else_try), (eq, ":positioning", 3), (position_set_x, pos0, -30), (position_set_y, pos0, -30), (position_set_x, pos2, 30), (position_set_y, pos2, 30), (assign, reg1, 35), (assign, reg4, 35), (assign, reg7, 35), (else_try), (eq, ":positioning", 4), (position_set_x, pos0, -25), (position_set_y, pos0, -25), (position_set_y, pos1, 25), (position_set_x, pos2, 25), (position_set_y, pos2, -25), (assign, reg1, 50), (assign, reg4, 50), (assign, reg7, 50), (else_try), (position_set_x, pos0, -25), (position_set_y, pos0, 25), (position_set_y, pos1, -25), (position_set_x, pos2, 25), (position_set_y, pos2, 25), (assign, reg1, 50), (assign, reg4, 50), (assign, reg7, 50), (try_end), (else_try), (try_begin), (eq, ":positioning", 0), (position_set_x, pos0, -25), (position_set_y, pos0, 25), (position_set_x, pos1, 25), (position_set_y, pos1, 25), (position_set_x, pos2, -25), (position_set_y, pos2, -25), (position_set_x, pos3, 25), (position_set_y, pos3, -25), (assign, reg1, 50), (assign, reg4, 50), (assign, reg7, 50), (assign, reg10, 50), (else_try), (position_set_y, pos0, 30), (position_set_x, pos1, -30), (position_set_x, pos2, 30), (position_set_y, pos3, -30), (assign, reg1, 35), (assign, reg4, 35), (assign, reg7, 35), (assign, reg10, 35), (try_end), (try_end), ]), # script_get_random_custom_banner # Input: arg1 = troop_no # Output: none ("get_random_custom_banner", [ (store_script_param, ":troop_no", 1), (store_random_in_range, ":num_charges", 1, 5), (troop_set_slot, ":troop_no", slot_troop_custom_banner_num_charges, ":num_charges"), (store_random_in_range, ":random_color_index", 0, 42), (call_script, "script_get_custom_banner_color_from_index", ":random_color_index"), (assign, ":color_1", reg0), (troop_set_slot, ":troop_no", slot_troop_custom_banner_bg_color_1, ":color_1"), (assign, ":end_cond", 1), (try_for_range, ":unused", 0, ":end_cond"), (store_random_in_range, ":random_color_index", 0, 42), (call_script, "script_get_custom_banner_color_from_index", ":random_color_index"), (assign, ":color_2", reg0), (try_begin), (call_script, "script_cf_check_color_visibility", ":color_1", ":color_2"), (troop_set_slot, ":troop_no", slot_troop_custom_banner_bg_color_2, ":color_2"), (else_try), (val_add, ":end_cond", 1), (try_end), (try_end), (assign, ":end_cond", 4), (assign, ":cur_charge", 0), (try_for_range, ":unused", 0, ":end_cond"), (store_random_in_range, ":random_color_index", 0, 42), (call_script, "script_get_custom_banner_color_from_index", ":random_color_index"), (assign, ":charge_color", reg0), (try_begin), (call_script, "script_cf_check_color_visibility", ":charge_color", ":color_1"), (call_script, "script_cf_check_color_visibility", ":charge_color", ":color_2"), (store_add, ":cur_slot", ":cur_charge", slot_troop_custom_banner_charge_color_1), (troop_set_slot, ":troop_no", ":cur_slot", ":charge_color"), (store_random_in_range, ":random_charge", custom_banner_charges_begin, custom_banner_charges_end), (val_sub, ":random_charge", custom_banner_charges_begin), (store_add, ":cur_slot", ":cur_charge", slot_troop_custom_banner_charge_type_1), (troop_set_slot, ":troop_no", ":cur_slot", ":random_charge"), (val_add, ":cur_charge", 1), (else_try), (val_add, ":end_cond", 1), (try_end), (try_end), (store_random_in_range, ":random_bg", custom_banner_backgrounds_begin, custom_banner_backgrounds_end), (val_sub, ":random_bg", custom_banner_backgrounds_begin), (troop_set_slot, ":troop_no", slot_troop_custom_banner_bg_type, ":random_bg"), (store_random_in_range, ":random_flag", custom_banner_flag_types_begin, custom_banner_flag_types_end), (val_sub, ":random_flag", custom_banner_flag_types_begin), (troop_set_slot, ":troop_no", slot_troop_custom_banner_flag_type, ":random_flag"), (store_random_in_range, ":random_positioning", 0, 4), (troop_set_slot, ":troop_no", slot_troop_custom_banner_positioning, ":random_positioning"), ]), # script_get_custom_banner_color_from_index # Input: arg1 = color_index # Output: reg0 = color ("get_custom_banner_color_from_index", [ (store_script_param, ":color_index", 1), (assign, ":cur_color", 0xFF000000), (assign, ":red", 0x00), (assign, ":green", 0x00), (assign, ":blue", 0x00), (store_mod, ":mod_i_color", ":color_index", 7), (try_begin), (eq, ":mod_i_color", 0), (assign, ":blue", 0xFF), (else_try), (eq, ":mod_i_color", 1), (assign, ":red", 0xEE), (else_try), (eq, ":mod_i_color", 2), (assign, ":red", 0xFB), (assign, ":green", 0xAC), (else_try), (eq, ":mod_i_color", 3), (assign, ":red", 0x5F), (assign, ":blue", 0xFF), (else_try), (eq, ":mod_i_color", 4), (assign, ":red", 0x05), (assign, ":green", 0x44), (else_try), (eq, ":mod_i_color", 5), (assign, ":red", 0xEE), (assign, ":green", 0xEE), (assign, ":blue", 0xEE), (else_try), (assign, ":red", 0x22), (assign, ":green", 0x22), (assign, ":blue", 0x22), (try_end), (store_div, ":cur_tone", ":color_index", 7), (store_sub, ":cur_tone", 8, ":cur_tone"), (val_mul, ":red", ":cur_tone"), (val_div, ":red", 8), (val_mul, ":green", ":cur_tone"), (val_div, ":green", 8), (val_mul, ":blue", ":cur_tone"), (val_div, ":blue", 8), (val_mul, ":green", 0x100), (val_mul, ":red", 0x10000), (val_add, ":cur_color", ":blue"), (val_add, ":cur_color", ":green"), (val_add, ":cur_color", ":red"), (assign, reg0, ":cur_color"), ]), # script_cf_check_color_visibility # Input: arg1 = color_1, arg2 = color_2 # Output: none ("cf_check_color_visibility", [ (store_script_param, ":color_1", 1), (store_script_param, ":color_2", 2), (store_mod, ":blue_1", ":color_1", 256), (store_div, ":green_1", ":color_1", 256), (val_mod, ":green_1", 256), (store_div, ":red_1", ":color_1", 256 * 256), (val_mod, ":red_1", 256), (store_mod, ":blue_2", ":color_2", 256), (store_div, ":green_2", ":color_2", 256), (val_mod, ":green_2", 256), (store_div, ":red_2", ":color_2", 256 * 256), (val_mod, ":red_2", 256), (store_sub, ":red_dif", ":red_1", ":red_2"), (val_abs, ":red_dif"), (store_sub, ":green_dif", ":green_1", ":green_2"), (val_abs, ":green_dif"), (store_sub, ":blue_dif", ":blue_1", ":blue_2"), (val_abs, ":blue_dif"), (assign, ":max_dif", 0), (val_max, ":max_dif", ":red_dif"), (val_max, ":max_dif", ":green_dif"), (val_max, ":max_dif", ":blue_dif"), (ge, ":max_dif", 64), ]), # script_get_next_active_kingdom # Input: arg1 = faction_no # Output: reg0 = faction_no (does not choose player faction) ("get_next_active_kingdom", [ (store_script_param, ":faction_no", 1), (assign, ":end_cond", kingdoms_end), (try_for_range, ":unused", kingdoms_begin, ":end_cond"), (val_add, ":faction_no", 1), (try_begin), (ge, ":faction_no", kingdoms_end), (assign, ":faction_no", kingdoms_begin), (try_end), (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active), (neq, ":faction_no", "fac_player_supporters_faction"), (assign, ":end_cond", 0), (try_end), (assign, reg0, ":faction_no"), ]), # script_store_average_center_value_per_faction # Input: none # Output: none (sets $g_average_center_value_per_faction) ("store_average_center_value_per_faction", [ (store_sub, ":num_towns", towns_end, towns_begin), (store_sub, ":num_castles", castles_end, castles_begin), (assign, ":num_factions", 0), (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active), (val_add, ":num_factions", 1), (try_end), (val_max, ":num_factions", 1), (store_mul, "$g_average_center_value_per_faction", ":num_towns", 2), (val_add, "$g_average_center_value_per_faction", ":num_castles"), (val_mul, "$g_average_center_value_per_faction", 10), (val_div, "$g_average_center_value_per_faction", ":num_factions"), ]), # script_remove_cattles_if_herd_is_close_to_party # Input: arg1 = party_no, arg2 = maximum_number_of_cattles_required # Output: reg0 = number_of_cattles_removed ("remove_cattles_if_herd_is_close_to_party", [ (store_script_param, ":party_no", 1), (store_script_param, ":max_req", 2), (assign, ":cur_req", ":max_req"), (try_for_parties, ":cur_party"), (gt, ":cur_req", 0), (party_slot_eq, ":cur_party", slot_party_type, spt_cattle_herd), (store_distance_to_party_from_party, ":dist", ":cur_party", ":party_no"), (lt, ":dist", 3), #Do not use the quest herd (assign, ":subcontinue", 1), (try_begin), (check_quest_active, "qst_move_cattle_herd"), (quest_slot_eq, "qst_move_cattle_herd", slot_quest_target_party, ":cur_party"), (assign, ":subcontinue", 0), (try_end), (eq, ":subcontinue", 1), (party_count_companions_of_type, ":num_cattle", ":cur_party", "trp_cattle"), (try_begin), (le, ":num_cattle", ":cur_req"), (assign, ":num_added", ":num_cattle"), (remove_party, ":cur_party"), (else_try), (assign, ":num_added", ":cur_req"), (party_remove_members, ":cur_party", "trp_cattle", ":cur_req"), (try_end), (val_sub, ":cur_req", ":num_added"), (try_begin), (party_slot_eq, ":party_no", slot_party_type, spt_village), (party_get_slot, ":village_cattle_amount", ":party_no", slot_village_number_of_cattle), (val_add, ":village_cattle_amount", ":num_added"), (party_set_slot, ":party_no", slot_village_number_of_cattle, ":village_cattle_amount"), (try_end), (assign, reg3, ":num_added"), (str_store_party_name_link, s1, ":party_no"), (display_message, "@You brought {reg3} heads of cattle to {s1}."), (try_end), (store_sub, reg0, ":max_req", ":cur_req"), ]), # script_get_rumor_to_s61 # Input: rumor_id # Output: reg0 = 1 if rumor found, 0 otherwise; s61 will contain rumor string if found ("get_rumor_to_s61", [ (store_script_param, ":base_rumor_id", 1), # the script returns the same rumor for the same rumor id, so that one cannot hear all rumors by # speaking to a single person. (store_current_hours, ":cur_hours"), (store_div, ":cur_day", ":cur_hours", 24), (assign, ":rumor_found", 0), (assign, ":num_tries", 3), (try_for_range, ":try_no", 0, ":num_tries"), (store_mul, ":rumor_id", ":try_no", 6781), (val_add, ":rumor_id", ":base_rumor_id"), (store_mod, ":rumor_type", ":rumor_id", 7), (val_add, ":rumor_id", ":cur_hours"), (try_begin), (eq, ":rumor_type", 0), (try_begin), (store_sub, ":range", towns_end, towns_begin), (store_mod, ":random_center", ":rumor_id", ":range"), (val_add, ":random_center", towns_begin), (party_slot_ge, ":random_center", slot_town_has_tournament, 1), (neq, ":random_center", "$current_town"), (str_store_party_name, s62, ":random_center"), (str_store_string, s61, "@I heard that there will be a tournament in {s62} soon."), (assign, ":rumor_found", 1), (try_end), (else_try), (eq, ":rumor_type", 1), (try_begin), (store_sub, ":range", kingdom_heroes_end, kingdom_heroes_begin), (store_mod, ":random_hero", ":rumor_id", ":range"), (val_add, ":random_hero", kingdom_heroes_begin), (troop_get_slot, ":personality", ":random_hero", slot_lord_reputation_type), (gt, ":personality", 0), (store_add, ":rumor_string", ":personality", "str_gossip_about_character_default"), (str_store_troop_name, s6, ":random_hero"), (str_store_string, s61, ":rumor_string"), (assign, ":rumor_found", 1), (try_end), (else_try), (eq, ":rumor_type", 2), (try_begin), (store_sub, ":range", trade_goods_end, trade_goods_begin), (store_add, ":random_trade_good", ":rumor_id", ":cur_day"), (store_mod, ":random_trade_good", ":random_trade_good", ":range"), (store_add, ":random_trade_good_slot", ":random_trade_good", slot_town_trade_good_prices_begin), (val_add, ":random_trade_good", trade_goods_begin), (store_mul, ":min_price", average_price_factor, 3), (val_div, ":min_price", 4), (assign, ":min_price_center", -1), (try_for_range, ":sub_try_no", 0, 10), (store_sub, ":range", towns_end, towns_begin), (store_add, ":center_rumor_id", ":rumor_id", ":sub_try_no"), (store_mod, ":random_center", ":center_rumor_id", ":range"), (val_add, ":random_center", towns_begin), (neq, ":random_center", "$g_encountered_party"), (party_get_slot, ":cur_price", ":random_center", ":random_trade_good_slot"), (lt, ":cur_price", ":min_price"), (assign, ":min_price", ":cur_price"), (assign, ":min_price_center", ":random_center"), (try_end), (ge, ":min_price_center", 0), (str_store_item_name, s62, ":random_trade_good"), (str_store_party_name, s63, ":min_price_center"), (str_store_string, s61, "@I heard that one can buy {s62} very cheap at {s63}."), (assign, ":rumor_found", 1), (try_end), (else_try), (eq, ":rumor_type", 3), (try_begin), (store_sub, ":range", trade_goods_end, trade_goods_begin), (store_add, ":random_trade_good", ":rumor_id", ":cur_day"), (store_mod, ":random_trade_good", ":random_trade_good", ":range"), (store_add, ":random_trade_good_slot", ":random_trade_good", slot_town_trade_good_prices_begin), (val_add, ":random_trade_good", trade_goods_begin), (store_mul, ":max_price", average_price_factor, 5), (val_div, ":max_price", 4), (assign, ":max_price_center", -1), (try_for_range, ":sub_try_no", 0, 10), (store_sub, ":range", towns_end, towns_begin), (store_add, ":center_rumor_id", ":rumor_id", ":sub_try_no"), (store_mod, ":random_center", ":center_rumor_id", ":range"), (val_add, ":random_center", towns_begin), (neq, ":random_center", "$g_encountered_party"), (party_get_slot, ":cur_price", ":random_center", ":random_trade_good_slot"), (gt, ":cur_price", ":max_price"), (assign, ":max_price", ":cur_price"), (assign, ":max_price_center", ":random_center"), (try_end), (ge, ":max_price_center", 0), (str_store_item_name, s62, ":random_trade_good"), (str_store_party_name, s63, ":max_price_center"), (str_store_string, s61, "@I heard that they pay a very high price for {s62} at {s63}."), (assign, ":rumor_found", 1), (try_end), (try_end), (try_begin), (gt, ":rumor_found", 0), (assign, ":num_tries", 0), (try_end), (try_end), (assign, reg0, ":rumor_found"), ]), ("lord_comment_to_s43", [(store_script_param, ":lord", 1), (store_script_param, ":default_string", 2), (troop_get_slot,":reputation", ":lord", slot_lord_reputation_type), (val_add,":reputation", ":default_string"), (str_store_string,43,":reputation"), ]), #Troop Commentaries begin # script_add_log_entry # Input: arg1 = entry_type, arg2 = event_actor, arg3 = center_object, arg4 = troop_object, arg5 = faction_object # Output: none ("add_log_entry", [(store_script_param, ":entry_type", 1), (store_script_param, ":actor", 2), (store_script_param, ":center_object", 3), (store_script_param, ":troop_object", 4), (store_script_param, ":faction_object", 5), (assign, ":center_object_lord", -1), (assign, ":center_object_faction", -1), (assign, ":troop_object_faction", -1), (try_begin), (gt, ":center_object", 0), (party_get_slot, ":center_object_lord", ":center_object", slot_town_lord), (store_faction_of_party, ":center_object_faction", ":center_object"), (try_end), (try_begin), (ge, ":troop_object", 0), (store_troop_faction, ":troop_object_faction", ":troop_object"), (try_end), (val_add, "$num_log_entries", 1), (store_current_hours, ":entry_time"), (troop_set_slot, "trp_log_array_entry_type", "$num_log_entries", ":entry_type"), (troop_set_slot, "trp_log_array_entry_time", "$num_log_entries", ":entry_time"), (troop_set_slot, "trp_log_array_actor", "$num_log_entries", ":actor"), (troop_set_slot, "trp_log_array_center_object", "$num_log_entries", ":center_object"), (troop_set_slot, "trp_log_array_center_object_lord", "$num_log_entries", ":center_object_lord"), (troop_set_slot, "trp_log_array_center_object_faction", "$num_log_entries", ":center_object_faction"), (troop_set_slot, "trp_log_array_troop_object", "$num_log_entries", ":troop_object"), (troop_set_slot, "trp_log_array_troop_object_faction", "$num_log_entries", ":troop_object_faction"), (troop_set_slot, "trp_log_array_faction_object", "$num_log_entries", ":faction_object"), (try_begin), (eq, "$cheat_mode", 1), (assign, reg3, "$num_log_entries"), (assign, reg4, ":entry_type"), (display_message, "@Log entry {reg3}: type {reg4}"), (try_begin), (gt, ":center_object", 0), (str_store_party_name, s4, ":center_object"), (display_message, "@Center: {s4}"), (try_end), (try_begin), (gt, ":troop_object", 0), (str_store_troop_name, s4, ":troop_object"), (display_message, "@Troop: {s4}"), (try_end), (try_begin), (gt, ":center_object_lord", 0), (str_store_troop_name, s4, ":center_object_lord"), (display_message, "@Lord: {s4}"), (try_end), (try_end), (try_begin), (this_or_next|gt, "$g_ally_party", 0), (eq, ":entry_type", logent_player_participated_in_siege), (try_begin), (eq, "$cheat_mode", 1), (display_message, "@Ally party is present"), (try_end), (try_for_range, ":hero", kingdom_heroes_begin, kingdom_heroes_end), (party_count_companions_of_type, ":hero_present", "p_collective_friends", ":hero"), (gt, ":hero_present", 0), (troop_set_slot, ":hero", slot_troop_present_at_event, "$num_log_entries"), # (store_sub, ":skip_up_to_here", "$num_log_entries", 1), # (troop_set_slot, ":hero", slot_troop_last_comment_slot, ":skip_up_to_here"), (try_begin), (eq, "$cheat_mode", 1), (str_store_troop_name, 4, ":hero"), (display_message, "@{s4} is present at event"), (try_end), (try_end), (try_end), ]), # script_get_relevant_comment_for_log_entry # Input: arg1 = log_entry_no, # Output: reg0 = comment_id; reg1 = relevance # Notes: 50 is the default relevance. # A comment with relevance less than 30 will always be skipped. # A comment with relevance 75 or more will never be skipped. # A comment with relevance 50 has about 50% chance to be skipped. # If there is more than one comment that is not skipped, the system will randomize their relevance values, and then choose the highest one. # Also note that the relevance of events decreases as time passes. After three months, relevance reduces to 50%, after 6 months, 25%, etc... ("get_relevant_comment_for_log_entry", [(store_script_param, ":log_entry_no", 1), (troop_get_slot, ":entry_type", "trp_log_array_entry_type", ":log_entry_no"), (troop_get_slot, ":entry_time", "trp_log_array_entry_time", ":log_entry_no"), (troop_get_slot, ":actor", "trp_log_array_actor", ":log_entry_no"), ## (troop_get_slot, ":center_object", "trp_log_array_center_object", ":log_entry_no"), (troop_get_slot, ":center_object_lord", "trp_log_array_center_object_lord", ":log_entry_no"), (troop_get_slot, ":center_object_faction", "trp_log_array_center_object_faction", ":log_entry_no"), (troop_get_slot, ":troop_object", "trp_log_array_troop_object", ":log_entry_no"), (troop_get_slot, ":troop_object_faction", "trp_log_array_troop_object_faction", ":log_entry_no"), (troop_get_slot, ":faction_object", "trp_log_array_faction_object", ":log_entry_no"), (assign, ":relevance", 0), (assign, ":comment", -1), (assign, ":suggested_relation_change", 0), (troop_get_slot, ":reputation", "$g_talk_troop", slot_lord_reputation_type), (store_current_hours, ":current_time"), (store_sub, ":entry_hours_elapsed", ":current_time", ":entry_time"), #Post 0907 changes begin (assign, ":players_kingdom_relation", 0), ##the below is so that lords will not congratulate player on attacking neutrals (try_begin), (eq, "$cheat_mode", 1), (try_begin), (assign, reg5, ":log_entry_no"), (assign, reg6, ":entry_type"), (assign, reg8, ":entry_time"), (gt, "$players_kingdom", 0), (try_begin), (gt, ":troop_object_faction", 0), (store_relation, ":players_kingdom_relation", "$players_kingdom", ":troop_object_faction"), (assign, reg7, ":players_kingdom_relation"), (display_message, "@Event #{reg5}, type {reg6}, time {reg8}: player's kingdom relation to troop object = {reg7}"), (else_try), (gt, ":center_object_faction", 0), (store_relation, ":players_kingdom_relation", "$players_kingdom", ":center_object_faction"), (assign, reg7, ":players_kingdom_relation"), (display_message, "@Event #{reg5}, type {reg6}, time {reg8}: player's kingdom relation to center object faction = {reg7}"), (else_try), (gt, ":faction_object", 0), (store_relation, ":players_kingdom_relation", "$players_kingdom", ":faction_object"), (assign, reg7, ":players_kingdom_relation"), (display_message, "@Event #{reg5}, type {reg6}, time {reg8}: player's kingdom relation to faction object = {reg7}"), (else_try), (display_message, "@Event #{reg5}, type {reg6}, time {reg8}. No relevant kingdom relation"), (try_end), (else_try), (display_message, "@Event #{reg5}, type {reg6}, time {reg8}. Player unaffiliated"), (try_end), (try_end), (try_begin), (eq, ":entry_type", logent_game_start), (eq, "$g_talk_troop_met", 0), (is_between, "$g_talk_troop_faction_relation", -5, 5), (is_between, "$g_talk_troop_relation", -5, 5), (assign, ":relevance", 25), (troop_get_slot, ":plyr_renown", "trp_player", slot_troop_renown), #normal_banner_begin (troop_get_slot, ":banner", "trp_player", slot_troop_banner_scene_prop), #custom_banner_begin # (troop_get_slot, ":banner", "trp_player", slot_troop_custom_banner_flag_type), (store_random_in_range, ":renown_check", 100, 200), (try_begin), (eq, ":reputation", lrep_none), (gt, "$players_kingdom", 0), (assign, ":comment", "str_comment_intro_liege_affiliated"), (else_try), (gt, ":plyr_renown", ":renown_check"), (assign, ":comment", "str_comment_intro_famous_liege"), (val_add, ":comment", ":reputation"), (else_try), #normal_banner_begin (gt, ":banner", 0), #custom_banner_begin # (ge, ":banner", 0), (assign, ":comment", "str_comment_intro_noble_liege"), (val_add, ":comment", ":reputation"), (else_try), (assign, ":comment", "str_comment_intro_common_liege"), (val_add, ":comment", ":reputation"), (try_end), #Post 0907 changes end (else_try), (eq, ":entry_type", logent_village_raided), (eq, ":actor", "trp_player"), (try_begin), (eq, ":center_object_lord", "$g_talk_troop"), (assign, ":relevance", 200), (assign, ":suggested_relation_change", -1), (assign, ":comment", "str_comment_you_raided_my_village_default"), (try_begin), (lt, "$g_talk_troop_faction_relation", -5), (this_or_next|eq, ":reputation", lrep_goodnatured), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_you_raided_my_village_enemy_benevolent"), (else_try), (lt, "$g_talk_troop_faction_relation", -5), (this_or_next|eq, ":reputation", lrep_cunning), (eq, ":reputation", lrep_selfrighteous), (assign, ":comment", "str_comment_you_raided_my_village_enemy_coldblooded"), (else_try), (lt, "$g_talk_troop_faction_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_raided_my_village_enemy_spiteful"), (else_try), (lt, "$g_talk_troop_faction_relation", -5), (assign, ":comment", "str_comment_you_raided_my_village_enemy"), (else_try), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_raided_my_village_unfriendly_spiteful"), (else_try), (gt, "$g_talk_troop_relation", 5), (assign, ":comment", "str_comment_you_raided_my_village_friendly"), (try_end), (try_end), (else_try), (eq, ":entry_type", logent_village_extorted), (eq, ":actor", "trp_player"), (try_begin), (eq, ":center_object_lord", "$g_talk_troop"), (assign, ":relevance", 30), (assign, ":suggested_relation_change", -1), (assign, ":comment", "str_comment_you_robbed_my_village_default"), (try_begin), (lt, "$g_talk_troop_faction_relation", -5), (this_or_next|eq, ":reputation", lrep_cunning), (eq, ":reputation", lrep_selfrighteous), (assign, ":comment", "str_comment_you_robbed_my_village_enemy_coldblooded"), (else_try), (lt, "$g_talk_troop_faction_relation", -5), (assign, ":comment", "str_comment_you_robbed_my_village_enemy"), (else_try), (gt, "$g_talk_troop_relation", 5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_robbed_my_village_friendly_spiteful"), (else_try), (gt, "$g_talk_troop_relation", 5), (assign, ":comment", "str_comment_you_robbed_my_village_friendly"), (try_end), (try_end), (else_try), (eq, ":entry_type", logent_caravan_accosted), (eq, ":actor", "trp_player"), (eq, ":faction_object", "$g_talk_troop_faction"), (faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "$g_talk_troop"), (assign, ":relevance", 30), (assign, ":suggested_relation_change", -1), (assign, ":comment", "str_comment_you_accosted_my_caravan_default"), (try_begin), (lt, "$g_talk_troop_faction_relation", -5), (assign, ":comment", "str_comment_you_accosted_my_caravan_enemy"), (try_end), (else_try), (eq, ":entry_type", logent_helped_peasants), (eq, ":actor", "trp_player"), (try_begin), (eq, ":center_object_lord", "$g_talk_troop"), (assign, ":relevance", 40), (assign, ":suggested_relation_change", 0), (try_begin), (this_or_next|eq, ":reputation", lrep_goodnatured), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_you_helped_villagers_benevolent"), (assign, ":suggested_relation_change", 1), (else_try), (gt, "$g_talk_troop_relation", 5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_helped_villagers_friendly_cruel"), (assign, ":suggested_relation_change", -1), (else_try), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_helped_villagers_unfriendly_spiteful"), (assign, ":suggested_relation_change", -1), (else_try), (gt, "$g_talk_troop_relation", 5), (assign, ":comment", "str_comment_you_helped_villagers_friendly"), (else_try), (this_or_next|eq, ":reputation", lrep_selfrighteous), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_helped_villagers_cruel"), (assign, ":suggested_relation_change", -1), (else_try), (assign, ":comment", "str_comment_you_helped_villagers_default"), (try_end), (try_end), ###Combat events (else_try), (eq, ":entry_type", logent_castle_captured_by_player), (try_begin), (eq, ":center_object_lord", "$g_talk_troop"), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_captured_my_castle_enemy_spiteful"), (assign, ":relevance", 200), (else_try), (eq, ":center_object_lord", "$g_talk_troop"), (this_or_next|eq, ":reputation", lrep_martial), (eq, ":reputation", lrep_goodnatured), (assign, ":comment", "str_comment_you_captured_my_castle_enemy_chivalrous"), (assign, ":relevance", 200), (else_try), (eq, ":center_object_lord", "$g_talk_troop"), (assign, ":comment", "str_comment_you_captured_my_castle_enemy"), (assign, ":relevance", 200), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_captured_a_castle_allied_spiteful"), (assign, ":relevance", 75), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (gt, "$g_talk_troop_relation", 5), (assign, ":comment", "str_comment_you_captured_a_castle_allied_friendly"), (assign, ":relevance", 75), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_captured_a_castle_allied_unfriendly_spiteful"), (assign, ":relevance", 75), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (lt, "$g_talk_troop_relation", -5), (assign, ":comment", "str_comment_you_captured_a_castle_allied_unfriendly"), (assign, ":relevance", 75), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (assign, ":comment", "str_comment_you_captured_a_castle_allied"), (assign, ":relevance", 75), (try_end), #Post 0907 changes begin (else_try), (this_or_next|eq, ":entry_type", logent_lord_defeated_by_player), (eq, ":entry_type", logent_lord_helped_by_player), (troop_slot_eq, "$g_talk_troop", slot_troop_present_at_event, ":log_entry_no"), (try_begin), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_we_defeated_a_lord_unfriendly_spiteful"), (assign, ":relevance", 150), (else_try), (lt, "$g_talk_troop_relation", -5), (assign, ":comment", "str_comment_we_defeated_a_lord_unfriendly"), (assign, ":relevance", 150), (else_try), (this_or_next|eq, ":reputation", lrep_selfrighteous), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_we_defeated_a_lord_cruel"), (assign, ":relevance", 150), (else_try), (eq, ":reputation", lrep_quarrelsome), (assign, ":comment", "str_comment_we_defeated_a_lord_cruel"), (assign, ":relevance", 150), (else_try), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_we_defeated_a_lord_upstanding"), (assign, ":relevance", 150), (else_try), (assign, ":comment", "str_comment_we_defeated_a_lord_default"), (assign, ":relevance", 150), (try_end), (else_try), (this_or_next|eq, ":entry_type", logent_castle_captured_by_player), (eq, ":entry_type", logent_player_participated_in_siege), (troop_slot_eq, "$g_talk_troop", slot_troop_present_at_event, ":log_entry_no"), (try_begin), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_we_fought_in_siege_unfriendly_spiteful"), (assign, ":relevance", 150), (else_try), (lt, "$g_talk_troop_relation", -5), (assign, ":comment", "str_comment_we_fought_in_siege_unfriendly"), (assign, ":relevance", 150), (else_try), (this_or_next|eq, ":reputation", lrep_selfrighteous), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_we_fought_in_siege_cruel"), (assign, ":relevance", 150), (else_try), (eq, ":reputation", lrep_quarrelsome), (assign, ":comment", "str_comment_we_fought_in_siege_quarrelsome"), (assign, ":relevance", 150), (else_try), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_we_fought_in_siege_upstanding"), (assign, ":relevance", 150), (else_try), (assign, ":comment", "str_comment_we_fought_in_siege_default"), (assign, ":relevance", 150), (try_end), (else_try), (eq, ":entry_type", logent_player_participated_in_major_battle), (troop_slot_eq, "$g_talk_troop", slot_troop_present_at_event, ":log_entry_no"), (try_begin), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_we_fought_in_major_battle_unfriendly_spiteful"), (assign, ":relevance", 150), (else_try), (lt, "$g_talk_troop_relation", -5), (assign, ":comment", "str_comment_we_fought_in_major_battle_unfriendly"), (assign, ":relevance", 150), (else_try), (this_or_next|eq, ":reputation", lrep_selfrighteous), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_we_fought_in_major_battle_cruel"), (assign, ":relevance", 150), (else_try), (eq, ":reputation", lrep_quarrelsome), (assign, ":comment", "str_comment_we_fought_in_major_battle_cruel"), (assign, ":relevance", 150), (else_try), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_we_fought_in_major_battle_upstanding"), (assign, ":relevance", 150), (else_try), (assign, ":comment", "str_comment_we_fought_in_major_battle_default"), (assign, ":relevance", 150), (try_end), #Post 0907 changes end (else_try), (eq, ":entry_type", logent_lord_defeated_by_player), (try_begin), (eq, ":troop_object", "$g_talk_troop"), (this_or_next|eq, ":reputation", lrep_martial), (eq, ":reputation", lrep_goodnatured), (assign, ":comment", "str_comment_you_defeated_me_enemy_chivalrous"), (assign, ":relevance", 200), (else_try), (eq, ":troop_object", "$g_talk_troop"), (this_or_next|eq, ":reputation", lrep_debauched), (eq, ":reputation", lrep_quarrelsome), (assign, ":comment", "str_comment_you_defeated_me_enemy_spiteful"), (assign, ":relevance", 200), (else_try), (eq, ":troop_object", "$g_talk_troop"), (assign, ":comment", "str_comment_you_defeated_me_enemy"), (assign, ":relevance", 200), (else_try), (eq, ":troop_object_faction", "$g_talk_troop_faction"), (this_or_next|eq, ":reputation", lrep_upstanding), (eq, ":reputation", lrep_cunning), (assign, ":comment", "str_comment_you_defeated_my_friend_enemy_pragmatic"), (assign, ":relevance", 85), (else_try), (eq, ":troop_object_faction", "$g_talk_troop_faction"), (this_or_next|eq, ":reputation", lrep_martial), (eq, ":reputation", lrep_goodnatured), (assign, ":comment", "str_comment_you_defeated_my_friend_enemy_chivalrous"), (assign, ":relevance", 85), (else_try), (eq, ":troop_object_faction", "$g_talk_troop_faction"), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_defeated_my_friend_enemy_spiteful"), (assign, ":relevance", 85), (else_try), (eq, ":troop_object_faction", "$g_talk_troop_faction"), (assign, ":comment", "str_comment_you_defeated_my_friend_enemy"), (assign, ":relevance", 85), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (faction_slot_eq, "$players_kingdom", slot_faction_leader, "$g_talk_troop"), (assign, ":comment", "str_comment_you_defeated_a_lord_allied_liege"), (assign, ":relevance", 70), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_defeated_a_lord_allied_unfriendly_spiteful"), (assign, ":relevance", 65), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_defeated_a_lord_allied_spiteful"), (assign, ":relevance", 65), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_upstanding), (eq, ":reputation", lrep_martial), (assign, ":comment", "str_comment_you_defeated_a_lord_allied_unfriendly_chivalrous"), (assign, ":relevance", 65), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (assign, ":comment", "str_comment_you_defeated_a_lord_allied"), (assign, ":relevance", 65), (try_end), (else_try), (eq, ":entry_type", logent_lord_defeated_by_player), (try_begin), (eq, ":troop_object", "$g_talk_troop"), (this_or_next|eq, ":reputation", lrep_martial), (eq, ":reputation", lrep_goodnatured), (assign, ":comment", "str_comment_you_defeated_me_enemy_chivalrous"), (assign, ":relevance", 200), (else_try), (eq, ":troop_object", "$g_talk_troop"), (this_or_next|eq, ":reputation", lrep_debauched), (eq, ":reputation", lrep_quarrelsome), (assign, ":comment", "str_comment_you_defeated_me_enemy_spiteful"), (assign, ":relevance", 200), (else_try), (eq, ":troop_object", "$g_talk_troop"), (assign, ":comment", "str_comment_you_defeated_me_enemy"), (assign, ":relevance", 200), (else_try), (eq, ":troop_object_faction", "$g_talk_troop_faction"), (this_or_next|eq, ":reputation", lrep_upstanding), (eq, ":reputation", lrep_cunning), (assign, ":comment", "str_comment_you_defeated_my_friend_enemy_pragmatic"), (assign, ":relevance", 85), (else_try), (eq, ":troop_object_faction", "$g_talk_troop_faction"), (this_or_next|eq, ":reputation", lrep_martial), (eq, ":reputation", lrep_goodnatured), (assign, ":comment", "str_comment_you_defeated_my_friend_enemy_chivalrous"), (assign, ":relevance", 85), (else_try), (eq, ":troop_object_faction", "$g_talk_troop_faction"), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_defeated_my_friend_enemy_spiteful"), (assign, ":relevance", 85), (else_try), (eq, ":troop_object_faction", "$g_talk_troop_faction"), (assign, ":comment", "str_comment_you_defeated_my_friend_enemy"), (assign, ":relevance", 85), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (faction_slot_eq, "$players_kingdom", slot_faction_leader, "$g_talk_troop"), (assign, ":comment", "str_comment_you_defeated_a_lord_allied_liege"), (assign, ":relevance", 70), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_defeated_a_lord_allied_unfriendly_spiteful"), (assign, ":relevance", 65), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_defeated_a_lord_allied_spiteful"), (assign, ":relevance", 65), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_upstanding), (eq, ":reputation", lrep_martial), (assign, ":comment", "str_comment_you_defeated_a_lord_allied_unfriendly_chivalrous"), (assign, ":relevance", 65), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (assign, ":comment", "str_comment_you_defeated_a_lord_allied"), (assign, ":relevance", 65), (try_end), #Post 0907 changes begin (else_try), (eq, ":entry_type", logent_lord_helped_by_player), (neq, ":troop_object", "$g_talk_troop"), (eq, ":troop_object_faction", "$g_talk_troop_faction"), (try_begin), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_upstanding), (eq, ":reputation", lrep_martial), (assign, ":comment", "str_comment_you_helped_my_ally_unfriendly_chivalrous"), (assign, ":relevance", 65), (assign, ":suggested_relation_change", 2), (else_try), (lt, "$g_talk_troop_relation", -5), (assign, ":comment", "str_comment_you_helped_my_ally_unfriendly"), (assign, ":relevance", 0), (else_try), (eq, ":reputation", lrep_none), (assign, ":comment", "str_comment_you_helped_my_ally_liege"), (assign, ":relevance", 65), (assign, ":suggested_relation_change", 3), (else_try), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_helped_my_ally_unfriendly_spiteful"), (assign, ":relevance", 65), (else_try), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_helped_my_ally_spiteful"), (assign, ":relevance", 65), (else_try), (this_or_next|eq, ":reputation", lrep_martial), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_you_helped_my_ally_chivalrous"), (assign, ":relevance", 65), (assign, ":suggested_relation_change", 2), (else_try), (eq, ":troop_object", "$g_talk_troop"), (assign, ":comment", "str_comment_you_helped_my_ally_default"), (try_end), #Post 0907 changes begin (else_try), (eq, ":entry_type", logent_player_defeated_by_lord), (troop_slot_eq, "$g_talk_troop", slot_troop_present_at_event, ":log_entry_no"), (try_begin), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_we_were_defeated_unfriendly_spiteful"), (assign, ":relevance", 150), (else_try), (lt, "$g_talk_troop_relation", -5), (assign, ":comment", "str_comment_we_were_defeated_unfriendly"), (assign, ":relevance", 150), (else_try), (this_or_next|eq, ":reputation", lrep_selfrighteous), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_we_were_defeated_cruel"), (assign, ":relevance", 150), (else_try), (assign, ":comment", "str_comment_we_were_defeated_default"), (assign, ":relevance", 150), (try_end), (else_try), (eq, ":entry_type", logent_player_defeated_by_lord), (try_begin), (eq, ":troop_object", "$g_talk_troop"), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_I_defeated_you_enemy_spiteful"), (assign, ":relevance", 200), (else_try), (eq, ":troop_object", "$g_talk_troop"), (eq, ":reputation", lrep_martial), (assign, ":comment", "str_comment_I_defeated_you_enemy_chivalrous"), (assign, ":relevance", 200), (else_try), (eq, ":troop_object", "$g_talk_troop"), (this_or_next|eq, ":reputation", lrep_goodnatured), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_I_defeated_you_enemy_benevolent"), (assign, ":relevance", 200), (else_try), (eq, ":troop_object", "$g_talk_troop"), (this_or_next|eq, ":reputation", lrep_selfrighteous), (eq, ":reputation", lrep_cunning), (assign, ":comment", "str_comment_I_defeated_you_enemy_coldblooded"), (assign, ":relevance", 200), (else_try), (eq, ":troop_object", "$g_talk_troop"), (assign, ":comment", "str_comment_I_defeated_you_enemy"), (assign, ":relevance", 200), (else_try), (eq, ":troop_object", "$g_talk_troop"), (assign, ":comment", "str_comment_I_defeated_you_enemy"), (assign, ":relevance", 200), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (gt, "$g_talk_troop_relation", 5), (assign, ":comment", "str_comment_you_were_defeated_allied_friendly_spiteful"), (assign, ":relevance", 80), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (this_or_next|eq, ":reputation", lrep_selfrighteous), (eq, ":reputation", lrep_debauched), (lt, "$g_talk_troop_relation", -5), (assign, ":comment", "str_comment_you_were_defeated_allied_unfriendly_cruel"), (assign, ":relevance", 80), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (le, "$g_talk_troop_relation", 5), (assign, ":comment", "str_comment_you_were_defeated_allied_spiteful"), (assign, ":relevance", 80), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (eq, ":reputation", lrep_selfrighteous), (assign, ":comment", "str_comment_you_were_defeated_allied_pitiless"), (assign, ":relevance", 65), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (eq, ":reputation", lrep_upstanding), (lt, "$g_talk_troop_relation", -15), (assign, ":comment", "str_comment_you_were_defeated_allied_unfriendly_upstanding"), (assign, ":relevance", 65), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, "$g_talk_troop_relation", -10), (assign, ":comment", "str_comment_you_were_defeated_allied_unfriendly"), (assign, ":relevance", 65), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (assign, ":comment", "str_comment_you_were_defeated_allied"), (assign, ":relevance", 65), (try_end), #Post 0907 changes end #Post 0907 changes begin (else_try), (eq, ":entry_type", logent_player_retreated_from_lord), (troop_slot_eq, "$g_talk_troop", slot_troop_present_at_event, ":log_entry_no"), (try_begin), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_abandoned_us_unfriendly_spiteful"), (assign, ":relevance", 150), (assign, ":suggested_relation_change", -5), (else_try), (lt, "$g_talk_troop_relation", -5), (eq, ":reputation", lrep_selfrighteous), (assign, ":comment", "str_comment_you_abandoned_us_unfriendly_pitiless"), (assign, ":relevance", 150), (assign, ":suggested_relation_change", -5), (else_try), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_abandoned_us_spiteful"), (assign, ":suggested_relation_change", -5), (else_try), (eq, ":reputation", lrep_martial), (assign, ":comment", "str_comment_you_abandoned_us_chivalrous"), (assign, ":relevance", 150), (assign, ":suggested_relation_change", -2), (else_try), (this_or_next|eq, ":reputation", lrep_upstanding), (eq, ":reputation", lrep_goodnatured), (assign, ":comment", "str_comment_you_abandoned_us_benefitofdoubt"), (assign, ":relevance", 150), (assign, ":suggested_relation_change", -1), (else_try), (assign, ":comment", "str_comment_you_abandoned_us_default"), (assign, ":relevance", 150), (assign, ":suggested_relation_change", -2), (try_end), #Post 0907 changes end (else_try), (this_or_next|eq, ":entry_type", logent_player_retreated_from_lord), (eq, ":entry_type", logent_player_retreated_from_lord_cowardly), (eq, ":troop_object", "$g_talk_troop"), (try_begin), (eq, "$cheat_mode", 1), (assign, reg7, ":entry_hours_elapsed"), (display_message, "@Elapsed hours: {reg7}"), (try_end), (gt, ":entry_hours_elapsed", 2), (try_begin), (this_or_next|eq, ":reputation", lrep_selfrighteous), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_ran_from_me_enemy_spiteful"), (assign, ":relevance", 25), (else_try), (eq, ":reputation", lrep_martial), (assign, ":comment", "str_comment_you_ran_from_me_enemy_chivalrous"), (assign, ":relevance", 25), (else_try), (this_or_next|eq, ":reputation", lrep_goodnatured), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_you_ran_from_me_enemy_benevolent"), (assign, ":relevance", 25), (else_try), (eq, ":reputation", lrep_cunning), (assign, ":comment", "str_comment_you_ran_from_me_enemy_coldblooded"), (assign, ":relevance", 25), (else_try), (assign, ":comment", "str_comment_you_ran_from_me_enemy"), (assign, ":relevance", 25), (try_end), (else_try), (eq, ":entry_type", logent_player_retreated_from_lord_cowardly), (try_begin), (eq, "$players_kingdom", "$g_talk_troop_faction"), (neq, ":troop_object", "$g_talk_troop"), (lt, "$g_talk_troop_relation", 5), (eq, ":reputation", lrep_martial), (assign, ":comment", "str_comment_you_ran_from_foe_allied_chivalrous"), (assign, ":relevance", 80), (assign, ":suggested_relation_change", -3), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (neq, ":troop_object", "$g_talk_troop"), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_you_ran_from_foe_allied_upstanding"), (assign, ":relevance", 80), (assign, ":suggested_relation_change", -1), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (neq, ":troop_object", "$g_talk_troop"), (lt, "$g_talk_troop_relation", 5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_ran_from_foe_allied_spiteful"), (assign, ":relevance", 80), (try_end), (else_try), (eq, ":entry_type", logent_lord_defeated_but_let_go_by_player), (try_begin), (eq, ":troop_object", "$g_talk_troop"), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_let_me_go_spiteful"), (assign, ":relevance", 300), (assign, ":suggested_relation_change", -15), (else_try), (eq, ":troop_object", "$g_talk_troop"), (ge, "$g_talk_troop_faction_relation", 0), (assign, ":comment", "str_comment_you_let_me_go_default"), (assign, ":relevance", 300), (assign, ":suggested_relation_change", 2), (else_try), (eq, ":troop_object", "$g_talk_troop"), (lt, "$g_talk_troop_faction_relation", 0), (this_or_next|eq, ":reputation", lrep_martial), (eq, ":reputation", lrep_upstanding), (assign, ":suggested_relation_change", 5), (assign, ":relevance", 300), (assign, ":comment", "str_comment_you_let_me_go_enemy_chivalrous"), (else_try), (eq, ":troop_object", "$g_talk_troop"), (lt, "$g_talk_troop_faction_relation", 0), (this_or_next|eq, ":reputation", lrep_selfrighteous), (eq, ":reputation", lrep_cunning), (assign, ":relevance", 300), (assign, ":comment", "str_comment_you_let_me_go_enemy_coldblooded"), (else_try), (eq, ":troop_object", "$g_talk_troop"), (lt, "$g_talk_troop_faction_relation", 0), (assign, ":relevance", 300), (assign, ":comment", "str_comment_you_let_me_go_enemy"), (assign, ":suggested_relation_change", 1), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (neq, ":troop_object", "$g_talk_troop"), (this_or_next|eq, ":reputation", lrep_martial), (eq, ":reputation", lrep_goodnatured), (assign, ":comment", "str_comment_you_let_go_a_lord_allied_chivalrous"), (assign, ":relevance", 80), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (neq, ":troop_object", "$g_talk_troop"), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_you_let_go_a_lord_allied_upstanding"), (assign, ":relevance", 80), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (neq, ":troop_object", "$g_talk_troop"), (this_or_next|eq, ":reputation", lrep_cunning), (eq, ":reputation", lrep_selfrighteous), (assign, ":comment", "str_comment_you_let_go_a_lord_allied_coldblooded"), (assign, ":relevance", 80), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (neq, ":troop_object", "$g_talk_troop"), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_let_go_a_lord_allied_unfriendly_spiteful"), (assign, ":relevance", 80), (else_try), (eq, "$players_kingdom", "$g_talk_troop_faction"), (lt, ":players_kingdom_relation", 0), (neq, ":troop_object", "$g_talk_troop"), (assign, ":comment", "str_comment_you_let_go_a_lord_allied"), (assign, ":relevance", 80), (try_end), #Internal faction relations (else_try), (eq, ":entry_type", logent_pledged_allegiance), (eq, ":actor", "trp_player"), (try_begin), (eq, ":faction_object", "$g_talk_troop_faction"), (neq, ":troop_object", "$g_talk_troop"), (assign, ":relevance", 200), (try_begin), (lt, "$g_talk_troop_relation", -5), (eq, ":reputation", lrep_martial), (assign, ":comment", "str_comment_pledged_allegiance_allied_martial_unfriendly"), (else_try), (eq, ":reputation", lrep_martial), (assign, ":comment", "str_comment_pledged_allegiance_allied_martial"), (else_try), (lt, "$g_talk_troop_relation", -5), (eq, ":reputation", lrep_quarrelsome), (assign, ":comment", "str_comment_pledged_allegiance_allied_quarrelsome_unfriendly"), (else_try), (eq, ":reputation", lrep_quarrelsome), (assign, ":comment", "str_comment_pledged_allegiance_allied_quarrelsome"), (else_try), (lt, "$g_talk_troop_relation", -5), (eq, ":reputation", lrep_selfrighteous), (assign, ":comment", "str_comment_pledged_allegiance_allied_selfrighteous_unfriendly"), (else_try), (eq, ":reputation", lrep_selfrighteous), (assign, ":comment", "str_comment_pledged_allegiance_allied_selfrighteous"), (else_try), (lt, "$g_talk_troop_relation", -5), (eq, ":reputation", lrep_cunning), (assign, ":comment", "str_comment_pledged_allegiance_allied_cunning_unfriendly"), (else_try), (eq, ":reputation", lrep_cunning), (assign, ":comment", "str_comment_pledged_allegiance_allied_cunning"), (else_try), (lt, "$g_talk_troop_relation", -5), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_pledged_allegiance_allied_debauched_unfriendly"), (else_try), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_pledged_allegiance_allied_debauched"), (else_try), (lt, "$g_talk_troop_relation", -5), (eq, ":reputation", lrep_goodnatured), (assign, ":comment", "str_comment_pledged_allegiance_allied_goodnatured_unfriendly"), (else_try), (eq, ":reputation", lrep_goodnatured), (assign, ":comment", "str_comment_pledged_allegiance_allied_goodnatured"), (else_try), (lt, "$g_talk_troop_relation", -5), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_pledged_allegiance_allied_upstanding_unfriendly"), (else_try), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_pledged_allegiance_allied_upstanding"), (try_end), (try_end), (else_try), (eq, ":entry_type", logent_fief_granted_village), (eq, ":actor", "trp_player"), (try_begin), (eq, ":faction_object", "$g_talk_troop_faction"), (neq, ":troop_object", "$g_talk_troop"), (eq, ":faction_object", "$players_kingdom"), (assign, ":relevance", 110), (try_begin), (gt, "$g_talk_troop_relation", 5), (this_or_next|eq, ":reputation", lrep_selfrighteous), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied_friendly_cruel"), (else_try), (gt, "$g_talk_troop_relation", 5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_cunning), (assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied_friendly_cynical"), (else_try), (gt, "$g_talk_troop_relation", 5), (assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied_friendly"), (else_try), (is_between, "$g_talk_troop_relation", -5, 5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied_spiteful"), (assign, ":suggested_relation_change", -2), (else_try), (lt, "$g_talk_troop_relation", -5), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied_unfriendly_upstanding"), (else_try), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied_unfriendly_spiteful"), (else_try), (assign, ":comment", "str_comment_our_king_granted_you_a_fief_allied"), (try_end), (try_end), (else_try), (eq, ":entry_type", logent_renounced_allegiance), (eq, ":actor", "trp_player"), (try_begin), (eq, ":faction_object", "$g_talk_troop_faction"), (neq, ":troop_object", "$g_talk_troop"), (try_begin), (ge, "$g_talk_troop_faction_relation", 0), (neq, "$g_talk_troop_faction", "$players_kingdom"), (assign, ":relevance", 180), (try_begin), (gt, "$g_talk_troop_relation", 5), (assign, ":comment", "str_comment_you_renounced_your_alliegance_friendly"), (else_try), (ge, "$g_talk_troop_relation", 0), (eq, ":reputation", lrep_goodnatured), (assign, ":comment", "str_comment_you_renounced_your_alliegance_friendly"), (try_end), (else_try), (lt, "$g_talk_troop_faction_relation", 0), (assign, ":relevance", 300), (try_begin), (ge, "$g_talk_troop_relation", 0), (this_or_next|eq, ":reputation", lrep_selfrighteous), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_renounced_your_alliegance_unfriendly_moralizing"), (else_try), (gt, "$g_talk_troop_relation", 5), (this_or_next|eq, ":reputation", lrep_goodnatured), (eq, ":reputation", lrep_upstanding), (assign, ":comment", "str_comment_you_renounced_your_alliegance_enemy_friendly"), (else_try), (gt, "$g_talk_troop_relation", 5), (assign, ":comment", "str_comment_you_renounced_your_alliegance_enemy"), (else_try), (is_between, "$g_talk_troop_relation", -5, 5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_renounced_your_alliegance_unfriendly_spiteful"), (assign, ":suggested_relation_change", -2), (else_try), (lt, "$g_talk_troop_relation", -5), (this_or_next|eq, ":reputation", lrep_quarrelsome), (this_or_next|eq, ":reputation", lrep_selfrighteous), (eq, ":reputation", lrep_debauched), (assign, ":comment", "str_comment_you_renounced_your_alliegance_unfriendly_spiteful"), (else_try), (assign, ":comment", "str_comment_you_renounced_your_alliegance_default"), (try_end), (try_end), (try_end), (try_end), (assign, reg0, ":comment"), (assign, reg1, ":relevance"), (assign, reg2, ":suggested_relation_change"), ]), # script_get_relevant_comment_to_s42 # Input: none # Output: reg0 = 1 if comment found, 0 otherwise; s61 will contain comment string if found ("get_relevant_comment_to_s42", [ (troop_get_slot, ":reputation", "$g_talk_troop", slot_lord_reputation_type), (try_begin), (eq, "$cheat_mode", 1), (store_add, ":rep_string", ":reputation", "str_personality_archetypes"), (str_store_string, s15, ":rep_string"), (display_message, "@Reputation type: {s15}"), (try_end), (assign, ":highest_score_so_far", 50), (assign, ":best_comment_so_far", -1), (assign, ":comment_found", 0), (assign, ":best_log_entry", -1), (assign, ":comment_relation_change", 0), (store_current_hours, ":current_time"), #prevents multiple comments in conversations in same hour # (troop_get_slot, ":talk_troop_last_comment_time", "$g_talk_troop", slot_troop_last_comment_time), #"$num_log_entries should also be set to one, not zero. This is included in the initialize npcs script, although could be moved to game_start (troop_get_slot, ":talk_troop_last_comment_slot", "$g_talk_troop", slot_troop_last_comment_slot), (troop_set_slot, "$g_talk_troop", slot_troop_last_comment_slot, "$num_log_entries"), (store_add, ":log_entries_plus_one", "$num_log_entries", 1), (try_for_range, ":log_entry_no", 1, ":log_entries_plus_one"), # It should be log entries plus one, so that the try_ sequence does not stop short of the last log entry # $Num_log_entries is now the number of the last log entry, which begins at "1" rather than "0" # This is so that (le, ":log_entry_no", ":talk_troop_last_comment_slot") works properly (troop_get_slot, ":entry_time", "trp_log_array_entry_time", ":log_entry_no"), # (val_max, ":entry_time", 1), #This is needed for pre-game events to be commented upon, if hours are used rather than the order of events (store_sub, ":entry_hours_elapsed", ":current_time", ":entry_time"), (try_begin), (le, ":log_entry_no", ":talk_troop_last_comment_slot"), # (le, ":entry_time", ":talk_troop_last_comment_time"), (try_begin), (eq, ":log_entry_no", ":talk_troop_last_comment_slot"), (eq, "$cheat_mode", 1), (assign, reg5, ":log_entry_no"), (display_message, "@Entries up to #{reg5} skipped"), (try_end), # I suggest using the log entry number as opposed to time so that events in the same hour can be commented upon # This feels more natural, for example, if there are other lords in the court when the player pledges allegiance (else_try), # (le, ":entry_hours_elapsed", 3), #don't comment on really fresh events # (else_try), (call_script, "script_get_relevant_comment_for_log_entry", ":log_entry_no"), (gt, reg1, 10), (assign, ":score", reg1), (assign, ":comment", reg0), (store_random_in_range, ":rand", 70, 140), (val_mul, ":score", ":rand"), (store_add, ":entry_time_score", ":entry_hours_elapsed", 500), #approx. one month (val_mul, ":score", 1000), (val_div, ":score", ":entry_time_score"), ###Relevance decreases over time - halved after one month, one-third after two, etc (try_begin), (gt, ":score", ":highest_score_so_far"), (assign, ":highest_score_so_far", ":score"), (assign, ":best_comment_so_far", ":comment"), (assign, ":best_log_entry", ":log_entry_no"), (assign, ":comment_relation_change", reg2), (try_end), (try_end), (try_end), (try_begin), (gt, ":best_comment_so_far", 0), (assign, ":comment_found", 1), #comment found print it to s61 now. (troop_get_slot, ":actor", "trp_log_array_actor", ":best_log_entry"), (troop_get_slot, ":center_object", "trp_log_array_center_object", ":best_log_entry"), (troop_get_slot, ":center_object_lord", "trp_log_array_center_object_lord", ":best_log_entry"), (troop_get_slot, ":center_object_faction", "trp_log_array_center_object_faction", ":best_log_entry"), (troop_get_slot, ":troop_object", "trp_log_array_troop_object", ":best_log_entry"), (troop_get_slot, ":troop_object_faction", "trp_log_array_troop_object_faction", ":best_log_entry"), (troop_get_slot, ":faction_object", "trp_log_array_faction_object", ":best_log_entry"), (try_begin), (ge, ":actor", 0), (str_store_troop_name, s50, ":actor"), (try_end), (try_begin), (ge, ":center_object", 0), (str_store_party_name, s51, ":center_object"), (try_end), (try_begin), (ge, ":center_object_lord", 0), (str_store_troop_name, s52, ":center_object_lord"), (try_end), (try_begin), (ge, ":center_object_faction", 0), (str_store_faction_name, s53, ":center_object_faction"), (try_end), (try_begin), (ge, ":troop_object", 0), (str_store_troop_name, s54, ":troop_object"), (try_end), (try_begin), (ge, ":troop_object_faction", 0), (str_store_faction_name, s55, ":troop_object_faction"), (try_end), (try_begin), (ge, ":faction_object", 0), (str_store_faction_name, s56, ":faction_object"), (try_end), (str_store_string, s42, ":best_comment_so_far"), (try_end), (assign, reg0, ":comment_found"), (assign, "$log_comment_relation_change", ":comment_relation_change"), ]), #Troop Commentaries end #Rebellion changes begin ("find_rival_from_faction", [ (store_script_param, ":source_lord", 1), (store_script_param, ":target_faction", 2), (assign, ":rival", 0), (troop_get_slot, ":source_reputation", ":source_lord", slot_lord_reputation_type), (try_for_range, ":target_lord", kingdom_heroes_begin, kingdom_heroes_end), (store_troop_faction, ":test_faction", ":target_lord"), (eq, ":test_faction", ":target_faction"), (troop_get_slot, ":target_reputation", ":target_lord", slot_lord_reputation_type), (try_begin), (eq, ":source_reputation", lrep_martial), (eq, ":target_reputation", lrep_martial), (assign, ":rival", ":target_lord"), (else_try), (eq, ":source_reputation", lrep_debauched), (eq, ":target_reputation", lrep_upstanding), (assign, ":rival", ":target_lord"), (else_try), (eq, ":source_reputation", lrep_selfrighteous), (eq, ":target_reputation", lrep_goodnatured), (assign, ":rival", ":target_lord"), (else_try), (eq, ":source_reputation", lrep_cunning), (eq, ":target_reputation", lrep_quarrelsome), (assign, ":rival", ":target_lord"), (else_try), (eq, ":source_reputation", lrep_quarrelsome), (eq, ":target_reputation", lrep_cunning), (assign, ":rival", ":target_lord"), (else_try), (eq, ":source_reputation", lrep_goodnatured), (eq, ":target_reputation", lrep_selfrighteous), (assign, ":rival", ":target_lord"), (else_try), (eq, ":source_reputation", lrep_upstanding), (eq, ":target_reputation", lrep_debauched), (assign, ":rival", ":target_lord"), (try_end), (try_end), (assign, reg0, ":rival"), ]), ("rebellion_arguments", [ (store_script_param, ":lord", 1), (store_script_param, ":argument", 2), (assign, ":argument_value", 0), (troop_get_slot, ":reputation", ":lord", slot_lord_reputation_type), (try_begin), (eq, ":reputation", lrep_martial), (try_begin), (eq, ":argument", argument_claim), (assign, ":argument_value", 30), (else_try), (eq, ":argument", argument_ruler), (assign, ":argument_value", 10), (else_try), (eq, ":argument", argument_benefit), (assign, ":argument_value", -20), (else_try), (eq, ":argument", argument_victory), (assign, ":argument_value", -30), (try_end), (else_try), (eq, ":reputation", lrep_quarrelsome), (try_begin), (eq, ":argument", argument_claim), (assign, ":argument_value", -20), (else_try), (eq, ":argument", argument_ruler), (assign, ":argument_value", -30), (else_try), (eq, ":argument", argument_benefit), (assign, ":argument_value", 30), (else_try), (eq, ":argument", argument_victory), (assign, ":argument_value", 10), (try_end), (else_try), (eq, ":reputation", lrep_selfrighteous), (try_begin), (eq, ":argument", argument_claim), (assign, ":argument_value", -20), (else_try), (eq, ":argument", argument_ruler), (assign, ":argument_value", -30), (else_try), (eq, ":argument", argument_benefit), (assign, ":argument_value", 20), (else_try), (eq, ":argument", argument_victory), (assign, ":argument_value", 20), (try_end), (else_try), (eq, ":reputation", lrep_cunning), (try_begin), (eq, ":argument", argument_claim), (assign, ":argument_value", -30), (else_try), (eq, ":argument", argument_ruler), (assign, ":argument_value", 20), (else_try), (eq, ":argument", argument_benefit), (assign, ":argument_value", -20), (else_try), (eq, ":argument", argument_victory), (assign, ":argument_value", 20), (try_end), (else_try), (eq, ":reputation", lrep_debauched), (try_begin), (eq, ":argument", argument_claim), (assign, ":argument_value", -20), (else_try), (eq, ":argument", argument_ruler), (assign, ":argument_value", -20), (else_try), (eq, ":argument", argument_benefit), (assign, ":argument_value", 20), (else_try), (eq, ":argument", argument_victory), (assign, ":argument_value", 10), (try_end), (else_try), (eq, ":reputation", lrep_goodnatured), (try_begin), (eq, ":argument", argument_claim), (assign, ":argument_value", 10), (else_try), (eq, ":argument", argument_ruler), (assign, ":argument_value", 20), (else_try), (eq, ":argument", argument_benefit), (assign, ":argument_value", -15), (else_try), (eq, ":argument", argument_victory), (assign, ":argument_value", -25), (try_end), (else_try), (eq, ":reputation", lrep_upstanding), (try_begin), (eq, ":argument", argument_claim), (assign, ":argument_value", 10), (else_try), (eq, ":argument", argument_ruler), (assign, ":argument_value", 0), (else_try), (eq, ":argument", argument_benefit), (assign, ":argument_value", -40), (else_try), (eq, ":argument", argument_victory), (assign, ":argument_value", 10), (try_end), (try_end), (assign, reg0, ":argument_value"), ]), #Rebellion changes end # script_get_culture_with_party_faction_for_music # Input: arg1 = party_no # Output: reg0 = culture ("get_culture_with_party_faction_for_music", [ (store_script_param, ":party_no", 1), (store_faction_of_party, ":faction_no", ":party_no"), (try_begin), (this_or_next|eq, ":faction_no", "fac_player_faction"), (eq, ":faction_no", "fac_player_supporters_faction"), (assign, ":faction_no", "$players_kingdom"), (try_end), (try_begin), (is_between, ":party_no", centers_begin, centers_end), (this_or_next|eq, ":faction_no", "fac_player_supporters_faction"), (neg|is_between, ":faction_no", kingdoms_begin, kingdoms_end), (party_get_slot, ":faction_no", ":party_no", slot_center_original_faction), (try_end), (try_begin), (eq, ":faction_no", "fac_kingdom_1"), (assign, ":result", mtf_culture_1), (else_try), (eq, ":faction_no", "fac_kingdom_2"), (assign, ":result", mtf_culture_2), (else_try), (eq, ":faction_no", "fac_kingdom_3"), (assign, ":result", mtf_culture_3), (else_try), (eq, ":faction_no", "fac_kingdom_4"), (assign, ":result", mtf_culture_4), (else_try), (eq, ":faction_no", "fac_kingdom_5"), (assign, ":result", mtf_culture_5), (else_try), (this_or_next|eq, ":faction_no", "fac_outlaws"), (this_or_next|eq, ":faction_no", "fac_peasant_rebels"), (this_or_next|eq, ":faction_no", "fac_deserters"), (this_or_next|eq, ":faction_no", "fac_mountain_bandits"), (eq, ":faction_no", "fac_forest_bandits"), (assign, ":result", mtf_culture_6), (else_try), (assign, ":result", 0), #no culture, including player with no bindings to another kingdom (try_end), (assign, reg0, ":result"), ]), # script_music_set_situation_with_culture # Input: arg1 = music_situation # Output: none ("music_set_situation_with_culture", [ (store_script_param, ":situation", 1), (assign, ":culture", 0), #no culture (try_begin), (this_or_next|eq, ":situation", mtf_sit_town), (this_or_next|eq, ":situation", mtf_sit_day), (this_or_next|eq, ":situation", mtf_sit_night), (this_or_next|eq, ":situation", mtf_sit_town_infiltrate), (eq, ":situation", mtf_sit_encounter_hostile), (call_script, "script_get_culture_with_party_faction_for_music", "$g_encountered_party"), (val_or, ":culture", reg0), (else_try), (this_or_next|eq, ":situation", mtf_sit_ambushed), (eq, ":situation", mtf_sit_fight), (call_script, "script_get_culture_with_party_faction_for_music", "$g_encountered_party"), (val_or, ":culture", reg0), (call_script, "script_get_culture_with_party_faction_for_music", "p_main_party"), (val_or, ":culture", reg0), (call_script, "script_get_closest_center", "p_main_party"), (call_script, "script_get_culture_with_party_faction_for_music", reg0), (val_or, ":culture", reg0), (else_try), (eq, ":situation", mtf_sit_travel), (call_script, "script_get_culture_with_party_faction_for_music", "p_main_party"), (val_or, ":culture", reg0), (call_script, "script_get_closest_center", "p_main_party"), (call_script, "script_get_culture_with_party_faction_for_music", reg0), (val_or, ":culture", reg0), (else_try), (eq, ":situation", mtf_sit_victorious), (call_script, "script_get_culture_with_party_faction_for_music", "p_main_party"), (val_or, ":culture", reg0), (else_try), (eq, ":situation", mtf_sit_killed), (call_script, "script_get_culture_with_party_faction_for_music", "$g_encountered_party"), (val_or, ":culture", reg0), (try_end), (try_begin), (this_or_next|eq, ":situation", mtf_sit_town), (eq, ":situation", mtf_sit_day), (try_begin), (is_currently_night), (assign, ":situation", mtf_sit_night), (try_end), (try_end), (music_set_situation, ":situation"), (music_set_culture, ":culture"), ]), # script_combat_music_set_situation_with_culture # Input: none # Output: none ("combat_music_set_situation_with_culture", [ (assign, ":situation", mtf_sit_fight), (assign, ":num_allies", 0), (assign, ":num_enemies", 0), (try_for_agents, ":agent_no"), (agent_is_alive, ":agent_no"), (agent_is_human, ":agent_no"), (agent_get_troop_id, ":agent_troop_id", ":agent_no"), (store_character_level, ":troop_level", ":agent_troop_id"), (val_add, ":troop_level", 10), (val_mul, ":troop_level", ":troop_level"), (try_begin), (agent_is_ally, ":agent_no"), (val_add, ":num_allies", ":troop_level"), (else_try), (val_add, ":num_enemies", ":troop_level"), (try_end), (try_end), (val_mul, ":num_allies", 4), #play ambushed music if we are 2 times outnumbered. (val_div, ":num_allies", 3), (try_begin), (lt, ":num_allies", ":num_enemies"), (assign, ":situation", mtf_sit_ambushed), (try_end), (call_script, "script_music_set_situation_with_culture", ":situation"), ]), # script_play_victorious_sound # Input: none # Output: none ("play_victorious_sound", [ (call_script, "script_music_set_situation_with_culture", mtf_sit_victorious), # (play_cue_track, "track_victorious_neutral_1"), # (play_track, "track_victorious_neutral_1", 1), ]), # script_set_items_for_tournament # Input: arg1 = horse_chance, arg2 = lance_chance (with horse only), arg3 = sword_chance, arg4 = axe_chance, arg5 = bow_chance (without horse only), arg6 = javelin_chance (with horse only), arg7 = mounted_bow_chance (with horse only), arg8 = crossbow_sword_chance, arg9 = armor_item_begin, arg10 = helm_item_begin # Output: none (sets mt_arena_melee_fight items) ("set_items_for_tournament", [ (store_script_param, ":horse_chance", 1), (store_script_param, ":lance_chance", 2), (store_script_param, ":sword_chance", 3), (store_script_param, ":axe_chance", 4), (store_script_param, ":bow_chance", 5), (store_script_param, ":javelin_chance", 6), (store_script_param, ":mounted_bow_chance", 7), (store_script_param, ":crossbow_sword_chance", 8), (store_script_param, ":armor_item_begin", 9), (store_script_param, ":helm_item_begin", 10), (store_add, ":total_chance", ":sword_chance", ":axe_chance"), (val_add, ":total_chance", ":crossbow_sword_chance"), (try_for_range, ":i_ep", 0, 32), (mission_tpl_entry_clear_override_items, "mt_arena_melee_fight", ":i_ep"), (assign, ":has_horse", 0), (store_div, ":cur_team", ":i_ep", 8), (try_begin), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", ":horse_chance"), (assign, ":has_horse", 1), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_horse"), (try_end), (try_begin), (eq, ":has_horse", 1), (store_add, ":cur_total_chance", ":total_chance", ":lance_chance"), (val_add, ":cur_total_chance", ":javelin_chance"), (val_add, ":cur_total_chance", ":mounted_bow_chance"), (else_try), (store_add, ":cur_total_chance", ":total_chance", ":bow_chance"), (try_end), (store_random_in_range, ":random_no", 0, ":cur_total_chance"), (store_add, ":cur_shield_item", "itm_arena_shield_red", ":cur_team"), (try_begin), (val_sub, ":random_no", ":sword_chance"), (lt, ":random_no", 0), (try_begin), (store_random_in_range, ":sub_random_no", 0, 100), (lt, ":sub_random_no", 50), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_sword"), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_shield_item"), # (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_shield"), (else_try), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_heavy_practice_sword"), (try_end), (else_try), (val_sub, ":random_no", ":axe_chance"), (lt, ":random_no", 0), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_axe"), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_shield_item"), # (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_shield"), (else_try), (val_sub, ":random_no", ":crossbow_sword_chance"), (lt, ":random_no", 0), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_sword"), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_crossbow"), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_bolts"), (else_try), (eq, ":has_horse", 0), (val_sub, ":random_no", ":bow_chance"), (lt, ":random_no", 0), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_bow"), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_arrows"), (else_try), (eq, ":has_horse", 1), (val_sub, ":random_no", ":lance_chance"), (lt, ":random_no", 0), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_lance"), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_shield_item"), # (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_shield"), (else_try), (eq, ":has_horse", 1), (val_sub, ":random_no", ":javelin_chance"), (lt, ":random_no", 0), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_javelin"), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_shield_item"), # (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_shield"), (else_try), (eq, ":has_horse", 1), (val_sub, ":random_no", ":mounted_bow_chance"), (lt, ":random_no", 0), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_bow"), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", "itm_practice_arrows"), (try_end), (try_begin), (ge, ":armor_item_begin", 0), (store_add, ":cur_armor_item", ":armor_item_begin", ":cur_team"), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_armor_item"), (try_end), (try_begin), (ge, ":helm_item_begin", 0), (store_add, ":cur_helm_item", ":helm_item_begin", ":cur_team"), (mission_tpl_entry_add_override_item, "mt_arena_melee_fight", ":i_ep", ":cur_helm_item"), (try_end), (try_end), ]), # script_custom_battle_end # Input: none # Output: none ("custom_battle_end", [ (assign, "$g_custom_battle_team1_death_count", 0), (assign, "$g_custom_battle_team2_death_count", 0), (try_for_agents, ":cur_agent"), (agent_is_human, ":cur_agent"), (neg|agent_is_alive, ":cur_agent"), (agent_get_team, ":cur_team", ":cur_agent"), (try_begin), (eq, ":cur_team", 0), (val_add, "$g_custom_battle_team1_death_count", 1), (else_try), (val_add, "$g_custom_battle_team2_death_count", 1), (try_end), (try_end), ]), # script_remove_troop_from_prison # Input: troop_no # Output: none ("remove_troop_from_prison", [(store_script_param, ":troop_no", 1), (troop_set_slot, ":troop_no", slot_troop_prisoner_of_party, -1), (try_begin), (check_quest_active, "qst_rescue_lord_by_replace"), (quest_slot_eq, "qst_rescue_lord_by_replace", slot_quest_target_troop, ":troop_no"), (call_script, "script_cancel_quest", "qst_rescue_lord_by_replace"), (try_end), (try_begin), (check_quest_active, "qst_deliver_message_to_prisoner_lord"), (quest_slot_eq, "qst_deliver_message_to_prisoner_lord", slot_quest_target_troop, ":troop_no"), (call_script, "script_cancel_quest", "qst_deliver_message_to_prisoner_lord"), (try_end), ]), ############################## # Form Ranks Scripts Section Begin # # script_formation_agent_init # Called when agent spawned. Initialize slot_agent_formations_states. # To be developed # Input: arg1: agent_no # Output: none ("formation_agent_init", [(store_script_param, ":agent_no", 1), #TO DO: add code for multi arrays, update $formation_max_array_no # set array leader -- added elsewhere (agent_get_party_id, ":party_no", ":agent_no"), (agent_get_team, ":team_no", ":agent_no"), (agent_get_troop_id, ":troop_id", ":agent_no"), (assign, ":formation_states", 0), (try_begin), #(eq, ":team_no", ":main_team"), #(agent_is_ally, ":agent_no"), (agent_is_human, ":agent_no"), (assign, ":array_no", -1), (assign, ":array_leader", 0), (try_begin), (eq, "p_main_party", ":party_no"), (assign, ":array_no", 0), (try_end), (party_get_slot, ":max_array_no", "p_main_party", slot_party_array_parties_begin), (try_for_range, ":i", 1, ":max_array_no"), (store_add, ":slot", slot_party_array_parties_begin, ":i"), (party_get_slot, ":array_party", "p_main_party", ":slot"), (try_begin), (party_slot_eq, ":array_party", slot_array_party_leader, ":troop_id"), (assign, ":array_no", ":i"), (assign, ":array_leader", 1), (try_end), (eq, ":array_party", ":party_no"), (assign, ":array_no", ":i"), (try_end), (neq, ":array_no", -1), (val_add, ":formation_states", ":array_no"), (try_begin), (neq, ":array_leader", 0), (val_add, ":formation_states", safs_array_leader), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader), (party_set_slot, formation_vector, reg0, ":agent_no"), (try_end), (else_try), (agent_is_human, ":agent_no"), (assign, ":formation_states", safs_full_mask), # agent to be assigned array (try_end), (agent_set_slot, ":agent_no", slot_agent_formation_states, ":formation_states"), ]), # scrip_formation_array_init # Called before change formation # Input: arg1: team_no, arg2: array_no # Output: reg0: num_of_men ("formation_array_init", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_no"), (assign, ":num_of_men", 0), #(get_player_agent_no, ":player"), (try_for_agents, ":agent"), #(neq, ":agent", ":player"), (agent_is_alive, ":agent"), (agent_is_human, ":agent"), (agent_get_team, ":agent_team", ":agent"), (eq, ":agent_team", ":team_no"), (agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states), (assign, ":agent_array", 0), (store_and, ":agent_array", ":formation_states", safs_array_no), (eq, ":agent_array", ":array_no"), (val_or, ":formation_states", safs_in_formation), (val_sub, ":formation_states", safs_in_formation), (agent_set_slot, ":agent", slot_agent_formation_states, ":formation_states"), (val_add, ":num_of_men", 1), (try_end), (assign, reg0, ":num_of_men"), #(display_message, "@Total {reg0} men.", formation_debug_color), ]), # script_formation_formulate_arrays # To assign soldiers to arrays for non-player teams # Input: none # Output: none ("formation_formulate_arrays", [(get_player_agent_no, ":player"), (agent_get_team, ":player_team", ":player"), (val_add, "$spawn_wave", 1), (try_begin), (eq, "$spawn_wave", 1), # initialize temp vector (assign, ":base", slot_formation_tmp_team_stat_begin), (try_for_range, ":team_no", 0, 4), (try_for_range, ":offset", 0, slot_formation_tmp_team_stat_section_size), (store_add, ":slot", ":offset", ":base"), (party_set_slot, formation_temp_vector, ":slot", 0), (try_end), (val_add, ":base", slot_formation_tmp_team_stat_section_size), (try_end), (try_end), (try_for_agents, ":agent_no"), (agent_is_alive, ":agent_no"), (agent_is_human, ":agent_no"), (agent_get_slot, ":formation_states", ":agent_no", slot_agent_formation_states), (eq, ":formation_states", safs_full_mask), # agent not assigned array yet (agent_get_team, ":team_no", ":agent_no"), (agent_get_troop_id, ":troop_id", ":agent_no"), (agent_get_class, ":class", ":agent_no"), (store_character_level, ":level", ":troop_id"), (store_mul, ":stat_slot", slot_formation_tmp_team_stat_section_size, ":team_no"), (val_add, ":stat_slot", slot_formation_tmp_team_stat_begin), (try_begin), (eq, ":class", grc_infantry), (try_begin), (ge, ":level", 15), (val_add, ":stat_slot", slot_formation_tmp_team_infantry_high), (party_get_slot, ":num", formation_temp_vector, ":stat_slot"), (val_add, ":num", 1), (try_begin), (assign, ":stage", 0), (store_and, ":stage", ":num", sftt_formation_stage_mask), (val_div, ":stage", sftt_formation_stage), (gt, ":stage", 0), (le, ":stage", 7), # new agents added, # set formation stage to reform formation (val_add, ":num", 7*sftt_formation_stage), (try_end), (party_set_slot, formation_temp_vector, ":stat_slot", ":num"), (else_try), (val_add, ":stat_slot", slot_formation_tmp_team_infantry_low), (party_get_slot, ":num", formation_temp_vector, ":stat_slot"), (val_add, ":num", 1), (try_begin), (assign, ":stage", 0), (store_and, ":stage", ":num", sftt_formation_stage_mask), (val_div, ":stage", sftt_formation_stage), (gt, ":stage", 0), (le, ":stage", 7), # new agents added, # set formation stage to reform formation (val_add, ":num", 7*sftt_formation_stage), (try_end), (party_set_slot, formation_temp_vector, ":stat_slot", ":num"), (try_end), (else_try), (eq, ":class", grc_archers), (val_add, ":stat_slot", slot_formation_tmp_team_archer), (party_get_slot, ":num", formation_temp_vector, ":stat_slot"), (val_add, ":num", 1), (try_begin), (assign, ":stage", 0), (store_and, ":stage", ":num", sftt_formation_stage_mask), (val_div, ":stage", sftt_formation_stage), (gt, ":stage", 0), (le, ":stage", 7), # new agents added, # set formation stage to reform formation (val_add, ":num", 7*sftt_formation_stage), (try_end), (party_set_slot, formation_temp_vector, ":stat_slot", ":num"), (else_try), (troop_is_guarantee_ranged, ":troop_id"), (val_add, ":stat_slot", slot_formation_tmp_team_horse_archer_1), (party_get_slot, ":num", formation_temp_vector, ":stat_slot"), (val_add, ":num", 1), (try_begin), (assign, ":stage", 0), (store_and, ":stage", ":num", sftt_formation_stage_mask), (val_div, ":stage", sftt_formation_stage), (gt, ":stage", 0), (le, ":stage", 7), # new agents added, # set formation stage to reform formation (val_add, ":num", 7*sftt_formation_stage), (try_end), (party_set_slot, formation_temp_vector, ":stat_slot", ":num"), (else_try), (val_add, ":stat_slot", slot_formation_tmp_team_cavalry_1), (party_get_slot, ":num", formation_temp_vector, ":stat_slot"), (val_add, ":num", 1), (try_begin), (assign, ":stage", 0), (store_and, ":stage", ":num", sftt_formation_stage_mask), (val_div, ":stage", sftt_formation_stage), (gt, ":stage", 0), (le, ":stage", 7), # new agents added, # set formation stage to reform formation (val_add, ":num", 7*sftt_formation_stage), (try_end), (party_set_slot, formation_temp_vector, ":stat_slot", ":num"), (try_end), (try_end), (assign, ":base", slot_formation_tmp_team_stat_begin), (assign, ":base_1", slot_formation_teams_begin), (try_for_range, ":team_no", 0, 4), #(eq, "$spawn_wave", 1), (try_begin), (store_add, ":max_array_slot", ":base_1", slot_formation_team_max_array_no), (party_get_slot, ":max_array_no", formation_vector, ":max_array_slot"), (assign, ":prev_max", ":max_array_no"), (store_add, ":infantry_high_slot", ":base", slot_formation_tmp_team_infantry_high), (try_begin), (party_get_slot, ":num", formation_temp_vector, ":infantry_high_slot"), (gt, ":num", 0), (assign, ":assigned", 0), (store_and, ":assigned", ":num", sftt_num_assigned_mask), (eq, ":assigned", 0), (try_begin), (lt, ":max_array_no", formation_arrays), (assign, ":array_no", ":max_array_no"), (else_try), (assign, ":array_no", formation_arrays-1), (try_end), (val_mul, ":array_no", sftt_array_no_base), (val_add, ":num", ":array_no"), (party_set_slot, formation_temp_vector, ":infantry_high_slot", ":num"), (val_add, ":max_array_no", 1), (try_end), (store_add, ":infantry_low_slot", ":base", slot_formation_tmp_team_infantry_low), (try_begin), (party_get_slot, ":num", formation_temp_vector, ":infantry_low_slot"), (gt, ":num", 0), (assign, ":assigned", 0), (store_and, ":assigned", ":num", sftt_num_assigned_mask), (eq, ":assigned", 0), (try_begin), (lt, ":max_array_no", formation_arrays), (assign, ":array_no", ":max_array_no"), (else_try), (assign, ":array_no", formation_arrays-1), (try_end), (val_mul, ":array_no", sftt_array_no_base), (val_add, ":num", ":array_no"), (party_set_slot, formation_temp_vector, ":infantry_low_slot", ":num"), (val_add, ":max_array_no", 1), (try_end), (store_add, ":archer_slot", ":base", slot_formation_tmp_team_archer), (try_begin), (party_get_slot, ":num", formation_temp_vector, ":archer_slot"), (gt, ":num", 0), (assign, ":assigned", 0), (store_and, ":assigned", ":num", sftt_num_assigned_mask), (eq, ":assigned", 0), (try_begin), (lt, ":max_array_no", formation_arrays), (assign, ":array_no", ":max_array_no"), (else_try), (assign, ":array_no", formation_arrays-1), (try_end), (val_mul, ":array_no", sftt_array_no_base), (val_add, ":num", ":array_no"), (party_set_slot, formation_temp_vector, ":archer_slot", ":num"), (val_add, ":max_array_no", 1), (try_end), (store_add, ":cavalry_slot", ":base", slot_formation_tmp_team_cavalry_1), (try_begin), (party_get_slot, ":stat", formation_temp_vector, ":cavalry_slot"), (gt, ":stat", 0), (assign, ":assigned", 0), (store_and, ":assigned", ":stat", sftt_num_assigned_mask), (eq, ":assigned", 0), (try_begin), (assign, ":num", 0), (store_and, ":num", ":stat", sftt_num_mask), (gt, ":num", 0), (lt, ":num", 30), (try_begin), (lt, ":max_array_no", formation_arrays), (assign, ":array_no", ":max_array_no"), (else_try), (assign, ":array_no", formation_arrays-1), (try_end), (val_mul, ":array_no", sftt_array_no_base), (val_add, ":num", ":array_no"), (party_set_slot, formation_temp_vector, ":cavalry_slot", ":num"), (val_add, ":max_array_no", 1), (else_try), (ge, ":num", 30), #(party_get_slot, ":num", formation_temp_vector, ":cavalry_slot"), (val_div, ":num", 2), (try_begin), (lt, ":max_array_no", formation_arrays), (assign, ":array_no", ":max_array_no"), (else_try), (assign, ":array_no", formation_arrays-1), (try_end), (val_mul, ":array_no", sftt_array_no_base), (val_add, ":num", ":array_no"), (party_set_slot, formation_temp_vector, ":cavalry_slot", ":num"), (val_add, ":cavalry_slot", 1), (try_begin), (lt, ":array_no", (formation_arrays-1)*sftt_array_no_base), (val_add, ":num", sftt_array_no_base), (try_end), (val_add, ":num", 1), # plus 1 in case the original number is odd (party_set_slot, formation_temp_vector, ":cavalry_slot", ":num"), (val_add, ":max_array_no", 2), (try_end), (else_try), (party_get_slot, ":stat_1", formation_temp_vector, ":cavalry_slot"), (val_add, ":cavalry_slot", 1), (party_get_slot, ":stat_2", formation_temp_vector, ":cavalry_slot"), (neq, ":stat_2", 0), (assign, ":num_1", 0), (assign, ":num_2", 0), (store_and, ":num_1", ":stat_1", sftt_num_mask), (store_and, ":num_2", ":stat_2", sftt_num_mask), (try_begin), (store_sub, ":dif", ":num_1", ":num_2"), (gt, ":dif", 5), (val_div, ":dif", 2), (val_sub, ":stat_1", ":dif"), (val_add, ":stat_2", ":dif"), (try_begin), (assign, ":stage", 0), (store_and, ":stage", ":stat_2", sftt_formation_stage_mask), (val_div, ":stage", sftt_formation_stage), (gt, ":stage", 0), (le, ":stage", 7), # new agents added, # set formation stage to reform formation (val_add, ":stat_2", 7*sftt_formation_stage), (try_end), (party_set_slot, formation_temp_vector, ":cavalry_slot", ":stat_2"), (val_sub, ":cavalry_slot", 1), (party_set_slot, formation_temp_vector, ":cavalry_slot", ":stat_1"), (try_end), (try_end), (store_add, ":horse_archer_slot", ":base", slot_formation_tmp_team_horse_archer_1), (try_begin), (assign, ":assigned", 0), (store_and, ":assigned", ":num", sftt_num_assigned_mask), (eq, ":assigned", 0), (try_begin), (party_get_slot, ":stat", formation_temp_vector, ":horse_archer_slot"), (gt, ":stat", 0), (assign, ":num", 0), (store_and, ":num", ":stat", sftt_num_mask), (gt, ":num", 0), (lt, ":num", 30), (try_begin), (lt, ":max_array_no", formation_arrays), (assign, ":array_no", ":max_array_no"), (else_try), (assign, ":array_no", formation_arrays-1), (try_end), (val_mul, ":array_no", sftt_array_no_base), (val_add, ":num", ":array_no"), (party_set_slot, formation_temp_vector, ":horse_archer_slot", ":num"), (val_add, ":max_array_no", 1), (else_try), (gt, ":stat", 0), (ge, ":num", 30), (val_div, ":num", 2), (try_begin), (lt, ":max_array_no", formation_arrays), (assign, ":array_no", ":max_array_no"), (else_try), (assign, ":array_no", formation_arrays-1), (try_end), (val_mul, ":array_no", sftt_array_no_base), (val_add, ":num", ":array_no"), (party_set_slot, formation_temp_vector, ":horse_archer_slot", ":num"), (val_add, ":horse_archer_slot", 1), (try_begin), (lt, ":array_no", (formation_arrays-1)*sftt_array_no_base), (val_add, ":num", sftt_array_no_base), (try_end), (val_add, ":num", 1), # plus 1 in case the original number is odd (party_set_slot, formation_temp_vector, ":horse_archer_slot", ":num"), (val_add, ":max_array_no", 2), (try_end), (else_try), (party_get_slot, ":stat_1", formation_temp_vector, ":horse_archer_slot"), (val_add, ":horse_archer_slot", 1), (party_get_slot, ":stat_2", formation_temp_vector, ":horse_archer_slot"), (neq, ":stat_2", 0), (assign, ":num_1", 0), (assign, ":num_2", 0), (store_and, ":num_1", ":stat_1", sftt_num_mask), (store_and, ":num_2", ":stat_2", sftt_num_mask), (try_begin), (store_sub, ":dif", ":num_1", ":num_2"), (gt, ":dif", 5), (val_div, ":dif", 2), (val_sub, ":stat_1", ":dif"), (val_add, ":stat_2", ":dif"), (try_begin), (assign, ":stage", 0), (store_and, ":stage", ":stat_2", sftt_formation_stage_mask), (val_div, ":stage", sftt_formation_stage), (gt, ":stage", 0), (le, ":stage", 7), # new agents added, # set formation stage to reform formation (val_add, ":stat_2", 7*sftt_formation_stage), (try_end), (party_set_slot, formation_temp_vector, ":horse_archer_slot", ":stat_2"), (val_sub, ":cavalry_slot", 1), (party_set_slot, formation_temp_vector, ":horse_archer_slot", ":stat_1"), (try_end), (try_end), (try_begin), (gt, ":max_array_no", formation_arrays), (assign, ":max_array_no", formation_arrays), (try_end), (store_add, ":base_2", ":base_1", slot_formation_team_arrays_begin), (try_for_range, ":array_no", 0, ":max_array_no"), (eq, "$spawn_wave", 1), (store_add, ":leader_slot", ":base_2", slot_formation_array_leader), (party_set_slot, formation_vector, ":leader_slot", -1), (val_add, ":base_2", sfa_array_section_size), (try_end), (store_add, ":slot", ":base_1", slot_formation_team_max_array_no), (party_set_slot, formation_vector, ":slot", ":max_array_no"), (try_end), (val_add, ":base_1", sft_team_section_size), (val_add, ":base", slot_formation_tmp_team_stat_section_size), (try_begin), (eq, ":team_no", ":player_team"), (assign, "$formation_max_array_no", ":max_array_no"), (try_end), (try_end), (try_for_agents, ":agent"), (agent_is_alive, ":agent"), (agent_is_human, ":agent"), (agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states), (eq, ":formation_states", safs_full_mask), # agent not assigned array yet (agent_get_team, ":team_no", ":agent"), (agent_get_class, ":class", ":agent"), (agent_get_troop_id, ":troop_id", ":agent"), (store_character_level, ":level", ":troop_id"), (try_begin), (eq, ":class", grc_infantry), (try_begin), (ge, ":level", 15), (call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_infantry_high), (else_try), (call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_infantry_low), (try_end), (else_try), (eq, ":class", grc_archers), (call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_archer), (else_try), (agent_get_troop_id, ":troop_id", ":agent"), (troop_is_guarantee_ranged, ":troop_id"), (try_begin), (call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_horse_archer_1), (else_try), (call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_horse_archer_2), (try_end), (else_try), (try_begin), (call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_cavalry_1), (else_try), (call_script, "script_cf_formation_agent_assign_array", ":agent", ":team_no", slot_formation_tmp_team_cavalry_2), (try_end), (try_end), (try_end), (try_for_range, ":team_no", 0, 4), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_max_array_no), (party_get_slot, ":max_array_no", formation_vector, reg0), (store_add, ":mark", slot_formation_array_marks_begin, ":max_array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_sub, ":mark", 1), (try_begin), (neq, ":team_no", ":player_team"), (call_script, "script_dismiss_battle_array", ":team_no", ":mark"), (try_end), (store_add, ":mark_1", slot_formation_array_marks_begin, ":prev_max"), (party_get_slot, ":mark_1", formation_vector, ":mark_1"), (val_sub, ":mark_1", 1), (val_sub, ":mark", ":mark_1"), (neq, ":mark", 0), (call_script, "script_cf_formation_elect_array_leader", ":team_no", ":mark"), (try_end), ] ), # script_cf_formation_agent_assign_array_by_class # Assign agent to paticular array # Input: arg1: agent_no, arg2: team_no # arg3: slot_offset - class-array slot defined for ai, # see module_constants.py for slots starting # with slot_formation_tmp_team_ # Output: none # Fail: If the array has already reached the number upon formulation ("cf_formation_agent_assign_array", [(store_script_param_1, ":agent_no"), (store_script_param_2, ":team_no"), (store_script_param, ":slot_offset", 3), (store_mul, ":stat_slot", slot_formation_tmp_team_stat_section_size, ":team_no"), (val_add, ":stat_slot", slot_formation_tmp_team_stat_begin), (val_add, ":stat_slot", ":slot_offset"), (party_get_slot, ":stat", formation_temp_vector, ":stat_slot"), (assign, ":array_no", 0), (store_and, ":array_no", ":stat", sftt_array_no_mask), (val_div, ":array_no", sftt_array_no_base), (assign, ":num", 0), (store_and, ":num", ":stat", sftt_num_mask), (assign, ":assigned", 0), (store_and, ":assigned", ":stat", sftt_num_assigned_mask), (val_div, ":assigned", sftt_num_assigned_base), (lt, ":assigned", ":num"), (val_add, ":stat", sftt_num_assigned_base), (party_set_slot, formation_temp_vector, ":stat_slot", ":stat"), (agent_set_slot, ":agent_no", slot_agent_formation_states, ":array_no"), ] ), # script_formation_elect_array_leader # Elect a new leader from members of arrays # Input: arg1: team_no, arg2: array_selection # Output: reg0 - agent no of the new leader for the array of smallest no. ("cf_formation_elect_array_leader", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_selection"), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_max_array_no), (party_get_slot, ":max_array_no", formation_vector, reg0), (try_for_range, ":array_no", 0, ":max_array_no"), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", ":array_selection"), (neq, ":mark", 0), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader), (party_set_slot, formation_vector, reg0, -1), (try_end), (try_for_agents, ":agent"), (agent_is_alive, ":agent"), (agent_is_human, ":agent"), (agent_get_team, ":agent_team", ":agent"), (eq, ":agent_team", ":team_no"), (agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states), (store_and, ":array_no", ":formation_states", safs_array_no), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", ":array_selection"), (neq, ":mark", 0), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader), (party_get_slot, ":array_leader", formation_vector, reg0), (try_begin), (neq, ":array_leader", -1), (agent_get_troop_id, ":leader_troop", ":array_leader"), (store_character_level, ":leader_level", ":leader_troop"), (agent_get_troop_id, ":troop_id", ":agent"), (store_character_level, ":level", ":troop_id"), (le, ":level", ":leader_level"), (else_try), (party_set_slot, formation_vector, reg0, ":agent"), (try_end), (try_end), (assign, reg0, -1), (try_for_range_backwards, ":array_no", 0, ":max_array_no"), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", ":array_selection"), (neq, ":mark", 0), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader), (party_get_slot, ":array_leader", formation_vector, reg0), (neq, ":array_leader", -1), (agent_get_slot, ":formation_states", ":array_leader", slot_agent_formation_states), (val_or, ":formation_states", safs_array_leader), (agent_set_slot, ":array_leader", slot_agent_formation_states, ":formation_states"), (assign, reg0, ":array_leader"), (try_end), (neq, reg0, -1), ] ), # script_formation_ai_tactics # script for AI tactics applying formations # Input: none # Output: none ("formation_ai_tactics", [(get_player_agent_no, ":player"), (agent_get_team, ":player_team", ":player"), (try_for_range, ":team_no", 0, 4), (neq, ":team_no", ":player_team"), (team_get_leader, ":team_leader", ":team_no"), (neq, ":team_leader", -1), #debug_point, (assign, ":team_tactic", 0), # Defensive by default (agent_get_position, pos2, ":team_leader"), #(position_get_x, reg0, pos2), #(position_get_y, reg1, pos2), #(display_message, "@Ref pos: {reg0}, {reg1}", formation_debug_color), (call_script, "script_find_high_ground_around_pos1", ":team_no", 5), (copy_position, pos2, pos52), (call_script, "script_team_get_average_position_of_enemies", ":team_no"), (assign, ":num_enemies", reg0), (call_script, "script_team_get_class_percentages", ":team_no", 1), (assign, ":enemy_perc_infantry", reg0), (assign, ":enemy_perc_archer", reg1), (assign, ":enemy_perc_cavalry", reg2), (get_battle_advantage, ":advantage"), (get_player_agent_no, ":player"), (agent_get_team, ":player_team", ":player"), (assign, ":archer_behind", 0), (try_begin), (store_mul, ":enemy_cavalry", ":num_enemies", ":enemy_perc_cavalry"), (val_div, ":enemy_cavalry", 100), (this_or_next|lt, ":num_enemies", 15), (this_or_next|gt, ":enemy_cavalry", 15), (gt, ":enemy_perc_cavalry", 80), (val_add, ":team_tactic", 2), # cavalry free charge (try_end), (try_begin), (lt, ":num_enemies", 15), (val_add, ":team_tactic", 4), # infantry free charge (try_end), (try_begin), (this_or_next|teams_are_enemies, ":player_team", ":team_no"), (gt, ":advantage", 0), (this_or_next|le, ":advantage", 0), (neg|teams_are_enemies, ":player_team", ":team_no"), (val_add, ":team_tactic", 1), # Aggressive (assign, ":archer_behind", 1), #debug_point, (try_end), #(try_begin), # (lt, #(try_end), (try_begin), (position_is_behind_position, pos0, pos2), (position_rotate_z, pos2, 180), (try_end), (position_transform_position_to_local, pos3, pos2, pos0), (position_get_x, ":pos_x", pos3), (position_get_y, ":pos_y", pos3), (set_fixed_point_multiplier, 100), (convert_to_fixed_point, ":pos_x"), (store_div, ":tan", ":pos_x", ":pos_y"), (call_script, "script_arctan", ":tan"), (val_mul, reg0, -1), (position_rotate_z, pos2, reg0), (try_begin), (copy_position, pos1, pos2), (call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_archer, ft_line, 0, ":team_tactic"), (store_mul, ":offset", ":archer_behind", 2250), (init_position, pos4), (position_move_y, pos4, ":offset"), (position_transform_position_to_parent, pos1, pos2, pos4), (position_copy_rotation, pos1, pos2), (copy_position, pos2, pos1), (try_end), (try_begin), (init_position, pos4), #(store_mul, ":offset", ":archer_front", -750), (position_move_y, pos4, -750), (position_transform_position_to_parent, pos1, pos2, pos4), (position_copy_rotation, pos1, pos2), (call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_infantry_low, ft_phalanx, 0, ":team_tactic"), (copy_position, pos2, pos1), (try_end), (try_begin), (init_position, pos4), (position_move_y, pos4, -750), (position_transform_position_to_parent, pos1, pos2, pos4), (position_copy_rotation, pos1, pos2), (call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_infantry_high, ft_phalanx, 0, ":team_tactic"), (copy_position, pos2, pos1), (try_end), (try_begin), (init_position, pos4), (position_move_x, pos4, -4000), (position_move_y, pos4, 1000), (position_transform_position_to_parent, pos1, pos2, pos4), (position_copy_rotation, pos1, pos2), (position_rotate_z, pos1, 45), (call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_cavalry_1, ft_wedge, 1, ":team_tactic"), (try_end), (try_begin), (init_position, pos4), (position_move_x, pos4, 4000), (position_move_y, pos4, 1000), (position_transform_position_to_parent, pos1, pos2, pos4), (position_copy_rotation, pos1, pos2), (position_rotate_z, pos1, -45), (call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_cavalry_2, ft_wedge, 1, ":team_tactic"), (try_end), (try_begin), (init_position, pos4), (position_move_x, pos4, -6000), (position_transform_position_to_parent, pos1, pos2, pos4), (position_copy_rotation, pos1, pos2), (call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_horse_archer_1, ft_wedge, 1, ":team_tactic"), (try_end), (try_begin), (init_position, pos4), (position_move_x, pos4, 6000), (position_transform_position_to_parent, pos1, pos2, pos4), (position_copy_rotation, pos1, pos2), (call_script, "script_cf_formation_ai_deploy_array_generic", ":team_no", slot_formation_tmp_team_horse_archer_2, ft_wedge, 1, ":team_tactic"), (try_end), (try_end), ] ), # script_cf_formation_ai_deploy_array_generic # Use the built-in tactical charge script for the corresponding formation # Input: arg1: team_no, arg2: slot_offset, arg3: formation_type # arg4: density - 0 to 3 # arg5: team_tactic # arg6: pos1 - the position to deploy array # Output: none ("cf_formation_ai_deploy_array_generic", [(store_script_param_1, ":team_no"), (store_script_param_2, ":slot_offset"), (store_script_param, ":formation_type", 3), (store_script_param, ":density", 4), (store_script_param, ":team_tactic", 5), (position_get_x, ":pos_x", pos1), (position_get_y, ":pos_y", pos1), (position_get_rotation_around_z, ":rotation", pos1), (store_mul, ":slot", ":team_no", slot_formation_tmp_team_stat_section_size), (val_add, ":slot", slot_formation_tmp_team_stat_begin), (val_add, ":slot", ":slot_offset"), (party_get_slot, ":state", formation_temp_vector, ":slot"), (neq, ":state", 0), (assign, ":formation_stage", 0), (store_and, ":formation_stage", ":state", sftt_formation_stage_mask), (val_div, ":formation_stage", sftt_formation_stage), (assign, ":array_no", 0), (store_and, ":array_no", ":state", sftt_array_no_mask), (val_div, ":array_no", sftt_array_no_base), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (assign, ":free_charge", 0), (try_begin), (this_or_next|eq, ":slot_offset", slot_formation_tmp_team_cavalry_1), (eq, ":slot_offset", slot_formation_tmp_team_cavalry_2), (assign, ":free_charge", 2), (val_and, ":free_charge", ":team_tactic"), #(neq, ":free_charge", 0), (eq, 0, 1), (else_try), (eq, ":slot_offset", slot_formation_tmp_team_archer), (call_script, "script_formation_check_array_ammo", ":team_no", ":array_no"), (lt, reg0, 20), (assign, ":free_charge", 2), (eq, 0, 1), (else_try), (this_or_next|eq, ":slot_offset", slot_formation_tmp_team_infantry_high), (eq, ":slot_offset", slot_formation_tmp_team_infantry_low), (assign, ":infantry_charge", 4), (val_and, ":infantry_charge", ":team_tactic"), (val_add, ":free_charge", ":infantry_charge"), (eq, 0, 1), (else_try), (this_or_next|eq, ":slot_offset", slot_formation_tmp_team_horse_archer_1), (this_or_next|eq, ":slot_offset", slot_formation_tmp_team_horse_archer_2), (neq, ":free_charge", 0), (try_begin), (le, ":formation_stage", 7), # array is currently in formation or to form formation (call_script, "script_dismiss_battle_array", ":team_no", ":mark"), (store_sub, ":rest", 14, ":formation_stage"), (val_mul, ":rest", sftt_formation_stage), (val_add, ":state", ":rest"), (party_set_slot, formation_temp_vector, ":slot", ":state"), (set_show_messages, 0), (team_give_order, ":team_no", grc_cavalry, mordr_charge), (set_show_messages, 1), (try_end), #(assign, reg0, ":array_no"), #(display_message, "@Array {reg0} routine 1", formation_debug_color), (else_try), #(assign, reg0, ":array_no"), #(display_message, "@Array {reg0} routine 2", formation_debug_color), (try_begin), # form ranks first (eq, ":formation_stage", 0), (call_script, "script_cf_apply_formation", ":team_no", ":array_no", ":formation_type"), #debug_point, (init_position, pos1), (position_move_x, pos1, ":pos_x"), (position_move_y, pos1, ":pos_y"), (position_rotate_z, pos1, ":rotation"), (call_script, "script_formation_move_to_pos", ":team_no", ":array_no"), (else_try), # when formation ready, start tactical action (eq, ":formation_stage", 7), (try_begin), (assign, ":aggressive", 1), (val_and, ":aggressive", ":team_tactic"), (eq, ":aggressive", 1), # Take aggressive action (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states), (party_get_slot, ":array_states", formation_vector, reg0), (val_or, ":array_states", sfas_tactical_charge), (party_set_slot, formation_vector, reg0, ":array_states"), (else_try), # Take defensive action (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states), (party_get_slot, ":array_state", formation_vector, reg0), (val_and, ":array_state", sfas_formation_density), (val_div, ":array_state", sfas_density_unit), (store_sub, ":density", ":density", ":array_state"), (neq, ":density", 0), (call_script, "script_formation_density_change", ":team_no", ":mark", ":density"), (try_end), (else_try), # formation need to be reformed, and then recover states (ge, ":formation_stage", 8), (try_begin), (call_script, "script_cf_apply_formation", ":team_no", ":array_no", ":formation_type"), (try_end), (try_end), (try_begin), (lt, ":formation_stage", 7), (val_add, ":state", sftt_formation_stage), (party_set_slot, formation_temp_vector, ":slot", ":state"), (else_try), # reformed array set back to normal stage (gt, ":formation_stage", 7), (val_sub, ":state", 7*sftt_formation_stage), (party_set_slot, formation_temp_vector, ":slot", ":state"), (try_end), (try_end), ] ), # script_formation_reassign_array # Script to reassign men of array with no leader to another array # Input: arg1: team_no, arg2: array_no, # Output: reg0 - no of array assigned to ("formation_reassign_array", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_no"), #(call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_max_array_no), #(party_get_slot, ":max_array_no", formation_vector, reg0), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":array_selection", formation_vector, reg0), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (val_or, ":array_selection", ":mark"), (val_sub, ":array_selection", ":mark"), (party_set_slot, formation_vector, reg0, ":array_selection"), (assign, ":dest_array", 0), # assign to main battle by default # below not yet done, need further update #(try_for_range, ":array", 1, ":max_array_no"), # (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader), # (party_get_slot, ":leader", formation_vector, reg0), # (agent_is_alive, ":leader"), # a valid candidate array # (agent_get_class, ":class", ":leader"), #(try_end), (assign, ":agent_array", 0), (try_for_agents, ":agent"), (agent_is_alive, ":agent"), (agent_is_human, ":agent"), (agent_get_team, ":agent_team", ":agent"), (eq, ":agent_team", ":team_no"), (agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states), (store_and, ":agent_array", ":formation_states", safs_array_no), (eq, ":agent_array", ":array_no"), (val_sub, ":formation_states", ":agent_array"), (val_add, ":formation_states", ":dest_array"), (val_or, ":formation_states", safs_in_formation), (val_sub, ":formation_states", safs_in_formation), (agent_clear_scripted_mode, ":agent"), (agent_set_slot, ":agent", slot_agent_is_in_scripted_mode, 0), (agent_set_slot, ":agent", slot_agent_formation_states, ":formation_states"), (try_end), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_num_of_men), (party_set_slot, formation_vector, reg0, 0), (assign, reg0, ":dest_array"), ]), # script_cf_apply_formation # Script to set formations active. Can fail! # Input: arg1: team_no, arg2: array_no, # arg3: formation_type, # Output: none ("cf_apply_formation", [(store_script_param, ":team_no", 1), (store_script_param, ":array_no", 2), (store_script_param, ":formation_type", 3), # Initialize array for formation and count number of men (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_num_of_men), (assign, ":slot", reg0), (call_script, "script_formation_array_init", ":team_no", ":array_no"), (party_set_slot, formation_vector, ":slot", reg0), (try_begin), (eq, reg0, 0), (store_add, ":array_string", formation_array_names_begin, ":array_no"), (str_store_string, s1, ":array_string"), (display_message, "@{s1} has no one left standing!!", formation_warning_color), (try_end), (neq, reg0, 0), # Store formation type and auto-rotation state (val_add, ":slot", 1), (store_add, ":array_states", ":formation_type", sfas_density_unit*2), #(try_begin), # (eq, ":auto_rotation", 1), # (val_add, ":array_states", sfas_auto_rotate), #(try_end), (party_set_slot, formation_vector, ":slot", ":array_states"), # Calculate the formation, assign position to soldiers (store_add, ":formation_script", formation_scripts_begin, ":formation_type"), (call_script, ":formation_script", ":team_no", ":array_no", reg0), # Mark that this array is in formation (store_add, ":slot", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":slot"), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":array_selection", formation_vector, reg0), (val_or, ":array_selection", ":mark"), (party_set_slot, formation_vector, reg0, ":array_selection"), # Set reference position as the leader's position (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader), (assign, ":slot", reg0), (party_get_slot, ":leader", formation_vector, ":slot"), (try_begin), (neg|agent_is_alive, ":leader"), (call_script, "script_cf_formation_elect_array_leader", ":team_no", ":mark"), (assign, ":leader", reg0), (try_end), (agent_get_position, pos1, ":leader"), (position_get_x, ":ref_x", pos1), (position_get_y, ":ref_y", pos1), (position_get_rotation_around_z, ":rotation", pos1), (store_sub, ":next", slot_formation_array_ref_x_pos, slot_formation_array_leader), (val_add, ":slot", ":next"), (party_set_slot, formation_vector, ":slot", ":ref_x"), (store_sub, ":next", slot_formation_array_ref_y_pos, slot_formation_array_ref_x_pos), (val_add, ":slot", ":next"), (party_set_slot, formation_vector, ":slot", ":ref_y"), (store_sub, ":next", slot_formation_array_ref_rotation, slot_formation_array_ref_y_pos), (val_add, ":slot", ":next"), (party_set_slot, formation_vector, ":slot", ":rotation"), ]), # script_maintain_formation # Called every 1sec # Input: none # Output: none ("maintain_formation", [(assign, ":base", slot_formation_teams_begin), (set_fixed_point_multiplier, 100), # initialize counters, reference positions, auto-rotation (try_for_range, ":team_no", 0, 4), (store_add, ":slot", ":base", slot_formation_team_array_selection), (try_begin), (neg|party_slot_eq, formation_vector, ":slot", 0), (call_script, "script_team_get_average_position_of_enemies", ":team_no"), (copy_position, pos62, pos0), (get_player_agent_no, ":player"), (val_add, ":slot", 1), (party_get_slot, ":max_array_no", formation_vector, ":slot"), # pick pos20 - pos51 to store reference positions (store_mul, ":ref_pos", ":team_no", formation_arrays), (val_add, ":ref_pos", 20), # use formation_temp_vector to record men number of current arrays (store_mul, ":num_tmp_pt", ":team_no", formation_arrays*2), (try_for_range, ":array_no", 0, ":max_array_no"), (store_mul, ":offset", ":array_no", sfa_array_section_size), (val_add, ":offset", slot_formation_team_arrays_begin), (store_add, ":slot", ":offset", ":base"), # consider charge, fall back and auto rotation (store_add, ":states_slot", ":slot", slot_formation_array_states), (party_get_slot, ":array_states", formation_vector, ":states_slot"), (store_add, ":leader_slot", ":slot", slot_formation_array_leader), (party_get_slot, ":leader", formation_vector, ":leader_slot"), (assign, ":charge", 0), (assign, ":fall_back", 0), (assign, ":speed", 0), (store_and, ":charge", ":array_states", sfas_charge), (store_and, ":fall_back", ":array_states", sfas_fall_back), (try_begin), (neq, ":charge", 0), (try_begin), (neq, ":fall_back", 0), (agent_get_position, pos1, ":leader"), (call_script, "script_formation_move_to_pos", ":team_no", ":array_no"), (val_sub, ":array_states", sfas_charge+sfas_fall_back), (party_set_slot, formation_vector, ":states_slot", ":array_states"), (else_try), (store_and, ":speed", ":array_states", sfas_speed), (val_div, ":speed", sfas_speed_base), (call_script, "script_formation_move", ":team_no", ":array_no", 0, ":speed"), (try_end), (else_try), (neq, ":fall_back", 0), (store_and, ":speed", ":array_states", sfas_speed), (val_div, ":speed", -sfas_speed_base), (call_script, "script_formation_move", ":team_no", ":array_no", 0, ":speed"), (try_end), (store_add, ":ref_x_slot", ":slot", slot_formation_array_ref_x_pos), (init_position, ":ref_pos"), (party_get_slot, ":ref_x", formation_vector, ":ref_x_slot"), (position_set_x, ":ref_pos", ":ref_x"), (store_add, ":ref_y_slot", ":slot", slot_formation_array_ref_y_pos), (party_get_slot, ":ref_y", formation_vector, ":ref_y_slot"), (position_set_y, ":ref_pos", ":ref_y"), (store_add, ":rotation_slot", ":slot", slot_formation_array_ref_rotation), #(position_get_x, reg0, ":ref_pos"), #(position_get_y, reg1, ":ref_pos"), #(assign, reg2, ":ref_pos"), #(display_message, "@ref_pos: {reg2}, ref: ({reg0}, {reg1}).", formation_debug_color), (party_get_slot, ":rotation", formation_vector, ":rotation_slot"), (position_get_rotation_around_z, ":cur_rot", ":ref_pos"), (val_sub, ":rotation", ":cur_rot"), (position_rotate_z, ":ref_pos", ":rotation"), # Turn ref_pos so that it faces enemies (try_begin), (party_get_slot, ":array_states", formation_vector, ":states_slot"), (val_and, ":array_states", sfas_auto_rotate), (neq, ":array_states", 0), #(agent_get_position, pos61, ":leader"), #(position_copy_rotation, pos61, ":ref_pos"), (assign, ":turned", 0), (try_begin), (position_is_behind_position, pos62, ":ref_pos"), #(position_rotate_z, pos61, 180), (position_rotate_z, ":ref_pos", 180), (assign, ":turned", 1), (try_end), (position_transform_position_to_local, pos2, ":ref_pos", pos62), (position_get_x, ":dir_x", pos2), (position_get_y, ":dir_y", pos2), (convert_from_fixed_point, ":dir_y"), (assign, ":tan", 0), (assign, ":rotation", 0), (store_div, ":tan", ":dir_x", ":dir_y"), (call_script, "script_arctan", ":tan"), (store_mul, ":rotation", reg0, -1), (this_or_next|gt, ":rotation", 5), (this_or_next|gt, -5, ":rotation"), (eq, ":turned", 1), (position_rotate_z, ":ref_pos", ":rotation"), (position_get_rotation_around_z, reg0, ":ref_pos"), (party_set_slot, formation_vector, ":rotation_slot", reg0), (try_end), (party_set_slot, formation_temp_vector, ":num_tmp_pt", 0), # set the engage state and war cry of array (party_get_slot, ":array_states", formation_vector, ":states_slot"), (val_and, ":array_states", sfas_engaged+sfas_roar), (store_add, ":engage_pt", ":num_tmp_pt", formation_arrays), (party_set_slot, formation_temp_vector, ":engage_pt", ":array_states"), (val_add, ":num_tmp_pt", 1), (val_add, ":ref_pos", 1), #(val_add, ":offset", sfa_array_section_size), (try_end), (store_mission_timer_a, ":cur_time"), (set_show_messages, 0), (try_begin), (ge, ":cur_time", 1), (team_give_order, ":team_no", grc_everyone, mordr_charge), (else_try), (team_give_order, ":team_no", grc_everyone, mordr_hold), (try_end), (set_show_messages, 1), (try_end), (val_add, ":base", sft_team_section_size), (try_end), # renew agent destinations, count number of men, (get_player_agent_no, ":player"), (try_for_agents, ":agent"), (neq, ":agent", ":player"), (agent_is_alive, ":agent"), (agent_is_human, ":agent"), (agent_get_team, ":team_no", ":agent"), (assign, ":in_formation", 0), (agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states), (store_and, ":in_formation", ":formation_states", safs_in_formation), (neq, ":in_formation", 0), #(display_message, "@reached!", formation_debug_color), (store_and, ":array_no", ":formation_states", safs_array_no), (store_mul, ":ref_pos", ":team_no", formation_arrays), (val_add, ":ref_pos", 20), (val_add, ":ref_pos",":array_no"), (store_mul, ":num_tmp_pt", ":team_no", formation_arrays*2), (val_add, ":num_tmp_pt", ":array_no"), (party_get_slot, ":num", formation_temp_vector, ":num_tmp_pt"), (val_add, ":num", 1), (party_set_slot, formation_temp_vector, ":num_tmp_pt", ":num"), (agent_get_slot, ":target_x", ":agent", slot_agent_formation_x_pos), (agent_get_slot, ":target_y", ":agent", slot_agent_formation_y_pos), (copy_position, pos9, ":ref_pos"), (position_set_x, pos9, ":target_x"), (position_set_y, pos9, ":target_y"), #(position_get_x, reg0, ":ref_pos"), #(position_get_y, reg1, ":ref_pos"), #(assign, reg2, ":ref_pos"), #(display_message, "@ref_pos: {reg2}, ref: ({reg0}, {reg1}).", formation_debug_color), (position_transform_position_to_parent, pos10, ":ref_pos", pos9), (position_copy_rotation, pos10, ":ref_pos"), (agent_get_position, pos11, ":agent"), (store_add, ":engage_pt", ":num_tmp_pt", formation_arrays), (party_get_slot, ":engage_states", formation_temp_vector, ":engage_pt"), (assign, ":engage", 0), (assign, ":roar", 0), (store_and, ":engage", sfas_engaged, ":engage_states"), (store_and, ":roar", sfas_roar, ":engage_states"), (assign, ":roar_stage", 0), (try_begin), (neq, ":roar", 0), (store_and, ":roar_stage", ":formation_states", safs_roar_stage), (val_sub, ":formation_states", ":roar_stage"), (try_begin), (neq, ":roar_stage", 0), (val_sub, ":roar_stage", safs_roar_stage_second), (try_end), (eq, ":roar_stage", 0), (store_random_in_range, ":dice", 0, 10), (lt, ":dice", 5), (agent_get_troop_id, ":agent_troop", ":agent"), (troop_get_type, ":gender", ":agent_troop"), (eq, ":gender", 0), (agent_play_sound, ":agent", "snd_man_warcry"), (assign, ":roar_stage", safs_roar_stage), (try_end), (val_add, ":formation_states", ":roar_stage"), (agent_set_slot, ":agent", slot_agent_formation_states, ":formation_states"), (try_begin), (set_fixed_point_multiplier, 100), (assign, ":pos_error", 0), (get_distance_between_positions, ":pos_error", pos10, pos11), # the agent is allow to stand at a position with an error of 20 metres # if the formation is engaged with enemy (try_begin), (eq, ":engage", 0), (assign, ":tolerance", 10), (else_try), (assign, ":tolerance", 2000), (try_end), (gt, ":pos_error", ":tolerance"), (agent_set_scripted_destination, ":agent", pos10, 1), (agent_set_slot, ":agent", slot_agent_is_in_scripted_mode, 1), #(val_mul, ":pos_error", 36), # the following rounds pos_error to integral kilometres -- Useless and causes trouble #(store_mod, ":remain", ":pos_error", 1000), #(try_begin), # (gt, ":remain", 500), # (val_add, ":pos_error", 500), #(try_end), #(val_div, ":pos_error", 1000), #(agent_set_speed_limit, ":agent", ":pos_error"), (else_try), (agent_clear_scripted_mode, ":agent"), (agent_set_slot, ":agent", slot_agent_is_in_scripted_mode, 0), (try_end), (try_end), (get_player_agent_no, ":player"), (agent_get_team, ":player_team", ":player"), (store_sub, ":base", 0, formation_arrays*2), # check for arrays with no leader (try_for_range, ":team_no", 0, 4), (val_add, ":base", formation_arrays*2), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":array_selection", formation_vector, reg0), (neq, ":array_selection", 0), (val_add, reg0, 1), (party_get_slot, ":max_array_no", formation_vector, reg0), (try_for_range, ":array_no", 0, ":max_array_no"), (store_add, ":slot", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":slot"), (val_and, ":mark", ":array_selection"), (neq, ":mark", 0), (store_add, ":slot", ":base", ":array_no"), (party_get_slot, ":cur_num", formation_temp_vector, ":slot"), (try_begin), (eq, ":cur_num", 0), # Mark that this array is no longer in formation (store_add, ":slot", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":slot"), (call_script, "script_dismiss_battle_array", ":team_no", ":mark"), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":array_selection", formation_vector, reg0), (val_or, ":array_selection", ":mark"), (val_sub, ":array_selection", ":mark"), (party_set_slot, formation_vector, reg0, ":array_selection"), #(get_player_agent_no, ":player"), #(agent_get_team, ":player_team", ":player"), (store_add, ":array_string", formation_array_names_begin, ":array_no"), (str_store_string, s1, ":array_string"), (try_begin), (eq, ":team_no", ":player_team"), (display_message, "@{s1} has fought till the last man!", formation_warning_color), (else_try), (teams_are_enemies, ":team_no", ":player_team"), (display_message, "@Enemies' {s1} is no more!", formation_message_color), (else_try), (display_message, "@Allies' {s1} has fought till the last man!", formation_warning_color), (try_end), (else_try), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_leader), (party_get_slot, ":leader", formation_vector, reg0), (try_begin), (neg|agent_is_alive, ":leader"), (agent_set_slot, ":leader", slot_agent_formation_states, 0), # leader down!! (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (call_script, "script_cf_formation_elect_array_leader", ":team_no", ":mark"), #(neq, ":team_no", ":player_team"), (store_add, ":array_string", formation_array_names_begin, ":array_no"), (str_store_string, s1, ":array_string"), (agent_get_troop_id, ":troop_id", reg0), (str_store_troop_name, s2, ":troop_id"), (try_begin), (eq, ":team_no", ":player_team"), (display_message, "@The commander of {s1} is down! {s2} has taken over command.", formation_warning_color), (else_try), (teams_are_enemies, ":team_no", ":player_team"), (display_message, "@The enemies' commander of {s1} is down! {s2} has taken over command.", formation_message_color), (else_try), (display_message, "@The allies' commander of {s1} is down! {s2} has taen over command.", formation_warning_color), (try_end), (try_end), (try_end), (try_end), (try_end), ]), # script_formation_move_key_reaction # React to player key press # Input: arg1:x_offset, arg2: y_offset, arg3: move name string id # Output: none ("formation_move_key_reaction", [(store_script_param, ":x_offset", 1), (store_script_param, ":y_offset", 2), (store_script_param, ":move_name", 3), (get_player_agent_no, ":player"), (agent_get_team, ":team_no", ":player"), (str_clear, s1), (assign, ":cnt", 0), (try_for_range_backwards, ":array_no", 0, formation_arrays), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", "$formation_array_selected"), (neq, ":mark", 0), (store_add, ":formation_array_string", formation_array_names_begin, ":array_no"), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":array_selection", formation_vector, reg0), (val_and, ":mark", ":array_selection"), (neq, ":mark", 0), (call_script, "script_formation_move", ":team_no", ":array_no", ":x_offset", ":y_offset"), (str_store_string, s2, ":formation_array_string"), (val_add, ":cnt", 1), (try_begin), (eq, ":cnt", 2), (str_store_string, s1, "@{s2} and {s1}"), (else_try), (str_store_string, s1, "@{s2}, {s1}"), (try_end), (try_end), (try_begin), (eq, ":cnt", "$formation_max_array_no"), (str_store_string, s1, "@All battles, "), (try_end), (str_store_string, s2, ":move_name"), (display_message, "@{s1}{s2}!!", formation_order_color), ]), # script_formation_move_to_pos # Input: arg1: team_no, arg2:array_no, # arg3: pos1 = position to move formation to # Output: none ("formation_move_to_pos", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_no"), (set_fixed_point_multiplier, 100), (position_get_x, ":ref_x", pos1), (val_max, ":ref_x", "$battle_x_min"), (val_min, ":ref_x", "$battle_x_max"), (position_get_y, ":ref_y", pos1), (val_max, ":ref_y", "$battle_y_min"), (val_min, ":ref_y", "$battle_y_max"), (position_get_rotation_around_z, ":rotation", pos1), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_ref_x_pos), (party_set_slot, formation_vector, reg0, ":ref_x"), (val_add, reg0, 1), (party_set_slot, formation_vector, reg0, ":ref_y"), (val_add, reg0, 1), (party_set_slot, formation_vector, reg0, ":rotation"), ] ), # script_formation_move # Input: arg1: team_no, arg2: array_no, # arg3: x_offset, arg4: y_offset, -- both relative to ref_pos # Output: none ("formation_move", [(store_script_param, ":team_no", 1), (store_script_param, ":array_no", 2), (store_script_param, ":x_offset", 3), (store_script_param, ":y_offset", 4), (set_fixed_point_multiplier, 100), (convert_to_fixed_point, ":x_offset"), (convert_to_fixed_point, ":y_offset"), (init_position, pos10), (position_set_x, pos10, ":x_offset"), (position_set_y, pos10, ":y_offset"), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_ref_x_pos), (assign, ":slot", reg0), (init_position, pos9), (party_get_slot, ":ref_x", formation_vector, ":slot"), (position_set_x, pos9, ":ref_x"), (val_add, ":slot", 1), (party_get_slot, ":ref_y", formation_vector, ":slot"), (position_set_y, pos9, ":ref_y"), (val_add, ":slot", 1), (party_get_slot, ":rotation", formation_vector, ":slot"), (position_get_rotation_around_z, ":cur_rot", pos9), (val_sub, ":rotation", ":cur_rot"), (position_rotate_z, pos9, ":rotation"), (position_transform_position_to_parent, pos11, pos9, pos10), (position_get_x, ":new_x", pos11), (position_get_y, ":new_y", pos11), (try_begin), (gt, ":new_x", "$battle_x_max"), (assign, ":new_x", "$battle_x_max"), (else_try), (lt, ":new_x", "$battle_x_min"), (assign, ":new_x", "$battle_x_min"), (try_end), (try_begin), (gt, ":new_y", "$battle_y_max"), (assign, ":new_y", "$battle_y_max"), (else_try), (lt, ":new_y", "$battle_y_min"), (assign, ":new_y", "$battle_y_min"), (try_end), (val_sub, ":slot", 1), (party_set_slot, formation_vector, ":slot", ":new_y"), (val_sub, ":slot", 1), (party_set_slot, formation_vector, ":slot", ":new_x"), ]), # script_formation_turn_key_reaction # React to player key press # Input: arg1:rotation, arg3: turn name string id # Output: none ("formation_turn_key_reaction", [(store_script_param, ":rotation", 1), (store_script_param, ":turn_name", 2), (str_clear, s1), (get_player_agent_no, ":player"), (agent_get_team, ":team_no", ":player"), (assign, ":cnt", 0), (try_for_range_backwards, ":array_no", 0, formation_arrays), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", "$formation_array_selected"), (neq, ":mark", 0), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":array_selection", formation_vector, reg0), (val_and, ":mark", ":array_selection"), (neq, ":mark", 0), (store_add, ":formation_array_string", formation_array_names_begin, ":array_no"), (str_store_string, s2, ":formation_array_string"), (val_add, ":cnt", 1), (try_begin), (eq, ":cnt", 2), (str_store_string, s1, "@{s2} and {s1}"), (else_try), (str_store_string, s1, "@{s2}, {s1}"), (try_end), (call_script, "script_formation_turn", ":team_no", ":array_no", ":rotation"), (try_end), (try_begin), (eq, ":cnt", "$formation_max_array_no"), (str_store_string, s1, "@All battles, "), (try_end), (str_store_string, s2, ":turn_name"), (display_message, "@{s1}{s2}!!", formation_order_color), ]), # script_formation_turn # Input: arg1: team_no, arg2: array_no, # arg3: rotation # Output: none ("formation_turn", [(store_script_param, ":team_no", 1), (store_script_param, ":array_no", 2), (store_script_param, ":rotation", 3), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_ref_rotation), (party_get_slot, ":cur_rot", formation_vector, reg0), (val_add, ":cur_rot", ":rotation"), (party_set_slot, formation_vector, reg0, ":cur_rot"), ]), # script_formation_charge_key_reaction # Input: arg1: acceleration, arg2: order_string # Output: none ("formation_charge_key_reaction", [(store_script_param_1, ":acceleration"), (store_script_param_2, ":order"), (get_player_agent_no, ":player"), (agent_get_team, ":team_no", ":player"), (assign, ":cnt", 0), (str_clear, s1), (try_for_range_backwards, ":array_no", 0, formation_arrays), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", "$formation_array_selected"), (neq, ":mark", 0), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":in_formation", formation_vector, reg0), (val_and, ":mark", ":in_formation"), (neq, ":mark", 0), (store_add, ":formation_array_string", formation_array_names_begin, ":array_no"), (str_store_string, s2, ":formation_array_string"), (val_add, ":cnt", 1), (try_begin), (eq, ":cnt", 2), (str_store_string, s1, "@{s2} and {s1}"), (else_try), (str_store_string, s1, "@{s2}, {s1}"), (try_end), (try_begin), (eq, ":cnt", 1), (call_script, "script_formation_accelerate", ":team_no", ":array_no", ":acceleration"), (assign, ":speed", reg0), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states), (party_get_slot, ":charge_states", formation_vector, reg0), (val_and, ":charge_states", sfas_charge+sfas_fall_back+sfas_speed), (else_try), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states), (party_get_slot, ":array_states", formation_vector, reg0), (val_or, ":array_states", sfas_charge+sfas_fall_back+sfas_speed), (val_sub, ":array_states", sfas_charge+sfas_fall_back+sfas_speed), (val_add, ":array_states", ":charge_states"), (party_set_slot, formation_vector, reg0, ":array_states"), (try_end), (try_end), (try_begin), (eq, ":cnt", "$formation_max_array_no"), (str_store_string, s1, "@All battles, "), (try_end), (str_store_string, s2, ":order"), (val_and, ":charge_states", sfas_charge+sfas_fall_back), (try_begin), (eq, ":charge_states", 0), (display_message, "@{s1}halt!!", formation_order_color), (else_try), (assign, reg0, ":speed"), (eq, ":charge_states", sfas_charge), (display_message, "@{s1}charge!! (With speed {reg0} m/s)", formation_order_color), (else_try), (display_message, "@{s1}fall back!! (With speed {reg0} m/s", formation_order_color), (try_end), ], ), # script_formation_accelerate # Accelerate the speed of charging or falling back # Input: arg1: team_no, arg2: array_no, # arg3: acceleration in speed bits # Output: reg0: current speed ("formation_accelerate", [(store_script_param, ":team_no", 1), (store_script_param, ":array_no", 2), (store_script_param, ":acceleration", 3), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states), (party_get_slot, ":formation_states", formation_vector, reg0), (assign, ":slot", reg0), (assign, ":speed", 0), (assign, ":charge", 0), (assign, ":fall_back", 0), (assign, reg0, 0), (try_begin), (eq, ":acceleration", 0), # halt command (val_or, ":formation_states", sfas_charge+sfas_fall_back+sfas_speed), (val_sub, ":formation_states", sfas_charge+sfas_fall_back+sfas_speed), (else_try), (store_and, ":charge", ":formation_states", sfas_charge), (store_and, ":fall_back", ":formation_states", sfas_fall_back), (neq, ":charge", 0), (store_and, ":speed", ":formation_states", sfas_speed), (val_sub, ":formation_states", ":speed"), (val_mul, ":acceleration", sfas_speed_unit), (val_add, ":speed", ":acceleration"), (try_begin), (gt, ":speed", sfas_speed), (assign, ":speed", sfas_speed), (else_try), (eq, ":speed", 0), (val_sub, ":formation_states", sfas_charge), (try_end), (val_add, ":formation_states", ":speed"), (val_div, ":speed", sfas_speed_base), (assign, reg0, ":speed"), (else_try), (neq, ":fall_back", 0), (val_mul, ":acceleration", -sfas_speed_unit), (store_and, ":speed", ":formation_states", sfas_speed), (val_sub, ":formation_states", ":speed"), (val_add, ":speed", ":acceleration"), (try_begin), (gt, ":speed", sfas_speed), (assign, ":speed", sfas_speed), (else_try), (eq, ":speed", 0), (val_sub, ":formation_states", sfas_fall_back), (try_end), (val_add, ":formation_states", ":speed"), (val_div, ":speed", sfas_speed_base), (assign, reg0, ":speed"), (else_try), (try_begin), (gt, ":acceleration", 0), (val_add, ":formation_states", sfas_charge+sfas_speed_unit), (else_try), (val_add, ":formation_states", sfas_fall_back+sfas_speed_unit), (try_end), (store_div, reg0, sfas_speed_unit, sfas_speed_base), (try_end), (party_set_slot, formation_vector, ":slot", ":formation_states"), #(store_and, ":speed", ":formation_states", sfas_speed), #(val_div, ":speed", sfas_speed_base), #(set_fixed_point_multiplier, 100), #(convert_to_fixed_point, ":speed"), #(store_mul, ":speed_slot", ":team_no", formation_arrays*2), #(val_add, ":speed_slot", ":array_no"), #(val_add, ":speed_slot", formation_arrays), #(party_set_slot, formation_temp_vector, ":speed_slot", ":speed"), ]), # script_formation_density_key_reaction # Script that reacts to density key # Input: arg1: option - -1 stand closer, 1 spread out # arg2: order_name # Output: none ("formation_density_key_reaction", [(store_script_param, ":option", 1), (store_script_param, ":order_name", 2), (get_player_agent_no, ":player"), (agent_get_team, ":team_no", ":player"), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":array_selection", formation_vector, reg0), (val_and, ":array_selection", "$formation_array_selected"), (call_script, "script_formation_density_change", ":team_no", ":array_selection", ":option"), (str_clear, s1), (assign, ":cnt", 0), (try_for_range_backwards, ":array_no", 0, formation_arrays), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", ":array_selection"), (neq, ":mark", 0), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":in_formation", formation_vector, reg0), (val_and, ":mark", ":in_formation"), (neq, ":mark", 0), (store_add, ":array_name", formation_array_names_begin, ":array_no"), (str_store_string, s2, ":array_name"), (val_add, ":cnt", 1), (try_begin), (eq, ":cnt", 2), (str_store_string, s1, "@{s2} and {s1}"), (else_try), (str_store_string, s1, "@{s2}, {s1}"), (try_end), (try_end), (try_begin), (eq, ":cnt", "$formation_max_array_no"), (str_store_string, s1, "@All battles, "), (try_end), (str_store_string, s2, ":order_name"), (display_message, "@{s1}{s2}!!", formation_order_color), ] ), # script_formation_density_change # Script changes the tightness of the formation # Input: arg1: team_no, arg2: array_selection # arg3: option - -1 stand closer, 1 spread out # Output: none ("formation_density_change", [(store_script_param, ":team_no", 1), (store_script_param, ":array_selection", 2), (store_script_param, ":option", 3), # calculate ratio to change density of all arrays selected (try_for_range, ":array_no", 0, formation_arrays), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", ":array_selection"), (neq, ":mark", 0), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states), (assign, ":slot", reg0), (party_get_slot, ":states", formation_vector, ":slot"), (assign, ":density", 0), (store_and, ":density", ":states", sfas_formation_density), (store_div, ":cur_ratio", ":density", sfas_density_unit), (store_add, ":density", ":cur_ratio", ":option"), (val_add, ":cur_ratio", 1), (store_add, ":new_ratio", ":cur_ratio", ":option"), # set the temporary vector to store density change ratios (try_begin), (store_mul, ":tmp_ratio_pt", ":team_no", formation_arrays), (val_add, ":tmp_ratio_pt", slot_formation_tmp_density), (val_add, ":tmp_ratio_pt", ":array_no"), (ge, ":density", 0), (le, ":density", 3), # out of boundary, no change (store_mul, ":change", ":option", sfas_density_unit), (val_add, ":states", ":change"), (party_set_slot, formation_vector, ":slot", ":states"), (store_mul, ":ratio", ":new_ratio", sftd_ratio_base), (val_div, ":ratio", ":cur_ratio"), (party_set_slot, formation_temp_vector, ":tmp_ratio_pt", ":ratio"), (else_try), (party_set_slot, formation_temp_vector, ":tmp_ratio_pt", sftd_ratio_base), (try_end), (try_end), (get_player_agent_no, ":player"), (try_for_agents, ":agent"), (neq, ":agent", ":player"), (agent_get_team, ":agent_team", ":agent"), (eq, ":team_no", ":agent_team"), (agent_get_slot, ":array_no", ":agent", slot_agent_formation_states), (val_and, ":array_no", safs_array_no), (val_add, ":array_no", slot_formation_array_marks_begin), (party_get_slot, ":mark", formation_vector, ":array_no"), (val_and, ":mark", ":array_selection"), (neq, ":mark", 0), (agent_get_slot, ":x_pos", ":agent", slot_agent_formation_x_pos), (agent_get_slot, ":y_pos", ":agent", slot_agent_formation_y_pos), (store_mul, ":tmp_ratio_pt", ":team_no", formation_arrays), (val_add, ":tmp_ratio_pt", slot_formation_tmp_density), (val_add, ":tmp_ratio_pt", ":array_no"), (party_get_slot, ":ratio", formation_temp_vector, ":tmp_ratio_pt"), (val_mul, ":x_pos", ":ratio"), (val_div, ":x_pos", sftd_ratio_base), (val_mul, ":y_pos", ":ratio"), (val_div, ":y_pos", sftd_ratio_base), (agent_set_slot, ":agent", slot_agent_formation_x_pos, ":x_pos"), (agent_set_slot, ":agent", slot_agent_formation_y_pos, ":y_pos"), (try_end), ] ), # script_calculate_formation_row # Script calculates line positions relative to ref_pos. # Internal function commonly used by line, phalanx, wedge and square formations # Input: arg1: team_no, arg2: array_no, # arg3: column_width - in centimeters, # arg4: width - in number of men, # arg5: row_width - distance between rows in centimetres # arg6: inc - to increase line width by row or not (for wedge) # Output: none ("calculate_formation_row", [(store_script_param, ":team_no", 1), (store_script_param, ":array_no", 2), #(team_get_leader, ":leader", "team_no"), (store_script_param, ":column_width", 3), #(assign, ":column_width", 50), (store_script_param, ":width", 4), (store_script_param, ":row_width", 5), (store_script_param, ":inc", 6), (set_fixed_point_multiplier, 100), (assign, ":dist", 0), (assign, ":step", 0), (try_begin), (store_mod, ":odd", ":width", 2), (eq, ":odd", 0), (store_div, ":offset", ":column_width", 2), (else_try), (assign, ":offset", 0), (try_end), (assign, ":dir", 1), (assign, ":num", 0), (get_player_agent_no, ":player"), (try_for_agents, ":agent"), (neq, ":agent", ":player"), (agent_get_team, ":agent_team", ":agent"), (eq, ":agent_team", ":team_no"), #(agent_is_ally, ":agent"), (agent_is_alive, ":agent"), (agent_is_human, ":agent"), # Make sure the agent is not in another line (agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states), (assign, ":agent_array", 0), (store_and, ":agent_array", ":formation_states", safs_array_no), (eq, ":agent_array", ":array_no"), (try_begin), (eq, ":width", ":num"), (val_sub, ":dist", ":row_width"), (assign, ":num", 0), (val_add, ":width", ":inc"), (assign, ":step", 0), (try_begin), (store_mod, ":odd", ":width", 2), (eq, ":odd", 0), (store_div, ":offset", ":column_width", 2), (else_try), (assign, ":offset", 0), (try_end), (assign, ":dir", 1), (try_end), (assign, ":in_formation", 0), (store_and, ":in_formation", ":formation_states", safs_in_formation), (eq, ":in_formation", 0), (store_mul, ":move", ":step", ":dir"), (val_add, ":offset", ":move"), (agent_set_slot, ":agent", slot_agent_formation_x_pos, ":offset"), (agent_set_slot, ":agent", slot_agent_formation_y_pos, ":dist"), # Make sure other lines don't include this agent (val_or, ":formation_states", safs_in_formation), (agent_set_slot, ":agent", slot_agent_formation_states, ":formation_states"), (val_add, ":step", ":column_width"), (val_mul, ":dir", -1), (val_add, ":num", 1), (try_end), ]), # script_formation_follow_key_reaction # Script called when follow key is clicked # Input: none # Output: none ("formation_follow_key_reaction", [ (val_or, "$formation_arrays_follow", "$formation_array_selected"), (str_clear, s1), (assign, ":cnt", 0), (try_for_range_backwards, ":array_no", 0, formation_arrays), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", "$formation_array_selected"), (neq, ":mark", 0), (store_add, ":array_string", formation_array_names_begin, ":array_no"), (str_store_string, s2, ":array_string"), (val_add, ":cnt", 1), (try_begin), (eq, ":cnt", 2), (str_store_string, s1, "@{s2} and {s1}"), (else_try), (str_store_string, s1, "@{s2}, {s1}"), (try_end), (try_end), (try_begin), (eq, ":cnt", "$formation_max_array_no"), (str_store_string, s1, "@All battles, "), (try_end), (display_message, "@{s1}follow me!!", formation_order_color), ] ), # script_formation_move_to_pos_key_reaction # Script called when move to position key is clicked # Input: arg1: pos1 = destination, arg2: show_messages # Output: none ("formation_move_to_pos_key_reaction", [(set_fixed_point_multiplier, 100), (store_script_param_1, ":show_messages"), (get_player_agent_no, ":player"), (agent_get_team, ":team_no", ":player"), (init_position, pos2), (copy_position, pos3, pos1), #(position_copy_rotation, pos2, pos1), (assign, ":pre1", 0), (assign, ":pre2", 0), (assign, ":cnt", 0), (try_for_range, ":array_no", 0, formation_arrays), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", "$formation_array_selected"), (neq, ":mark", 0), (val_add, ":cnt", 1), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":in_formation", formation_vector, reg0), (val_and, ":mark", ":in_formation"), (neq, ":mark", 0), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_num_of_men), (party_get_slot, ":num_of_men", formation_vector, reg0), (store_mul, ":width", ":num_of_men", sfas_density_base), (val_div, ":width", 4), # Just some estimated number that could well separate different arrays but not too dispersal (try_begin), (neq, ":cnt", 1), (position_move_x, pos2, ":width", 1), (position_move_x, pos2, ":pre2", 1), (position_move_x, pos2, 75, 1), # one metre boundaries (position_rotate_z, pos3, 180), (position_rotate_z, pos2, 180), (try_end), (position_transform_position_to_parent, pos1, pos3, pos2), #(position_copy_rotation, pos1, pos2), (position_copy_origin, pos3, pos1), (call_script, "script_formation_move_to_pos", ":team_no", ":array_no"), (assign, ":pre2", ":pre1"), (assign, ":pre1", ":width"), (try_end), (str_clear, s1), (assign, ":cnt", 0), (try_for_range_backwards, ":array_no", 0, formation_arrays), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", "$formation_array_selected"), (neq, ":mark", 0), (store_add, ":array_string", formation_array_names_begin, ":array_no"), (str_store_string, s2, ":array_string"), (val_add, ":cnt", 1), (try_begin), (eq, ":cnt", 2), (str_store_string, s1, "@{s2} and {s1}"), (else_try), (str_store_string, s1, "@{s2}, {s1}"), (try_end), (try_end), (try_begin), (eq, ":cnt", "$formation_max_array_no"), (str_store_string, s1, "@All battles, "), (try_end), (try_begin), (neq, ":show_messages", 0), (display_message, "@{s1}hold this position!!", formation_order_color), (try_end), ] ), # script_apply_formation_key_reaction # Script called when apply formation key is clicked # Input: arg1: formation_type # Output: none ("apply_formation_key_reaction", [(store_script_param_1, ":formation_type"), (get_player_agent_no, ":player"), (agent_get_team, ":team_no", ":player"), (assign, ":pl", 0), (str_clear, s1), (try_for_range_backwards, ":array_no", 0, formation_arrays), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", "$formation_array_selected"), (neq, ":mark", 0), (store_add, ":formation_array_string", formation_array_names_begin, ":array_no"), (str_store_string, s2, ":formation_array_string"), (val_add, ":pl", 1), (try_begin), (eq, ":pl", 2), (str_store_string, s1, "@{s2} and {s1}"), (else_try), (str_store_string, s1, "@{s2}, {s1}"), (try_end), (call_script, "script_cf_apply_formation", ":team_no", ":array_no", ":formation_type"), (try_end), (try_begin), (eq, ":pl", "$formation_max_array_no"), (str_store_string, s1, "@All battles, "), (try_end), (try_begin), (gt, ":pl", 1), (store_add, ":formation_string", formation_commands_pl_begin, ":formation_type"), (str_store_string, s2, ":formation_string"), (else_try), (store_add, ":formation_string", formation_commands_begin, ":formation_type"), (str_store_string, s2, ":formation_string"), (try_end), (display_message, "@{s1}form {s2}!"), ] ), # script_formation_auto_rotation_key_reaction # Script called when auto rotation key clicked # Input: arg1: value - 1 = on, 0 = off, -1 = toggle # Output: none ("formation_auto_rotation_key_reaction", [(store_script_param_1, ":result"), (get_player_agent_no, ":player"), (agent_get_team, ":team_no", ":player"), (str_clear, s1), (assign, ":cnt", 0), (try_for_range_backwards, ":array_no", 0, formation_arrays), (store_add, ":mark", ":array_no", slot_formation_array_marks_begin), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", "$formation_array_selected"), (neq, ":mark", 0), (party_get_slot, ":in_formation", formation_vector, ":array_no"), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":array_selection", formation_vector, reg0), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states), (party_get_slot, ":formation_states", formation_vector, reg0), (assign, ":auto_rotation", 0), (val_and, ":in_formation", ":array_selection"), (store_and, ":auto_rotation", ":formation_states", sfas_auto_rotate), (store_add, ":array_string", formation_array_names_begin, ":array_no"), (str_store_string, s2, ":array_string"), (val_add, ":cnt", 1), (try_begin), (eq, ":cnt", 2), (str_store_string, s1, "@{s2} and {s1}"), (else_try), (str_store_string, s1, "@{s2}, {s1}"), (try_end), (try_begin), (eq, ":result", -1), (val_or, ":formation_states", sfas_auto_rotate), (try_begin), (eq, ":auto_rotation", 0), (assign, ":result", 1), (else_try), (val_sub, ":formation_states", sfas_auto_rotate), (assign, ":result", 0), (try_end), (else_try), (eq, ":result", 1), (val_or, ":formation_states", sfas_auto_rotate), (else_try), (val_or, ":formation_states", sfas_auto_rotate), (val_sub, ":formation_states", sfas_auto_rotate), (try_end), (party_set_slot, formation_vector, reg0, ":formation_states"), (try_end), (try_begin), (eq, ":cnt", "$formation_max_array_no"), (str_store_string, s1, "@All battles, "), (try_end), (try_begin), (eq, ":result", 1), (display_message, "@{s1}turn to enemies' direction!", formation_order_color), (else_try), (display_message, "@{s1}stick to current direction!", formation_order_color), (try_end), ] ), # script_formation_tactical_charge_key_reaction # Script called when tactical charge key clicked # Input: none # Output: none ("formation_tactical_charge_key_reaction", [(get_player_agent_no, ":player"), (agent_get_team, ":team_no", ":player"), (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":array_selection", formation_vector, reg0), (val_and, ":array_selection", "$formation_array_selected"), (str_clear, s1), (assign, ":cnt", 0), (assign, ":result", -1), (try_for_range_backwards, ":array_no", 0, formation_arrays), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", ":array_selection"), (neq, ":mark", 0), (val_add, ":cnt", 1), (store_add, ":array_string", formation_array_names_begin, ":array_no"), (str_store_string, s2, ":array_string"), (try_begin), (eq, ":cnt", 2), (str_store_string, s1, "@{s2} and {s1}"), (else_try), (str_store_string, s1, "@{s2}, {s1}"), (try_end), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states), (party_get_slot, ":array_states", formation_vector, reg0), (try_begin), (eq, ":cnt", 1), (store_and, ":result", ":array_states", sfas_tactical_charge), (store_sub, ":result", sfas_tactical_charge, ":result"), (try_end), (val_or, ":array_states", sfas_tactical_charge), (val_sub, ":array_states", sfas_tactical_charge), (val_add, ":array_states", ":result"), (party_set_slot, formation_vector, reg0, ":array_states"), (try_end), (try_begin), (eq, ":cnt", "$formation_max_array_no"), (str_store_string, s1, "@All battles, "), (try_end), (try_begin), (neq, ":result", 0), (display_message, "@{s1}charge!!(Tactical)", formation_order_color), (else_try), (display_message, "@{s1}stop charging!!", formation_order_color), (try_end), ] ), # script_formation_dismiss_key_reacion # Script called when dismiss key clicked # Input: none # Output: none ("formation_dismiss_key_reaction", [(str_clear, s1), (assign, ":cnt", 0), (try_for_range_backwards, ":array_no", 0, formation_arrays), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (val_and, ":mark", "$formation_array_selected"), (neq, ":mark", 0), (store_add, ":array_string", ":array_no", formation_array_names_begin), (str_store_string, s2, ":array_string"), (val_add, ":cnt", 1), (try_begin), (eq, ":cnt", 2), (str_store_string, s1, "@{s2} and {s1}"), (else_try), (str_store_string, s1, "@{s2}, {s1}"), (try_end), (try_end), (try_begin), (eq, ":cnt", "$formation_max_array_no"), (str_store_string, s1, "@All battles, "), (try_end), (display_message, "@{s1}dismiss formation!!", formation_order_color), (get_player_agent_no, ":player"), (agent_get_team, ":team_no", ":player"), (call_script, "script_dismiss_battle_array", ":team_no", "$formation_array_selected"), ] ), # script_formation_clean_up # Script that's called by the end of mission # Input: none # Output: none ("formation_clean_up", [(get_player_agent_no, ":player"), (agent_get_team, ":team_no", ":player"), (call_script, "script_dismiss_battle_array", ":team_no", "$formation_all_arrays"), (assign, "$formation_vector_active", 0), (remove_party, formation_vector), (remove_party, formation_temp_vector), ]), # script_get_closest_distance_of_enemy_at_pos1 # Find an enemy standing closest to the center of enemies # Input: arg1: team_no, arg2: pos1, arg3: ex_class - one class to be excluded # Output: reg0 - distance to the closest enemy in cms, pos2 - closest enemy position ("get_closest_distance_of_enemy_at_pos1", [(store_script_param_1, ":team_no"), (store_script_param_2, ":ex_class"), (set_fixed_point_multiplier, 100), (assign, reg0, 100000), (try_for_agents, ":agent"), (agent_is_alive, ":agent"), (agent_is_human, ":agent"), (agent_get_team, ":agent_team", ":agent"), (teams_are_enemies, ":team_no", ":agent_team"), (agent_get_class, ":agent_class", ":agent"), (neq, ":agent_class", ":ex_class"), (agent_get_position, pos2, ":agent"), (get_distance_between_positions, ":dist", pos1, pos2), (lt, ":dist", reg0), (assign, reg0, ":dist"), (copy_position, pos3, pos2), (try_end), (copy_position, pos2, pos3), ] ), # script_formation_tactical_charge_generic # Infantry formations can use this as tactical charge script # Input: arg1: team_no, arg2: array_no, # Output: none ("formation_tactical_charge_generic", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_no"), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", 0), (assign, ":slot", reg0), (store_add, reg0, ":slot", slot_formation_array_ref_x_pos), (party_get_slot, ":ref_x", formation_vector, reg0), (store_add, reg0, ":slot", slot_formation_array_ref_y_pos), (party_get_slot, ":ref_y", formation_vector, reg0), (store_add, reg0, ":slot", slot_formation_array_ref_rotation), (party_get_slot, ":rotation", formation_vector, reg0), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, ":ref_x"), (position_set_y, pos1, ":ref_y"), (position_rotate_z, pos1, ":rotation"), (position_set_z_to_ground_level, pos1), (copy_position, pos4, pos1), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (assign, ":no_infantry", 0), (assign, ":charge_speed", 2), (try_begin), (call_script, "script_cf_calculate_enemy_infantry_centroid", ":team_no"), (copy_position, pos2, pos4), # Get distance from enemy infantry, turn formation toward enemy infantry (get_distance_between_positions, ":dist", pos1, pos2), (try_begin), (position_is_behind_position, pos1, pos2), (position_rotate_z, pos2, 180), #debug_point, (try_end), (position_transform_position_to_local, pos3, pos2, pos1), (set_fixed_point_multiplier, 100), (position_get_x, ":pos_x", pos3), (position_get_y, ":pos_y", pos3), #(position_get_x, reg1, pos3), #(position_get_y, reg2, pos3), #(display_message, "@Rel pos: {reg1}, {reg2}", formation_debug_color), (convert_from_fixed_point, ":pos_y"), (try_begin), (neq, ":pos_y", 0), (store_div, ":tan", ":pos_x", ":pos_y"), (call_script, "script_arctan", ":tan"), (else_try), (gt, ":pos_x", 0), (assign, reg0, 90), (else_try), (assign, reg0, -89), (try_end), (val_mul, reg0, -1), (position_rotate_z, pos2, reg0), (position_get_rotation_around_z, ":rotation", pos2), (store_add, reg0, ":slot", slot_formation_array_ref_rotation), (party_set_slot, formation_vector, reg0, ":rotation"), (else_try), (assign, ":dist", 10000), (assign, ":no_infantry", 1), (try_end), (try_begin), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states), (party_get_slot, ":array_states", formation_vector, reg0), (assign, ":density", 0), (store_and, ":density", ":array_states", sfas_formation_density), (val_div, ":density", sfas_density_unit), (lt, ":dist", 300), # infantry in melee (store_sub, ":density", 1, ":density"), (try_begin), (neq, ":density", 0), (call_script, "script_formation_density_change", ":team_no", ":mark", ":density"), (try_end), (else_try), (store_sub, ":density", 0, ":density"), (neq, ":density", 0), (call_script, "script_formation_density_change", ":team_no", ":mark", ":density"), (try_end), (copy_position, pos1, pos2), (call_script, "script_get_closest_distance_of_enemy_at_pos1", ":team_no", -1), (set_fixed_point_multiplier, 100), (try_begin), #(gt, reg0, 300), (lt, reg0, 1000), (this_or_next|position_is_behind_position, pos2, pos1), (lt, reg0, 100), # change formation to engaged stage (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states), (party_get_slot, ":array_states", formation_vector, reg0), (val_or, ":array_states", sfas_engaged), (party_set_slot, formation_vector, reg0, ":array_states"), (assign, ":no_infantry", 1), (eq, 0, 1), (else_try), (eq, ":no_infantry", 1), # stop march (call_script, "script_formation_accelerate", ":team_no", ":array_no", 0), (else_try), # march with a speed of 2m/s (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states), (party_get_slot, ":array_states", formation_vector, reg0), (val_or, ":array_states", sfas_engaged), (val_sub, ":array_states", sfas_engaged), #(val_or, ":array_states", sfas_auto_rotate), (party_set_slot, formation_vector, reg0, ":array_states"), (assign, ":speed", 0), (assign, ":fall_back", 0), (store_and, ":speed", ":array_states", sfas_speed), (store_and, ":fall_back", ":array_states", sfas_fall_back), (val_div, ":speed", sfas_speed_unit), (try_begin), (lt, ":dist", 1500), # enemy close, charge!! (assign, ":charge_speed", 3), (try_end), (try_begin), (this_or_next|neq, ":fall_back", 0), (lt, ":speed", ":charge_speed"), (call_script, "script_formation_accelerate", ":team_no", ":array_no", 1), (else_try), (gt, ":speed", ":charge_speed"), (call_script, "script_formation_accelerate", ":team_no", ":array_no", -1), (try_end), (try_end), ] ), # script_cf_calculate_enemy_infantry_centroid # Input: arg1: team_no # Output: pos1 = Centroid ("cf_calculate_enemy_infantry_centroid", [(store_script_param_1, ":team_no"), (set_fixed_point_multiplier, 100), (init_position, pos1), (assign, ":acc_x", 0), (assign, ":acc_y", 0), (assign, ":cnt", 0), (try_for_agents, ":agent"), (agent_is_alive, ":agent"), (agent_is_human, ":agent"), (agent_get_team, ":agent_team", ":agent"), (teams_are_enemies, ":team_no", ":agent_team"), (agent_get_class, ":class", ":agent"), (neq, ":class", grc_cavalry), (agent_get_position, pos2, ":agent"), (position_get_x, ":pos_x", pos2), (position_get_y, ":pos_y", pos2), (val_add, ":acc_x", ":pos_x"), (val_add, ":acc_y", ":pos_y"), (val_add, ":cnt", 1), (try_end), (neq, ":cnt", 0), (val_div, ":acc_x", ":cnt"), (val_div, ":acc_y", ":cnt"), (position_set_x, pos1, ":acc_x"), (position_set_y, pos1, ":acc_y"), (assign, ":min", -1), (try_for_agents, ":agent"), (agent_is_alive, ":agent"), (agent_is_human, ":agent"), (agent_get_team, ":agent_team", ":agent"), (teams_are_enemies, ":team_no", ":agent_team"), (agent_get_class, ":class", ":agent"), (neq, ":class", grc_cavalry), (agent_get_position, pos2, ":agent"), (get_distance_between_positions, ":dist", pos1, pos2), (try_begin), (this_or_next|eq, ":min", -1), (lt, ":dist", ":min"), (assign, ":min", ":dist"), (copy_position, pos3, pos2), (try_end), (try_end), (copy_position, pos1, pos3), ] ), # script_get_square_distance_between_positions # Used for script_cf_calculate_enemy_infantry_clustering # Calculate distance between centroids of two clusters, in square meters # Input: arg1: pos_no_1, arg2: pos_no_2 # Output: reg0 - square of distance ("get_square_distance_between_positions", [(store_script_param_1, ":pos_no_1"), (store_script_param_2, ":pos_no_2"), (set_fixed_point_multiplier, 1), (position_get_x, ":pos_x_1", ":pos_no_1"), (position_get_y, ":pos_y_1", ":pos_no_1"), (position_get_x, ":pos_x_2", ":pos_no_2"), (position_get_y, ":pos_y_2", ":pos_no_2"), (store_sub, reg0, ":pos_x_1", ":pos_x_2"), (store_mul, reg0, reg0, reg0), (store_sub, ":tmp", ":pos_y_1", ":pos_y_2"), (store_mul, ":tmp", ":tmp", ":tmp"), (val_add, reg0, ":tmp"), (set_fixed_point_multiplier, 100), ] ), # script_calculate_enemy_infantry_clustering # Calculates clustering of enemy infantry and find a sparse cluster # Use slot_agent_formation_alg_cell_1 to store cluster no of agent during calculation # Use slot_agent_formation_alg_cell_2 to store cluster no of agent for optimal clustering # Use pos10 - pos20 to store all _centroids of clusters # Use formation_temp_vector starting from slot_formation_tmp_alg_stat_begin to store # cluster size and average square Euclidian distance of clusters # Input: arg1: team_no, arg2: threshold, marking when to stop joining clusters # Output: pos1: sparse cluster centroid # reg0: total count of enemies ("calculate_enemy_infantry_clustering", [(store_script_param_1, ":team_no"), (set_fixed_point_multiplier, 100), (assign, ":prev_RSS", -1), #debug_point, # Try cluster number from 1 to 9 (assign, ":RSS", -1), # Residual sum of squares (assign, ":prev_k", 0), (assign, ":num", 0), (assign, ":max_cluster", 10), (try_for_range, ":k", 1, ":max_cluster"), (assign, ":continue_1", 0), (try_for_range, ":i", 0, 4), # Try few times of clustering, now 4 # Randomly assign agents to initial clusters (try_for_agents, ":agent"), (agent_is_human, ":agent"), (agent_is_alive, ":agent"), (agent_get_team, ":agent_team", ":agent"), (teams_are_enemies, ":team_no", ":agent_team"), (agent_get_class, ":class", ":agent"), (neq, ":class", grc_cavalry), (store_random_in_range, ":cluster", 0, ":k"), (agent_set_slot, ":agent", slot_agent_formation_alg_cell_1, ":cluster"), (try_end), (assign, ":max_trial", 50), # maximal 50 trials of reassignment (assign, ":continue", 1), (try_for_range, ":j", 0, ":max_trial"), # Initialization # Use pos10 - pos20 to store all centroids of clusters # Use formation_temp_vector to store cluster size (try_for_range, ":cluster", 0, ":k"), (store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin), (party_set_slot, formation_temp_vector, ":slot", 0), (store_add, ":centroid", ":cluster", 10), (init_position, ":centroid"), (position_set_x, ":centroid", 0), (position_set_y, ":centroid", 0), (try_end), (try_for_agents, ":agent"), (agent_is_human, ":agent"), (agent_is_alive, ":agent"), (agent_get_team, ":agent_team", ":agent"), (teams_are_enemies, ":team_no", ":agent_team"), (agent_get_class, ":class", ":agent"), (neq, ":class", grc_cavalry), (agent_get_slot, ":cluster", ":agent", slot_agent_formation_alg_cell_1), (store_add, ":centroid", ":cluster", 10), (agent_get_position, pos1, ":agent"), (position_transform_position_to_parent, pos3, ":centroid", pos1), # update centroid (position_copy_origin, ":centroid", pos3), (store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin), (party_get_slot, ":size", formation_temp_vector, ":slot"), (val_add, ":size", 1), (party_set_slot, formation_temp_vector, ":slot", ":size"), # update size (try_end), (try_for_range, ":cluster", 0, ":k"), (store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin), (party_get_slot, ":size", formation_temp_vector, ":slot"), (store_add, ":centroid", ":cluster", 10), (position_get_x, ":pos_x", ":centroid"), (position_get_y, ":pos_y", ":centroid"), (val_div, ":pos_x", ":size"), (val_div, ":pos_y", ":size"), (position_set_x, ":centroid", ":pos_x"), (position_set_y, ":centroid", ":pos_y"), (try_end), (eq, ":continue", 1), (assign, ":continue", 0), # Reassign agents to clusters (try_for_agents, ":agent"), (agent_is_human, ":agent"), (agent_is_alive, ":agent"), (agent_get_team, ":agent_team", ":agent"), (teams_are_enemies, ":team_no", ":agent_team"), (agent_get_class, ":class", ":agent"), (neq, ":class", grc_cavalry), (agent_get_position, pos1, ":agent"), (assign, ":min", -1), (agent_get_slot, ":old_cluster", ":agent", slot_agent_formation_alg_cell_1), (try_for_range, ":cluster", 0, ":k"), (store_add, ":centroid", ":cluster", 10), (call_script, "script_get_square_distance_between_positions", ":centroid", pos1), (assign, ":dist", reg0), (this_or_next|eq, ":min", -1), (lt, ":dist", ":min"), (assign, ":min", ":dist"), (agent_set_slot, ":agent", slot_agent_formation_alg_cell_1, ":cluster"), (try_end), (neg|agent_slot_eq, ":agent", slot_agent_formation_alg_cell_1, ":old_cluster"), (assign, ":continue", 1), (try_end), (else_try), #debug_point, (assign, ":max_trial", 0), # clusters fixed, break (try_end), # Calculate current RSS (assign, ":new_RSS", 0), (try_for_agents, ":agent"), (agent_is_human, ":agent"), (agent_is_alive, ":agent"), (agent_get_team, ":agent_team", ":agent"), (teams_are_enemies, ":team_no", ":agent_team"), (agent_get_class, ":class", ":agent"), (neq, ":class", grc_cavalry), (agent_get_position, pos1, ":agent"), (agent_get_slot, ":cluster", ":agent", slot_agent_formation_alg_cell_1), (store_add, ":centroid", ":cluster", 10), (call_script, "script_get_square_distance_between_positions", pos1, ":centroid"), (val_add, ":new_RSS", reg0), (try_end), (assign, ":continue", 1), (try_for_range, ":cluster", 0, ":k"), (store_add, ":centroid", ":cluster", 10), #(position_get_x, reg1, ":centroid"), #(position_get_y, reg2, ":centroid"), #(assign, reg3, ":cluster"), #(display_message, "@Centroid of {reg3}: ({reg1}, {reg2})", formation_debug_color), (store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin), (party_slot_eq, formation_temp_vector, ":slot", 0), # contains empty cluster, invalid partition (assign, ":continue", 0), (try_end), (eq, ":continue", 1), (store_mul, ":tmp", 800, ":prev_k"), # here 800 should be an empirical value (store_add, ":tmp", ":RSS", ":tmp"), (store_mul, ":tmp_1", 800, ":k"), (store_add, ":tmp_1", ":new_RSS", ":tmp_1"), #(assign, reg1, ":RSS"), #(assign, reg2, ":new_RSS"), #(display_message, "@before: {reg1} after: {reg2}", formation_debug_color), (this_or_next|eq, ":RSS", -1), (gt, ":tmp", ":tmp_1"), #debug_point, (assign, ":RSS", ":new_RSS"), (assign, ":prev_k", ":k"), (assign, ":continue_1", 1), # Store current partition (try_for_agents, ":agent"), (agent_is_human, ":agent"), (agent_is_alive, ":agent"), (agent_get_team, ":agent_team", ":agent"), (teams_are_enemies, ":team_no", ":agent_team"), (agent_get_class, ":class", ":agent"), (neq, ":class", grc_cavalry), (agent_get_slot, ":cluster", ":agent", slot_agent_formation_alg_cell_1), (agent_set_slot, ":agent", slot_agent_formation_alg_cell_2, ":cluster"), (try_end), (try_end), (eq, ":continue_1", 1), #debug_point, (else_try), (assign, ":max_cluster", 0), (try_end), # find one cluster most sparse (try_for_range, ":i", 0, ":prev_k"), (store_add, ":slot", ":i", slot_formation_tmp_alg_stat_begin), (party_set_slot, formation_temp_vector, ":slot", 0), (val_add, ":slot", 10), (party_set_slot, formation_temp_vector, ":slot", 0), # accumulated square distance (store_add, ":centroid", ":i", 10), (init_position, ":centroid"), (position_set_x, ":centroid", 0), (position_set_y, ":centroid", 0), (try_end), (try_for_agents, ":agent"), (agent_is_human, ":agent"), (agent_is_alive, ":agent"), (agent_get_team, ":agent_team", ":agent"), (teams_are_enemies, ":team_no", ":agent_team"), (agent_get_class, ":class", ":agent"), (neq, ":class", grc_cavalry), (agent_get_slot, ":cluster", ":agent", slot_agent_formation_alg_cell_2), (store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin), (party_get_slot, ":stat", formation_temp_vector, ":slot"), (val_add, ":stat", 1), (party_set_slot, formation_temp_vector, ":slot", ":stat"), (store_add, ":centroid", ":cluster", 10), (agent_get_position, pos1, ":agent"), (position_transform_position_to_parent, pos3, ":centroid", pos1), (position_copy_origin, ":centroid", pos3), (try_end), (try_for_range, ":i", 0, ":prev_k"), (store_add, ":slot", ":i", slot_formation_tmp_alg_stat_begin), (party_get_slot, ":size", formation_temp_vector, ":slot"), (store_add, ":centroid", ":i", 10), (position_get_x, ":pos_x", ":centroid"), (position_get_y, ":pos_y", ":centroid"), (val_div, ":pos_x", ":size"), (val_div, ":pos_y", ":size"), (position_set_x, ":centroid", ":pos_x"), (position_set_y, ":centroid", ":pos_y"), (try_end), (try_for_agents, ":agent"), (agent_is_human, ":agent"), (agent_is_alive, ":agent"), (agent_get_team, ":agent_team", ":agent"), (teams_are_enemies, ":team_no", ":agent_team"), (agent_get_class, ":class", ":agent"), (neq, ":class", grc_cavalry), (agent_get_position, pos1, ":agent"), (agent_get_slot, ":cluster", ":agent", slot_agent_formation_alg_cell_2), (store_add, ":centroid", ":cluster", 10), (call_script, "script_get_square_distance_between_positions", pos1, ":centroid"), (store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin), (party_get_slot, ":size", formation_temp_vector, ":slot"), (val_add, ":slot", 10), (party_get_slot, ":stat", formation_temp_vector, ":slot"), (val_div, reg0, ":size"), (val_add, ":stat", reg0), (party_set_slot, formation_temp_vector, ":slot", ":stat"), (val_add, ":num", 1), (try_end), (assign, ":max", -1), (try_for_range, ":cluster", 0, ":prev_k"), (store_add, ":centroid", ":cluster", 10), (store_add, ":slot", ":cluster", slot_formation_tmp_alg_stat_begin+10), (party_get_slot, ":sqdist", formation_temp_vector, ":slot"), (this_or_next|eq, ":max", -1), (gt, ":sqdist", ":max"), (assign, ":max", ":sqdist"), (copy_position, pos1, ":centroid"), (try_end), #(position_get_x, reg1, pos1), #(position_get_y, reg2, pos1), #(display_message, "@Selected cluster: ({reg1}, {reg2})", formation_debug_color), (assign, reg0, ":num"), ] ), # script_cf_calculate_enemy_infantry_linear_regression_pos # Model enmey cluster as a line segment and find the estimation # Input: arg1: team_no # Output: pos1 = Middle point of the line segment, reg0 = number of enemies ("cf_calculate_enemy_infantry_linear_regression_pos", [(store_script_param_1, ":team_no"), (set_fixed_point_multiplier, 100), (init_position, pos1), (assign, ":acc_x", 0), (assign, ":acc_y", 0), (assign, ":cnt", 0), (try_for_agents, ":agent"), (agent_is_alive, ":agent"), (agent_is_human, ":agent"), (agent_get_team, ":agent_team", ":agent"), (agent_get_class, ":class", ":agent"), (neq, ":class", grc_cavalry), (teams_are_enemies, ":team_no", ":agent_team"), (agent_get_position, pos2, ":agent"), (position_get_x, ":pos_x", pos2), (position_get_y, ":pos_y", pos2), (val_add, ":acc_x", ":pos_x"), (val_add, ":acc_y", ":pos_y"), (val_add, ":cnt", 1), (try_end), (neq, ":cnt", 0), (val_div, ":acc_x", ":cnt"), (val_div, ":acc_y", ":cnt"), (position_set_x, pos1, ":acc_x"), (position_set_y, pos1, ":acc_y"), (assign, ":param1", -1), (val_mul, ":param1", ":cnt"), (val_mul, ":param1", ":acc_x"), (val_mul, ":param1", ":acc_y"), (val_div, ":param1", 10000), (assign, ":param2", -1), (val_mul, ":param2", ":cnt"), (val_mul, ":param2", ":acc_x"), (val_mul, ":param2", ":acc_x"), (val_div, ":param2", 10000), (try_for_agents, ":agent"), (agent_is_alive, ":agent"), (agent_is_human, ":agent"), (agent_get_team, ":agent_team", ":agent"), (agent_get_class, ":class", ":agent"), (neq, ":class", grc_cavalry), (teams_are_enemies, ":team_no", ":agent_team"), (agent_get_position, pos2, ":agent"), (position_get_x, ":pos_x", pos2), (convert_from_fixed_point, ":pos_x"), (position_get_y, ":pos_y", pos2), (convert_from_fixed_point, ":pos_y"), (store_mul, ":tmp", ":pos_x", ":pos_y"), (val_add, ":param1", ":tmp"), (store_mul, ":tmp", ":pos_x", ":pos_x"), (val_add, ":param2", ":tmp"), (try_end), # rotate pos1 so that its x-axis lies along side the regression line (copy_position, pos3, pos1), (position_move_x, pos3, ":param2"), (position_move_y, pos3, ":param1"), (position_transform_position_to_local, pos4, pos1, pos3), (position_get_x, ":pos_x", pos4), (position_get_y, ":pos_y", pos4), (convert_from_fixed_point, ":pos_x"), (store_div, ":tan", ":pos_y", ":pos_x"), (call_script, "script_arctan", ":tan"), (position_rotate_z, pos1, reg0), (assign, reg0, ":cnt"), ] ), # script_formation_tactical_charge_cavalry # Tactical charge script for cavalries # Input: arg1: team_no, arg2: array_no # Output: none ("formation_tactical_charge_cavalry", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_no"), #(try_begin), #(call_script, "script_cf_calculate_enemy_infantry_linear_regression_pos", ":team_no"), #(gt, reg0, 10), (store_mul, ":tmp_slot", ":team_no", formation_arrays*2), (val_add, ":tmp_slot", ":array_no"), (party_get_slot, ":cur_num", formation_temp_vector, ":tmp_slot"), #(gt, ":cur_num", 10), (store_add, ":stage_slot", slot_formation_tmp_clustering, ":team_no"), (party_get_slot, ":stage", formation_temp_vector, ":stage_slot"), (try_begin), (eq, ":stage", 0), (call_script, "script_calculate_enemy_infantry_clustering", ":team_no"), (set_fixed_point_multiplier, 100), (position_get_x, ":pos_x", pos1), (position_get_y, ":pos_y", pos1), (store_add, ":clustering_slot", slot_formation_tmp_cavalry_target, ":team_no"), (party_set_slot, formation_temp_vector, ":clustering_slot", ":pos_x"), (val_add, ":clustering_slot", 4), (party_set_slot, formation_temp_vector, ":clustering_slot", ":pos_y"), (val_add, ":clustering_slot", 4), (party_set_slot, formation_temp_vector, ":clustering_slot", reg0), (val_add, ":stage", 1), (party_set_slot, formation_temp_vector, ":stage_slot", ":stage"), (else_try), (store_add, ":clustering_slot", slot_formation_tmp_cavalry_target, ":team_no"), (party_get_slot, ":pos_x", formation_temp_vector, ":clustering_slot"), (val_add, ":clustering_slot", 4), (party_get_slot, ":pos_y", formation_temp_vector, ":clustering_slot"), (val_add, ":clustering_slot", 4), (party_get_slot, reg0, formation_temp_vector, ":clustering_slot"), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, ":pos_x"), (position_set_y, pos1, ":pos_y"), (try_end), #(position_get_x, reg1, pos1), #(position_get_y, reg2, pos1), #(display_message, "@Aiming at: ({reg1}, {reg2})", formation_debug_color), (position_set_z_to_ground_level, pos1), #(gt, reg0, 10), (set_fixed_point_multiplier, 100), (init_position, pos2), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_ref_x_pos), (store_sub, ":slot", reg0, slot_formation_array_ref_x_pos), (party_get_slot, ":ref_x", formation_vector, reg0), (position_set_x, pos2, ":ref_x"), (val_add, reg0, 1), (party_get_slot, ":ref_y", formation_vector, reg0), (position_set_y, pos2, ":ref_y"), (val_add, reg0, 1), (party_get_slot, ":rotation", formation_vector, reg0), #(assign, reg1, ":ref_x"), #(assign, reg2, ":ref_y"), #(display_message, "@Cavalry at: {reg1}, {reg2}", formation_debug_color), # In case the formation stuck at boundaries, drive it out (try_begin), (eq, ":ref_x", "$battle_x_min"), (try_begin), (eq, ":ref_y", "$battle_y_min"), (assign, ":rotation", -45), (else_try), (assign, ":rotation", -135), (try_end), (else_try), (try_begin), (eq, ":ref_y", "$battle_y_min"), (assign, ":rotation", 45), (else_try), (this_or_next|eq, ":ref_y", "$battle_y_max"), (eq, ":ref_x", "$battle_x_max"), (assign, ":rotation", 135), (try_end), (try_end), (position_get_rotation_around_z, ":cur_rot", pos2), (val_sub, ":rotation", ":cur_rot"), (position_rotate_z, pos2, ":rotation"), (party_set_slot, formation_vector, reg0, ":rotation"), (get_distance_between_positions, ":dist", pos1, pos2), (store_add, ":states_slot", ":slot", slot_formation_array_states), (party_get_slot, ":array_states", formation_vector, ":states_slot"), (assign, ":speed", 0), (assign, ":fall_back", 0), (assign, ":density", 0), (store_and, ":speed", ":array_states", sfas_speed), (val_div, ":speed", sfas_speed_unit), (store_and, ":fall_back", ":array_states", sfas_fall_back), (store_and, ":density", ":array_states", sfas_formation_density), (val_div, ":density", sfas_density_unit), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (try_begin), (store_sub, ":density", 2, ":density"), (neq, ":density", 0), (call_script, "script_formation_density_change", ":team_no", ":mark", ":density"), (try_end), (try_begin), (le, ":dist", 3500), #(val_or, ":array_states", sfas_engaged), (try_begin), (le, ":dist", 2500), (val_or, ":array_states", sfas_roar), (try_end), (party_set_slot, formation_vector, ":states_slot", ":array_states"), (try_begin), (this_or_next|neq, ":fall_back", 0), (lt, ":speed", 9), (call_script, "script_formation_accelerate", ":team_no", ":array_no", 1), (else_try), (gt, ":speed", 9), (call_script, "script_formation_accelerate", ":team_no", ":array_no", -1), (try_end), (else_try), (val_or, ":array_states", sfas_roar), (val_sub, ":array_states", sfas_roar), #(val_or, ":array_states", sfas_engaged), #(val_sub, ":array_states", sfas_engaged), (party_set_slot, formation_vector, ":states_slot", ":array_states"), (try_begin), (position_is_behind_position, pos2, pos1), (position_rotate_z, pos1, 180), (try_end), (position_transform_position_to_local, pos3, pos1, pos2), (set_fixed_point_multiplier, 100), (position_get_x, ":pos_x", pos3), (position_get_y, ":pos_y", pos3), (convert_to_fixed_point, ":pos_x"), (store_div, ":tan", ":pos_x", ":pos_y"), (call_script, "script_arctan", ":tan"), (val_abs, reg0), (assign, ":cut_in_angle", reg0), (try_begin), #(le, reg0, 80), #(ge, ":dist", 6000), (init_position, pos4), (position_set_x, pos4, 0), (position_set_y, pos4, ":dist"), (position_transform_position_to_parent, pos6, pos1, pos4), #(neg|position_is_behind_position, pos6, pos2), (position_transform_position_to_local, pos5, pos2, pos1), (position_get_x, ":pos_x", pos5), (position_get_y, ":pos_y", pos5), (set_fixed_point_multiplier, 100), (convert_to_fixed_point, ":pos_y"), (try_begin), (eq, ":pos_x", 0), (assign, ":pos_x", 1), (try_end), (try_begin), (gt, ":pos_x", 0), (assign, ":sign", -1), (else_try), (assign, ":sign", 1), (try_end), (val_abs, ":pos_x"), (store_div, ":tan", ":pos_y", ":pos_x"), (call_script, "script_arctan", ":tan"), (store_sub, reg0, 90, reg0), (try_begin), # (gt, reg0, tactical_charge_cut_in), # (store_mul, ":rotation", ":sign", tactical_charge_cut_in), # (call_script, "script_formation_turn", ":team_no", ":array_no", ":rotation"), #(else_try), (gt, reg0, tactical_charge_adjust_in), (try_begin), (gt, reg0, 30), (lt, reg0, 120), (store_mul, ":rotation", ":sign", tactical_charge_cut_in), (else_try), (store_mul, ":rotation", ":sign", tactical_charge_adjust_in), (try_end), (call_script, "script_formation_turn", ":team_no", ":array_no", ":rotation"), (assign, ":charge_speed", 6), (else_try), (assign, ":charge_speed", 7), (try_end), (try_begin), (this_or_next|neq, ":fall_back", 0), (lt, ":speed", ":charge_speed"), (call_script, "script_formation_accelerate", ":team_no", ":array_no", 1), (else_try), (gt, ":speed", ":charge_speed"), (call_script, "script_formation_accelerate", ":team_no", ":array_no", -1), (try_end), #(else_try), # (store_mul, ":perimeter", ":dist", 2*Pi), # (store_div, ":time", ":perimeter", ":speed"), # (val_div, ":time", 100*tactical_charge_listen_interval), # (store_div, ":omega", 360, ":time"), # (position_transform_position_to_local, pos5, pos2, pos1), # (position_get_x, ":pos_x", pos5), # (position_get_y, ":pos_y", pos5), # (assign, ":sign", 1), # (try_begin), # (gt, ":pos_x", 0), # (assign, ":sign", -1), # (try_end), # (convert_from_fixed_point, ":pos_x"), # (store_div, ":tan", ":pos_y", ":pos_x"), # (call_script, "script_arctan", ":tan"), # (val_abs, reg0), # (try_begin), # (this_or_next|gt, reg0, 3), # (lt, ":dist", 4500), # (gt, ":pos_y", 0), # (val_sub, ":omega", tactical_charge_adjust_out), # (else_try), # (gt, reg0, 3), # (val_add, ":omega", tactical_charge_adjust_in), # (try_end), # (val_mul, ":omega", ":sign"), # (call_script, "script_formation_turn", ":team_no", ":array_no", ":omega"), (try_end), (try_end), ] ), # script_formation_check_array_ammo # Check the ratio of agents having ammo left # Input: arg1: team_no, arg2: array_no, # Output: reg0 - ratio in percentage ("formation_check_array_ammo", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_no"), (assign, ":cnt", 0), (assign, ":cnt_1", 0), (try_for_agents, ":agent"), (agent_is_alive, ":agent"), (agent_is_human, ":agent"), (agent_get_team, ":agent_team", ":agent"), (eq, ":agent_team", ":team_no"), (agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states), (val_and, ":formation_states", safs_array_no), (eq, ":formation_states", ":array_no"), (agent_get_ammo, ":ammo", ":agent"), (val_add, ":cnt", 1), (neq, ":ammo", 0), (val_add, ":cnt_1", 1), (try_end), (val_mul, ":cnt_1", 100), (store_div, reg0, ":cnt_1", ":cnt"), ] ), # script_formation_tactical_charge_ranged # Infantry formations can use this as tactical charge script # Input: arg1: team_no, arg2: array_no, # Output: none ("formation_tactical_charge_ranged", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_no"), (set_fixed_point_multiplier, 100), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", 0), (assign, ":slot", reg0), (store_add, reg0, ":slot", slot_formation_array_ref_x_pos), (party_get_slot, ":ref_x", formation_vector, reg0), (store_add, reg0, ":slot", slot_formation_array_ref_y_pos), (party_get_slot, ":ref_y", formation_vector, reg0), (store_add, reg0, ":slot", slot_formation_array_ref_rotation), (party_get_slot, ":rotation", formation_vector, reg0), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, ":ref_x"), (position_set_y, pos1, ":ref_y"), (position_rotate_z, pos1, ":rotation"), (position_set_z_to_ground_level, pos1), (copy_position, pos4, pos1), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (assign, ":no_infantry", 0), (try_begin), (call_script, "script_cf_calculate_enemy_infantry_centroid", ":team_no", grc_cavalry), (copy_position, pos2, pos4), # Get distance from enemy infantry, turn formation toward enemy infantry (get_distance_between_positions, ":dist", pos1, pos2), (try_begin), (position_is_behind_position, pos1, pos2), (position_rotate_z, pos2, 180), #debug_point, (try_end), (position_transform_position_to_local, pos3, pos2, pos1), (set_fixed_point_multiplier, 100), (position_get_x, ":pos_x", pos3), (position_get_y, ":pos_y", pos3), #(position_get_x, reg1, pos2), #(position_get_y, reg2, pos2), #(display_message, "@Rel pos: {reg1}, {reg2}", formation_debug_color), (convert_from_fixed_point, ":pos_y"), (try_begin), (neq, ":pos_y", 0), (store_div, ":tan", ":pos_x", ":pos_y"), (call_script, "script_arctan", ":tan"), (else_try), (gt, ":pos_x", 0), (assign, reg0, 90), (else_try), (assign, reg0, -89), (try_end), (val_mul, reg0, -1), (position_rotate_z, pos2, reg0), (position_get_rotation_around_z, ":rotation", pos2), (store_add, reg0, ":slot", slot_formation_array_ref_rotation), (party_set_slot, formation_vector, reg0, ":rotation"), (else_try), (assign, ":dist", 4000), (try_end), (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states), (assign, ":states_slot", reg0), (party_get_slot, ":array_states", formation_vector, reg0), (assign, ":density", 0), (store_and, ":density", ":array_states", sfas_formation_density), (val_div, ":density", sfas_density_unit), (store_sub, ":density", 0, ":density"), (store_add, ":mark", slot_formation_array_marks_begin, ":array_no"), (party_get_slot, ":mark", formation_vector, ":mark"), (try_begin), (neq, ":density", 0), (call_script, "script_formation_density_change", ":team_no", ":mark", ":density"), (try_end), (try_begin), (lt, ":dist", 1000), # change formation to engaged stage (party_get_slot, ":array_states", formation_vector, ":states_slot"), (val_or, ":array_states", sfas_engaged), (party_set_slot, formation_vector, reg0, ":array_states"), (try_end), (try_begin), (lt, ":dist", 7500), # stop march (call_script, "script_formation_accelerate", ":team_no", ":array_no", 0), (else_try), # march with a speed of 2m/s (call_script, "script_convert_to_slot_no", ":team_no", ":array_no", slot_formation_array_states), (party_get_slot, ":array_states", formation_vector, reg0), (val_or, ":array_states", sfas_engaged), (val_sub, ":array_states", sfas_engaged), (party_set_slot, formation_vector, reg0, ":array_states"), (assign, ":speed", 0), (assign, ":fall_back", 0), (store_and, ":speed", ":array_states", sfas_speed), (store_and, ":fall_back", ":array_states", sfas_fall_back), (val_div, ":speed", sfas_speed_unit), (try_begin), (this_or_next|neq, ":fall_back", 0), (lt, ":speed", 2), (call_script, "script_formation_accelerate", ":team_no", ":array_no", 1), (else_try), (gt, ":speed", 2), (call_script, "script_formation_accelerate", ":team_no", ":array_no", -1), (try_end), (try_end), ] ), ################################################################## # Notes: intending to align the following scripts the same as in string file # and in constants assignment, so that scripts can be called by # index instead of trying all names. # In such case do not insert scripts in between. # If you want to add new formations: # Append new formation scripts right after the last formation script, # and change module_strings.py, module_constants.py accordingly. # All formation scripts shall take the same parameters: # arg1: team_no, arg2:array_no, arg3: num_of_men ################################################################### # script_formation_tactical_charge_line # Tactical unit for charge of line formation # Input: arg1: team_no, arg2: array_no # Output: none ("formation_tactical_charge_line", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_no"), (call_script, "script_formation_tactical_charge_ranged", ":team_no", ":array_no"), ] ), ########DO NOT INSERT scripts here!!############### # #### ############################################ ## ## ############################################# ### ############################################## ### ####### DO NOT INSERT SCRIPTS HERE!!!! ####### ## ## ############################################# # #### ############################################ ########DO NOT INSERT scripts here!!############### # script_formation_tactical_charge_phalanx # Tactical unit for charge of line formation # Input: arg1: team_no, arg2: array_no # Output: none ("formation_tactical_charge_phalanx", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_no"), (call_script, "script_formation_tactical_charge_generic", ":team_no", ":array_no"), ] ), ########DO NOT INSERT scripts here!!############### # #### ############################################ ## ## ############################################# ### ############################################## ### ####### DO NOT INSERT SCRIPTS HERE!!!! ####### ## ## ############################################# # #### ############################################ ########DO NOT INSERT scripts here!!############### # script_formation_tactical_charge_wedge # Tactical unit for charge of line formation # Input: arg1: team_no, arg2: array_no # Output: none ("formation_tactical_charge_wedge", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_no"), (call_script, "script_formation_tactical_charge_cavalry", ":team_no", ":array_no"), ] ), ########DO NOT INSERT scripts here!!############### # #### ############################################ ## ## ############################################# ### ############################################## ### ####### DO NOT INSERT SCRIPTS HERE!!!! ####### ## ## ############################################# # #### ############################################ ########DO NOT INSERT scripts here!!############### # script_formation_tactical_charge_square # Tactical unit for charge of line formation # Input: arg1: team_no, arg2: array_no # Output: none ("formation_tactical_charge_square", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_no"), (call_script, "script_formation_tactical_charge_generic", ":team_no", ":array_no"), ] ), ########DO NOT INSERT scripts here!!############### # #### ############################################ ## ## ############################################# ### ############################################## ### ####### DO NOT INSERT SCRIPTS HERE!!!! ####### ## ## ############################################# # #### ############################################ ########DO NOT INSERT scripts here!!############### # script_formation_line # Calculate line formation # Input: arg1: team_no, arg2: array_no, # arg3: num_of_men # Output: none ("formation_line", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_no"), (store_script_param, ":num_of_men", 3), (call_script, "script_calculate_formation_row", ":team_no", ":array_no", sfas_density_base*3, ":num_of_men", sfas_density_base*3, 0), ] ), ########DO NOT INSERT scripts here!!############### # #### ############################################ ## ## ############################################# ### ############################################## ### ####### DO NOT INSERT SCRIPTS HERE!!!! ####### ## ## ############################################# # #### ############################################ ########DO NOT INSERT scripts here!!############### # script_formation_phalanx # Calculate phalanx formation # Input: arg1: team_no, arg2: array_no, # arg3: num_of_men # Output: none ("formation_phalanx", [(store_script_param, ":team_no", 1), (store_script_param, ":array_no", 2), (store_script_param, ":num_of_men", 3), (try_begin), (ge, ":num_of_men", 4), (store_div, ":width", ":num_of_men", 4), (else_try), (assign, ":width", ":num_of_men"), (try_end), (call_script, "script_calculate_formation_row", ":team_no", ":array_no", sfas_density_base*3, ":width", sfas_density_base*3, 0), ] ), ########DO NOT INSERT scripts here!!############### # #### ############################################ ## ## ############################################# ### ############################################## ### ####### DO NOT INSERT SCRIPTS HERE!!!! ####### ## ## ############################################# # #### ############################################ ########DO NOT INSERT scripts here!!############### # script_formation_wedge # Calculate wedge formation # Input: arg1: team_no, arg2: array_no, # arg3: num_of_men # Output: none ("formation_wedge", [(store_script_param, ":team_no", 1), (store_script_param, ":array_no", 2), #(store_script_param, ":num_of_men", 3), (call_script, "script_calculate_formation_row", ":team_no", ":array_no", sfas_density_base*3, 1, sfas_density_base*4*3, 2), ] ), ########DO NOT INSERT scripts here!!############### # #### ############################################ ## ## ############################################# ### ############################################## ### ####### DO NOT INSERT SCRIPTS HERE!!!! ####### ## ## ############################################# # #### ############################################ ########DO NOT INSERT scripts here!!############### # script_formation_square # Calculate square formation # Input: arg1: team_no, arg2: array_no # arg3: num_of_men # Output: none ("formation_square", [(store_script_param, ":team_no", 1), (store_script_param, ":array_no", 2), (store_script_param, ":num_of_men", 3), (set_fixed_point_multiplier, 100), (convert_to_fixed_point, ":num_of_men"), (store_sqrt, ":width", ":num_of_men"), (convert_from_fixed_point, ":width"), (call_script, "script_calculate_formation_row", ":team_no", ":array_no", sfas_density_base*3, ":width", sfas_density_base*3, 0), ] ), ########DO NOT INSERT scripts here!!############### # #### ############################################ ## ## ############################################# ### ############################################## ### ####### DO NOT INSERT SCRIPTS HERE!!!! ####### ## ## ############################################# # #### ############################################ ########DO NOT INSERT scripts here!!############### # script_dismiss_battle_array # Input: arg1: team_no, arg2:array_selection # Output: none ("dismiss_battle_array", [(store_script_param_1, ":team_no"), (store_script_param_2, ":array_selection"), #debug_point, (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":array_in_formation", formation_vector, reg0), (val_or, ":array_in_formation", ":array_selection"), (val_sub, ":array_in_formation", ":array_selection"), (party_set_slot, formation_vector, reg0, ":array_in_formation"), (get_player_agent_no, ":player"), (try_for_agents, ":agent"), (neq, ":agent", ":player"), (agent_get_team, ":agent_team", ":agent"), (eq, ":agent_team", ":team_no"), (agent_is_alive, ":agent"), (agent_is_human, ":agent"), (agent_get_slot, ":formation_states", ":agent", slot_agent_formation_states), (assign, ":agent_array", 0), (store_and, ":agent_array", ":formation_states", safs_array_no), (val_add, ":agent_array", slot_formation_array_marks_begin), (party_get_slot, ":agent_array", formation_vector, ":agent_array"), (val_and, ":agent_array", ":array_selection"), (neq, ":agent_array", 0), (val_or, ":formation_states", safs_in_formation), (val_sub, ":formation_states", safs_in_formation), (agent_set_slot, ":agent", slot_agent_formation_states, ":formation_states"), (agent_clear_scripted_mode, ":agent"), (agent_set_slot, ":agent", slot_agent_is_in_scripted_mode, 0), (try_end), (set_show_messages, 0), (team_give_order, ":team_no", grc_everyone, mordr_charge), (set_show_messages, 1), ]), ###########Do not insert scripts above############## # script_convert_to_slot_no # Convert to slot no in formation vector # Input: arg1: team_no - -1 if not in team slots, # arg2: array_no - -1 if not in array slots, # arg3: slot name # Output: reg0 = slot no ("convert_to_slot_no", [(store_script_param, ":team_no", 1), (store_script_param, ":array_no", 2), (store_script_param, ":slot", 3), (try_begin), (eq, ":team_no", -1), (else_try), (store_mul, ":base", ":team_no", sft_team_section_size), (val_add, ":base", slot_formation_teams_begin), (eq, ":array_no", -1), (val_add, ":slot", ":base"), (else_try), (store_mul, ":offset", ":array_no", sfa_array_section_size), (val_add, ":offset", slot_formation_team_arrays_begin), (val_add, ":slot", ":base"), (val_add, ":slot", ":offset"), (try_end), (assign, reg0, ":slot"), ]), # script_arctan # Input: arg1: fixed_point # Output: reg0 = angle in degrees ("arctan", [(store_script_param_1, ":fixed_point"), (set_fixed_point_multiplier, 100), (assign, reg0, 90), (assign, ":tangent", 0), (assign, ":lower_bound", -89), (assign, ":upper_bound", 90), (try_for_range, ":angle", ":lower_bound", ":upper_bound"), (assign, ":fixed_angle", ":angle"), (convert_to_fixed_point, ":fixed_angle"), (store_tan, ":tangent", ":fixed_angle"), (try_begin), (ge, ":tangent", ":fixed_point"), (assign, reg0, ":angle"), (assign, ":upper_bound", ":angle"), (try_end), (try_end), ]), #### Presentation scripts ############# # script_update_formation_key_config_buttons # Refresh button content in prsnt_formation_key_config # Input: none # Output: none ("update_formation_key_config_buttons", concatenate_scripts([ [(party_get_slot, ":key", "p_main_party", slot_party_formation_keys_begin+y), (try_begin), ]+concatenate_scripts([ [ (eq, ":key", all_keys_list[x][0]), (overlay_set_text, "$g_presentation_obj_"+str(y*2+2), all_keys_list[x][1], 0), (overlay_set_color, "$g_presentation_obj_"+str(y*2+2), 0x0), (else_try), ] for x in range(0, len(all_keys_list)) ])+[ (eq, ":key", 0xff), (overlay_set_text, "$g_presentation_obj_"+str(y*2+2), "@Disabled"), (overlay_set_color, "$g_presentation_obj_"+str(y*2+2), 0x800000), (else_try), (overlay_set_text, "$g_presentation_obj_"+str(y*2+2), "@Undefined!"), (overlay_set_color, "$g_presentation_obj_"+str(y*2+2), 0xFF0000), (try_end), ] for y in range(0, len(formation_keys_list)) ])+[ (party_get_slot, ":state", "p_main_party", slot_party_formation_ai_switch), (try_begin), (eq, ":state", 0), (overlay_set_text, "$formation_key_config_ai_switch", "@Disabled"), (overlay_set_color, "$formation_key_config_ai_switch", 0x800000), (else_try), (overlay_set_text, "$formation_key_config_ai_switch", "@Enabled"), (overlay_set_color, "$formation_key_config_ai_switch", 0x0), (try_end), ] ), # script_update_formation_order_panel # Input: arg1 = team_no # Output: none ("update_formation_order_panel", [(store_script_param_1, ":team_no"), (set_fixed_point_multiplier, 1000), (assign, ":tactical_charge", 0), (assign, ":charge", 0), (assign, ":fall_back", 0), (assign, ":formation_type", 0), (assign, ":density", 0), (assign, ":auto_rotation", 0), (position_set_y, pos1, 660), ]+concatenate_scripts([ [ (call_script, "script_convert_to_slot_no", ":team_no", -1, slot_formation_team_array_selection), (party_get_slot, ":array_selection", formation_vector, reg0), (party_get_slot, ":mark", formation_vector, slot_formation_array_marks_begin+x), (val_and, ":mark", ":array_selection"), (try_begin), (eq, ":mark", 0), (overlay_set_text, "$g_presentation_array_formation_"+str(x+1), "@Dismissed"), (overlay_set_text, "$g_presentation_array_movement_"+str(x+1), "@Charging"), (overlay_set_text, "$g_presentation_array_density_"+str(x+1), "@Scattered"), (overlay_set_text, "$g_presentation_array_facing_"+str(x+1), "@Free"), (else_try), (call_script, "script_convert_to_slot_no", ":team_no", x, slot_formation_array_states), (party_get_slot, ":array_states", formation_vector, reg0), (store_and, ":formation_type", ":array_states", sfas_formation_type), (store_add, ":formation_name", formation_commands_begin, ":formation_type"), (overlay_set_text, "$g_presentation_array_formation_"+str(x+1), ":formation_name"), (try_begin), (store_and, ":tactical_charge", ":array_states", sfas_tactical_charge), (neq, ":tactical_charge", 0), (overlay_set_text, "$g_presentation_array_movement_"+str(x+1), "@Charging(Tactical)"), (else_try), (store_and, ":charge", ":array_states", sfas_charge), (neq, ":charge", 0), (store_and, reg1, ":array_states", sfas_speed), (val_div, reg1, sfas_speed_base), (overlay_set_text, "$g_presentation_array_movement_"+str(x+1), "@Charging({reg1}m/s)"), (else_try), (store_and, ":fall_back", ":array_states", sfas_fall_back), (neq, ":fall_back", 0), (store_and, reg1, ":array_states", sfas_speed), (val_div, reg1, sfas_speed_base), (overlay_set_text, "$g_presentation_array_movement_"+str(x+1), "@Retreating({reg1}m/s)"), (else_try), (overlay_set_text, "$g_presentation_array_movement_"+str(x+1), "@Holding"), (try_end), (store_and, ":density", ":array_states", sfas_formation_density), (val_div, ":density", sfas_density_unit), (try_begin), (eq, ":density", 0), (overlay_set_text, "$g_presentation_array_density_"+str(x+1), "@Densest"), (else_try), (eq, ":density", 1), (overlay_set_text, "$g_presentation_array_density_"+str(x+1), "@Dense"), (else_try), (eq, ":density", 2), (overlay_set_text, "$g_presentation_array_density_"+str(x+1), "@Sparse"), (else_try), (overlay_set_text, "$g_presentation_array_density_"+str(x+1), "@Sparsest"), (try_end), (store_and, ":auto_rotation", ":array_states", sfas_auto_rotate), (try_begin), (neq, ":auto_rotation", 0), (overlay_set_text, "$g_presentation_array_facing_"+str(x+1), "@Toward enemies"), (else_try), (overlay_set_text, "$g_presentation_array_facing_"+str(x+1), "@Free"), (try_end), (try_end), (set_fixed_point_multiplier, 1000), #(position_set_x, pos2, 900), #(position_set_y, pos2, 900), #(position_set_x, pos1, 215), #(overlay_set_position, "$g_presentation_array_formation_"+str(x+1), pos1), #(overlay_set_size, "$g_presentation_array_formation_"+str(x+1), pos2), #(position_set_x, pos1, 330), #(overlay_set_position, "$g_presentation_array_movement_"+str(x+1), pos1), #(overlay_set_size, "$g_presentation_array_movement_"+str(x+1), pos2), #(position_set_x, pos1, 430), #(overlay_set_position, "$g_presentation_array_density_"+str(x+1), pos1), #(overlay_set_size, "$g_presentation_array_density_"+str(x+1), pos2), #(position_set_x, pos1, 540), #(overlay_set_position, "$g_presentation_array_facing_"+str(x+1), pos1), #(overlay_set_size, "$g_presentation_array_facing_"+str(x+1), pos2), #(position_move_y, pos1, -5), ] for x in range(0, formation_arrays) ])+[ ]), # further follow-up needed... # script_update_formation_order_flags_on_map # Input: none # Output: none ("update_formation_order_flags_on_map", [(get_player_agent_no, ":player_agent"), (agent_get_team, ":player_team", ":player_agent"), (get_scene_boundaries, pos2, pos3), ]+concatenate_scripts([ [ (try_begin), (set_fixed_point_multiplier, 100), (call_script, "script_convert_to_slot_no", ":player_team", -1, slot_formation_team_array_selection), (party_get_slot, ":array_selection", formation_vector, reg0), (party_get_slot, ":mark", formation_vector, slot_formation_array_marks_begin+x), (val_and, ":mark", ":array_selection"), (neq, ":mark", 0), (call_script, "script_convert_to_slot_no", ":player_team", x, 0), (store_add, ":x_slot", reg0, slot_formation_array_ref_x_pos), (party_get_slot, ":ref_x", formation_vector, ":x_slot"), (store_add, ":y_slot", reg0, slot_formation_array_ref_y_pos), (party_get_slot, ":ref_y", formation_vector, ":y_slot"), (position_set_x, pos1, ":ref_x"), (position_set_y, pos1, ":ref_y"), (call_script, "script_convert_3d_pos_to_map_pos"), (overlay_set_alpha, "$g_battle_map_array_"+str(x+1)+"_flag", 0xFF), (overlay_set_position, "$g_battle_map_array_"+str(x+1)+"_flag", pos0), (else_try), (overlay_set_alpha, "$g_battle_map_array_"+str(x+1)+"_flag", 0), (try_end), ] for x in range(0, formation_arrays) ])+[ ]), # script_update_formation_order_panel_checked_arrays # Input: none # Output: none ("update_formation_order_panel_checked_arrays", [#(get_player_agent_no, ":player_agent"), #(agent_get_team, ":player_team", ":player_agent"), ]+concatenate_scripts([ [ (try_begin), (party_get_slot, ":mark", formation_vector, slot_formation_array_marks_begin+x), (val_and, ":mark", "$formation_array_selected"), (neq, ":mark", 0), (overlay_set_val, "$g_presentation_obj_"+str(x+1+formation_arrays), 1), (overlay_animate_to_alpha, "$g_presentation_obj_"+str(x+1), 250, 0x44), (else_try), (overlay_set_val, "$g_presentation_obj_"+str(x+1+formation_arrays), 0), (overlay_animate_to_alpha, "$g_presentation_obj_"+str(x+1), 250, 0), (try_end), ] for x in range(0, formation_arrays) ])+[ ]), # script_update_formation_order_panel_statistics_and_map # Input: none # Output: none ("update_formation_order_panel_statistics_and_map", #TODO: Call this in every battle mission template, once per second [(set_fixed_point_multiplier, 1000), (get_player_agent_no, ":player_agent"), (agent_get_team, ":player_team", ":player_agent"), (get_scene_boundaries, pos2, pos3), (try_for_agents,":cur_agent"), (agent_is_human, ":cur_agent"), #(agent_get_class, ":agent_class", ":cur_agent"), (agent_get_party_id, ":agent_party", ":cur_agent"), (agent_get_slot, ":agent_overlay", ":cur_agent", slot_agent_map_overlay_id), (try_begin), (eq, ":agent_party", "p_main_party"), (try_begin), (agent_is_alive, ":cur_agent"), (call_script, "script_update_agent_position_on_map", ":cur_agent"), (else_try), (overlay_set_alpha, ":agent_overlay", 0), (try_end), (else_try), (agent_is_ally, ":cur_agent"), (try_begin), (agent_is_alive, ":cur_agent"), (call_script, "script_update_agent_position_on_map", ":cur_agent"), (else_try), (overlay_set_alpha, ":agent_overlay", 0), (try_end), (else_try), (try_begin), (agent_is_alive, ":cur_agent"), (call_script, "script_update_agent_position_on_map", ":cur_agent"), (else_try), (overlay_set_alpha, ":agent_overlay", 0), (try_end), (try_end), (try_end), (store_mul, ":base", ":player_team", formation_arrays*2), (val_add, ":base", slot_formation_tmp_maintain), ]+concatenate_scripts([ [ (store_add, ":num_slot", ":base", x), (party_get_slot, reg1, formation_temp_vector, ":num_slot"), (store_add, ":array_name", formation_order_panel_array_names_begin, x), (str_store_string, s1, ":array_name"), (overlay_set_text, "$g_presentation_obj_"+str(x+1+formation_arrays*2), "@{s1} ({reg1})"), ] for x in range(0, formation_arrays) ])+[ (call_script, "script_update_formation_order_flags_on_map"), ]), ###### Command Cursor script ("cf_shift_pos1_along_y_axis_to_ground", [ (store_script_param_1, ":max_trial"), (set_fixed_point_multiplier, 100), (assign, ":result", 1), (try_for_range, ":i", 0, ":max_trial"), (position_move_y, pos1, 100), (copy_position, pos2, pos1), (position_set_z_to_ground_level, pos2), (position_get_z, ":ground_level", pos2), (position_get_x, ":x_pos", pos1), (position_get_y, ":y_pos", pos1), (try_begin), (this_or_next|gt, ":x_pos", "$battle_x_max"), (this_or_next|lt, ":x_pos", "$battle_x_min"), (this_or_next|gt, ":y_pos", "$battle_y_max"), (lt, ":y_pos", "$battle_y_min"), (assign, ":result", 0), # function fails (assign, ":max_trial", 0), # break (try_end), (position_get_z, ":pos1_height", pos1), (gt, ":pos1_height", ":ground_level"), (else_try), # ground reached (assign, ":max_trial", 0), # break (try_end), (eq, ":result", 1), ] ), # Form Ranks Scripts Section End ################################## ]
Python
file = open("module_scripts.py","r") lines = file.readlines() file.close() file = open("module_scripts.py","w") level = 0 for line in lines: line = line.strip() acceptableindex = line.find("#") if (acceptableindex == -1): acceptableindex = len(line) level -= line.count("try_end", 0, acceptableindex) level -= line.count("end_try", 0, acceptableindex) level -= line.count("else_try", 0, acceptableindex) newlevel = level level_positive_change = 0 newlevel += line.count("else_try", 0, acceptableindex) newlevel += line.count("(", 0, acceptableindex) newlevel += line.count("[", 0, acceptableindex) newlevel += line.count("try_begin", 0, acceptableindex) newlevel += line.count("try_for", 0, acceptableindex) level_positive_change = newlevel - level newlevel -= line.count(")", 0, acceptableindex) newlevel -= line.count("]", 0, acceptableindex) if (level_positive_change == 0): level = newlevel for i in xrange(level): file.write(" ") level = newlevel file.write("%s\n"%line) file.close()
Python
icon_player = 0 icon_player_horseman = 1 icon_gray_knight = 2 icon_vaegir_knight = 3 icon_flagbearer_a = 4 icon_flagbearer_b = 5 icon_peasant = 6 icon_khergit = 7 icon_khergit_horseman_b = 8 icon_axeman = 9 icon_woman = 10 icon_woman_b = 11 icon_town = 12 icon_town_steppe = 13 icon_village_a = 14 icon_village_burnt_a = 15 icon_village_deserted_a = 16 icon_camp = 17 icon_ship = 18 icon_ship_on_land = 19 icon_castle_a = 20 icon_castle_b = 21 icon_castle_c = 22 icon_castle_d = 23 icon_town_snow = 24 icon_village_snow_a = 25 icon_village_snow_burnt_a = 26 icon_village_snow_deserted_a = 27 icon_castle_snow_a = 28 icon_castle_snow_b = 29 icon_mule = 30 icon_cattle = 31 icon_training_ground = 32 icon_bridge_a = 33 icon_bridge_b = 34 icon_bridge_snow_a = 35 icon_custom_banner_01 = 36 icon_custom_banner_02 = 37 icon_custom_banner_03 = 38 icon_banner_01 = 39 icon_banner_02 = 40 icon_banner_03 = 41 icon_banner_04 = 42 icon_banner_05 = 43 icon_banner_06 = 44 icon_banner_07 = 45 icon_banner_08 = 46 icon_banner_09 = 47 icon_banner_10 = 48 icon_banner_11 = 49 icon_banner_12 = 50 icon_banner_13 = 51 icon_banner_14 = 52 icon_banner_15 = 53 icon_banner_16 = 54 icon_banner_17 = 55 icon_banner_18 = 56 icon_banner_19 = 57 icon_banner_20 = 58 icon_banner_21 = 59 icon_banner_22 = 60 icon_banner_23 = 61 icon_banner_24 = 62 icon_banner_25 = 63 icon_banner_26 = 64 icon_banner_27 = 65 icon_banner_28 = 66 icon_banner_29 = 67 icon_banner_30 = 68 icon_banner_31 = 69 icon_banner_32 = 70 icon_banner_33 = 71 icon_banner_34 = 72 icon_banner_35 = 73 icon_banner_36 = 74 icon_banner_37 = 75 icon_banner_38 = 76 icon_banner_39 = 77 icon_banner_40 = 78 icon_banner_41 = 79 icon_banner_42 = 80 icon_banner_43 = 81 icon_banner_44 = 82 icon_banner_45 = 83 icon_banner_46 = 84 icon_banner_47 = 85 icon_banner_48 = 86 icon_banner_49 = 87 icon_banner_50 = 88 icon_banner_51 = 89 icon_banner_52 = 90 icon_banner_53 = 91 icon_banner_54 = 92 icon_banner_55 = 93 icon_banner_56 = 94 icon_banner_57 = 95 icon_banner_58 = 96 icon_banner_59 = 97 icon_banner_60 = 98 icon_banner_61 = 99 icon_banner_62 = 100 icon_banner_63 = 101 icon_banner_64 = 102 icon_banner_65 = 103 icon_banner_66 = 104 icon_banner_67 = 105 icon_banner_68 = 106 icon_banner_69 = 107 icon_banner_70 = 108 icon_banner_71 = 109 icon_banner_72 = 110 icon_banner_73 = 111 icon_banner_74 = 112 icon_banner_75 = 113 icon_banner_76 = 114 icon_banner_77 = 115 icon_banner_78 = 116 icon_banner_79 = 117 icon_banner_80 = 118 icon_banner_81 = 119 icon_banner_82 = 120 icon_banner_83 = 121 icon_banner_84 = 122 icon_banner_85 = 123 icon_banner_86 = 124 icon_banner_87 = 125 icon_banner_88 = 126 icon_banner_89 = 127 icon_banner_90 = 128 icon_banner_91 = 129 icon_banner_92 = 130 icon_banner_93 = 131 icon_banner_94 = 132 icon_banner_95 = 133 icon_banner_96 = 134 icon_banner_97 = 135 icon_banner_98 = 136 icon_banner_99 = 137 icon_banner_100 = 138 icon_banner_101 = 139 icon_banner_102 = 140 icon_banner_103 = 141 icon_banner_104 = 142 icon_banner_105 = 143 icon_banner_106 = 144 icon_banner_107 = 145 icon_banner_108 = 146 icon_banner_109 = 147 icon_banner_110 = 148 icon_banner_111 = 149 icon_banner_112 = 150 icon_banner_113 = 151 icon_banner_114 = 152 icon_banner_115 = 153 icon_banner_116 = 154 icon_banner_117 = 155 icon_banner_118 = 156 icon_banner_119 = 157 icon_banner_120 = 158 icon_banner_121 = 159 icon_banner_122 = 160 icon_banner_123 = 161 icon_banner_124 = 162 icon_banner_125 = 163 icon_banner_126 = 164
Python
from header_common import * from header_operations import * from header_parties import * from header_items import * from header_skills import * from header_triggers import * from header_troops import * from header_music import * from module_constants import * #################################################################################################################### # Simple triggers are the alternative to old style triggers. They do not preserve state, and thus simpler to maintain. # # Each simple trigger contains the following fields: # 1) Check interval: How frequently this trigger will be checked # 2) Operation block: This must be a valid operation block. See header_operations.py for reference. #################################################################################################################### simple_triggers = [ # This trigger is deprecated. Use "script_game_event_party_encounter" in module_scripts.py instead (ti_on_party_encounter, [ ]), # This trigger is deprecated. Use "script_game_event_simulate_battle" in module_scripts.py instead (ti_simulate_battle, [ ]), (1, [ (gt,"$auto_besiege_town",0), (gt,"$g_player_besiege_town", 0), (ge, "$g_siege_method", 1), (store_current_hours, ":cur_hours"), (eq, "$g_siege_force_wait", 0), (ge, ":cur_hours", "$g_siege_method_finish_hours"), (neg|is_currently_night), (rest_for_hours, 0, 0, 0), #stop resting ]), (0, [ (eq,"$g_player_is_captive",1), (gt, "$capturer_party", 0), (party_is_active, "$capturer_party"), (party_relocate_near_party, "p_main_party", "$capturer_party", 0), ]), #Auto-menu (0, [ (try_begin), (gt, "$g_last_rest_center", 0), (party_get_battle_opponent, ":besieger_party", "$g_last_rest_center"), (gt, ":besieger_party", 0), (store_faction_of_party, ":encountered_faction", "$g_last_rest_center"), (store_relation, ":faction_relation", ":encountered_faction", "fac_player_supporters_faction"), (store_faction_of_party, ":besieger_party_faction", ":besieger_party"), (store_relation, ":besieger_party_relation", ":besieger_party_faction", "fac_player_supporters_faction"), (ge, ":faction_relation", 0), (lt, ":besieger_party_relation", 0), (start_encounter, "$g_last_rest_center"), (rest_for_hours, 0, 0, 0), #stop resting (else_try), (store_current_hours, ":cur_hours"), (assign, ":check", 0), (try_begin), (neq, "$g_check_autos_at_hour", 0), (ge, ":cur_hours", "$g_check_autos_at_hour"), (assign, ":check", 1), (assign, "$g_check_autos_at_hour", 0), (try_end), (this_or_next|eq, ":check", 1), (map_free), (try_begin), (ge,"$auto_menu",1), (jump_to_menu,"$auto_menu"), (assign,"$auto_menu",-1), (else_try), (ge,"$auto_enter_town",1), (start_encounter, "$auto_enter_town"), (else_try), (ge,"$auto_besiege_town",1), (assign, reg0, 200|opmask_variable), (display_message, "@content of supposed variable: {reg0}", formation_debug_color), #(display_message, "@Error here?", formation_debug_color), (start_encounter, "$auto_besiege_town"), (else_try), (ge,"$g_camp_mode", 1), (assign, "$g_camp_mode", 0), (assign, "$g_player_icon_state", pis_normal), (display_message, "@Breaking camp..."), (try_end), (try_end), ]), #Notification menus (0, [ (troop_slot_ge, "trp_notification_menu_types", 0, 1), (troop_get_slot, ":menu_type", "trp_notification_menu_types", 0), (troop_get_slot, "$g_notification_menu_var1", "trp_notification_menu_var1", 0), (troop_get_slot, "$g_notification_menu_var2", "trp_notification_menu_var2", 0), (jump_to_menu, ":menu_type"), (assign, ":end_cond", 2), (try_for_range, ":cur_slot", 1, ":end_cond"), (try_begin), (troop_slot_ge, "trp_notification_menu_types", ":cur_slot", 1), (val_add, ":end_cond", 1), (try_end), (store_sub, ":cur_slot_minus_one", ":cur_slot", 1), (troop_get_slot, ":local_temp", "trp_notification_menu_types", ":cur_slot"), (troop_set_slot, "trp_notification_menu_types", ":cur_slot_minus_one", ":local_temp"), (troop_get_slot, ":local_temp", "trp_notification_menu_var1", ":cur_slot"), (troop_set_slot, "trp_notification_menu_var1", ":cur_slot_minus_one", ":local_temp"), (troop_get_slot, ":local_temp", "trp_notification_menu_var2", ":cur_slot"), (troop_set_slot, "trp_notification_menu_var2", ":cur_slot_minus_one", ":local_temp"), (try_end), ]), #Music, (1, [ (map_free), (call_script, "script_music_set_situation_with_culture", mtf_sit_travel), ]), #Player raiding a village # This trigger will check if player's raid has been completed and will lead control to village menu. (1, [ (ge,"$g_player_raiding_village",1), (try_begin), (neq, "$g_player_is_captive", 0), (rest_for_hours, 0, 0, 0), #stop resting - abort (assign,"$g_player_raiding_village",0), (else_try), (map_free), #we have been attacked during raid (assign,"$g_player_raiding_village",0), (else_try), (this_or_next|party_slot_eq, "$g_player_raiding_village", slot_village_state, svs_looted), (party_slot_eq, "$g_player_raiding_village", slot_village_state, svs_deserted), (start_encounter, "$g_player_raiding_village"), (rest_for_hours, 0), (assign,"$g_player_raiding_village",0), (assign,"$g_player_raid_complete",1), (else_try), (party_slot_eq, "$g_player_raiding_village", slot_village_state, svs_being_raided), (rest_for_hours, 3, 5, 1), #rest while attackable (else_try), (rest_for_hours, 0, 0, 0), #stop resting - abort (assign,"$g_player_raiding_village",0), (assign,"$g_player_raid_complete",0), (try_end), ]), #Pay day. (24 * 7, [ (call_script, "script_calculate_player_faction_wage"), (assign, ":total_wages", reg0), (store_add, ":total_debt", ":total_wages", "$g_player_debt_to_party_members"), (try_begin), (gt, ":total_debt", 0), (jump_to_menu,"mnu_pay_day"), (try_end), (assign, "$g_cur_week_half_daily_wage_payments", 0),#Reseting the weekly half wage payments ]), #Mercenary Pay day. (6, [ (store_current_hours, ":cur_hours"), (try_begin), (ge, ":cur_hours", "$mercenary_service_next_pay_time"), (call_script, "script_party_calculate_strength", "p_main_party", 0), (assign, ":offer_value", reg0), (val_div, ":offer_value", 2), (val_add, ":offer_value", 30), (call_script, "script_round_value", ":offer_value"), (val_add, "$mercenary_service_accumulated_pay", reg0), (store_add, "$mercenary_service_next_pay_time", ":cur_hours", 7 * 24), (try_end), ]), # Oath fulfilled? (24, [ (le, "$auto_menu", 0), (gt, "$players_kingdom", 0), (neq, "$players_kingdom", "fac_player_supporters_faction"), (eq, "$player_has_homage", 0), (store_current_day, ":cur_day"), (gt, ":cur_day", "$mercenary_service_next_renew_day"), (jump_to_menu, "mnu_oath_fulfilled"), ]), # Reducing luck by 1 in every 180 hours (180, [ (val_sub, "$g_player_luck", 1), (val_max, "$g_player_luck", 0), ]), # Banner selection menu (24, [ (eq, "$g_player_banner_granted", 1), (troop_slot_eq, "trp_player", slot_troop_banner_scene_prop, 0), (le,"$auto_menu",0), #normal_banner_begin (start_presentation, "prsnt_banner_selection"), #custom_banner_begin # (start_presentation, "prsnt_custom_banner"), ]), # Party Morale: Move morale towards target value. (24, [ (call_script, "script_get_player_party_morale_values"), (assign, ":target_morale", reg0), (party_get_morale, ":cur_morale", "p_main_party"), (store_sub, ":dif", ":target_morale", ":cur_morale"), (store_div, ":dif_to_add", ":dif", 5), (store_mul, ":dif_to_add_correction", ":dif_to_add", 5), (try_begin),#finding ceiling of the value (neq, ":dif_to_add_correction", ":dif"), (try_begin), (gt, ":dif", 0), (val_add, ":dif_to_add", 1), (else_try), (val_sub, ":dif_to_add", 1), (try_end), (try_end), (val_add, ":cur_morale", ":dif_to_add"), (party_set_morale, "p_main_party", ":cur_morale"), ]), #Party AI: pruning some of the prisoners in each center (once a week) (24*7, [ (try_for_range, ":center_no", centers_begin, centers_end), (party_get_num_prisoner_stacks, ":num_prisoner_stacks",":center_no"), (try_for_range_backwards, ":stack_no", 0, ":num_prisoner_stacks"), (party_prisoner_stack_get_troop_id, ":stack_troop",":center_no",":stack_no"), (neg|troop_is_hero, ":stack_troop"), (party_prisoner_stack_get_size, ":stack_size",":center_no",":stack_no"), (store_random_in_range, ":rand_no", 0, 40), (val_mul, ":stack_size", ":rand_no"), (val_div, ":stack_size", 100), (party_remove_prisoners, ":center_no", ":stack_troop", ":stack_size"), (try_end), (try_end), ]), #Adding net incomes to heroes (once a week) #Increasing debts to heroes by 1% (once a week) #Adding net incomes to centers (once a week) (24*7, [ (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (troop_get_slot, ":cur_debt", ":troop_no", slot_troop_player_debt),#Increasing debt (val_mul, ":cur_debt", 101), (val_div, ":cur_debt", 100), (troop_set_slot, ":troop_no", slot_troop_player_debt, ":cur_debt"), (call_script, "script_calculate_hero_weekly_net_income_and_add_to_wealth", ":troop_no"),#Adding net income (try_end), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), #If non-player center, adding income to wealth (neg|party_slot_eq, ":center_no", slot_town_lord, "trp_player"), #center does not belong to player. (party_slot_ge, ":center_no", slot_town_lord, 1), #center belongs to someone. (party_get_slot, ":cur_wealth", ":center_no", slot_town_wealth), (party_get_slot, ":prosperity", ":center_no", slot_town_prosperity), (store_mul, ":added_wealth", ":prosperity", 15), (val_add, ":added_wealth", 700), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_town), (val_mul, ":added_wealth", 3), (val_div, ":added_wealth", 2), (try_end), (val_add, ":cur_wealth", ":added_wealth"), (call_script, "script_calculate_weekly_party_wage", ":center_no"), (val_sub, ":cur_wealth", reg0), (val_max, ":cur_wealth", 0), (party_set_slot, ":center_no", slot_town_wealth, ":cur_wealth"), (try_end), ]), #Hiring men with hero wealths (once a day) #Hiring men with center wealths (once a day) (24, [ (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (ge, ":party_no", 1), (party_get_attached_to, ":cur_attached_party", ":party_no"), (is_between, ":cur_attached_party", centers_begin, centers_end), (party_slot_eq, ":cur_attached_party", slot_center_is_besieged_by, -1), #center not under siege (call_script, "script_hire_men_to_kingdom_hero_party", ":troop_no"), #Hiring men with current wealth (try_end), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), (neg|party_slot_eq, ":center_no", slot_town_lord, "trp_player"), #center does not belong to player. (party_slot_ge, ":center_no", slot_town_lord, 1), #center belongs to someone. (party_get_slot, ":cur_wealth", ":center_no", slot_town_wealth), (party_slot_eq, ":center_no", slot_center_is_besieged_by, -1), #center not under siege (assign, ":hiring_budget", ":cur_wealth"), (val_div, ":hiring_budget", 5), (gt, ":hiring_budget", reinforcement_cost), (call_script, "script_cf_reinforce_party", ":center_no"), (val_sub, ":cur_wealth", reinforcement_cost), (party_set_slot, ":center_no", slot_town_wealth, ":cur_wealth"), (try_end), ]), #Converging center prosperity to ideal prosperity once in every 15 days (24*15, [(try_for_range, ":center_no", centers_begin, centers_end), (call_script, "script_get_center_ideal_prosperity", ":center_no"), (assign, ":ideal_prosperity", reg0), (party_get_slot, ":prosperity", ":center_no", slot_town_prosperity), (try_begin), (gt, ":prosperity", ":ideal_prosperity"), (call_script, "script_change_center_prosperity", ":center_no", -1), (else_try), (lt, ":prosperity", ":ideal_prosperity"), (call_script, "script_change_center_prosperity", ":center_no", 1), (try_end), (try_end), ]), #Checking if the troops are resting at a half payment point (6, [(store_current_day, ":cur_day"), (try_begin), (neq, ":cur_day", "$g_last_half_payment_check_day"), (assign, "$g_last_half_payment_check_day", ":cur_day"), (try_begin), (eq, "$g_half_payment_checkpoint", 1), (val_add, "$g_cur_week_half_daily_wage_payments", 1), #half payment for yesterday (try_end), (assign, "$g_half_payment_checkpoint", 1), (try_end), (assign, ":resting_at_manor_or_walled_center", 0), (try_begin), (neg|map_free), (ge, "$g_last_rest_center", 0), (this_or_next|party_slot_eq, "$g_last_rest_center", slot_center_has_manor, 1), (is_between, "$g_last_rest_center", walled_centers_begin, walled_centers_end), (assign, ":resting_at_manor_or_walled_center", 1), (try_end), (eq, ":resting_at_manor_or_walled_center", 0), (assign, "$g_half_payment_checkpoint", 0), ]), # Give some xp to hero parties (48, [ (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (store_random_in_range, ":rand", 0, 100), (lt, ":rand", 30), (troop_get_slot, ":hero_party", ":troop_no", slot_troop_leaded_party), (gt, ":hero_party", centers_end), (party_is_active, ":hero_party"), (store_skill_level, ":trainer_level", skl_trainer, ":troop_no"), (val_add, ":trainer_level", 2), (store_mul, ":xp_gain", ":trainer_level", 500), (party_upgrade_with_xp, ":hero_party", ":xp_gain"), (try_end), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), (store_random_in_range, ":rand", 0, 100), (lt, ":rand", 10), (party_get_slot, ":center_lord", ":center_no", slot_town_lord), (neq, ":center_lord", "trp_player"), (party_upgrade_with_xp, ":center_no", 3000), (try_end), ]), # Process sieges (24, [ (call_script, "script_process_sieges"), ]), # Process village raids (2, [ (call_script, "script_process_village_raids"), ]), # Decide vassal ai (7, [ (call_script, "script_init_ai_calculation"), (call_script, "script_decide_kingdom_party_ais"), ]), # Hold regular marshall elections for players_kingdom (24, [ (val_add, "$g_election_date", 1), (ge, "$g_election_date", 90), (is_between, "$players_kingdom", kingdoms_begin, kingdoms_end), (neq, "$players_kingdom", "fac_player_supporters_faction"), (assign, "$g_presentation_input", -1), (assign, "$g_presentation_marshall_selection_1_vote", 0), (assign, "$g_presentation_marshall_selection_2_vote", 0), (assign, "$g_presentation_marshall_selection_max_renown_1", -10000), (assign, "$g_presentation_marshall_selection_max_renown_2", -10000), (assign, "$g_presentation_marshall_selection_max_renown_3", -10000), (assign, "$g_presentation_marshall_selection_max_renown_1_troop", -10000), (assign, "$g_presentation_marshall_selection_max_renown_2_troop", -10000), (assign, "$g_presentation_marshall_selection_max_renown_3_troop", -10000), (assign, ":num_men", 0), (try_for_range, ":loop_var", "trp_kingdom_heroes_including_player_begin", kingdom_heroes_end), (assign, ":cur_troop", ":loop_var"), (assign, ":continue", 0), (try_begin), (eq, ":loop_var", "trp_kingdom_heroes_including_player_begin"), (assign, ":cur_troop", "trp_player"), (try_begin), (eq, "$g_player_is_captive", 0), (assign, ":continue", 1), (try_end), (else_try), (store_troop_faction, ":cur_troop_faction", ":cur_troop"), (eq, "$players_kingdom", ":cur_troop_faction"), #(troop_slot_eq, ":cur_troop", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":cur_troop", slot_troop_prisoner_of_party, 0), (troop_slot_ge, ":cur_troop", slot_troop_leaded_party, 1), (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero), (neg|faction_slot_eq, ":cur_troop_faction", slot_faction_leader, ":cur_troop"), (troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party), (gt, ":cur_party", 0), (party_is_active, ":cur_party"), (call_script, "script_party_count_fit_for_battle", ":cur_party"), (assign, ":party_fit_for_battle", reg0), (call_script, "script_party_get_ideal_size", ":cur_party"), (assign, ":ideal_size", reg0), (store_mul, ":relative_strength", ":party_fit_for_battle", 100), (val_div, ":relative_strength", ":ideal_size"), (ge, ":relative_strength", 25), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (val_add, ":num_men", 1), (troop_get_slot, ":renown", ":cur_troop", slot_troop_renown), (try_begin), (gt, ":renown", "$g_presentation_marshall_selection_max_renown_1"), (assign, "$g_presentation_marshall_selection_max_renown_3", "$g_presentation_marshall_selection_max_renown_2"), (assign, "$g_presentation_marshall_selection_max_renown_2", "$g_presentation_marshall_selection_max_renown_1"), (assign, "$g_presentation_marshall_selection_max_renown_1", ":renown"), (assign, "$g_presentation_marshall_selection_max_renown_3_troop", "$g_presentation_marshall_selection_max_renown_2_troop"), (assign, "$g_presentation_marshall_selection_max_renown_2_troop", "$g_presentation_marshall_selection_max_renown_1_troop"), (assign, "$g_presentation_marshall_selection_max_renown_1_troop", ":cur_troop"), (else_try), (gt, ":renown", "$g_presentation_marshall_selection_max_renown_2"), (assign, "$g_presentation_marshall_selection_max_renown_3", "$g_presentation_marshall_selection_max_renown_2"), (assign, "$g_presentation_marshall_selection_max_renown_2", ":renown"), (assign, "$g_presentation_marshall_selection_max_renown_3_troop", "$g_presentation_marshall_selection_max_renown_2_troop"), (assign, "$g_presentation_marshall_selection_max_renown_2_troop", ":cur_troop"), (else_try), (gt, ":renown", "$g_presentation_marshall_selection_max_renown_3"), (assign, "$g_presentation_marshall_selection_max_renown_3", ":renown"), (assign, "$g_presentation_marshall_selection_max_renown_3_troop", ":cur_troop"), (try_end), (try_end), (ge, "$g_presentation_marshall_selection_max_renown_1_troop", 0), (ge, "$g_presentation_marshall_selection_max_renown_2_troop", 0), (ge, "$g_presentation_marshall_selection_max_renown_3_troop", 0), (gt, ":num_men", 2), #at least 1 voter (assign, "$g_election_date", 0), (assign, "$g_presentation_marshall_selection_ended", 0), (try_begin), (neq, "$g_presentation_marshall_selection_max_renown_1_troop", "trp_player"), (neq, "$g_presentation_marshall_selection_max_renown_2_troop", "trp_player"), (start_presentation, "prsnt_marshall_selection"), (else_try), (jump_to_menu, "mnu_marshall_selection_candidate_ask"), (try_end), ]), # Changing readiness to join army (10, [ (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (assign, ":modifier", 1), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (try_begin), (gt, ":party_no", 0), (party_get_slot, ":commander_party", ":party_no", slot_party_commander_party), (ge, ":commander_party", 0), (store_faction_of_party, ":faction_no", ":party_no"), (faction_get_slot, ":faction_marshall", ":faction_no", slot_faction_marshall), (ge, ":faction_marshall", 0), (troop_get_slot, ":marshall_party", ":faction_marshall", slot_troop_leaded_party), (eq, ":commander_party", ":marshall_party"), (assign, ":modifier", -1), (try_end), (troop_get_slot, ":readiness", ":troop_no", slot_troop_readiness_to_join_army), (val_add, ":readiness", ":modifier"), (val_clamp, ":readiness", 0, 100), (troop_set_slot, ":troop_no", slot_troop_readiness_to_join_army, ":readiness"), (assign, ":modifier", 1), (try_begin), (gt, ":party_no", 0), (store_troop_faction, ":troop_faction", ":troop_no"), (eq, ":troop_faction", "fac_player_supporters_faction"), (neg|troop_slot_eq, ":troop_no", slot_troop_player_order_state, spai_undefined), (party_get_slot, ":party_ai_state", ":party_no", slot_party_ai_state), (party_get_slot, ":party_ai_object", ":party_no", slot_party_ai_object), #Check if party is following player orders (try_begin), (troop_slot_eq, ":troop_no", slot_troop_player_order_state, ":party_ai_state"), (troop_slot_eq, ":troop_no", slot_troop_player_order_object, ":party_ai_object"), (assign, ":modifier", -1), (else_try), #Leaving following player orders if the current party order is not the same. (troop_set_slot, ":troop_no", slot_troop_player_order_state, spai_undefined), (troop_set_slot, ":troop_no", slot_troop_player_order_object, -1), (try_end), (try_end), (troop_get_slot, ":readiness", ":troop_no", slot_troop_readiness_to_follow_orders), (val_add, ":readiness", ":modifier"), (val_clamp, ":readiness", 0, 100), (troop_set_slot, ":troop_no", slot_troop_readiness_to_follow_orders, ":readiness"), (try_begin), (lt, ":readiness", 10), (troop_set_slot, ":troop_no", slot_troop_player_order_state, spai_undefined), (troop_set_slot, ":troop_no", slot_troop_player_order_object, -1), (try_end), (try_end), ]), # Process vassal ai (2, [ (call_script, "script_process_kingdom_parties_ai"), ]), # Process alarms (3, [ (call_script, "script_process_alarms"), ]), # Process siege ai (3, [ (store_current_hours, ":cur_hours"), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), (party_get_slot, ":besieger_party", ":center_no", slot_center_is_besieged_by), (gt, ":besieger_party", 0), (party_is_active, ":besieger_party"), (store_faction_of_party, ":besieger_faction", ":besieger_party"), (party_slot_ge, ":center_no", slot_center_is_besieged_by, 1), (party_get_slot, ":siege_begin_hours", ":center_no", slot_center_siege_begin_hours), (store_sub, ":siege_begin_hours", ":cur_hours", ":siege_begin_hours"), (assign, ":launch_attack", 0), (assign, ":call_attack_back", 0), (assign, ":attacker_strength", 0), (assign, ":marshall_attacking", 0), (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (gt, ":party_no", 0), (store_troop_faction, ":troop_faction_no", ":troop_no"), (eq, ":troop_faction_no", ":besieger_faction"), (assign, ":continue", 0), (try_begin), (party_slot_eq, ":party_no", slot_party_ai_state, spai_besieging_center), (party_slot_eq, ":party_no", slot_party_ai_object, ":center_no"), (assign, ":continue", 1), (else_try), (party_get_slot, ":commander_party", ":party_no", slot_party_commander_party), (gt, ":commander_party", 0), (party_is_active, ":commander_party"), (party_slot_eq, ":commander_party", slot_party_ai_state, spai_besieging_center), (party_slot_eq, ":commander_party", slot_party_ai_object, ":center_no"), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (party_get_battle_opponent, ":opponent", ":party_no"), (this_or_next|lt, ":opponent", 0), (eq, ":opponent", ":center_no"), (try_begin), (faction_slot_eq, ":besieger_faction", slot_faction_marshall, ":troop_no"), (assign, ":marshall_attacking", 1), (try_end), (call_script, "script_party_calculate_regular_strength", ":party_no"), (val_add, ":attacker_strength", reg0), (try_end), (try_begin), (gt, ":attacker_strength", 0), (party_collect_attachments_to_party, ":center_no", "p_collective_enemy"), (call_script, "script_party_calculate_regular_strength", "p_collective_enemy"), (assign, ":defender_strength", reg0), (try_begin), (eq, "$auto_enter_town", ":center_no"), (eq, "$g_player_is_captive", 0), (call_script, "script_party_calculate_regular_strength", "p_main_party"), (val_add, ":defender_strength", reg0), (val_mul, ":attacker_strength", 2), #double the power of attackers if the player is in the campaign (try_end), (party_get_slot, ":siege_hardness", ":center_no", slot_center_siege_hardness), (val_add, ":siege_hardness", 100), (val_mul, ":defender_strength", ":siege_hardness"), (val_div, ":defender_strength", 100), (val_max, ":defender_strength", 1), (try_begin), (eq, ":marshall_attacking", 1), (eq, ":besieger_faction", "$players_kingdom"), (check_quest_active, "qst_follow_army"), (val_mul, ":attacker_strength", 2), #double the power of attackers if the player is in the campaign (try_end), (store_mul, ":strength_ratio", ":attacker_strength", 100), (val_div, ":strength_ratio", ":defender_strength"), (store_sub, ":random_up_limit", ":strength_ratio", 300), (try_begin), (gt, ":random_up_limit", -100), #never attack if the strength ratio is less than 200% (store_div, ":siege_begin_hours_effect", ":siege_begin_hours", 3), (val_add, ":random_up_limit", ":siege_begin_hours_effect"), (try_end), (val_div, ":random_up_limit", 5), (val_max, ":random_up_limit", 0), (store_sub, ":random_down_limit", 200, ":strength_ratio"), (val_max, ":random_down_limit", 0), (try_begin), (store_random_in_range, ":rand", 0, 100), (lt, ":rand", ":random_up_limit"), (gt, ":siege_begin_hours", 24),#initial preparation (assign, ":launch_attack", 1), (else_try), (store_random_in_range, ":rand", 0, 100), (lt, ":rand", ":random_down_limit"), (assign, ":call_attack_back", 1), (try_end), (else_try), (assign, ":call_attack_back", 1), (try_end), (try_begin), (eq, ":launch_attack", 1), (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (gt, ":party_no", 0), (assign, ":continue", 0), (try_begin), (party_slot_eq, ":party_no", slot_party_ai_state, spai_besieging_center), (party_slot_eq, ":party_no", slot_party_ai_object, ":center_no"), (party_slot_eq, ":party_no", slot_party_ai_substate, 0), (assign, ":continue", 1), (else_try), (party_get_slot, ":commander_party", ":party_no", slot_party_commander_party), (gt, ":commander_party", 0), (party_is_active, ":commander_party"), (party_slot_eq, ":commander_party", slot_party_ai_state, spai_besieging_center), (party_slot_eq, ":commander_party", slot_party_ai_object, ":center_no"), (call_script, "script_party_set_ai_state", ":party_no", spai_besieging_center, ":center_no"), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (party_set_ai_behavior, ":party_no", ai_bhvr_attack_party), (party_set_ai_object, ":party_no", ":center_no"), (party_set_flags, ":party_no", pf_default_behavior, 1), (party_set_slot, ":party_no", slot_party_ai_substate, 1), (try_end), (else_try), (eq, ":call_attack_back", 1), (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (gt, ":party_no", 0), (party_slot_eq, ":party_no", slot_party_ai_state, spai_besieging_center), (party_slot_eq, ":party_no", slot_party_ai_object, ":center_no"), (party_slot_eq, ":party_no", slot_party_ai_substate, 1), (call_script, "script_party_set_ai_state", ":party_no", spai_undefined, -1), (call_script, "script_party_set_ai_state", ":party_no", spai_besieging_center, ":center_no"), #resetting siege begin time if at least 1 party retreats (party_set_slot, ":center_no", slot_center_siege_begin_hours, ":cur_hours"), (try_end), (try_end), (try_end), ]), # Decide faction ai (36, [ (assign, "$g_recalculate_ais", 1), ]), # Decide faction ai flag check (0, [ (eq, "$g_recalculate_ais", 1), (assign, "$g_recalculate_ais", 0), (call_script, "script_recalculate_ais"), ]), # Count faction armies (24, [ (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end), (call_script, "script_faction_recalculate_strength", ":faction_no"), (try_end), ]), # Reset hero quest status # Change hero relation (36, [ (try_for_range, ":troop_no", heroes_begin, heroes_end), (troop_set_slot, ":troop_no", slot_troop_does_not_give_quest, 0), (try_end), (try_for_range, ":troop_no", village_elders_begin, village_elders_end), (troop_set_slot, ":troop_no", slot_troop_does_not_give_quest, 0), (try_end), ]), # Refresh merchant inventories (24, [ (try_for_range, ":village_no", villages_begin, villages_end), (call_script, "script_refresh_village_merchant_inventory", ":village_no"), (try_end), ]), #Refreshing village defenders #Clearing slot_village_player_can_not_steal_cattle flags (48, [ (try_for_range, ":village_no", villages_begin, villages_end), (call_script, "script_refresh_village_defenders", ":village_no"), (party_set_slot, ":village_no", slot_village_player_can_not_steal_cattle, 0), (try_end), ]), # Refresh number of cattle in villages (24, [(try_for_range, ":village_no", villages_begin, villages_end), (party_get_slot, ":num_cattle", ":village_no", slot_village_number_of_cattle), (store_random_in_range, ":random_no", 0, 100), (try_begin), (lt, ":random_no", 3),#famine (assign, ":num_cattle", 0), (try_begin), # (eq, "$cheat_mode", 1), # (str_store_party_name, s1, ":village_no"), # (display_message, "@Cattle in {s1} are exterminated due to famine."), (try_end), (else_try), (lt, ":random_no", 10),#double growth (store_random_in_range, ":random_no", 111, 121), (val_mul, ":num_cattle", ":random_no"), (val_div, ":num_cattle", 100), (store_random_in_range, ":random_no", 1, 3), (val_add, ":num_cattle", ":random_no"), (else_try), (lt, ":random_no", 50),#negative growth (store_random_in_range, ":random_no", 3, 8), (val_sub, ":num_cattle", ":random_no"), (else_try),#positive growth (store_random_in_range, ":random_no", 101, 111), (val_mul, ":num_cattle", ":random_no"), (val_div, ":num_cattle", 100), (store_random_in_range, ":random_no", 1, 3), (val_add, ":num_cattle", ":random_no"), (try_end), (val_clamp, ":num_cattle", 0, 101), (party_set_slot, ":village_no", slot_village_number_of_cattle, ":num_cattle"), #Reassigning the cattle production in the village (store_sub, ":production", ":num_cattle", 10), (val_div, ":production", 2), (call_script, "script_center_change_trade_good_production", ":village_no", "itm_cattle_meat", ":production", 0), (try_end), ]), # Accumulate taxes (24 * 7, [ (try_for_range, ":center_no", centers_begin, centers_end), (party_get_slot, ":accumulated_rents", ":center_no", slot_center_accumulated_rents), (assign, ":cur_rents", 0), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_village), (try_begin), (party_slot_eq, ":center_no", slot_village_state, svs_normal), (assign, ":cur_rents", 500), (try_end), (else_try), (party_slot_eq, ":center_no", slot_party_type, spt_castle), (assign, ":cur_rents", 250), (else_try), (party_slot_eq, ":center_no", slot_party_type, spt_town), (assign, ":cur_rents", 1000), (try_end), (party_get_slot, ":prosperity", ":center_no", slot_town_prosperity), (store_add, ":multiplier", 10, ":prosperity"), (val_mul, ":cur_rents", ":multiplier"), (val_div, ":cur_rents", 110),#Prosperity of 100 gives the default values (val_add, ":accumulated_rents", ":cur_rents"), (party_set_slot, ":center_no", slot_center_accumulated_rents, ":accumulated_rents"), (try_end), #Adding earnings to town lords' wealths. (try_for_range, ":center_no", centers_begin, centers_end), (party_get_slot, ":town_lord", ":center_no", slot_town_lord), (neq, ":town_lord", "trp_player"), (is_between, ":town_lord", kingdom_heroes_begin, kingdom_heroes_end), (party_get_slot, ":accumulated_rents", ":center_no", slot_center_accumulated_rents), (party_get_slot, ":accumulated_tariffs", ":center_no", slot_center_accumulated_tariffs), (troop_get_slot, ":troop_wealth", ":town_lord", slot_troop_wealth), (val_add, ":troop_wealth", ":accumulated_rents"), (val_add, ":troop_wealth", ":accumulated_tariffs"), (troop_set_slot, ":town_lord", slot_troop_wealth, ":troop_wealth"), (party_set_slot, ":center_no", slot_center_accumulated_rents, 0), (party_set_slot, ":center_no", slot_center_accumulated_tariffs, 0), (try_begin), (eq, "$cheat_mode", 1), (assign, reg1, ":troop_wealth"), (add_troop_note_from_sreg, ":town_lord", 1, "@Current wealth: {reg1}", 0), (try_end), (try_end), ]), # (7 * 24, # [ ## (call_script, "script_get_number_of_unclaimed_centers_by_player"), ## (assign, ":unclaimed_centers", reg0), ## (gt, ":unclaimed_centers", 0), # You are holding an estate without a lord. # (try_for_range, ":troop_no", heroes_begin, heroes_end), # (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), # (troop_get_slot, ":relation", ":troop_no", slot_troop_player_relation), # (val_sub, ":relation", 1), # (val_max, ":relation", -100), # (troop_set_slot, ":troop_no", slot_troop_player_relation, ":relation"), # (try_end), # You relation with all kingdoms other than your own has decreased by 1. # (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end), # (neq, ":faction_no", "$players_kingdom"), # (store_relation,":faction_relation",":faction_no","fac_player_supporters_faction"), # (val_sub, ":faction_relation", 1), # (val_max, ":faction_relation", -100), # WARNING: Never use set_relation! # (set_relation, ":faction_no", "fac_player_supporters_faction", ":faction_relation"), # (try_end), # ]), # Offer player to join faction (32, [ (eq, "$players_kingdom", 0), (le, "$g_invite_faction", 0), (eq, "$g_player_is_captive", 0), (store_random_in_range, ":kingdom_no", kingdoms_begin, kingdoms_end), (assign, ":min_distance", 999999), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), (store_faction_of_party, ":center_faction", ":center_no"), (eq, ":center_faction", ":kingdom_no"), (store_distance_to_party_from_party, ":cur_distance", "p_main_party", ":center_no"), (val_min, ":min_distance", ":cur_distance"), (try_end), (lt, ":min_distance", 30), (store_relation, ":kingdom_relation", ":kingdom_no", "fac_player_supporters_faction"), (faction_get_slot, ":kingdom_lord", ":kingdom_no", slot_faction_leader), (call_script, "script_troop_get_player_relation", ":kingdom_lord"), (assign, ":lord_relation", reg0), #(troop_get_slot, ":lord_relation", ":kingdom_lord", slot_troop_player_relation), (call_script, "script_get_number_of_hero_centers", "trp_player"), (assign, ":num_centers_owned", reg0), (try_begin), (eq, ":num_centers_owned", 0), (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown), (ge, ":player_renown", 160), (ge, ":kingdom_relation", 0), (ge, ":lord_relation", 0), (store_random_in_range, ":rand", 0, 100), (lt, ":rand", 50), (call_script, "script_get_poorest_village_of_faction", ":kingdom_no"), (assign, "$g_invite_offered_center", reg0), (ge, "$g_invite_offered_center", 0), (assign, "$g_invite_faction", ":kingdom_no"), (jump_to_menu, "mnu_invite_player_to_faction"), (else_try), (gt, ":num_centers_owned", 0), (neq, "$players_oath_renounced_against_kingdom", ":kingdom_no"), (ge, ":kingdom_relation", -80), (ge, ":lord_relation", -30), (store_random_in_range, ":rand", 0, 100), (lt, ":rand", 20), (assign, "$g_invite_faction", ":kingdom_no"), (assign, "$g_invite_offered_center", -1), (jump_to_menu, "mnu_invite_player_to_faction_without_center"), (try_end), ]), # Change kingdom relations (24 * 7, [(call_script, "script_randomly_start_war_peace", 1), ]), # During rebellion, removing troops from player faction randomly because of low relation points (5, [ (gt, "$supported_pretender", 0), (try_for_range, ":cur_troop", kingdom_heroes_begin, kingdom_heroes_end), (store_troop_faction, ":cur_faction", ":cur_troop"), (eq, ":cur_faction", "fac_player_supporters_faction"), (neg|troop_slot_ge, ":cur_troop", slot_troop_change_to_faction, 1), (call_script, "script_troop_get_player_relation", ":cur_troop"), (assign, ":player_relation", reg0), #(troop_get_slot, ":player_relation", ":cur_troop", slot_troop_player_relation), (lt, ":player_relation", -5), (neq, "$supported_pretender", ":cur_troop"), (val_mul, ":player_relation", -1), (val_sub, ":player_relation", 5), (store_random_in_range, ":random_no", 0, 2000), (lt, ":random_no", ":player_relation"), (call_script, "script_cf_get_random_active_faction_except_player_faction_and_faction", -1), (troop_set_slot, ":cur_troop", slot_troop_change_to_faction, reg0), (try_end), ]), # Reset kingdom lady current centers ## (28, ## [ ## (try_for_range, ":troop_no", heroes_begin, heroes_end), ## (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_lady), ## ## # Find the active quest ladies ## (assign, ":not_ok", 0), ## (try_for_range, ":quest_no", lord_quests_begin, lord_quests_end), ## (eq, ":not_ok", 0), ## (check_quest_active, ":quest_no"), ## (quest_slot_eq, ":quest_no", slot_quest_object_troop, ":troop_no"), ## (assign, ":not_ok", 1), ## (try_end), ## (eq, ":not_ok", 0), ## ## (troop_get_slot, ":troop_center", ":troop_no", slot_troop_cur_center), ## (assign, ":is_under_siege", 0), ## (try_begin), ## (is_between, ":troop_center", walled_centers_begin, walled_centers_end), ## (party_get_battle_opponent, ":besieger_party", ":troop_center"), ## (gt, ":besieger_party", 0), ## (assign, ":is_under_siege", 1), ## (try_end), ## ## (eq, ":is_under_siege", 0),# Omit ladies in centers under siege ## ## (try_begin), ## (store_random_in_range, ":random_num",0, 100), ## (lt, ":random_num", 20), ## (store_troop_faction, ":cur_faction", ":troop_no"), ## (call_script, "script_cf_select_random_town_with_faction", ":cur_faction"),#Can fail ## (troop_set_slot, ":troop_no", slot_troop_cur_center, reg0), ## (try_end), ## ## (store_random_in_range, ":random_num",0, 100), ## (lt, ":random_num", 50), ## (troop_get_slot, ":lord_no", ":troop_no", slot_troop_father), ## (try_begin), ## (eq, ":lord_no", 0), ## (troop_get_slot, ":lord_no", ":troop_no", slot_troop_spouse), ## (try_end), ## (gt, ":lord_no", 0), ## (troop_get_slot, ":cur_party", ":lord_no", slot_troop_leaded_party), ## (gt, ":cur_party", 0), ## (party_get_attached_to, ":cur_center", ":cur_party"), ## (gt, ":cur_center", 0), ## ## (troop_set_slot, ":troop_no", slot_troop_cur_center, ":cur_center"), ## (try_end), ## ]), # Attach Lord Parties to the town they are in (0.1, [ (try_for_range, ":troop_no", heroes_begin, heroes_end), (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), (troop_get_slot, ":troop_party_no", ":troop_no", slot_troop_leaded_party), (ge, ":troop_party_no", 1), (party_get_attached_to, ":cur_attached_town", ":troop_party_no"), (lt, ":cur_attached_town", 1), (party_get_cur_town, ":destination", ":troop_party_no"), (is_between, ":destination", centers_begin, centers_end), (call_script, "script_get_relation_between_parties", ":destination", ":troop_party_no"), (try_begin), (ge, reg0, 0), (party_attach_to_party, ":troop_party_no", ":destination"), (else_try), (party_set_ai_behavior, ":troop_party_no", ai_bhvr_hold), (try_end), (try_begin), (this_or_next|party_slot_eq, ":destination", slot_party_type, spt_town), (party_slot_eq, ":destination", slot_party_type, spt_castle), (store_faction_of_party, ":troop_faction_no", ":troop_party_no"), (store_faction_of_party, ":destination_faction_no", ":destination"), (eq, ":troop_faction_no", ":destination_faction_no"), (party_get_num_prisoner_stacks, ":num_stacks", ":troop_party_no"), (gt, ":num_stacks", 0), (assign, "$g_move_heroes", 1), (call_script, "script_party_prisoners_add_party_prisoners", ":destination", ":troop_party_no"),#Moving prisoners to the center (assign, "$g_move_heroes", 1), (call_script, "script_party_remove_all_prisoners", ":troop_party_no"), (try_end), (try_end), ]), # Check escape chances of hero prisoners. (48, [ (call_script, "script_randomly_make_prisoner_heroes_escape_from_party", "p_main_party", 50), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), ## (party_slot_eq, ":center_no", slot_town_lord, "trp_player"), (assign, ":chance", 30), (try_begin), (party_slot_eq, ":center_no", slot_center_has_prisoner_tower, 1), (assign, ":chance", 5), (try_end), (call_script, "script_randomly_make_prisoner_heroes_escape_from_party", ":center_no", ":chance"), (try_end), ]), # Asking the ownership of captured centers to the player (3, [ (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"), (this_or_next|party_slot_eq, ":center_no", slot_town_lord, stl_reserved_for_player), (this_or_next|party_slot_eq, ":center_no", slot_town_lord, stl_unassigned), (party_slot_eq, ":center_no", slot_town_lord, stl_rejected_by_player), (assign, "$g_center_taken_by_player_faction", ":center_no"), (try_end), (ge, "$g_center_taken_by_player_faction", 0), (faction_get_slot, ":leader", "fac_player_supporters_faction", slot_faction_leader), (start_map_conversation, ":leader"), ]), # Respawn hero party after kingdom hero is released from captivity. (48, [ (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero), #(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0), (neg|troop_slot_ge, ":troop_no", slot_troop_leaded_party, 1), (store_troop_faction, ":cur_faction", ":troop_no"), (try_begin), (call_script, "script_cf_select_random_walled_center_with_faction_and_owner_priority_no_siege", ":cur_faction", ":troop_no"),#Can fail (assign, ":center_no", reg0), (call_script, "script_create_kingdom_hero_party", ":troop_no", ":center_no"), (party_attach_to_party, "$pout_party", ":center_no"), (else_try), (neg|faction_slot_eq, ":cur_faction", slot_faction_state, sfs_active), (try_begin), (is_between, ":troop_no", kings_begin, kings_end), (troop_set_slot, ":troop_no", slot_troop_change_to_faction, "fac_commoners"), (else_try), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 10), (call_script, "script_cf_get_random_active_faction_except_player_faction_and_faction", ":cur_faction"), (troop_set_slot, ":troop_no", slot_troop_change_to_faction, reg0), (try_end), (try_end), (try_end), ]), # Spawn merchant caravan parties ## (3, ## [ ## (try_for_range, ":troop_no", merchants_begin, merchants_end), ## (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_merchant), ## (troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0), ## (neg|troop_slot_ge, ":troop_no", slot_troop_leaded_party, 1), ## ## (call_script, "script_cf_create_merchant_party", ":troop_no"), ## (try_end), ## ]), # Spawn village farmer parties (24, [ (try_for_range, ":village_no", villages_begin, villages_end), (party_slot_eq, ":village_no", slot_village_state, svs_normal), (party_get_slot, ":farmer_party", ":village_no", slot_village_farmer_party), (this_or_next|eq, ":farmer_party", 0), (neg|party_is_active, ":farmer_party"), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 30), (call_script, "script_create_village_farmer_party", ":village_no"), (party_set_slot, ":village_no", slot_village_farmer_party, reg0), # (str_store_party_name, s1, ":village_no"), # (display_message, "@Village farmers created at {s1}."), (try_end), ]), (72, [ # Updating trade good prices according to the productions (call_script, "script_update_trade_good_prices"), # Updating player odds (try_for_range, ":cur_center", centers_begin, centers_end), (party_get_slot, ":player_odds", ":cur_center", slot_town_player_odds), (try_begin), (gt, ":player_odds", 1000), (val_mul, ":player_odds", 95), (val_div, ":player_odds", 100), (val_max, ":player_odds", 1000), (else_try), (lt, ":player_odds", 1000), (val_mul, ":player_odds", 105), (val_div, ":player_odds", 100), (val_min, ":player_odds", 1000), (try_end), (party_set_slot, ":cur_center", slot_town_player_odds, ":player_odds"), (try_end), ]), #Troop AI: Merchants thinking (8, [ (try_for_parties, ":party_no"), (party_slot_eq, ":party_no", slot_party_type, spt_kingdom_caravan), (party_is_in_any_town, ":party_no"), (store_faction_of_party, ":merchant_faction", ":party_no"), (faction_get_slot, ":num_towns", ":merchant_faction", slot_faction_num_towns), (try_begin), (le, ":num_towns", 0), (remove_party, ":party_no"), (else_try), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 35), (party_get_cur_town, ":cur_center", ":party_no"), (assign, ":can_leave", 1), (try_begin), (is_between, ":cur_center", walled_centers_begin, walled_centers_end), (neg|party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1), (assign, ":can_leave", 0), (try_end), (eq, ":can_leave", 1), (assign, ":do_trade", 0), (try_begin), (party_get_slot, ":cur_ai_state", ":party_no", slot_party_ai_state), (eq, ":cur_ai_state", spai_trading_with_town), (party_get_slot, ":cur_ai_object", ":party_no", slot_party_ai_object), (eq, ":cur_center", ":cur_ai_object"), (assign, ":do_trade", 1), (try_end), (assign, ":target_center", -1), (try_begin), #Make sure escorted caravan continues to its original destination. (eq, "$caravan_escort_party_id", ":party_no"), (neg|party_is_in_town, ":party_no", "$caravan_escort_destination_town"), (assign, ":target_center", "$caravan_escort_destination_town"), (else_try), (call_script, "script_cf_select_random_town_at_peace_with_faction_in_trade_route", ":cur_center", ":merchant_faction"), (assign, ":target_center", reg0), (try_end), (is_between, ":target_center", towns_begin, towns_end), (neg|party_is_in_town, ":party_no", ":target_center"), (try_begin), (eq, ":do_trade", 1), (call_script, "script_do_merchant_town_trade", ":party_no", ":cur_center"), (try_end), (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party), (party_set_ai_object, ":party_no", ":target_center"), (party_set_flags, ":party_no", pf_default_behavior, 0), (party_set_slot, ":party_no", slot_party_ai_state, spai_trading_with_town), (party_set_slot, ":party_no", slot_party_ai_object, ":target_center"), (try_end), (try_end), ]), #Troop AI: Village farmers thinking (8, [ (try_for_parties, ":party_no"), (party_slot_eq, ":party_no", slot_party_type, spt_village_farmer), (party_is_in_any_town, ":party_no"), (party_get_slot, ":home_center", ":party_no", slot_party_home_center), (party_get_cur_town, ":cur_center", ":party_no"), (assign, ":can_leave", 1), (try_begin), (is_between, ":cur_center", walled_centers_begin, walled_centers_end), (neg|party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1), (assign, ":can_leave", 0), (try_end), (eq, ":can_leave", 1), (try_begin), (eq, ":cur_center", ":home_center"), (try_begin), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 5), (call_script, "script_do_party_center_trade", ":party_no", ":home_center", 50), (assign, ":total_change", reg0), (party_get_slot, ":prosperity", ":home_center", slot_town_prosperity), (val_add, ":prosperity", 30), (val_mul, ":total_change", ":prosperity"), (val_div, ":total_change", 2600), #(30 + prosperity) / 130 * 5% of the sales. #Adding tax revenue to the center (party_get_slot, ":accumulated_tariffs", ":home_center", slot_center_accumulated_tariffs), (val_add, ":accumulated_tariffs", ":total_change"), (party_set_slot, ":home_center", slot_center_accumulated_tariffs, ":accumulated_tariffs"), #Moving farmers to the home town (party_get_slot, ":market_town", ":home_center", slot_village_market_town), (party_set_slot, ":party_no", slot_party_ai_object, ":market_town"), (party_set_slot, ":party_no", slot_party_ai_state, spai_trading_with_town), (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party), (party_set_ai_object, ":party_no", ":market_town"), ## (try_begin), ## (eq, "$cheat_mode", 1), ## (str_store_party_name, s1, ":home_center"), ## (assign, reg1, ":total_change"), ## (display_message, "@Village farmers traded with {s1} merchants. Tax={reg1}"), ## (try_end), (try_end), (else_try), (try_begin), (party_get_slot, ":cur_ai_object", ":party_no", slot_party_ai_object), (eq, ":cur_center", ":cur_ai_object"), (call_script, "script_do_party_center_trade", ":party_no", ":cur_ai_object", 10), (assign, ":total_change", reg0), (party_get_slot, ":prosperity", ":cur_ai_object", slot_town_prosperity), (val_add, ":prosperity", 30), (val_mul, ":total_change", ":prosperity"), (val_div, ":total_change", 2600), #(30 + prosperity) / 130 * 5% of the sales. #Adding tax revenue to the center (party_get_slot, ":accumulated_tariffs", ":cur_ai_object", slot_center_accumulated_tariffs), (val_add, ":accumulated_tariffs", ":total_change"), (party_set_slot, ":cur_ai_object", slot_center_accumulated_tariffs, ":accumulated_tariffs"), #Adding tax revenue to the home center (party_get_slot, ":accumulated_tariffs", ":home_center", slot_center_accumulated_tariffs), (val_add, ":accumulated_tariffs", ":total_change"), (party_set_slot, ":home_center", slot_center_accumulated_tariffs, ":accumulated_tariffs"), #Increasing food stocks of the town (party_get_slot, ":town_food_store", ":cur_ai_object", slot_party_food_store), (call_script, "script_center_get_food_store_limit", ":cur_ai_object"), (assign, ":food_store_limit", reg0), (val_add, ":town_food_store", 1000), (val_min, ":town_food_store", ":food_store_limit"), (party_set_slot, ":cur_ai_object", slot_party_food_store, ":town_food_store"), #Adding 1 to village prosperity (try_begin), (store_random_in_range, ":rand", 0, 100), (lt, ":rand", 35), (call_script, "script_change_center_prosperity", ":home_center", 1), (try_end), (try_end), #Moving farmers to their home village (party_set_slot, ":party_no", slot_party_ai_object, ":home_center"), (party_set_slot, ":party_no", slot_party_ai_state, spai_trading_with_town), (party_set_ai_behavior, ":party_no", ai_bhvr_travel_to_party), (party_set_ai_object, ":party_no", ":home_center"), ## (try_begin), ## (eq, "$cheat_mode", 1), ## (str_store_party_name, s1, ":cur_ai_object"), ## (assign, reg1, ":total_change"), ## (display_message, "@Village farmers traded with {s1} merchants. Tax={reg1} to both sides"), ## (try_end), (try_end), (try_end), ]), #Increase castle food stores (2, [ (try_for_range, ":center_no", castles_begin, castles_end), (party_slot_eq, ":center_no", slot_center_is_besieged_by, -1), #castle is not under siege (party_get_slot, ":center_food_store", ":center_no", slot_party_food_store), (val_add, ":center_food_store", 100), (call_script, "script_center_get_food_store_limit", ":center_no"), (assign, ":food_store_limit", reg0), (val_min, ":center_food_store", ":food_store_limit"), (party_set_slot, ":center_no", slot_party_food_store, ":center_food_store"), (try_end), ]), #cache party strengths (to avoid re-calculating) ## (2, ## [ ## (try_for_range, ":cur_troop", heroes_begin, heroes_end), ## (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero), ## (troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party), ## (ge, ":cur_party", 0), ## (call_script, "script_party_calculate_strength", ":cur_party", 0), #will update slot_party_cached_strength ## (try_end), ## ]), ## ## (6, ## [ ## (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end), ## (call_script, "script_party_calculate_strength", ":cur_center", 0), #will update slot_party_cached_strength ## (try_end), ## ]), ## (1, ## [ ## (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end), ## (store_random_in_range, ":rand", 0, 100), ## (lt, ":rand", 10), ## (store_faction_of_party, ":center_faction", ":cur_center"), ## (assign, ":friend_strength", 0), ## (try_for_range, ":cur_troop", heroes_begin, heroes_end), ## (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero), ## (troop_get_slot, ":cur_troop_party", ":cur_troop", slot_troop_leaded_party), ## (gt, ":cur_troop_party", 0), ## (store_distance_to_party_from_party, ":distance", ":cur_troop_party", ":cur_center"), ## (lt, ":distance", 10), ## (store_troop_faction, ":army_faction", ":cur_troop"), ## (store_relation, ":rel", ":army_faction", ":center_faction"), ## (try_begin), ## (gt, ":rel", 10), ## (party_get_slot, ":str", ":cur_troop_party", slot_party_cached_strength), ## (val_add, ":friend_strength", ":str"), ## (try_end), ## (try_end), ## (party_set_slot, ":cur_center", slot_party_nearby_friend_strength, ":friend_strength"), ## (try_end), ## ]), # Make heroes running away from someone retreat to friendly centers (0.5, [ (try_for_range, ":cur_troop", heroes_begin, heroes_end), (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), (try_begin), (party_is_active, ":cur_party"), (try_begin), (get_party_ai_current_behavior, ":ai_bhvr", ":cur_party"), (eq, ":ai_bhvr", ai_bhvr_avoid_party), (store_faction_of_party, ":party_faction", ":cur_party"), (party_get_slot, ":commander_party", ":cur_party", slot_party_commander_party), (faction_get_slot, ":faction_marshall", ":party_faction", slot_faction_marshall), (neq, ":faction_marshall", ":cur_troop"), (assign, ":continue", 1), (try_begin), (ge, ":faction_marshall", 0), (troop_get_slot, ":faction_marshall_party", ":faction_marshall", slot_troop_leaded_party), (ge, ":faction_marshall_party", 0), (eq, ":commander_party", ":faction_marshall_party"), (assign, ":continue", 0), (try_end), (eq, ":continue", 1), (assign, ":done", 0), (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end), (eq, ":done", 0), (party_slot_eq, ":cur_center", slot_center_is_besieged_by, -1), (store_faction_of_party, ":center_faction", ":cur_center"), (store_relation, ":cur_relation", ":center_faction", ":party_faction"), (gt, ":cur_relation", 0), (store_distance_to_party_from_party, ":cur_distance", ":cur_party", ":cur_center"), (lt, ":cur_distance", 20), (party_get_position, pos1, ":cur_party"), (party_get_position, pos2, ":cur_center"), (neg|position_is_behind_position, pos2, pos1), (call_script, "script_party_set_ai_state", ":cur_party", spai_retreating_to_center, ":cur_center"), (assign, ":done", 1), (try_end), (try_end), (else_try), (troop_set_slot, ":cur_troop", slot_troop_leaded_party, -1), (try_end), (try_end), ]), # Centers give alarm if the player is around (0.5, [ (store_current_hours, ":cur_hours"), (store_mod, ":cur_hours_mod", ":cur_hours", 11), (store_sub, ":hour_limit", ":cur_hours", 5), (party_get_num_companions, ":num_men", "p_main_party"), (party_get_num_prisoners, ":num_prisoners", "p_main_party"), (val_add, ":num_men", ":num_prisoners"), (convert_to_fixed_point, ":num_men"), (store_sqrt, ":num_men_effect", ":num_men"), (convert_from_fixed_point, ":num_men_effect"), (try_begin), (eq, ":cur_hours_mod", 0), #Reduce alarm by 2 in every 11 hours. (try_for_range, ":cur_faction", kingdoms_begin, kingdoms_end), (faction_get_slot, ":player_alarm", ":cur_faction", slot_faction_player_alarm), (val_sub, ":player_alarm", 1), (val_max, ":player_alarm", 0), (faction_set_slot, ":cur_faction", slot_faction_player_alarm, ":player_alarm"), (try_end), (try_end), (eq, "$g_player_is_captive", 0), (try_for_range, ":cur_center", centers_begin, centers_end), (store_faction_of_party, ":cur_faction", ":cur_center"), (store_relation, ":reln", ":cur_faction", "fac_player_supporters_faction"), (lt, ":reln", 0), (store_distance_to_party_from_party, ":dist", "p_main_party", ":cur_center"), (lt, ":dist", 5), (store_mul, ":dist_sqr", ":dist", ":dist"), (store_sub, ":dist_effect", 20, ":dist_sqr"), (store_sub, ":reln_effect", 20, ":reln"), (store_mul, ":total_effect", ":dist_effect", ":reln_effect"), (val_mul, ":total_effect", ":num_men_effect"), (store_div, ":spot_chance", ":total_effect", 10), (store_random_in_range, ":random_spot", 0, 1000), (lt, ":random_spot", ":spot_chance"), (faction_get_slot, ":player_alarm", ":cur_faction", slot_faction_player_alarm), (val_add, ":player_alarm", 1), (val_min, ":player_alarm", 100), (faction_set_slot, ":cur_faction", slot_faction_player_alarm, ":player_alarm"), (try_begin), (neg|party_slot_ge, ":cur_center", slot_center_last_player_alarm_hour, ":hour_limit"), (str_store_party_name_link, s1, ":cur_center"), (display_message, "@Your party is spotted by {s1}."), (party_set_slot, ":cur_center", slot_center_last_player_alarm_hour, ":cur_hours"), (try_end), (try_end), ]), # Consuming food at every 14 hours (14, [#(store_sub, ":num_food", food_end, food_begin), (eq, "$g_player_is_captive", 0), (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), ############################## # Changed by Form Ranks kit # (party_get_num_attached_parties, ":arrays", "p_main_party"), (try_for_range, ":i", 0, ":arrays"), (party_get_attached_party_with_rank, ":array_party", "p_main_party", ":i"), (store_party_size, ":array_size", ":array_party"), (val_add, ":num_men", ":array_size"), (try_end), # # Change of Form Ranks kit end ############################### (val_div, ":num_men", 3), (try_begin), (eq, ":num_men", 0), (val_add, ":num_men", 1), (try_end), (assign, ":consumption_amount", ":num_men"), (assign, ":no_food_displayed", 0), (try_for_range, ":unused", 0, ":consumption_amount"), (assign, ":available_food", 0), (try_for_range, ":cur_food", food_begin, food_end), (item_set_slot, ":cur_food", slot_item_is_checked, 0), (call_script, "script_cf_player_has_item_without_modifier", ":cur_food", imod_rotten), (val_add, ":available_food", 1), (try_end), (try_begin), (gt, ":available_food", 0), (store_random_in_range, ":selected_food", 0, ":available_food"), (call_script, "script_consume_food", ":selected_food"), (else_try), (eq, ":no_food_displayed", 0), (display_message, "@Party has nothing to eat!", 0xFF0000), (call_script, "script_change_player_party_morale", -3), (assign, ":no_food_displayed", 1), #NPC companion changes begin (try_begin), (call_script, "script_party_count_fit_regulars", "p_main_party"), (gt, reg0, 0), (call_script, "script_objectionable_action", tmt_egalitarian, "str_men_hungry"), (try_end), #NPC companion changes end (try_end), (try_end), ]), # Setting item modifiers for food (24, [ (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"), (eq, ":item_id", "itm_cattle_meat"), (troop_get_inventory_slot_modifier, ":modifier", "trp_player", ":i_slot"), (try_begin), (ge, ":modifier", imod_fresh), (lt, ":modifier", imod_rotten), (val_add, ":modifier", 1), (troop_set_inventory_slot_modifier, "trp_player", ":i_slot", ":modifier"), (else_try), (lt, ":modifier", imod_fresh), (troop_set_inventory_slot_modifier, "trp_player", ":i_slot", imod_fresh), (try_end), (try_end), ]), # Assigning lords to centers with no leaders (72, [(call_script, "script_assign_lords_to_empty_centers"), ]), # Updating player icon in every frame (0, [(troop_get_inventory_slot, ":cur_horse", "trp_player", 8), #horse slot (assign, ":new_icon", -1), (try_begin), (eq, "$g_player_icon_state", pis_normal), (try_begin), (ge, ":cur_horse", 0), (assign, ":new_icon", "icon_player_horseman"), (else_try), (assign, ":new_icon", "icon_player"), (try_end), (else_try), (eq, "$g_player_icon_state", pis_camping), (assign, ":new_icon", "icon_camp"), (else_try), (eq, "$g_player_icon_state", pis_ship), (assign, ":new_icon", "icon_ship"), (try_end), (neq, ":new_icon", "$g_player_party_icon"), (assign, "$g_player_party_icon", ":new_icon"), (party_set_icon, "p_main_party", ":new_icon"), ]), #Update how good a target player is for bandits (2, [ (store_troop_gold, ":total_value", "trp_player"), (store_div, ":bandit_attraction", ":total_value", (10000/100)), #10000 gold = excellent_target (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), (val_clamp, ":bandit_attraction", 0, 100), (party_set_bandit_attraction, "p_main_party", ":bandit_attraction"), ]), # Checking escape chances of prisoners that joined the party recently. (6, [(gt, "$g_prisoner_recruit_troop_id", 0), (gt, "$g_prisoner_recruit_size", 0), (gt, "$g_prisoner_recruit_last_time", 0), (is_currently_night), (try_begin), (store_skill_level, ":leadership", "skl_leadership", "trp_player"), (val_mul, ":leadership", 5), (store_sub, ":chance", 66, ":leadership"), (gt, ":chance", 0), (assign, ":num_escaped", 0), (try_for_range, ":unused", 0, "$g_prisoner_recruit_size"), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", ":chance"), (val_add, ":num_escaped", 1), (try_end), (party_remove_members, "p_main_party", "$g_prisoner_recruit_troop_id", ":num_escaped"), (assign, ":num_escaped", reg0), (gt, ":num_escaped", 0), (try_begin), (gt, ":num_escaped", 1), (assign, reg2, 1), (else_try), (assign, reg2, 0), (try_end), (assign, reg1, ":num_escaped"), (str_store_troop_name_by_count, s1, "$g_prisoner_recruit_troop_id", ":num_escaped"), (display_log_message, "@{reg1} {s1} {reg2?have:has} escaped from your party during the night."), (try_end), (assign, "$g_prisoner_recruit_troop_id", 0), (assign, "$g_prisoner_recruit_size", 0), ]), # Offering ransom fees for player's prisoner heroes (24, [(neq, "$g_ransom_offer_rejected", 1), (call_script, "script_offer_ransom_amount_to_player_for_prisoners_in_party", "p_main_party"), (eq, reg0, 0),#no prisoners offered (assign, ":end_cond", walled_centers_end), (try_for_range, ":center_no", walled_centers_begin, ":end_cond"), (party_slot_eq, ":center_no", slot_town_lord, "trp_player"), (call_script, "script_offer_ransom_amount_to_player_for_prisoners_in_party", ":center_no"), (eq, reg0, 1),#a prisoner is offered (assign, ":end_cond", 0),#break (try_end), ]), # Exchanging hero prisoners between factions and clearing old ransom offers (72, [(assign, "$g_ransom_offer_rejected", 0), (try_for_range, ":center_no", walled_centers_begin, walled_centers_end), (party_get_slot, ":town_lord", ":center_no", slot_town_lord), (gt, ":town_lord", 0), (party_get_num_prisoner_stacks, ":num_stacks", ":center_no"), (try_for_range_backwards, ":i_stack", 0, ":num_stacks"), (party_prisoner_stack_get_troop_id, ":stack_troop", ":center_no", ":i_stack"), (troop_is_hero, ":stack_troop"), (troop_slot_eq, ":stack_troop", slot_troop_occupation, slto_kingdom_hero), (store_random_in_range, ":random_no", 0, 100), (try_begin), (le, ":random_no", 10), (call_script, "script_calculate_ransom_amount_for_troop", ":stack_troop"), (assign, ":ransom_amount", reg0), (troop_get_slot, ":wealth", ":town_lord", slot_troop_wealth), (val_add, ":wealth", ":ransom_amount"), (troop_set_slot, ":town_lord", slot_troop_wealth, ":wealth"), (party_remove_prisoners, ":center_no", ":stack_troop", 1), (call_script, "script_remove_troop_from_prison", ":stack_troop"), (store_troop_faction, ":faction_no", ":town_lord"), (store_troop_faction, ":troop_faction", ":stack_troop"), (str_store_troop_name, s1, ":stack_troop"), (str_store_faction_name, s2, ":faction_no"), (str_store_faction_name, s3, ":troop_faction"), (display_log_message, "@{s1} of {s3} has been released from captivity."), (try_end), (try_end), (try_end), ]), # Adding mercenary troops to the towns (72, [(call_script, "script_update_mercenary_units_of_towns"), #NPC changes begin # removes (call_script, "script_update_companion_candidates_in_taverns"), #NPC changes end (call_script, "script_update_ransom_brokers"), (call_script, "script_update_tavern_travelers"), (call_script, "script_update_tavern_minstels"), (call_script, "script_update_booksellers"), (call_script, "script_update_villages_infested_by_bandits"), (try_for_range, ":village_no", villages_begin, villages_end), (call_script, "script_update_volunteer_troops_in_village", ":village_no"), (call_script, "script_update_npc_volunteer_troops_in_village", ":village_no"), (try_end), ]), # Setting random walker types (36, [(try_for_range, ":center_no", centers_begin, centers_end), (this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town), ( party_slot_eq, ":center_no", slot_party_type, spt_village), (call_script, "script_center_remove_walker_type_from_walkers", ":center_no", walkert_needs_money), (call_script, "script_center_remove_walker_type_from_walkers", ":center_no", walkert_needs_money_helped), (store_random_in_range, ":rand", 0, 100), (try_begin), (lt, ":rand", 70), (neg|party_slot_ge, ":center_no", slot_town_prosperity, 60), (call_script, "script_cf_center_get_free_walker", ":center_no"), (call_script, "script_center_set_walker_to_type", ":center_no", reg0, walkert_needs_money), (try_end), (try_end), ]), # Checking center upgrades (12, [(try_for_range, ":center_no", centers_begin, centers_end), (party_get_slot, ":cur_improvement", ":center_no", slot_center_current_improvement), (gt, ":cur_improvement", 0), (party_get_slot, ":cur_improvement_end_time", ":center_no", slot_center_improvement_end_hour), (store_current_hours, ":cur_hours"), (ge, ":cur_hours", ":cur_improvement_end_time"), (party_set_slot, ":center_no", ":cur_improvement", 1), (party_set_slot, ":center_no", slot_center_current_improvement, 0), (call_script, "script_get_improvement_details", ":cur_improvement"), (try_begin), (party_slot_eq, ":center_no", slot_town_lord, "trp_player"), (str_store_party_name, s4, ":center_no"), (display_log_message, "@Building of {s0} in {s4} has been completed."), (try_end), (try_begin), (is_between, ":center_no", villages_begin, villages_end), (eq, ":cur_improvement", slot_center_has_fish_pond), (call_script, "script_change_center_prosperity", ":center_no", 5), (try_end), (try_end), ]), # Adding tournaments to towns # Adding bandits to towns and villages (24, [(assign, ":num_active_tournaments", 0), (try_for_range, ":center_no", towns_begin, towns_end), (party_get_slot, ":has_tournament", ":center_no", slot_town_has_tournament), (try_begin), (eq, ":has_tournament", 1),#tournament ended, simulate (call_script, "script_fill_tournament_participants_troop", ":center_no", 0), (call_script, "script_sort_tournament_participant_troops"),#may not be needed (call_script, "script_get_num_tournament_participants"), (store_sub, ":needed_to_remove_randomly", reg0, 1), (call_script, "script_remove_tournament_participants_randomly", ":needed_to_remove_randomly"), (call_script, "script_sort_tournament_participant_troops"), (troop_get_slot, ":winner_troop", "trp_tournament_participants", 0), (try_begin), (is_between, ":winner_troop", kingdom_heroes_begin, kingdom_heroes_end), (str_store_troop_name_link, s1, ":winner_troop"), (str_store_party_name_link, s2, ":center_no"), (display_message, "@{s1} has won the tournament at {s2}."), (call_script, "script_change_troop_renown", ":winner_troop", 20), (try_end), (try_end), (val_sub, ":has_tournament", 1), (val_max, ":has_tournament", 0), (party_set_slot, ":center_no", slot_town_has_tournament, ":has_tournament"), (try_begin), (gt, ":has_tournament", 0), (val_add, ":num_active_tournaments", 1), (try_end), (try_end), (try_for_range, ":center_no", centers_begin, centers_end), (this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town), (party_slot_eq, ":center_no", slot_party_type, spt_village), (party_get_slot, ":has_bandits", ":center_no", slot_center_has_bandits), (try_begin), (le, ":has_bandits", 0), (assign, ":continue", 0), (try_begin), (check_quest_active, "qst_deal_with_night_bandits"), (quest_slot_eq, "qst_deal_with_night_bandits", slot_quest_target_center, ":center_no"), (neg|check_quest_succeeded, "qst_deal_with_night_bandits"), (assign, ":continue", 1), (else_try), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 3), (assign, ":continue", 1), (try_end), (try_begin), (eq, ":continue", 1), (store_random_in_range, ":random_no", 0, 3), (try_begin), (eq, ":random_no", 0), (assign, ":bandit_troop", "trp_bandit"), (else_try), (eq, ":random_no", 1), (assign, ":bandit_troop", "trp_mountain_bandit"), (else_try), (assign, ":bandit_troop", "trp_forest_bandit"), (try_end), (party_set_slot, ":center_no", slot_center_has_bandits, ":bandit_troop"), (try_begin), (eq, "$cheat_mode", 1), (str_store_party_name, s1, ":center_no"), (display_message, "@{s1} is infested by bandits (at night)."), (try_end), (try_end), (else_try), (try_begin), (assign, ":random_chance", 40), (try_begin), (party_slot_eq, ":center_no", slot_party_type, spt_town), (assign, ":random_chance", 20), (try_end), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", ":random_chance"), (party_set_slot, ":center_no", slot_center_has_bandits, 0), (try_begin), (eq, "$cheat_mode", 1), (str_store_party_name, s1, ":center_no"), (display_message, "@{s1} is no longer infested by bandits (at night)."), (try_end), (try_end), (try_end), (try_end), (try_begin), (lt, ":num_active_tournaments", 3), (store_random_in_range, ":random_no", 0, 100), #Add new tournaments with a 30% chance if there are less than 3 tournaments going on (lt, ":random_no", 30), (store_random_in_range, ":random_town", towns_begin, towns_end), (store_random_in_range, ":random_days", 12, 15), (party_set_slot, ":random_town", slot_town_has_tournament, ":random_days"), (try_begin), (eq, "$cheat_mode", 1), (str_store_party_name, s1, ":random_town"), (display_message, "@{s1} is holding a tournament."), (try_end), (try_end), ]), # Asking to give center to player (8, [ (assign, ":done", 0), (try_for_range, ":center_no", centers_begin, centers_end), (eq, ":done", 0), (party_slot_eq, ":center_no", slot_town_lord, stl_reserved_for_player), (assign, "$g_center_to_give_to_player", ":center_no"), (try_begin), (eq, "$g_center_to_give_to_player", "$g_castle_requested_by_player"), (assign, "$g_castle_requested_by_player", 0), (jump_to_menu, "mnu_requested_castle_granted_to_player"), (else_try), (jump_to_menu, "mnu_give_center_to_player"), (try_end), (assign, ":done", 1), (else_try), (eq, ":center_no", "$g_castle_requested_by_player"), (party_slot_ge, ":center_no", slot_town_lord, kingdom_heroes_begin), (assign, "$g_castle_requested_by_player", 0), (store_faction_of_party, ":faction", ":center_no"), (eq, ":faction", "$players_kingdom"), (assign, "$g_center_to_give_to_player", ":center_no"), (jump_to_menu, "mnu_requested_castle_granted_to_another"), (assign, ":done", 1), (try_end), ]), # Taking denars from player while resting in not owned centers (1, [(neg|map_free), (is_currently_night), (ge, "$g_last_rest_center", 0), (neg|party_slot_eq, "$g_last_rest_center", slot_town_lord, "trp_player"), (store_current_hours, ":cur_hours"), (ge, ":cur_hours", "$g_last_rest_payment_until"), (store_add, "$g_last_rest_payment_until", ":cur_hours", 24), (store_troop_gold, ":gold", "trp_player"), (party_get_num_companions, ":num_men", "p_main_party"), ############################## # Changed by Form Ranks kit # (party_get_num_attached_parties, ":arrays", "p_main_party"), (try_for_range, ":i", 0, ":arrays"), (party_get_attached_party_with_rank, ":array_party", "p_main_party", ":i"), (store_party_size, ":array_size", ":array_party"), (val_add, ":num_men", ":array_size"), (try_end), # # Change of Form Ranks kit end ############################### (store_div, ":total_cost", ":num_men", 4), (val_add, ":total_cost", 1), (try_begin), (ge, ":gold", ":total_cost"), (display_message, "@You pay for accommodation."), (troop_remove_gold, "trp_player", ":total_cost"), (else_try), (gt, ":gold", 0), (troop_remove_gold, "trp_player", ":gold"), (try_end), ]), # Spawn some bandits. (36, [ (call_script, "script_spawn_bandits"), ]), # Make parties larger as game progresses. (24, [ (call_script, "script_update_party_creation_random_limits"), ]), # Check if a faction is defeated every day (24, [ (assign, ":num_active_factions", 0), (try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end), (faction_set_slot, ":cur_kingdom", slot_faction_number_of_parties, 0), (try_end), (try_for_parties, ":cur_party"), (store_faction_of_party, ":party_faction", ":cur_party"), (is_between, ":party_faction", kingdoms_begin, kingdoms_end), (this_or_next|is_between, ":cur_party", centers_begin, centers_end), (party_slot_eq, ":cur_party", slot_party_type, spt_kingdom_hero_party), (faction_get_slot, ":kingdom_num_parties", ":party_faction", slot_faction_number_of_parties), (val_add, ":kingdom_num_parties", 1), (faction_set_slot, ":party_faction", slot_faction_number_of_parties, ":kingdom_num_parties"), (try_end), (try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end), ## (try_begin), ## (eq, "$cheat_mode", 1), ## (str_store_faction_name, s1, ":cur_kingdom"), ## (faction_get_slot, reg1, ":cur_kingdom", slot_faction_number_of_parties), ## (display_message, "@Number of parties belonging to {s1}: {reg1}"), ## (try_end), (faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active), (val_add, ":num_active_factions", 1), (faction_slot_eq, ":cur_kingdom", slot_faction_number_of_parties, 0), (assign, ":faction_removed", 0), (try_begin), (eq, ":cur_kingdom", "fac_player_supporters_faction"), (try_begin), (le, "$supported_pretender", 0), (faction_set_slot, ":cur_kingdom", slot_faction_state, sfs_inactive), (assign, ":faction_removed", 1), (try_end), (else_try), (neq, "$players_kingdom", ":cur_kingdom"), (faction_set_slot, ":cur_kingdom", slot_faction_state, sfs_defeated), (try_for_parties, ":cur_party"), (store_faction_of_party, ":party_faction", ":cur_party"), (eq, ":party_faction", ":cur_kingdom"), (party_get_slot, ":home_center", ":cur_party", slot_party_home_center), (store_faction_of_party, ":home_center_faction", ":home_center"), (party_set_faction, ":cur_party", ":home_center_faction"), (try_end), (assign, ":kingdom_pretender", -1), (try_for_range, ":cur_pretender", pretenders_begin, pretenders_end), (troop_slot_eq, ":cur_pretender", slot_troop_original_faction, ":cur_kingdom"), (assign, ":kingdom_pretender", ":cur_pretender"), (try_end), (try_begin), (is_between, ":kingdom_pretender", pretenders_begin, pretenders_end), (neq, ":kingdom_pretender", "$supported_pretender"), (troop_set_slot, ":kingdom_pretender", slot_troop_cur_center, 0), #remove pretender from the world (try_end), (assign, ":faction_removed", 1), (try_begin), (eq, "$players_oath_renounced_against_kingdom", ":cur_kingdom"), (assign, "$players_oath_renounced_against_kingdom", 0), (assign, "$players_oath_renounced_given_center", 0), (assign, "$players_oath_renounced_begin_time", 0), (call_script, "script_add_notification_menu", "mnu_notification_oath_renounced_faction_defeated", ":cur_kingdom", 0), (try_end), #This menu must be at the end because faction banner will change after this menu if the player's supported pretender's original faction is cur_kingdom (call_script, "script_add_notification_menu", "mnu_notification_faction_defeated", ":cur_kingdom", 0), (try_end), (try_begin), (eq, ":faction_removed", 1), (val_sub, ":num_active_factions", 1), (call_script, "script_store_average_center_value_per_faction"), (try_end), (try_for_range, ":cur_kingdom_2", kingdoms_begin, kingdoms_end), (call_script, "script_update_faction_notes", ":cur_kingdom_2"), (try_end), (try_end), (try_begin), (eq, ":num_active_factions", 1), (try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end), (faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active), (call_script, "script_add_notification_menu", "mnu_notification_one_faction_left", ":cur_kingdom", 0), (try_end), (try_end), ]), # Reduce renown slightly by 0.5% every week (7 * 24, [ (troop_get_slot, ":player_renown", "trp_player", slot_troop_renown), (store_div, ":renown_decrease", ":player_renown", 200), (val_sub, ":player_renown", ":renown_decrease"), (troop_set_slot, "trp_player", slot_troop_renown, ":player_renown"), ]), # Read books if player is resting. (1, [(neg|map_free), (gt, "$g_player_reading_book", 0), (player_has_item, "$g_player_reading_book"), (store_attribute_level, ":int", "trp_player", ca_intelligence), (item_get_slot, ":int_req", "$g_player_reading_book", slot_item_intelligence_requirement), (le, ":int_req", ":int"), (item_get_slot, ":book_reading_progress", "$g_player_reading_book", slot_item_book_reading_progress), (item_get_slot, ":book_read", "$g_player_reading_book", slot_item_book_read), (eq, ":book_read", 0), (val_add, ":book_reading_progress", 7), (item_set_slot, "$g_player_reading_book", slot_item_book_reading_progress, ":book_reading_progress"), (ge, ":book_reading_progress", 1000), (item_set_slot, "$g_player_reading_book", slot_item_book_read, 1), (str_store_item_name, s1, "$g_player_reading_book"), (str_clear, s2), (try_begin), (eq, "$g_player_reading_book", "itm_book_tactics"), (troop_raise_skill, "trp_player", "skl_tactics", 1), (str_store_string, s2, "@ Your tactics skill has increased by 1."), (else_try), (eq, "$g_player_reading_book", "itm_book_persuasion"), (troop_raise_skill, "trp_player", "skl_persuasion", 1), (str_store_string, s2, "@ Your persuasion skill has increased by 1."), (else_try), (eq, "$g_player_reading_book", "itm_book_leadership"), (troop_raise_skill, "trp_player", "skl_leadership", 1), (str_store_string, s2, "@ Your leadership skill has increased by 1."), (else_try), (eq, "$g_player_reading_book", "itm_book_intelligence"), (troop_raise_attribute, "trp_player", ca_intelligence, 1), (str_store_string, s2, "@ Your intelligence has increased by 1."), (else_try), (eq, "$g_player_reading_book", "itm_book_trade"), (troop_raise_skill, "trp_player", "skl_trade", 1), (str_store_string, s2, "@ Your trade skill has increased by 1."), (else_try), (eq, "$g_player_reading_book", "itm_book_weapon_mastery"), (troop_raise_skill, "trp_player", "skl_weapon_master", 1), (str_store_string, s2, "@ Your weapon master skill has increased by 1."), (else_try), (eq, "$g_player_reading_book", "itm_book_engineering"), (troop_raise_skill, "trp_player", "skl_engineer", 1), (str_store_string, s2, "@ Your engineer skill has increased by 1."), (try_end), (dialog_box, "@You have finished reading {s1}.{s2}", "@Book Read"), (assign, "$g_player_reading_book", 0), ]), # Removing cattle herds if they are way out of range (12, [(try_for_parties, ":cur_party"), (party_slot_eq, ":cur_party", slot_party_type, spt_cattle_herd), (store_distance_to_party_from_party, ":dist",":cur_party", "p_main_party"), (try_begin), (gt, ":dist", 30), (remove_party, ":cur_party"), (try_begin), #Fail quest if the party is the quest party (check_quest_active, "qst_move_cattle_herd"), (neg|check_quest_concluded, "qst_move_cattle_herd"), (quest_slot_eq, "qst_move_cattle_herd", slot_quest_target_party, ":cur_party"), (call_script, "script_fail_quest", "qst_move_cattle_herd"), (end_try), (else_try), (gt, ":dist", 10), (party_set_slot, ":cur_party", slot_cattle_driven_by_player, 0), (party_set_ai_behavior, ":cur_party", ai_bhvr_hold), (try_end), (try_end), ]), #####!!!!! # Village upgrade triggers # School (30 * 24, [(try_for_range, ":cur_village", villages_begin, villages_end), (party_slot_eq, ":cur_village", slot_town_lord, "trp_player"), (party_get_slot, ":cur_relation", ":cur_village", slot_center_player_relation), (val_add, ":cur_relation", 1), (val_min, ":cur_relation", 100), (party_set_slot, ":cur_village", slot_center_player_relation, ":cur_relation"), (try_end), ]), # Quest triggers: # Remaining days text update (24, [(try_for_range, ":cur_quest", all_quests_begin, all_quests_end), (try_begin), (check_quest_active, ":cur_quest"), (try_begin), (neg|check_quest_concluded, ":cur_quest"), (quest_slot_ge, ":cur_quest", slot_quest_expiration_days, 1), (quest_get_slot, ":exp_days", ":cur_quest", slot_quest_expiration_days), (val_sub, ":exp_days", 1), (try_begin), (eq, ":exp_days", 0), (call_script, "script_abort_quest", ":cur_quest", 1), (else_try), (quest_set_slot, ":cur_quest", slot_quest_expiration_days, ":exp_days"), (assign, reg0, ":exp_days"), (add_quest_note_from_sreg, ":cur_quest", 7, "@You have {reg0} days to finish this quest.", 0), (try_end), (try_end), (else_try), (quest_slot_ge, ":cur_quest", slot_quest_dont_give_again_remaining_days, 1), (quest_get_slot, ":value", ":cur_quest", slot_quest_dont_give_again_remaining_days), (val_sub, ":value", 1), (quest_set_slot, ":cur_quest", slot_quest_dont_give_again_remaining_days, ":value"), (try_end), (try_end), ]), # Report to army quest (6, [ (is_between, "$players_kingdom", kingdoms_begin, kingdoms_end), (eq, "$g_player_is_captive", 0), (neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_default), (neg|check_quest_active, "qst_report_to_army"), (neg|check_quest_active, "qst_follow_army"), (neg|quest_slot_ge, "qst_report_to_army", slot_quest_dont_give_again_remaining_days, 1), (faction_get_slot, ":faction_marshall", "$players_kingdom", slot_faction_marshall), (gt, ":faction_marshall", 0), (troop_get_slot, ":faction_marshall_party", ":faction_marshall", slot_troop_leaded_party), (gt, ":faction_marshall_party", 0), (assign, ":has_no_quests", 1), (try_for_range, ":cur_quest", lord_quests_begin, lord_quests_end), (check_quest_active, ":cur_quest"), (quest_slot_eq, ":cur_quest", slot_quest_giver_troop, ":faction_marshall"), (assign, ":has_no_quests", 0), (try_end), (eq, ":has_no_quests", 1), (try_for_range, ":cur_quest", army_quests_begin, army_quests_end), (check_quest_active, ":cur_quest"), (assign, ":has_no_quests", 0), (try_end), (eq, ":has_no_quests", 1), (store_character_level, ":level", "trp_player"), (ge, ":level", 8), (assign, ":cur_target_amount", 2), (try_for_range, ":cur_center", centers_begin, centers_end), (party_slot_eq, ":cur_center", slot_town_lord, "trp_player"), (try_begin), (party_slot_eq, ":cur_center", slot_party_type, spt_town), (val_add, ":cur_target_amount", 3), (else_try), (party_slot_eq, ":cur_center", slot_party_type, spt_castle), (val_add, ":cur_target_amount", 1), (else_try), (val_add, ":cur_target_amount", 1), (try_end), (try_end), (val_mul, ":cur_target_amount", 4), (val_min, ":cur_target_amount", 60), (quest_set_slot, "qst_report_to_army", slot_quest_giver_troop, ":faction_marshall"), (quest_set_slot, "qst_report_to_army", slot_quest_target_troop, ":faction_marshall"), (quest_set_slot, "qst_report_to_army", slot_quest_target_amount, ":cur_target_amount"), (quest_set_slot, "qst_report_to_army", slot_quest_expiration_days, 4), (quest_set_slot, "qst_report_to_army", slot_quest_dont_give_again_period, 28), (jump_to_menu, "mnu_kingdom_army_quest_report_to_army"), ]), # Army quest initializer (3, [ (assign, "$g_random_army_quest", -1), (check_quest_active, "qst_follow_army", 1), (is_between, "$players_kingdom", kingdoms_begin, kingdoms_end), #Rebellion changes begin # (neg|is_between, "$players_kingdom", rebel_factions_begin, rebel_factions_end), #Rebellion changes end (neg|faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_default), (faction_get_slot, ":faction_marshall", "$players_kingdom", slot_faction_marshall), (neq, ":faction_marshall", "trp_player"), (gt, ":faction_marshall", 0), (troop_get_slot, ":faction_marshall_party", ":faction_marshall", slot_troop_leaded_party), (gt, ":faction_marshall_party", 0), (store_distance_to_party_from_party, ":dist", ":faction_marshall_party", "p_main_party"), (try_begin), (lt, ":dist", 15), (assign, "$g_player_follow_army_warnings", 0), (store_current_hours, ":cur_hours"), (faction_get_slot, ":last_offensive_time", "$players_kingdom", slot_faction_ai_last_offensive_time), (store_sub, ":passed_time", ":cur_hours", ":last_offensive_time"), (assign, ":result", -1), (try_begin), (store_random_in_range, ":random_no", 0, 100), (lt, ":random_no", 30), (troop_slot_eq, ":faction_marshall", slot_troop_does_not_give_quest, 0), (try_for_range, ":unused", 0, 20), #Repeat trial twenty times (eq, ":result", -1), (store_random_in_range, ":quest_no", army_quests_begin, army_quests_end), (neg|quest_slot_ge, ":quest_no", slot_quest_dont_give_again_remaining_days, 1), (try_begin), (eq, ":quest_no", "qst_deliver_cattle_to_army"), (try_begin), (faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_attacking_center), (gt, ":passed_time", 120),#5 days (store_random_in_range, ":quest_target_amount", 5, 10), (assign, ":result", ":quest_no"), (quest_set_slot, ":result", slot_quest_target_amount, ":quest_target_amount"), (quest_set_slot, ":result", slot_quest_expiration_days, 10), (quest_set_slot, ":result", slot_quest_dont_give_again_period, 30), (try_end), (else_try), (eq, ":quest_no", "qst_join_siege_with_army"), (try_begin), (faction_slot_eq, "$players_kingdom", slot_faction_ai_state, sfai_attacking_center), (faction_get_slot, ":ai_object", "$players_kingdom", slot_faction_ai_object), (is_between, ":ai_object", walled_centers_begin, walled_centers_end), (party_get_battle_opponent, ":besieged_center", ":faction_marshall_party"), (eq, ":besieged_center", ":ai_object"), #army is assaulting the center (assign, ":result", ":quest_no"), (quest_set_slot, ":result", slot_quest_target_center, ":ai_object"), (quest_set_slot, ":result", slot_quest_expiration_days, 2), (quest_set_slot, ":result", slot_quest_dont_give_again_period, 15), (try_end), (else_try), (eq, ":quest_no", "qst_scout_waypoints"), (try_begin), (assign, ":end_cond", 100), (assign, "$qst_scout_waypoints_wp_1", -1), (assign, "$qst_scout_waypoints_wp_2", -1), (assign, "$qst_scout_waypoints_wp_3", -1), (assign, ":continue", 0), (try_for_range, ":unused", 0, ":end_cond"), (try_begin), (lt, "$qst_scout_waypoints_wp_1", 0), (call_script, "script_cf_get_random_enemy_center_within_range", ":faction_marshall_party", 50), (assign, "$qst_scout_waypoints_wp_1", reg0), (try_end), (try_begin), (lt, "$qst_scout_waypoints_wp_2", 0), (call_script, "script_cf_get_random_enemy_center_within_range", ":faction_marshall_party", 50), (neq, "$qst_scout_waypoints_wp_1", reg0), (assign, "$qst_scout_waypoints_wp_2", reg0), (try_end), (try_begin), (lt, "$qst_scout_waypoints_wp_3", 0), (call_script, "script_cf_get_random_enemy_center_within_range", ":faction_marshall_party", 50), (neq, "$qst_scout_waypoints_wp_1", reg0), (neq, "$qst_scout_waypoints_wp_2", reg0), (assign, "$qst_scout_waypoints_wp_3", reg0), (try_end), (neq, "$qst_scout_waypoints_wp_1", "$qst_scout_waypoints_wp_2"), (neq, "$qst_scout_waypoints_wp_1", "$qst_scout_waypoints_wp_2"), (neq, "$qst_scout_waypoints_wp_2", "$qst_scout_waypoints_wp_3"), (ge, "$qst_scout_waypoints_wp_1", 0), (ge, "$qst_scout_waypoints_wp_2", 0), (ge, "$qst_scout_waypoints_wp_3", 0), (assign, ":end_cond", 0), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (assign, "$qst_scout_waypoints_wp_1_visited", 0), (assign, "$qst_scout_waypoints_wp_2_visited", 0), (assign, "$qst_scout_waypoints_wp_3_visited", 0), (assign, ":result", ":quest_no"), (quest_set_slot, ":result", slot_quest_expiration_days, 7), (quest_set_slot, ":result", slot_quest_dont_give_again_period, 25), (try_end), (try_end), (try_end), (try_begin), (neq, ":result", -1), (quest_set_slot, ":result", slot_quest_current_state, 0), (quest_set_slot, ":result", slot_quest_giver_troop, ":faction_marshall"), (try_begin), (eq, ":result", "qst_join_siege_with_army"), (jump_to_menu, "mnu_kingdom_army_quest_join_siege_order"), (else_try), (assign, "$g_random_army_quest", ":result"), (quest_set_slot, "$g_random_army_quest", slot_quest_giver_troop, ":faction_marshall"), (jump_to_menu, "mnu_kingdom_army_quest_messenger"), (try_end), (try_end), (try_end), (else_try), (val_add, "$g_player_follow_army_warnings", 1), (try_begin), (lt, "$g_player_follow_army_warnings", 12), (try_begin), (store_mod, ":follow_mod", "$g_player_follow_army_warnings", 4), (eq, ":follow_mod", 0), (str_store_troop_name_link, s1, ":faction_marshall"), (try_begin), (lt, "$g_player_follow_army_warnings", 8), (display_message, "@You must follow {s1}!"), (else_try), (display_message, "@You must follow {s1}! This is your last warning!"), (try_end), (try_end), (else_try), (jump_to_menu, "mnu_kingdom_army_follow_failed"), (try_end), (try_end), ]), # Move cattle herd (0.5, [(check_quest_active,"qst_move_cattle_herd"), (neg|check_quest_concluded,"qst_move_cattle_herd"), (quest_get_slot, ":target_party", "qst_move_cattle_herd", slot_quest_target_party), (quest_get_slot, ":target_center", "qst_move_cattle_herd", slot_quest_target_center), (store_distance_to_party_from_party, ":dist",":target_party", ":target_center"), (lt, ":dist", 3), (remove_party, ":target_party"), (call_script, "script_succeed_quest", "qst_move_cattle_herd"), ]), (2, [ (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (ge, ":party_no", 1), (party_slot_eq, ":party_no", slot_party_following_player, 1), (store_current_hours, ":cur_time"), (neg|party_slot_ge, ":party_no", slot_party_follow_player_until_time, ":cur_time"), (party_set_slot, ":party_no", slot_party_commander_party, -1), (party_set_slot, ":party_no", slot_party_following_player, 0), (assign, ":dont_follow_period", 200), (store_add, ":dont_follow_time", ":cur_time", ":dont_follow_period"), (party_set_slot, ":party_no", slot_party_dont_follow_player_until_time, ":dont_follow_time"), (try_end), ]), # Deliver cattle and deliver cattle to army (0.5, [ (try_begin), (check_quest_active,"qst_deliver_cattle"), (neg|check_quest_succeeded, "qst_deliver_cattle"), (quest_get_slot, ":target_center", "qst_deliver_cattle", slot_quest_target_center), (quest_get_slot, ":target_amount", "qst_deliver_cattle", slot_quest_target_amount), (quest_get_slot, ":cur_amount", "qst_deliver_cattle", slot_quest_current_state), (store_sub, ":left_amount", ":target_amount", ":cur_amount"), (call_script, "script_remove_cattles_if_herd_is_close_to_party", ":target_center", ":left_amount"), (val_add, ":cur_amount", reg0), (quest_set_slot, "qst_deliver_cattle", slot_quest_current_state, ":cur_amount"), (le, ":target_amount", ":cur_amount"), (call_script, "script_succeed_quest", "qst_deliver_cattle"), (try_end), (try_begin), (check_quest_active, "qst_deliver_cattle_to_army"), (neg|check_quest_succeeded, "qst_deliver_cattle_to_army"), (quest_get_slot, ":giver_troop", "qst_deliver_cattle_to_army", slot_quest_giver_troop), (troop_get_slot, ":target_party", ":giver_troop", slot_troop_leaded_party), (try_begin), (gt, ":target_party", 0), (quest_get_slot, ":target_amount", "qst_deliver_cattle_to_army", slot_quest_target_amount), (quest_get_slot, ":cur_amount", "qst_deliver_cattle_to_army", slot_quest_current_state), (store_sub, ":left_amount", ":target_amount", ":cur_amount"), (call_script, "script_remove_cattles_if_herd_is_close_to_party", ":target_party", ":left_amount"), (val_add, ":cur_amount", reg0), (quest_set_slot, "qst_deliver_cattle_to_army", slot_quest_current_state, ":cur_amount"), (try_begin), (le, ":target_amount", ":cur_amount"), (call_script, "script_succeed_quest", "qst_deliver_cattle_to_army"), (try_end), (else_try), (call_script, "script_abort_quest", "qst_deliver_cattle_to_army", 0), (try_end), (try_end), ]), # Train peasants against bandits (1, [ (neg|map_free), (check_quest_active, "qst_train_peasants_against_bandits"), (neg|check_quest_concluded, "qst_train_peasants_against_bandits"), (eq, "$qst_train_peasants_against_bandits_currently_training", 1), (val_add, "$qst_train_peasants_against_bandits_num_hours_trained", 1), (call_script, "script_get_max_skill_of_player_party", "skl_trainer"), (assign, ":trainer_skill", reg0), (store_sub, ":needed_hours", 20, ":trainer_skill"), (val_mul, ":needed_hours", 3), (val_div, ":needed_hours", 5), (ge, "$qst_train_peasants_against_bandits_num_hours_trained", ":needed_hours"), (assign, "$qst_train_peasants_against_bandits_num_hours_trained", 0), (rest_for_hours, 0, 0, 0), #stop resting (jump_to_menu, "mnu_train_peasants_against_bandits_ready"), ]), # Scout waypoints (1, [ (check_quest_active,"qst_scout_waypoints"), (neg|check_quest_succeeded, "qst_scout_waypoints"), (try_begin), (eq, "$qst_scout_waypoints_wp_1_visited", 0), (store_distance_to_party_from_party, ":distance", "$qst_scout_waypoints_wp_1", "p_main_party"), (le, ":distance", 3), (assign, "$qst_scout_waypoints_wp_1_visited", 1), (str_store_party_name_link, s1, "$qst_scout_waypoints_wp_1"), (display_message, "@{s1} is scouted."), (try_end), (try_begin), (eq, "$qst_scout_waypoints_wp_2_visited", 0), (store_distance_to_party_from_party, ":distance", "$qst_scout_waypoints_wp_2", "p_main_party"), (le, ":distance", 3), (assign, "$qst_scout_waypoints_wp_2_visited", 1), (str_store_party_name_link, s1, "$qst_scout_waypoints_wp_2"), (display_message, "@{s1} is scouted."), (try_end), (try_begin), (eq, "$qst_scout_waypoints_wp_3_visited", 0), (store_distance_to_party_from_party, ":distance", "$qst_scout_waypoints_wp_3", "p_main_party"), (le, ":distance", 3), (assign, "$qst_scout_waypoints_wp_3_visited", 1), (str_store_party_name_link, s1, "$qst_scout_waypoints_wp_3"), (display_message, "@{s1} is scouted."), (try_end), (eq, "$qst_scout_waypoints_wp_1_visited", 1), (eq, "$qst_scout_waypoints_wp_2_visited", 1), (eq, "$qst_scout_waypoints_wp_3_visited", 1), (call_script, "script_succeed_quest", "qst_scout_waypoints"), ]), # Kill local merchant (3, [(neg|map_free), (check_quest_active, "qst_kill_local_merchant"), (quest_slot_eq, "qst_kill_local_merchant", slot_quest_current_state, 0), (quest_set_slot, "qst_kill_local_merchant", slot_quest_current_state, 1), (rest_for_hours, 0, 0, 0), #stop resting (assign, "$auto_enter_town", "$qst_kill_local_merchant_center"), (assign, "$quest_auto_menu", "mnu_kill_local_merchant_begin"), ]), # Collect taxes (1, [(neg|map_free), (check_quest_active, "qst_collect_taxes"), (eq, "$g_player_is_captive", 0), (eq, "$qst_collect_taxes_currently_collecting", 1), (quest_get_slot, ":quest_current_state", "qst_collect_taxes", slot_quest_current_state), (this_or_next|eq, ":quest_current_state", 1), (this_or_next|eq, ":quest_current_state", 2), (eq, ":quest_current_state", 3), (quest_get_slot, ":left_hours", "qst_collect_taxes", slot_quest_target_amount), (val_sub, ":left_hours", 1), (quest_set_slot, "qst_collect_taxes", slot_quest_target_amount, ":left_hours"), (call_script, "script_get_max_skill_of_player_party", "skl_trade"), (try_begin), (lt, ":left_hours", 0), (assign, ":quest_current_state", 4), (quest_set_slot, "qst_collect_taxes", slot_quest_current_state, 4), (rest_for_hours, 0, 0, 0), #stop resting (jump_to_menu, "mnu_collect_taxes_complete"), (else_try), #Continue collecting taxes (assign, ":max_collected_tax", "$qst_collect_taxes_hourly_income"), (party_get_slot, ":prosperity", "$g_encountered_party", slot_town_prosperity), (store_add, ":multiplier", 30, ":prosperity"), (val_mul, ":max_collected_tax", ":multiplier"), (val_div, ":max_collected_tax", 80),#Prosperity of 50 gives the default values (try_begin), (eq, "$qst_collect_taxes_halve_taxes", 1), (val_div, ":max_collected_tax", 2), (try_end), (val_max, ":max_collected_tax", 2), (store_random_in_range, ":collected_tax", 1, ":max_collected_tax"), (quest_get_slot, ":cur_collected", "qst_collect_taxes", slot_quest_gold_reward), (val_add, ":cur_collected", ":collected_tax"), (quest_set_slot, "qst_collect_taxes", slot_quest_gold_reward, ":cur_collected"), (call_script, "script_troop_add_gold", "trp_player", ":collected_tax"), (try_end), (try_begin), (eq, ":quest_current_state", 1), (val_sub, "$qst_collect_taxes_menu_counter", 1), (le, "$qst_collect_taxes_menu_counter", 0), (quest_set_slot, "qst_collect_taxes", slot_quest_current_state, 2), (jump_to_menu, "mnu_collect_taxes_revolt_warning"), (else_try), #Chance of revolt against player (eq, ":quest_current_state", 2), (val_sub, "$qst_collect_taxes_unrest_counter", 1), (le, "$qst_collect_taxes_unrest_counter", 0), (eq, "$qst_collect_taxes_halve_taxes", 0), (quest_set_slot, "qst_collect_taxes", slot_quest_current_state, 3), (store_div, ":unrest_chance", 10000, "$qst_collect_taxes_total_hours"), (val_add, ":unrest_chance",30), (store_random_in_range, ":unrest_roll", 0, 1000), (try_begin), (lt, ":unrest_roll", ":unrest_chance"), (jump_to_menu, "mnu_collect_taxes_revolt"), (try_end), (try_end), ]), #persuade_lords_to_make_peace begin (72, [(gt, "$g_force_peace_faction_1", 0), (gt, "$g_force_peace_faction_2", 0), (try_begin), (store_relation, ":relation", "$g_force_peace_faction_1", "$g_force_peace_faction_2"), (lt, ":relation", 0), (call_script, "script_diplomacy_start_peace_between_kingdoms", "$g_force_peace_faction_1", "$g_force_peace_faction_2", 1), (try_end), (assign, "$g_force_peace_faction_1", 0), (assign, "$g_force_peace_faction_2", 0), ]), #NPC changes begin (1, [ #Resolve one issue each hour (try_begin), ### Here do NPC that is quitting (gt, "$npc_is_quitting", 0), (try_begin), (main_party_has_troop, "$npc_is_quitting"), (neq, "$g_player_is_captive", 1), (start_map_conversation, "$npc_is_quitting"), (else_try), (assign, "$npc_is_quitting", 0), (try_end), (else_try), #### Grievance (gt, "$npc_with_grievance", 0), (eq, "$disable_npc_complaints", 0), (try_begin), (main_party_has_troop, "$npc_with_grievance"), (neq, "$g_player_is_captive", 1), (assign, "$npc_map_talk_context", slot_troop_morality_state), (start_map_conversation, "$npc_with_grievance"), (else_try), (assign, "$npc_with_grievance", 0), (try_end), (else_try), (gt, "$npc_with_personality_clash", 0), (eq, "$disable_npc_complaints", 0), (troop_get_slot, ":object", "$npc_with_personality_clash", slot_troop_personalityclash_object), (try_begin), (main_party_has_troop, "$npc_with_personality_clash"), (main_party_has_troop, ":object"), (neq, "$g_player_is_captive", 1), (assign, "$npc_map_talk_context", slot_troop_personalityclash_state), (start_map_conversation, "$npc_with_personality_clash"), (else_try), (assign, "$npc_with_personality_clash", 0), (try_end), (else_try), ###check for regional background (eq, "$disable_local_histories", 0), (try_for_range, ":npc", companions_begin, companions_end), (main_party_has_troop, ":npc"), (troop_slot_eq, ":npc", slot_troop_home_speech_delivered, 0), # (eq, "$npc_map_talk_context", 0), (troop_get_slot, ":home", ":npc", slot_troop_home), (gt, ":home", 0), (store_distance_to_party_from_party, ":distance", ":home", "p_main_party"), (lt, ":distance", 7), (assign, "$npc_map_talk_context", slot_troop_home), (start_map_conversation, ":npc"), (try_end), (try_end), ]), #NPC changes end ##(1, ## [(store_random_in_range, ":random_troop", kingdom_heroes_begin, kingdom_heroes_end), ## (store_random_in_range, ":random_faction", kingdoms_begin, kingdoms_end), ## (store_troop_faction, ":troop_faction", ":random_troop"), ## (neq, ":troop_faction", ":random_faction"), ## (faction_slot_eq, ":random_faction", slot_faction_state, sfs_active), ## (troop_set_slot, ":random_troop", slot_troop_change_to_faction, ":random_faction"), ## (str_store_troop_name, s1, ":random_troop"), ## (str_store_faction_name, s2, ":troop_faction"), ## (str_store_faction_name, s3, ":random_faction"), ## (display_message, "@{s1} is willing to switch from {s2} to {s3}."), ## ]), (4, [(try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end), (troop_slot_ge, ":troop_no", slot_troop_change_to_faction, 1), (store_troop_faction, ":faction_no", ":troop_no"), (troop_get_slot, ":new_faction_no", ":troop_no", slot_troop_change_to_faction), (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party), (assign, ":continue", 0), (try_begin), (le, ":party_no", 0), #(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0), (neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0), (assign, ":continue", 1), (else_try), (gt, ":party_no", 0), #checking if the party is outside the centers (party_get_attached_to, ":cur_center_no", ":party_no"), (try_begin), (lt, ":cur_center_no", 0), (party_get_cur_town, ":cur_center_no", ":party_no"), (try_end), (this_or_next|neg|is_between, ":cur_center_no", centers_begin, centers_end), (party_slot_eq, ":cur_center_no", slot_town_lord, ":troop_no"), #checking if the party is away from his original faction parties (assign, ":end_cond", kingdom_heroes_end), (try_for_range, ":enemy_troop_no", kingdom_heroes_begin, ":end_cond"), (troop_get_slot, ":enemy_party_no", ":enemy_troop_no", slot_troop_leaded_party), (gt, ":enemy_party_no", 0), (store_faction_of_party, ":enemy_faction_no", ":enemy_party_no"), (eq, ":enemy_faction_no", ":faction_no"), (store_distance_to_party_from_party, ":dist", ":party_no", ":enemy_party_no"), (lt, ":dist", 4), (assign, ":end_cond", 0), (try_end), (neq, ":end_cond", 0), (assign, ":continue", 1), (try_end), (eq, ":continue", 1), (call_script, "script_change_troop_faction", ":troop_no", ":new_faction_no"), (troop_set_slot, ":troop_no", slot_troop_change_to_faction, 0), (try_begin), (is_between, ":new_faction_no", kingdoms_begin, kingdoms_end), (str_store_troop_name_link, s1, ":troop_no"), (str_store_faction_name_link, s2, ":faction_no"), (str_store_faction_name_link, s3, ":new_faction_no"), (display_message, "@{s1} has switched from {s2} to {s3}."), (try_begin), (eq, ":faction_no", "$players_kingdom"), (call_script, "script_add_notification_menu", "mnu_notification_troop_left_players_faction", ":troop_no", ":new_faction_no"), (else_try), (eq, ":new_faction_no", "$players_kingdom"), (call_script, "script_add_notification_menu", "mnu_notification_troop_joined_players_faction", ":troop_no", ":faction_no"), (try_end), (try_end), (try_end), ]) ]
Python
import random from header_common import * from header_items import * from header_troops import * from header_skills import * from ID_factions import * from ID_items import * from ID_scenes import * #################################################################################################################### # Each troop contains the following fields: # 1) Troop id (string): used for referencing troops in other files. The prefix trp_ is automatically added before each troop-id . # 2) Toop name (string). # 3) Plural troop name (string). # 4) Troop flags (int). See header_troops.py for a list of available flags # 5) Scene (int) (only applicable to heroes) For example: scn_reyvadin_castle|entry(1) puts troop in reyvadin castle's first entry point # 6) Reserved (int). Put constant "reserved" or 0. # 7) Faction (int) # 8) Inventory (list): Must be a list of items # 9) Attributes (int): Example usage: # str_6|agi_6|int_4|cha_5|level(5) # 10) Weapon proficiencies (int): Example usage: # wp_one_handed(55)|wp_two_handed(90)|wp_polearm(36)|wp_archery(80)|wp_crossbow(24)|wp_throwing(45) # The function wp(x) will create random weapon proficiencies close to value x. # To make an expert archer with other weapon proficiencies close to 60 you can use something like: # wp_archery(160) | wp(60) # 11) Skills (int): See header_skills.py to see a list of skills. Example: # knows_ironflesh_3|knows_power_strike_2|knows_athletics_2|knows_riding_2 # 12) Face code (int): You can obtain the face code by pressing ctrl+E in face generator screen # 13) Face code (int)(2) (only applicable to regular troops, can be omitted for heroes): # The game will create random faces between Face code 1 and face code 2 for generated troops # town_1 Sargoth # town_2 Tihr # town_3 Veluca # town_4 Suno # town_5 Jelkala # town_6 Praven # town_7 Uxkhal # town_8 Reyvadin # town_9 Khudan # town_10 Tulga # town_11 Curaw # town_12 Wercheg # town_13 Rivacheg # town_14 Halmar #################################################################################################################### # Some constant and function declarations to be used below... def wp(x): n = 0 r = 10 + int(x / 10) n |= wp_one_handed(x + random.randrange(r)) n |= wp_two_handed(x + random.randrange(r)) n |= wp_polearm(x + random.randrange(r)) n |= wp_archery(x + random.randrange(r)) n |= wp_crossbow(x + random.randrange(r)) n |= wp_throwing(x + random.randrange(r)) return n def wp_melee(x): n = 0 r = 10 + int(x / 10) n |= wp_one_handed(x + random.randrange(r)) n |= wp_two_handed(x + random.randrange(r)) n |= wp_polearm(x + random.randrange(r)) return n #Skills knows_common = knows_riding_1|knows_trade_2|knows_inventory_management_2|knows_prisoner_management_1|knows_leadership_1 def_attrib = str_7 | agi_5 | int_4 | cha_4 knows_lord_1 = knows_riding_3|knows_trade_2|knows_inventory_management_2|knows_tactics_4|knows_prisoner_management_4|knows_leadership_7 knows_warrior_npc = knows_weapon_master_2|knows_ironflesh_1|knows_athletics_1|knows_power_strike_2|knows_riding_2|knows_shield_1|knows_inventory_management_2 knows_merchant_npc = knows_riding_2|knows_trade_3|knows_inventory_management_3 #knows persuasion knows_tracker_npc = knows_weapon_master_1|knows_athletics_2|knows_spotting_2|knows_pathfinding_2|knows_tracking_2|knows_ironflesh_1|knows_inventory_management_2 lord_attrib = str_20|agi_20|int_20|cha_20|level(38) knight_attrib_1 = str_15|agi_14|int_8|cha_16|level(22) knight_attrib_2 = str_16|agi_16|int_10|cha_18|level(26) knight_attrib_3 = str_18|agi_17|int_12|cha_20|level(30) knight_attrib_4 = str_19|agi_19|int_13|cha_22|level(35) knight_attrib_5 = str_20|agi_20|int_15|cha_25|level(41) knight_skills_1 = knows_riding_3|knows_ironflesh_2|knows_power_strike_3|knows_athletics_1|knows_tactics_2|knows_prisoner_management_1|knows_leadership_3 knight_skills_2 = knows_riding_4|knows_ironflesh_3|knows_power_strike_4|knows_athletics_2|knows_tactics_3|knows_prisoner_management_2|knows_leadership_5 knight_skills_3 = knows_riding_5|knows_ironflesh_4|knows_power_strike_5|knows_athletics_3|knows_tactics_4|knows_prisoner_management_2|knows_leadership_6 knight_skills_4 = knows_riding_6|knows_ironflesh_5|knows_power_strike_6|knows_athletics_4|knows_tactics_5|knows_prisoner_management_3|knows_leadership_7 knight_skills_5 = knows_riding_7|knows_ironflesh_6|knows_power_strike_7|knows_athletics_5|knows_tactics_6|knows_prisoner_management_3|knows_leadership_9 #These face codes are generated by the in-game face generator. #Enable edit mode and press ctrl+E in face generator screen to obtain face codes. reserved = 0 no_scene = 0 swadian_face_younger_1 = 0x0000000000000001124000000020000000000000001c00800000000000000000 swadian_face_young_1 = 0x0000000400000001124000000020000000000000001c00800000000000000000 swadian_face_middle_1 = 0x0000000800000001124000000020000000000000001c00800000000000000000 swadian_face_old_1 = 0x0000000d00000001124000000020000000000000001c00800000000000000000 swadian_face_older_1 = 0x0000000fc0000001124000000020000000000000001c00800000000000000000 swadian_face_younger_2 = 0x00000000000062c76ddcdf7feefbffff00000000001efdbc0000000000000000 swadian_face_young_2 = 0x00000003c00062c76ddcdf7feefbffff00000000001efdbc0000000000000000 swadian_face_middle_2 = 0x00000007c00062c76ddcdf7feefbffff00000000001efdbc0000000000000000 swadian_face_old_2 = 0x0000000bc00062c76ddcdf7feefbffff00000000001efdbc0000000000000000 swadian_face_older_2 = 0x0000000fc00062c76ddcdf7feefbffff00000000001efdbc0000000000000000 vaegir_face_younger_1 = 0x0000000000000001124000000020000000000000001c00800000000000000000 vaegir_face_young_1 = 0x0000000400000001124000000020000000000000001c00800000000000000000 vaegir_face_middle_1 = 0x0000000800000001124000000020000000000000001c00800000000000000000 vaegir_face_old_1 = 0x0000000d00000001124000000020000000000000001c00800000000000000000 vaegir_face_older_1 = 0x0000000fc0000001124000000020000000000000001c00800000000000000000 vaegir_face_younger_2 = 0x000000003f00230c4deeffffffffffff00000000001efff90000000000000000 vaegir_face_young_2 = 0x00000003bf00230c4deeffffffffffff00000000001efff90000000000000000 vaegir_face_middle_2 = 0x00000007bf00230c4deeffffffffffff00000000001efff90000000000000000 vaegir_face_old_2 = 0x0000000cbf00230c4deeffffffffffff00000000001efff90000000000000000 vaegir_face_older_2 = 0x0000000ff100230c4deeffffffffffff00000000001efff90000000000000000 khergit_face_younger_1 = 0x0000000009003109207000000000000000000000001c80470000000000000000 khergit_face_young_1 = 0x00000003c9003109207000000000000000000000001c80470000000000000000 khergit_face_middle_1 = 0x00000007c9003109207000000000000000000000001c80470000000000000000 khergit_face_old_1 = 0x0000000b89003109207000000000000000000000001c80470000000000000000 khergit_face_older_1 = 0x0000000fc9003109207000000000000000000000001c80470000000000000000 khergit_face_younger_2 = 0x000000003f0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000 khergit_face_young_2 = 0x00000003bf0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000 khergit_face_middle_2 = 0x000000077f0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000 khergit_face_old_2 = 0x0000000b3f0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000 khergit_face_older_2 = 0x0000000fff0061cd6d7ffbdf9df6ebee00000000001ffb7f0000000000000000 nord_face_younger_1 = 0x0000000000000001124000000020000000000000001c00800000000000000000 nord_face_young_1 = 0x0000000400000001124000000020000000000000001c00800000000000000000 nord_face_middle_1 = 0x0000000800000001124000000020000000000000001c00800000000000000000 nord_face_old_1 = 0x0000000d00000001124000000020000000000000001c00800000000000000000 nord_face_older_1 = 0x0000000fc0000001124000000020000000000000001c00800000000000000000 nord_face_younger_2 = 0x00000000310023084deeffffffffffff00000000001efff90000000000000000 nord_face_young_2 = 0x00000003b10023084deeffffffffffff00000000001efff90000000000000000 nord_face_middle_2 = 0x00000008310023084deeffffffffffff00000000001efff90000000000000000 nord_face_old_2 = 0x0000000c710023084deeffffffffffff00000000001efff90000000000000000 nord_face_older_2 = 0x0000000ff10023084deeffffffffffff00000000001efff90000000000000000 rhodok_face_younger_1 = 0x0000000009002003140000000000000000000000001c80400000000000000000 rhodok_face_young_1 = 0x0000000449002003140000000000000000000000001c80400000000000000000 rhodok_face_middle_1 = 0x0000000849002003140000000000000000000000001c80400000000000000000 rhodok_face_old_1 = 0x0000000cc9002003140000000000000000000000001c80400000000000000000 rhodok_face_older_1 = 0x0000000fc9002003140000000000000000000000001c80400000000000000000 rhodok_face_younger_2 = 0x00000000000062c76ddcdf7feefbffff00000000001efdbc0000000000000000 rhodok_face_young_2 = 0x00000003c00062c76ddcdf7feefbffff00000000001efdbc0000000000000000 rhodok_face_middle_2 = 0x00000007c00062c76ddcdf7feefbffff00000000001efdbc0000000000000000 rhodok_face_old_2 = 0x0000000bc00062c76ddcdf7feefbffff00000000001efdbc0000000000000000 rhodok_face_older_2 = 0x0000000fc00062c76ddcdf7feefbffff00000000001efdbc0000000000000000 man_face_younger_1 = 0x0000000000000001124000000020000000000000001c00800000000000000000 man_face_young_1 = 0x0000000400000001124000000020000000000000001c00800000000000000000 man_face_middle_1 = 0x0000000800000001124000000020000000000000001c00800000000000000000 man_face_old_1 = 0x0000000d00000001124000000020000000000000001c00800000000000000000 man_face_older_1 = 0x0000000fc0000001124000000020000000000000001c00800000000000000000 man_face_younger_2 = 0x000000003f0052064deeffffffffffff00000000001efff90000000000000000 man_face_young_2 = 0x00000003bf0052064deeffffffffffff00000000001efff90000000000000000 man_face_middle_2 = 0x00000007bf0052064deeffffffffffff00000000001efff90000000000000000 man_face_old_2 = 0x0000000bff0052064deeffffffffffff00000000001efff90000000000000000 man_face_older_2 = 0x0000000fff0052064deeffffffffffff00000000001efff90000000000000000 merchant_face_1 = man_face_young_1 merchant_face_2 = man_face_older_2 woman_face_1 = 0x0000000000000001000000000000000000000000001c00000000000000000000 woman_face_2 = 0x00000003bf0030067ff7fbffefff6dff00000000001f6dbf0000000000000000 refugee_face1 = woman_face_1 refugee_face2 = woman_face_2 girl_face1 = woman_face_1 girl_face2 = woman_face_2 mercenary_face_1 = 0x0000000000000000000000000000000000000000001c00000000000000000000 mercenary_face_2 = 0x0000000cff00730b6db6db6db7fbffff00000000001efffe0000000000000000 vaegir_face1 = vaegir_face_young_1 vaegir_face2 = vaegir_face_older_2 bandit_face1 = man_face_young_1 bandit_face2 = man_face_older_2 undead_face1 = 0x00000000002000000000000000000000 undead_face2 = 0x000000000020010000001fffffffffff #NAMES: # troops = [ ["player","Player","Player",tf_hero|tf_unmoveable_in_party_window,no_scene,reserved,fac_player_faction, [], str_4|agi_4|int_4|cha_4,wp(15),0,0x000000018000000136db6db6db6db6db00000000001db6db0000000000000000], ["temp_troop","Temp Troop","Temp Troop",tf_hero,no_scene,reserved,fac_commoners,[],def_attrib,0,knows_common|knows_inventory_management_10,0], ["game","Game","Game",tf_hero,no_scene,reserved,fac_commoners,[],def_attrib,0,knows_common,0], ["unarmed_troop","Unarmed Troop","Unarmed Troops",tf_hero,no_scene,reserved,fac_commoners,[itm_arrows,itm_short_bow],def_attrib|str_14,0,knows_common|knows_power_draw_2,0], #################################################################################################################### # Troops before this point are hardwired into the game and their order should not be changed! #################################################################################################################### ["random_town_sequence","Random Town Sequence","Random Town Sequence",tf_hero,no_scene,reserved,fac_commoners,[],def_attrib,0,knows_common|knows_inventory_management_10,0], ["tournament_participants","Tournament Participants","Tournament Participants",tf_hero,no_scene,reserved,fac_commoners,[],def_attrib,0,knows_common|knows_inventory_management_10,0], ["tutorial_maceman","Maceman","Maceman",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_tutorial_club,itm_leather_jerkin,itm_hide_boots], str_6|agi_6|level(1),wp(50),knows_common,mercenary_face_1,mercenary_face_2], ["tutorial_archer","Archer","Archer",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_ranged,no_scene,reserved,fac_commoners, [itm_tutorial_short_bow,itm_tutorial_arrows,itm_linen_tunic,itm_hide_boots], str_6|agi_6|level(5),wp(100),knows_common|knows_power_draw_4,mercenary_face_1,mercenary_face_2], ["tutorial_swordsman","Swordsman","Swordsman",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_tutorial_sword,itm_leather_vest,itm_hide_boots], str_6|agi_6|level(5),wp(80),knows_common,mercenary_face_1,mercenary_face_2], ["novice_fighter","Novice Fighter","Novice Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_hide_boots], str_6|agi_6|level(5),wp(60),knows_common,mercenary_face_1, mercenary_face_2], ["regular_fighter","Regular Fighter","Regular Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_hide_boots], str_8|agi_8|level(11),wp(90),knows_common|knows_ironflesh_1|knows_power_strike_1|knows_athletics_1|knows_riding_1|knows_shield_2,mercenary_face_1, mercenary_face_2], ["veteran_fighter","Veteran Fighter","Veteran Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,0,fac_commoners, [itm_hide_boots], str_10|agi_10|level(17),wp(110),knows_common|knows_ironflesh_3|knows_power_strike_2|knows_athletics_2|knows_riding_2|knows_shield_3,mercenary_face_1, mercenary_face_2], ["champion_fighter","Champion Fighter","Champion Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_hide_boots], str_12|agi_11|level(22),wp(140),knows_common|knows_ironflesh_4|knows_power_strike_3|knows_athletics_3|knows_riding_3|knows_shield_4,mercenary_face_1, mercenary_face_2], ["arena_training_fighter_1","Novice Fighter","Novice Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_hide_boots], str_6|agi_6|level(5),wp(60),knows_common,mercenary_face_1, mercenary_face_2], ["arena_training_fighter_2","Novice Fighter","Novice Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_hide_boots], str_7|agi_6|level(7),wp(70),knows_common,mercenary_face_1, mercenary_face_2], ["arena_training_fighter_3","Regular Fighter","Regular Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_hide_boots], str_8|agi_7|level(9),wp(80),knows_common,mercenary_face_1, mercenary_face_2], ["arena_training_fighter_4","Regular Fighter","Regular Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_hide_boots], str_8|agi_8|level(11),wp(90),knows_common,mercenary_face_1, mercenary_face_2], ["arena_training_fighter_5","Regular Fighter","Regular Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_hide_boots], str_9|agi_8|level(13),wp(100),knows_common,mercenary_face_1, mercenary_face_2], ["arena_training_fighter_6","Veteran Fighter","Veteran Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_hide_boots], str_10|agi_9|level(15),wp(110),knows_common,mercenary_face_1, mercenary_face_2], ["arena_training_fighter_7","Veteran Fighter","Veteran Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_hide_boots], str_10|agi_10|level(17),wp(120),knows_common,mercenary_face_1, mercenary_face_2], ["arena_training_fighter_8","Veteran Fighter","Veteran Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_hide_boots], str_11|agi_10|level(19),wp(130),knows_common,mercenary_face_1, mercenary_face_2], ["arena_training_fighter_9","Champion Fighter","Champion Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_hide_boots], str_12|agi_11|level(21),wp(140),knows_common,mercenary_face_1, mercenary_face_2], ["arena_training_fighter_10","Champion Fighter","Champion Fighters",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_hide_boots], str_12|agi_12|level(23),wp(150),knows_common,mercenary_face_1, mercenary_face_2], ["cattle","Cattle","Cattle",0,no_scene,reserved,fac_neutral, [], def_attrib|level(1),wp(60),0,mercenary_face_1, mercenary_face_2], #soldiers: #This troop is the troop marked as soldiers_begin ["farmer","Farmer","Farmers",tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_cleaver,itm_knife,itm_pitch_fork,itm_sickle,itm_club,itm_stones,itm_leather_cap,itm_felt_hat,itm_felt_hat,itm_linen_tunic,itm_coarse_tunic,itm_nomad_boots,itm_wrapping_boots], def_attrib|level(4),wp(60),knows_common,man_face_middle_1, man_face_old_2], ["townsman","Townsman","Townsmen",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_cleaver,itm_knife,itm_club,itm_quarter_staff,itm_dagger,itm_stones,itm_leather_cap,itm_linen_tunic,itm_coarse_tunic,itm_leather_apron,itm_nomad_boots,itm_wrapping_boots], def_attrib|level(4),wp(60),knows_common,mercenary_face_1, mercenary_face_2], ["watchman","Watchman","Watchmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,no_scene,reserved,fac_commoners, [itm_bolts,itm_spiked_club,itm_fighting_pick,itm_sword_medieval_a,itm_boar_spear,itm_hunting_crossbow,itm_light_crossbow,itm_tab_shield_round_a,itm_tab_shield_round_b,itm_padded_cloth,itm_leather_jerkin,itm_leather_cap,itm_padded_coif,itm_footman_helmet,itm_nomad_boots,itm_wrapping_boots], def_attrib|level(9),wp(75),knows_common|knows_shield_1,mercenary_face_1, mercenary_face_2], ["caravan_guard","Caravan Guard","Caravan Guards",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse|tf_guarantee_shield,no_scene,0,fac_commoners, [itm_spear,itm_fighting_pick,itm_sword_medieval_a,itm_voulge,itm_tab_shield_round_b,itm_tab_shield_round_c,itm_leather_jerkin,itm_leather_vest,itm_hide_boots,itm_padded_coif,itm_nasal_helmet,itm_footman_helmet,itm_saddle_horse], def_attrib|level(14),wp(85),knows_common|knows_riding_2|knows_ironflesh_1|knows_shield_3,mercenary_face_1, mercenary_face_2], ["mercenary_swordsman","Mercenary Swordsman","Mercenary Swordsmen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,no_scene,reserved,fac_commoners, [itm_bastard_sword_a,itm_sword_medieval_b,itm_sword_medieval_b_small,itm_tab_shield_heater_c,itm_mail_hauberk,itm_haubergeon,itm_hide_boots,itm_kettle_hat,itm_mail_coif,itm_flat_topped_helmet, itm_helmet_with_neckguard], def_attrib|level(20),wp(100),knows_common|knows_riding_3|knows_ironflesh_2|knows_shield_3|knows_power_strike_2,mercenary_face_1, mercenary_face_2], ["hired_blade","Hired Blade","Hired Blades",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,no_scene,reserved,fac_commoners, [itm_bastard_sword_b,itm_sword_medieval_c,itm_tab_shield_heater_cav_a,itm_haubergeon,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_great_helmet,itm_bascinet, itm_leather_gloves], def_attrib|level(25),wp(130),knows_common|knows_riding_3|knows_athletics_5|knows_shield_4|knows_power_strike_4|knows_ironflesh_3,mercenary_face_1, mercenary_face_2], ["mercenary_crossbowman","Mercenary Crossbowman","Mercenary Crossbowmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_ranged,no_scene,reserved,fac_commoners, [itm_bolts,itm_spiked_club,itm_fighting_pick,itm_sword_medieval_a,itm_boar_spear,itm_crossbow,itm_tab_shield_pavise_a,itm_tab_shield_round_b,itm_padded_cloth,itm_leather_jerkin,itm_leather_cap,itm_padded_coif,itm_footman_helmet,itm_nomad_boots,itm_wrapping_boots], def_attrib|level(19),wp_melee(90)|wp_crossbow(120),knows_common|knows_athletics_2|knows_shield_1,mercenary_face_1, mercenary_face_2], ["mercenary_horseman","Mercenary Horseman","Mercenary Horsemen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,no_scene,reserved,fac_commoners, [itm_lance,itm_bastard_sword_a,itm_sword_medieval_b,itm_tab_shield_heater_c,itm_mail_shirt,itm_haubergeon,itm_hide_boots,itm_norman_helmet,itm_mail_coif,itm_helmet_with_neckguard,itm_saddle_horse,itm_courser,itm_hunter], def_attrib|level(20),wp(100),knows_common|knows_riding_4|knows_ironflesh_2|knows_shield_2|knows_power_strike_2,mercenary_face_1, mercenary_face_2], ["mercenary_cavalry","Mercenary Cavalry","Mercenary Cavalry",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,no_scene,reserved,fac_commoners, [itm_lance,itm_bastard_sword_a,itm_sword_medieval_b,itm_tab_shield_heater_c,itm_mail_hauberk,itm_banded_armor,itm_hide_boots,itm_kettle_hat,itm_mail_coif,itm_flat_topped_helmet,itm_helmet_with_neckguard,itm_saddle_horse,itm_courser,itm_hunter], def_attrib|level(25),wp(120),knows_common|knows_riding_5|knows_ironflesh_3|knows_shield_3|knows_power_strike_3,mercenary_face_1, mercenary_face_2], ["mercenaries_end","mercenaries_end","mercenaries_end",0,no_scene,reserved,fac_commoners, [], def_attrib|level(4),wp(60),knows_common,mercenary_face_1, mercenary_face_2], #peasant - retainer - footman - man-at-arms - knight ["swadian_recruit","Swadian Recruit","Swadian Recruits",tf_guarantee_armor,0,0,fac_neutral, [itm_scythe,itm_hatchet,itm_pickaxe,itm_club,itm_stones,itm_tab_shield_heater_a,itm_leather_cap,itm_felt_hat,itm_felt_hat, itm_shirt,itm_coarse_tunic,itm_leather_apron,itm_nomad_boots,itm_wrapping_boots], def_attrib|level(4),wp(60),knows_common,swadian_face_younger_1, swadian_face_middle_2], ["swadian_militia","Swadian Militia","Swadian Militia",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_neutral, [itm_bolts,itm_spiked_club,itm_fighting_pick,itm_boar_spear,itm_hunting_crossbow,itm_tab_shield_heater_a, itm_padded_cloth,itm_leather_armor,itm_leather_cap,itm_arming_cap,itm_padded_coif,itm_ankle_boots,itm_wrapping_boots], def_attrib|level(9),wp(75),knows_common,swadian_face_young_1, swadian_face_old_2], ["swadian_footman","Swadian Footman","Swadian Footmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_neutral, [itm_spear,itm_fighting_pick,itm_sword_medieval_b_small,itm_sword_medieval_a,itm_tab_shield_heater_b, itm_leather_jerkin,itm_padded_leather,itm_leather_armor,itm_ankle_boots,itm_padded_coif,itm_footman_helmet], def_attrib|level(14),wp_melee(85),knows_common|knows_ironflesh_1|knows_shield_2,swadian_face_young_1, swadian_face_old_2], ["swadian_infantry","Swadian Infantry","Swadian Infantry",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_pike,itm_fighting_pick,itm_bastard_sword_a,itm_sword_medieval_a,itm_sword_medieval_b_small,itm_tab_shield_heater_c, itm_mail_with_surcoat,itm_haubergeon,itm_hide_boots,itm_ankle_boots,itm_kettle_hat,itm_mail_coif,itm_flat_topped_helmet,itm_helmet_with_neckguard], def_attrib|level(20),wp_melee(105),knows_common|knows_riding_3|knows_ironflesh_2|knows_shield_3,swadian_face_middle_1, swadian_face_old_2], ["swadian_sergeant","Swadian Sergeant","Swadian Sergeants",tf_mounted|tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_awlpike,itm_bastard_sword_b,itm_morningstar,itm_sword_medieval_c,itm_tab_shield_heater_d, itm_coat_of_plates,itm_mail_with_surcoat,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_helmet_with_neckguard,itm_bascinet,itm_guard_helmet,itm_leather_gloves], def_attrib|level(25),wp_melee(135),knows_common|knows_shield_3|knows_ironflesh_3|knows_power_strike_3,swadian_face_middle_1, swadian_face_older_2], ["swadian_skirmisher","Swadian Skirmisher","Swadian Skirmishers",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral, [itm_bolts,itm_light_crossbow,itm_hunting_crossbow,itm_dagger,itm_club,itm_voulge,itm_tab_shield_heater_a, itm_leather_armor,itm_padded_cloth,itm_ankle_boots,itm_padded_coif,itm_arming_cap,itm_footman_helmet], def_attrib|level(14),wp(80),knows_common|knows_riding_2|knows_ironflesh_1,swadian_face_young_1, swadian_face_middle_2], ["swadian_crossbowman","Swadian Crossbowman","Swadian Crossbowmen",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral, [itm_bolts,itm_crossbow,itm_light_crossbow,itm_fighting_pick,itm_dagger,itm_sword_medieval_a,itm_voulge,itm_tab_shield_heater_b, itm_leather_jerkin,itm_leather_armor,itm_hide_boots,itm_ankle_boots,itm_padded_coif,itm_nasal_helmet,itm_footman_helmet], def_attrib|level(19),wp_melee(90)|wp_crossbow(100),knows_common|knows_riding_2|knows_ironflesh_1,swadian_face_young_1, swadian_face_old_2], ["swadian_sharpshooter","Swadian Sharpshooter","Swadian Sharpshooters",tf_guarantee_ranged|tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_bolts,itm_arrows,itm_crossbow,itm_crossbow,itm_heavy_crossbow,itm_sword_medieval_b_small,itm_sword_medieval_a,itm_voulge,itm_tab_shield_heater_c, itm_haubergeon,itm_padded_leather,itm_hide_boots,itm_norman_helmet,itm_nasal_helmet,itm_kettle_hat,itm_kettle_hat,itm_leather_gloves], def_attrib|str_14|level(24),wp_melee(100)|wp_crossbow(130),knows_common|knows_power_draw_3|knows_ironflesh_1,swadian_face_middle_1, swadian_face_older_2], ["swadian_man_at_arms","Swadian Man at Arms","Swadian Men at Arms",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_neutral, [itm_lance,itm_fighting_pick,itm_bastard_sword_a,itm_sword_medieval_b,itm_sword_medieval_c_small,itm_tab_shield_heater_cav_a, itm_haubergeon,itm_mail_with_surcoat,itm_hide_boots,itm_norman_helmet,itm_mail_coif,itm_flat_topped_helmet,itm_helmet_with_neckguard,itm_warhorse,itm_warhorse,itm_hunter], def_attrib|level(20),wp_melee(100),knows_common|knows_riding_4|knows_ironflesh_2|knows_shield_2|knows_power_strike_3,swadian_face_young_1, swadian_face_old_2], ["swadian_knight","Swadian Knight","Swadian Knights",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_neutral, [itm_heavy_lance,itm_bastard_sword_b,itm_morningstar,itm_sword_medieval_c,itm_tab_shield_heater_cav_b, itm_coat_of_plates,itm_cuir_bouilli,itm_mail_with_surcoat,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_great_helmet,itm_bascinet,itm_hunter,itm_warhorse,itm_leather_gloves,itm_mail_mittens], def_attrib|level(25),wp_melee(130),knows_common|knows_riding_5|knows_shield_3|knows_ironflesh_4|knows_power_strike_5,swadian_face_middle_1, swadian_face_older_2], ["swadian_messenger","Swadian Messenger","Swadian Messengers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse|tf_guarantee_ranged,0,0,fac_neutral, [itm_sword_medieval_a,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves,itm_light_crossbow,itm_bolts], def_attrib|agi_21|level(25),wp(130),knows_common|knows_riding_7|knows_horse_archery_5,swadian_face_young_1, swadian_face_old_2], ["swadian_deserter","Swadian Deserter","Swadian Deserters",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_deserters, [itm_bolts,itm_light_crossbow,itm_hunting_crossbow,itm_dagger,itm_club,itm_voulge,itm_wooden_shield,itm_leather_jerkin,itm_padded_cloth,itm_hide_boots,itm_padded_coif,itm_nasal_helmet,itm_footman_helmet], def_attrib|level(14),wp(80),knows_common|knows_riding_2|knows_ironflesh_1,swadian_face_young_1, swadian_face_old_2], ["swadian_prison_guard","Prison Guard","Prison Guards",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_awlpike,itm_pike,itm_great_sword,itm_morningstar,itm_sword_medieval_b,itm_tab_shield_heater_c,itm_coat_of_plates,itm_plate_armor,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_helmet_with_neckguard,itm_bascinet,itm_guard_helmet,itm_leather_gloves], def_attrib|level(25),wp(130),knows_common|knows_shield_3|knows_ironflesh_3|knows_power_strike_3,swadian_face_young_1, swadian_face_old_2], ["swadian_castle_guard","Castle Guard","Castle Guards",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_awlpike,itm_pike,itm_great_sword,itm_morningstar,itm_sword_medieval_b,itm_tab_shield_heater_c,itm_tab_shield_heater_d,itm_coat_of_plates,itm_plate_armor,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_helmet_with_neckguard,itm_bascinet,itm_guard_helmet,itm_leather_gloves], def_attrib|level(25),wp(130),knows_common|knows_shield_3|knows_ironflesh_3|knows_power_strike_3,swadian_face_young_1, swadian_face_old_2], # Vaegir watchman? ["vaegir_recruit","Vaegir Recruit","Vaegir Recruits",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral, [itm_scythe,itm_hatchet,itm_cudgel,itm_axe,itm_stones,itm_tab_shield_kite_a, itm_tab_shield_kite_a,itm_rawhide_coat,itm_nomad_armor,itm_nomad_boots], def_attrib|level(4),wp(60),knows_common, vaegir_face_younger_1, vaegir_face_middle_2], ["vaegir_footman","Vaegir Footman","Vaegir Footmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_neutral, [itm_spiked_club,itm_hand_axe,itm_sword_viking_1,itm_two_handed_axe,itm_tab_shield_kite_a,itm_tab_shield_kite_b,itm_spear,itm_nomad_cap,itm_skullcap,itm_rawhide_coat,itm_nomad_armor,itm_nomad_boots], def_attrib|level(9),wp(75),knows_common, vaegir_face_young_1, vaegir_face_middle_2], ["vaegir_skirmisher","Vaegir Skirmisher","Vaegir Skirmishers",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral, [itm_arrows,itm_spiked_mace,itm_axe,itm_sword_khergit_1,itm_short_bow,itm_short_bow,itm_hunting_bow,itm_javelin,itm_javelin,itm_steppe_cap,itm_nomad_cap,itm_leather_vest,itm_leather_vest,itm_nomad_armor,itm_nomad_boots], def_attrib|str_10|level(14),wp(60),knows_ironflesh_1|knows_power_draw_1|knows_power_throw_1,vaegir_face_young_1, vaegir_face_old_2], ["vaegir_archer","Vaegir Archer","Vaegir Archers",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral, [itm_arrows,itm_axe,itm_sword_khergit_1,itm_nomad_bow,itm_nomad_bow,itm_short_bow,itm_leather_jerkin,itm_leather_vest,itm_nomad_boots,itm_spiked_helmet,itm_nordic_helmet,itm_nasal_helmet,itm_nomad_cap], def_attrib|str_12|level(19),wp_melee(70)|wp_archery(110),knows_ironflesh_1|knows_power_draw_2|knows_athletics_2|knows_power_throw_1,vaegir_face_young_1, vaegir_face_older_2], ["vaegir_marksman","Vaegir Marksman","Vaegir Marksmen",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_arrows,itm_axe,itm_voulge,itm_sword_khergit_2,itm_strong_bow,itm_nomad_bow,itm_nomad_bow,itm_leather_vest,itm_studded_leather_coat,itm_nomad_boots,itm_spiked_helmet,itm_nordic_helmet,itm_nasal_helmet,itm_nomad_cap], def_attrib|str_14|level(24),wp_melee(80)|wp_archery(140),knows_ironflesh_2|knows_power_draw_4|knows_athletics_3|knows_power_throw_1,vaegir_face_young_1, vaegir_face_older_2], ["vaegir_veteran","Vaegir Veteran","Vaegir Veterans",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_neutral, [itm_spiked_mace,itm_two_handed_axe,itm_sword_viking_1,itm_tab_shield_kite_b,itm_tab_shield_kite_c,itm_spear, itm_steppe_cap,itm_nomad_cap,itm_leather_jerkin,itm_studded_leather_coat,itm_nomad_boots,itm_saddle_horse], def_attrib|level(14),wp_melee(85),knows_athletics_1|knows_ironflesh_1|knows_shield_2,vaegir_face_young_1, vaegir_face_old_2], ["vaegir_infantry","Vaegir Infantry","Vaegir Infantries",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_pike,itm_battle_axe,itm_sword_viking_2,itm_sword_khergit_2,itm_tab_shield_kite_c,itm_spear, itm_mail_hauberk,itm_lamellar_vest,itm_nomad_boots,itm_spiked_helmet,itm_nordic_helmet,itm_nasal_helmet,itm_nomad_cap], def_attrib|level(19),wp_melee(100),knows_athletics_2|knows_ironflesh_2|knows_power_strike_2|knows_shield_2,vaegir_face_young_1, vaegir_face_older_2], ["vaegir_guard","Vaegir Guard","Vaegir Guards",tf_mounted|tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_ashwood_pike,itm_battle_fork,itm_bardiche,itm_battle_axe,itm_fighting_axe,itm_tab_shield_kite_d, itm_banded_armor,itm_lamellar_vest,itm_lamellar_armor,itm_mail_chausses,itm_iron_greaves,itm_nordic_helmet,itm_nordic_helmet,itm_nordic_helmet,itm_spiked_helmet,itm_leather_gloves], def_attrib|level(24),wp_melee(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3|knows_power_strike_2,vaegir_face_middle_1, vaegir_face_older_2], ["vaegir_horseman","Vaegir Horseman","Vaegir Horsemen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_neutral, [itm_battle_axe,itm_sword_khergit_2,itm_lance,itm_tab_shield_kite_cav_a,itm_spear, itm_studded_leather_coat,itm_lamellar_vest,itm_nomad_boots,itm_spiked_helmet,itm_nordic_helmet,itm_nasal_helmet,itm_nomad_cap,itm_steppe_horse,itm_hunter], def_attrib|level(19),wp(100),knows_riding_3|knows_ironflesh_2|knows_power_strike_1,vaegir_face_young_1, vaegir_face_older_2], ["vaegir_knight","Vaegir Knight","Vaegir Knights",tf_mounted|tf_guarantee_boots|tf_guarantee_gloves|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_neutral, [itm_bardiche,itm_war_axe,itm_fighting_axe,itm_lance,itm_lance,itm_tab_shield_kite_cav_b, itm_banded_armor,itm_lamellar_vest,itm_lamellar_armor,itm_mail_chausses,itm_iron_greaves,itm_nordic_helmet,itm_nordic_helmet,itm_nordic_helmet,itm_spiked_helmet,itm_hunter, itm_warhorse,itm_leather_gloves], def_attrib|level(24),wp(130),knows_riding_4|knows_shield_2|knows_ironflesh_3|knows_power_strike_2,vaegir_face_middle_1, vaegir_face_older_2], ["vaegir_messenger","Vaegir Messenger","Vaegir Messengers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse|tf_guarantee_ranged,0,0,fac_neutral, [itm_sword_medieval_b,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves,itm_short_bow,itm_arrows], def_attrib|agi_21|level(25),wp(130),knows_common|knows_riding_7|knows_horse_archery_5|knows_power_draw_5,vaegir_face_young_1, vaegir_face_older_2], ["vaegir_deserter","Vaegir Deserter","Vaegir Deserters",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_deserters, [itm_arrows,itm_spiked_mace,itm_axe,itm_falchion,itm_short_bow,itm_short_bow,itm_hunting_bow,itm_javelin,itm_javelin,itm_steppe_cap,itm_nomad_cap,itm_leather_vest,itm_leather_vest,itm_nomad_armor,itm_nomad_boots], def_attrib|str_10|level(14),wp(80),knows_ironflesh_1|knows_power_draw_1,vaegir_face_young_1, vaegir_face_older_2], ["vaegir_prison_guard","Prison Guard","Prison Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_ashwood_pike,itm_battle_fork,itm_bardiche,itm_battle_axe,itm_fighting_axe,itm_tab_shield_kite_b,itm_studded_leather_coat,itm_lamellar_armor,itm_mail_chausses,itm_iron_greaves,itm_nordic_helmet,itm_nordic_helmet,itm_nordic_helmet,itm_spiked_helmet,itm_leather_gloves], def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,vaegir_face_middle_1, vaegir_face_older_2], ["vaegir_castle_guard","Castle Guard","Castle Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_ashwood_pike,itm_battle_fork,itm_bardiche,itm_battle_axe,itm_fighting_axe,itm_tab_shield_kite_d,itm_studded_leather_coat,itm_lamellar_armor,itm_mail_chausses,itm_iron_greaves,itm_nordic_helmet,itm_nordic_helmet,itm_nordic_helmet,itm_spiked_helmet,itm_leather_gloves], def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,vaegir_face_middle_1, vaegir_face_older_2], ["khergit_tribesman","Khergit Tribesman","Khergit Tribesmen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_khergits, [itm_arrows,itm_club,itm_spear,itm_hunting_bow, itm_steppe_cap,itm_nomad_cap,itm_leather_vest,itm_steppe_armor,itm_nomad_boots,itm_steppe_horse,itm_sumpter_horse], def_attrib|level(5),wp(50),knows_common|knows_riding_3|knows_power_draw_2|knows_horse_archery_2,khergit_face_younger_1, khergit_face_old_2], ["khergit_skirmisher","Khergit Skirmisher","Khergit Skirmishers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse|tf_guarantee_ranged,0,0,fac_khergits, [itm_arrows,itm_sword_khergit_1,itm_winged_mace,itm_spear,itm_nomad_bow,itm_javelin,itm_tab_shield_small_round_a, itm_steppe_cap,itm_nomad_cap,itm_leather_steppe_cap_a,itm_khergit_armor,itm_steppe_armor,itm_leather_vest,itm_nomad_boots,itm_steppe_horse,itm_saddle_horse], def_attrib|level(10),wp(60)|wp_archery(80)|wp_throwing(80),knows_common|knows_riding_4|knows_power_draw_3|knows_power_throw_1|knows_horse_archery_3,khergit_face_younger_1, khergit_face_old_2], ["khergit_horseman","Khergit Horseman","Khergit Horsemen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_ranged|tf_guarantee_horse,0,0,fac_khergits, [itm_arrows,itm_light_lance,itm_nomad_bow,itm_sword_khergit_2,itm_tab_shield_small_round_a,itm_tab_shield_small_round_b,itm_spear, itm_leather_steppe_cap_a, itm_leather_steppe_cap_b,itm_nomad_robe,itm_nomad_vest,itm_nomad_boots,itm_hide_boots,itm_spiked_helmet,itm_nomad_cap,itm_steppe_horse,itm_hunter], def_attrib|level(14),wp(80),knows_common|knows_riding_5|knows_power_draw_4|knows_ironflesh_1|knows_power_throw_1,khergit_face_young_1, khergit_face_older_2], ["khergit_horse_archer","Khergit Horse Archer","Khergit Horse Archers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_ranged|tf_guarantee_horse,0,0,fac_khergits, [itm_arrows,itm_sword_khergit_2,itm_winged_mace,itm_spear,itm_khergit_bow,itm_tab_shield_small_round_a,itm_tab_shield_small_round_a,itm_tab_shield_small_round_b,itm_bodkin_arrows,itm_arrows,itm_javelin, itm_leather_steppe_cap_b,itm_leather_steppe_cap_c,itm_tribal_warrior_outfit,itm_nomad_robe,itm_hide_boots,itm_tab_shield_small_round_a,itm_tab_shield_small_round_b,itm_steppe_horse], def_attrib|level(14),wp(80)|wp_archery(110),knows_riding_5|knows_power_draw_3|knows_ironflesh_1|knows_horse_archery_4|knows_power_throw_1,khergit_face_young_1, khergit_face_older_2], ["khergit_veteran_horse_archer","Khergit Veteran Horse Archer","Khergit Veteran Horse Archers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_ranged|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_khergits, [itm_sword_khergit_3,itm_winged_mace,itm_spear,itm_khergit_bow,itm_nomad_bow,itm_nomad_bow,itm_arrows,itm_khergit_arrows,itm_khergit_arrows,itm_javelin,itm_tab_shield_small_round_b,itm_tab_shield_small_round_c, itm_leather_steppe_cap_c,itm_leather_warrior_cap,itm_lamellar_vest,itm_tribal_warrior_outfit,itm_hide_boots,itm_saddle_horse,itm_courser], def_attrib|level(21),wp(90)|wp_archery(130),knows_riding_6|knows_power_draw_4|knows_ironflesh_2|knows_horse_archery_5|knows_power_throw_3,khergit_face_middle_1, khergit_face_older_2], ["khergit_lancer","Khergit Lancer","Khergit Lancers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_khergits, [itm_arrows,itm_sword_khergit_4,itm_winged_mace,itm_spear,itm_lance,itm_lance,itm_khergit_bow, itm_strong_bow,itm_short_bow,itm_khergit_arrows,itm_arrows, itm_khergit_guard_helmet,itm_khergit_cavalry_helmet,itm_lamellar_vest,itm_lamellar_armor,itm_hide_boots,itm_leather_gloves,itm_tab_shield_small_round_b,itm_tab_shield_small_round_c,itm_courser], def_attrib|level(23),wp(120),knows_riding_6|knows_power_strike_2|knows_power_draw_2|knows_power_throw_2|knows_ironflesh_2|knows_horse_archery_1,khergit_face_middle_1, khergit_face_older_2], ["khergit_messenger","Khergit Messenger","Khergit Messengers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse|tf_guarantee_ranged,0,0,fac_neutral, [itm_sword_khergit_2,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves,itm_short_bow,itm_arrows], def_attrib|agi_21|level(25),wp(130),knows_common|knows_riding_7|knows_horse_archery_5|knows_power_draw_5,khergit_face_young_1, khergit_face_older_2], ["khergit_deserter","Khergit Deserter","Khergit Deserters",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_deserters, [itm_arrows,itm_spiked_mace,itm_axe,itm_sword_khergit_1,itm_short_bow,itm_short_bow,itm_hunting_bow,itm_javelin,itm_javelin,itm_steppe_cap,itm_nomad_cap,itm_leather_vest,itm_leather_vest,itm_nomad_armor,itm_nomad_boots], def_attrib|str_10|level(14),wp(80),knows_ironflesh_1|knows_power_draw_1,khergit_face_young_1, khergit_face_older_2], ["khergit_prison_guard","Prison Guard","Prison Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_sword_khergit_3,itm_tab_shield_small_round_b,itm_tab_shield_small_round_a,itm_lamellar_vest,itm_lamellar_armor,itm_hide_boots,itm_iron_greaves,itm_khergit_guard_helmet,itm_khergit_cavalry_helmet,itm_leather_warrior_cap], def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,khergit_face_middle_1, khergit_face_older_2], ["khergit_castle_guard","Castle Guard","Castle Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_sword_khergit_4,itm_tab_shield_small_round_b,itm_tab_shield_small_round_a,itm_lamellar_vest,itm_lamellar_armor,itm_hide_boots,itm_iron_greaves,itm_khergit_guard_helmet,itm_khergit_cavalry_helmet,itm_leather_warrior_cap], def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,khergit_face_middle_1, khergit_face_older_2], ["nord_recruit","Nord Recruit","Nord Recruits",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_outlaws, [itm_axe,itm_hatchet,itm_spear,itm_tab_shield_round_a,itm_tab_shield_round_a, itm_shirt,itm_coarse_tunic,itm_hide_boots,itm_nomad_boots], def_attrib|level(6),wp(50),knows_power_strike_1|knows_power_throw_1|knows_riding_1|knows_athletics_1,nord_face_younger_1, nord_face_old_2], ["nord_footman","Nord Footman","Nord Footmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_outlaws, [itm_fighting_axe,itm_one_handed_war_axe_a,itm_spear,itm_tab_shield_round_a,itm_tab_shield_round_b,itm_javelin,itm_throwing_axes, itm_leather_cap,itm_skullcap,itm_nomad_vest,itm_shirt,itm_leather_boots,itm_nomad_boots], def_attrib|level(10),wp(70),knows_ironflesh_2|knows_power_strike_2|knows_power_throw_2|knows_riding_2|knows_athletics_2|knows_shield_1,nord_face_young_1, nord_face_old_2], ["nord_trained_footman","Nord Trained Footman","Nord Trained Footmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws, [itm_arrows,itm_one_handed_war_axe_a,itm_one_handed_war_axe_b,itm_one_handed_battle_axe_a,itm_tab_shield_round_b, itm_skullcap,itm_nasal_helmet,itm_byrnie,itm_studded_leather_coat,itm_leather_jerkin,itm_leather_boots], def_attrib|level(14),wp(100),knows_ironflesh_3|knows_power_strike_3|knows_power_throw_2|knows_riding_2|knows_athletics_3|knows_shield_2,nord_face_young_1, nord_face_old_2], ["nord_warrior","Nord Warrior","Nord Warriors",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws, [itm_arrows,itm_sword_viking_1,itm_one_handed_war_axe_b,itm_one_handed_battle_axe_a,itm_tab_shield_round_c,itm_javelin, itm_nasal_helmet,itm_byrnie,itm_mail_shirt,itm_mail_hauberk,itm_studded_leather_coat,itm_hunter_boots,itm_leather_boots], def_attrib|level(19),wp(115),knows_ironflesh_4|knows_power_strike_4|knows_power_throw_3|knows_riding_2|knows_athletics_4|knows_shield_3,nord_face_young_1, nord_face_older_2], ["nord_veteran","Nord Veteran","Nord Veterans",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws, [itm_arrows,itm_sword_viking_2,itm_sword_viking_2_small,itm_one_handed_battle_axe_b,itm_spiked_mace,itm_tab_shield_round_d,itm_javelin,itm_throwing_axes, itm_nordic_helmet,itm_nasal_helmet,itm_byrnie,itm_mail_hauberk,itm_splinted_leather_greaves,itm_leather_boots,itm_leather_gloves], def_attrib|level(24),wp(130),knows_ironflesh_5|knows_power_strike_5|knows_power_throw_4|knows_riding_3|knows_athletics_5|knows_shield_4,nord_face_young_1, nord_face_older_2], ["nord_champion","Nord Huscarl","Nord Huscarls",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws, [itm_arrows,itm_sword_viking_3,itm_sword_viking_3_small,itm_great_axe,itm_one_handed_battle_axe_c,itm_tab_shield_round_e,itm_javelin,itm_throwing_axes,itm_throwing_axes, itm_nordic_helmet,itm_banded_armor,itm_mail_boots,itm_leather_boots,itm_mail_mittens], def_attrib|level(28),wp(145),knows_ironflesh_6|knows_power_strike_7|knows_power_throw_5|knows_riding_2|knows_athletics_6|knows_shield_5,nord_face_middle_1, nord_face_older_2], ["nord_huntsman","Nord Huntsman","Nord Huntsmen",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral, [itm_arrows,itm_hatchet,itm_hunting_bow,itm_shirt,itm_shirt,itm_hide_boots], def_attrib|str_10|level(11),wp_melee(60)|wp_archery(70),knows_ironflesh_1|knows_power_draw_1|knows_athletics_2,nord_face_young_1, nord_face_old_2], ["nord_archer","Nord Archer","Nord Archers",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral, [itm_arrows,itm_axe,itm_short_bow,itm_leather_jerkin,itm_shirt,itm_leather_boots,itm_nasal_helmet,itm_leather_cap], def_attrib|str_11|level(15),wp_melee(80)|wp_archery(90),knows_ironflesh_1|knows_power_draw_2|knows_athletics_3,nord_face_young_1, nord_face_old_2], ["nord_veteran_archer","Nord Veteran Archer","Nord Veteran Archers",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral, [itm_arrows,itm_one_handed_war_axe_a,itm_sword_viking_1,itm_long_bow,itm_leather_jerkin,itm_padded_leather,itm_leather_boots,itm_nasal_helmet,itm_leather_cap], def_attrib|str_12|level(19),wp_melee(95)|wp_archery(110),knows_power_strike_1|knows_ironflesh_2|knows_power_draw_3|knows_athletics_4,nord_face_middle_1, nord_face_older_2], ["nord_messenger","Nord Messenger","Nord Messengers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse|tf_guarantee_ranged,0,0,fac_neutral, [itm_sword_viking_2,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves,itm_short_bow,itm_arrows], def_attrib|agi_21|level(25),wp(130),knows_common|knows_riding_7|knows_horse_archery_5|knows_power_draw_5,nord_face_young_1, nord_face_older_2], ["nord_deserter","Nord Deserter","Nord Deserters",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_deserters, [itm_arrows,itm_spiked_mace,itm_axe,itm_falchion,itm_short_bow,itm_short_bow,itm_hunting_bow,itm_javelin,itm_javelin,itm_steppe_cap,itm_nomad_cap,itm_leather_vest,itm_leather_vest,itm_nomad_armor,itm_nomad_boots], def_attrib|str_10|level(14),wp(80),knows_ironflesh_1|knows_power_draw_1,nord_face_young_1, nord_face_older_2], ["nord_prison_guard","Prison Guard","Prison Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_ashwood_pike,itm_battle_fork,itm_battle_axe,itm_fighting_axe,itm_tab_shield_round_d,itm_mail_hauberk,itm_mail_chausses,itm_iron_greaves,itm_nordic_helmet,itm_nordic_helmet,itm_nordic_helmet,itm_spiked_helmet,itm_leather_gloves], def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,nord_face_middle_1, nord_face_older_2], ["nord_castle_guard","Castle Guard","Castle Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_ashwood_pike,itm_battle_fork,itm_battle_axe,itm_fighting_axe,itm_tab_shield_round_d,itm_tab_shield_round_e,itm_mail_hauberk,itm_heraldic_mail_with_tabard,itm_mail_chausses,itm_iron_greaves,itm_nordic_helmet,itm_nordic_helmet,itm_nordic_helmet,itm_spiked_helmet,itm_leather_gloves], def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,nord_face_middle_1, nord_face_older_2], ["rhodok_tribesman","Rhodok Tribesman","Rhodok Tribesmen",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_kingdom_5, [itm_pitch_fork,itm_tab_shield_pavise_a, itm_shirt,itm_coarse_tunic,itm_wrapping_boots,itm_nomad_boots,itm_head_wrappings], def_attrib|level(4),wp(55),knows_common|knows_power_draw_2|knows_ironflesh_1,rhodok_face_younger_1, rhodok_face_old_2], ["rhodok_spearman","Rhodok Spearman","Rhodok Spearmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_kingdom_5, [itm_spear,itm_tab_shield_pavise_a,itm_tab_shield_pavise_a, itm_leather_cap,itm_common_hood,itm_leather_vest,itm_leather_vest,itm_wrapping_boots,itm_nomad_boots], def_attrib|level(9),wp(80),knows_common|knows_ironflesh_2|knows_shield_1|knows_power_strike_2|knows_athletics_1,rhodok_face_young_1, rhodok_face_old_2], ["rhodok_trained_spearman","Rhodok Trained Spearman","Rhodok Trained Spearmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_kingdom_5, [itm_pike,itm_spear,itm_tab_shield_pavise_b, itm_leather_cap,itm_leather_vest,itm_ragged_outfit,itm_padded_cloth,itm_gambeson,itm_nomad_boots], def_attrib|level(14),wp(105),knows_common|knows_ironflesh_3|knows_shield_2|knows_power_strike_2|knows_athletics_2,rhodok_face_young_1, rhodok_face_older_2], ["rhodok_veteran_spearman","Rhodok Veteran Spearman","Rhodok Veteran Spearmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_shield,0,0,fac_kingdom_5, [itm_ashwood_pike,itm_war_spear,itm_pike,itm_club_with_spike_head,itm_tab_shield_pavise_c,itm_sword_medieval_a, itm_leather_cap,itm_byrnie,itm_ragged_outfit,itm_nomad_boots], def_attrib|level(19),wp(115),knows_common|knows_ironflesh_5|knows_shield_3|knows_power_strike_4|knows_athletics_3,rhodok_face_young_1, rhodok_face_older_2], ["rhodok_sergeant","Rhodok Sergeant","Rhodok Sergeants",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_shield,0,0,fac_kingdom_5, [itm_glaive,itm_war_spear,itm_sword_medieval_b,itm_tab_shield_pavise_d, itm_kettle_hat, itm_guard_helmet,itm_spiked_helmet,itm_byrnie,itm_surcoat_over_mail,itm_banded_armor,itm_nomad_boots,], def_attrib|level(24),wp(130),knows_common|knows_ironflesh_7|knows_shield_5|knows_power_strike_5|knows_athletics_5,rhodok_face_middle_1, rhodok_face_older_2], ["rhodok_crossbowman","Rhodok Crossbowman","Rhodok Crossbowmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_ranged,0,0,fac_kingdom_5, [itm_sword_medieval_a,itm_falchion,itm_club_with_spike_head,itm_tab_shield_pavise_a,itm_crossbow,itm_bolts, itm_leather_jerkin,itm_ragged_outfit,itm_nomad_boots], def_attrib|level(10),wp(85),knows_common|knows_ironflesh_2|knows_shield_1|knows_power_strike_1|knows_athletics_2,rhodok_face_young_1, rhodok_face_older_2], ["rhodok_trained_crossbowman","Rhodok Trained Crossbowman","Rhodok Trained Crossbowmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_ranged|tf_guarantee_shield,0,0,fac_kingdom_5, [itm_sword_medieval_a,itm_sword_medieval_b_small,itm_club_with_spike_head,itm_tab_shield_pavise_a,itm_tab_shield_pavise_a,itm_crossbow,itm_bolts, itm_leather_cap,itm_leather_jerkin,itm_ragged_outfit,itm_nomad_boots], def_attrib|level(15),wp_melee(90)|wp_crossbow(105),knows_common|knows_ironflesh_3|knows_shield_2|knows_power_strike_2|knows_athletics_3,rhodok_face_young_1, rhodok_face_older_2], ["rhodok_veteran_crossbowman","Rhodok Veteran Crossbowman","Rhodok Veteran Crossbowmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_ranged|tf_guarantee_shield,0,0,fac_kingdom_5, [itm_sword_medieval_a,itm_sword_medieval_b_small,itm_fighting_pick,itm_club_with_spike_head,itm_tab_shield_pavise_a,itm_tab_shield_pavise_b,itm_tab_shield_pavise_c,itm_heavy_crossbow,itm_bolts, itm_leather_cap,itm_leather_jerkin,itm_padded_leather,itm_nomad_boots], def_attrib|level(20),wp_melee(100)|wp_crossbow(120),knows_common|knows_ironflesh_4|knows_shield_3|knows_power_strike_3|knows_athletics_4,rhodok_face_middle_1, rhodok_face_older_2], ["rhodok_sharpshooter","Rhodok Sharpshooter","Rhodok Sharpshooters",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_ranged|tf_guarantee_shield,0,0,fac_kingdom_5, [itm_sword_medieval_b,itm_military_pick,itm_tab_shield_pavise_c,itm_sniper_crossbow,itm_steel_bolts, itm_kettle_hat,itm_leather_cap,itm_byrnie,itm_padded_leather,itm_leather_boots], def_attrib|level(25),wp_melee(110)|wp_crossbow(140),knows_common|knows_ironflesh_5|knows_shield_4|knows_power_strike_4|knows_athletics_6,rhodok_face_middle_1, rhodok_face_older_2], ["rhodok_messenger","Rhodok Messenger","Rhodok Messengers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse|tf_guarantee_ranged,0,0,fac_neutral, [itm_sword_medieval_b,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves,itm_short_bow,itm_arrows], def_attrib|agi_21|level(25),wp(130),knows_common|knows_riding_7|knows_horse_archery_5|knows_power_draw_5,rhodok_face_middle_1, rhodok_face_older_2], ["rhodok_deserter","Rhodok Deserter","Rhodok Deserters",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_deserters, [itm_arrows,itm_spiked_mace,itm_axe,itm_falchion,itm_short_bow,itm_short_bow,itm_hunting_bow,itm_javelin,itm_javelin,itm_steppe_cap,itm_nomad_cap,itm_leather_vest,itm_leather_vest,itm_nomad_armor,itm_nomad_boots], def_attrib|str_10|level(14),wp(80),knows_ironflesh_1|knows_power_draw_1,rhodok_face_middle_1, rhodok_face_older_2], ["rhodok_prison_guard","Prison Guard","Prison Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_ashwood_pike,itm_battle_fork,itm_battle_axe,itm_fighting_axe,itm_tab_shield_pavise_b,itm_mail_hauberk,itm_byrnie,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_leather_gloves], def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,rhodok_face_middle_1, rhodok_face_older_2], ["rhodok_castle_guard","Castle Guard","Castle Guards", tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral, [itm_ashwood_pike,itm_battle_fork,itm_battle_axe,itm_fighting_axe,itm_tab_shield_pavise_c,itm_mail_hauberk,itm_byrnie,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_leather_gloves], def_attrib|level(24),wp(130),knows_athletics_3|knows_shield_2|knows_ironflesh_3,rhodok_face_middle_1, rhodok_face_older_2], # Ryan BEGIN ["looter","Looter","Looters",0,0,0,fac_outlaws, [itm_hatchet,itm_club,itm_butchering_knife,itm_falchion,itm_rawhide_coat,itm_stones,itm_nomad_armor,itm_nomad_armor,itm_woolen_cap,itm_woolen_cap,itm_nomad_boots,itm_wrapping_boots], def_attrib|level(4),wp(20),knows_common,bandit_face1, bandit_face2], # Ryan END ["bandit","Bandit","Bandits",tf_guarantee_armor,0,0,fac_outlaws, [itm_arrows,itm_spiked_mace,itm_sword_viking_1,itm_short_bow,itm_falchion,itm_nordic_shield,itm_rawhide_coat,itm_leather_cap,itm_leather_jerkin,itm_nomad_armor,itm_nomad_boots,itm_wrapping_boots,itm_saddle_horse], def_attrib|level(10),wp(60),knows_common|knows_power_draw_1,bandit_face1, bandit_face2], ["brigand","Brigand","Brigands",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse,0,0,fac_outlaws, [itm_arrows,itm_spiked_mace,itm_sword_viking_1,itm_falchion,itm_wooden_shield,itm_hide_covered_round_shield,itm_long_bow,itm_leather_cap,itm_leather_jerkin,itm_nomad_boots,itm_saddle_horse], def_attrib|level(16),wp(90),knows_common|knows_power_draw_3,bandit_face1, bandit_face2], ["mountain_bandit","Mountain Bandit","Mountain Bandits",tf_guarantee_armor|tf_guarantee_boots,0,0,fac_outlaws, [itm_arrows,itm_sword_viking_1,itm_spear,itm_winged_mace,itm_maul,itm_falchion,itm_short_bow,itm_javelin,itm_fur_covered_shield,itm_hide_covered_round_shield, itm_felt_hat,itm_head_wrappings,itm_skullcap,itm_khergit_armor,itm_nomad_armor,itm_rawhide_coat,itm_nomad_vest,itm_hide_boots,itm_nomad_boots,itm_wooden_shield,itm_nordic_shield,itm_saddle_horse], def_attrib|level(11),wp(90),knows_common|knows_power_draw_2,rhodok_face_young_1, rhodok_face_old_2], ["forest_bandit","Forest Bandit","Forest Bandits",tf_guarantee_armor|tf_guarantee_ranged|tf_guarantee_boots,0,0,fac_outlaws, [itm_arrows,itm_axe,itm_hatchet,itm_quarter_staff,itm_short_bow,itm_hunting_bow, itm_common_hood,itm_black_hood,itm_shirt,itm_padded_leather,itm_leather_jerkin,itm_ragged_outfit,itm_hide_boots,itm_leather_boots], def_attrib|level(11),wp(90),knows_common|knows_power_draw_3,swadian_face_young_1, swadian_face_old_2], ["sea_raider","Sea Raider","Sea Raiders",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_outlaws, [itm_arrows,itm_sword_viking_1,itm_sword_viking_2,itm_fighting_axe,itm_battle_axe,itm_spear,itm_nordic_shield,itm_nordic_shield,itm_nordic_shield,itm_wooden_shield,itm_long_bow,itm_javelin,itm_throwing_axes, itm_nordic_helmet,itm_nordic_helmet,itm_nasal_helmet,itm_leather_jerkin,itm_byrnie,itm_leather_jerkin,itm_leather_boots, itm_nomad_boots], def_attrib|level(16),wp(110),knows_ironflesh_2|knows_power_strike_2|knows_power_draw_3|knows_power_throw_2|knows_riding_1|knows_athletics_2,nord_face_young_1, nord_face_old_2], ["steppe_bandit","Steppe Bandit","Steppe Bandits",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse|tf_guarantee_ranged|tf_mounted,0,0,fac_outlaws, [itm_arrows,itm_sword_khergit_1,itm_winged_mace,itm_spear, itm_light_lance,itm_nomad_bow,itm_nomad_bow,itm_short_bow,itm_jarid,itm_leather_steppe_cap_a,itm_leather_steppe_cap_b,itm_leather_steppe_cap_c,itm_khergit_armor,itm_nomad_armor,itm_steppe_armor,itm_leather_vest,itm_hide_boots,itm_nomad_boots,itm_leather_covered_round_shield,itm_leather_covered_round_shield,itm_saddle_horse,itm_steppe_horse,itm_steppe_horse], def_attrib|level(12),wp(100),knows_riding_4|knows_horse_archery_3|knows_power_draw_3,khergit_face_young_1, khergit_face_old_2], ["black_khergit_horseman","Black Khergit Horseman","Black Khergit Horsemen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse,0,0,fac_black_khergits, [itm_arrows,itm_sword_khergit_2,itm_scimitar,itm_scimitar,itm_winged_mace,itm_spear,itm_lance,itm_khergit_bow,itm_khergit_bow,itm_nomad_bow,itm_nomad_bow,itm_steppe_cap,itm_nomad_cap,itm_khergit_war_helmet,itm_khergit_war_helmet,itm_mail_hauberk,itm_lamellar_armor,itm_hide_boots,itm_plate_covered_round_shield,itm_plate_covered_round_shield,itm_saddle_horse,itm_steppe_horse], def_attrib|level(21),wp(100),knows_riding_3|knows_ironflesh_3|knows_horse_archery_3|knows_power_draw_3,khergit_face_young_1, khergit_face_old_2], ["manhunter","Manhunter","Manhunters",tf_guarantee_armor,0,0,fac_manhunters, [itm_spiked_mace,itm_club,itm_woolen_cap,itm_rawhide_coat,itm_coarse_tunic,itm_nomad_armor,itm_nordic_shield,itm_nomad_boots,itm_wrapping_boots,itm_sumpter_horse], def_attrib|level(10),wp(50),knows_common,bandit_face1, bandit_face2], ## ["deserter","Deserter","Deserters",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_swadian_deserters, ## [itm_arrows,itm_spear,itm_fighting_pick,itm_short_bow,itm_sword,itm_voulge,itm_nordic_shield,itm_round_shield,itm_kettle_hat,itm_leather_cap,itm_padded_cloth,itm_leather_armor,itm_scale_armor,itm_saddle_horse], ## def_attrib|level(12),wp(60),knows_common,bandit_face1, bandit_face2], #fac_slavers ## ["slave_keeper","Slave Keeper","Slave Keepers",tf_guarantee_armor,0,0,fac_slavers, ## [itm_cudgel,itm_club,itm_woolen_cap,itm_rawhide_coat,itm_coarse_tunic,itm_nomad_armor,itm_nordic_shield,itm_nomad_boots,itm_wrapping_boots,itm_sumpter_horse], ## def_attrib|level(10),wp(60),knows_common,bandit_face1, bandit_face2], ["slave_driver","Slave Driver","Slave Drivers",tf_guarantee_armor,0,0,fac_slavers, [itm_spiked_mace,itm_club,itm_woolen_cap,itm_rawhide_coat,itm_coarse_tunic,itm_nomad_armor,itm_nordic_shield,itm_nomad_boots,itm_wrapping_boots,itm_sumpter_horse], def_attrib|level(14),wp(80),knows_common,bandit_face1, bandit_face2], ["slave_hunter","Slave Hunter","Slave Hunters",tf_guarantee_armor,0,0,fac_slavers, [itm_winged_mace,itm_club,itm_woolen_cap,itm_rawhide_coat,itm_coarse_tunic,itm_nomad_armor,itm_nordic_shield,itm_nomad_boots,itm_wrapping_boots,itm_sumpter_horse], def_attrib|level(18),wp(90),knows_common,bandit_face1, bandit_face2], ["slave_crusher","Slave Crusher","Slave Crushers",tf_mounted|tf_guarantee_armor|tf_guarantee_horse,0,0,fac_slavers, [itm_maul,itm_winged_mace,itm_leather_vest,itm_nordic_shield,itm_nomad_boots,itm_leather_boots,itm_saddle_horse], def_attrib|level(22),wp(110),knows_common|knows_power_strike_2,bandit_face1, bandit_face2], ["slaver_chief","Slaver Chief","Slaver Chiefs",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse,0,0,fac_slavers, [itm_maul,itm_winged_mace,itm_mail_hauberk,itm_steel_shield,itm_nomad_boots,itm_leather_boots,itm_hunter], def_attrib|level(26),wp(130),knows_common|knows_riding_3|knows_power_strike_3,bandit_face1, bandit_face2], #Rhodok tribal, Hunter, warrior, veteran, warchief # ["undead_walker","undead_walker","undead_walkers",tf_undead|tf_allways_fall_dead,0,0,fac_undeads, # [], # def_attrib|level(3),wp(60),knows_common,undead_face1, undead_face2], # ["undead_horseman","undead_horseman","undead_horsemen",tf_undead|tf_allways_fall_dead|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse,0,0,fac_undeads, # [], # def_attrib|level(19),wp(100),knows_common,undead_face1, undead_face2], # ["undead_nomad","undead_nomad","undead_nomads",tf_undead|tf_allways_fall_dead|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse,0,0,fac_black_khergits, # [], # def_attrib|level(21),wp(100),knows_common|knows_riding_4,khergit_face1, khergit_face2], # ["undead","undead","undead",tf_undead|tf_allways_fall_dead,0,0,fac_undeads, # [], # def_attrib|level(3),wp(60),knows_common,undead_face1, undead_face2], # ["hell_knight","hell_knight","hell_knights",tf_undead|tf_allways_fall_dead|tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_undeads, # [], # def_attrib|level(23),wp(100),knows_common|knows_riding_3,undead_face1, undead_face2], ["follower_woman","Camp Follower","Camp Follower",tf_female|tf_guarantee_armor,0,0,fac_commoners, [itm_bolts,itm_light_crossbow,itm_short_bow,itm_crossbow,itm_nordic_shield,itm_hide_covered_round_shield,itm_hatchet,itm_hand_axe,itm_voulge,itm_fighting_pick,itm_club,itm_dress,itm_woolen_dress, itm_skullcap, itm_wrapping_boots], def_attrib|level(5),wp(70),knows_common,refugee_face1,refugee_face2], ["hunter_woman","Huntress","Huntresses",tf_female|tf_guarantee_armor,0,0,fac_commoners, [itm_bolts,itm_arrows,itm_light_crossbow,itm_short_bow,itm_crossbow,itm_nordic_shield,itm_hide_covered_round_shield,itm_hatchet,itm_hand_axe,itm_voulge,itm_fighting_pick,itm_club,itm_dress,itm_woolen_dress, itm_skullcap, itm_wrapping_boots], def_attrib|level(10),wp(85),knows_common,refugee_face1,refugee_face2], ["fighter_woman","Camp Defender","Camp Defenders",tf_female|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners, [itm_bolts,itm_arrows,itm_light_crossbow,itm_short_bow,itm_crossbow,itm_fur_covered_shield,itm_hide_covered_round_shield,itm_hatchet,itm_voulge,itm_leather_jerkin,itm_leather_vest, itm_skullcap, itm_wrapping_boots], def_attrib|level(16),wp(100),knows_common|knows_riding_3|knows_athletics_2|knows_ironflesh_1,refugee_face1,refugee_face2], ["sword_sister","Sword Sister","Sword Sisters",tf_female|tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_shield|tf_guarantee_horse,0,0,fac_commoners, [itm_bolts,itm_sword_medieval_b,itm_sword_khergit_3,itm_plate_covered_round_shield,itm_tab_shield_small_round_c, itm_crossbow,itm_plate_armor,itm_coat_of_plates,itm_mail_chausses,itm_iron_greaves,itm_guard_helmet,itm_helmet_with_neckguard,itm_courser,itm_leather_gloves], def_attrib|level(22),wp(140),knows_common|knows_riding_5|knows_athletics_3|knows_ironflesh_2|knows_shield_2,refugee_face1,refugee_face2], ["refugee","Refugee","Refugees",tf_female|tf_guarantee_armor,0,0,fac_commoners, [itm_knife,itm_pitch_fork,itm_sickle,itm_hatchet,itm_club,itm_dress,itm_robe,itm_woolen_dress, itm_headcloth, itm_woolen_hood, itm_wrapping_boots], def_attrib|level(1),wp(45),knows_common,refugee_face1,refugee_face2], ["peasant_woman","Peasant Woman","Peasant Women",tf_female|tf_guarantee_armor,0,0,fac_commoners, [itm_knife,itm_pitch_fork,itm_sickle,itm_hatchet,itm_club,itm_dress,itm_woolen_dress, itm_headcloth, itm_woolen_hood, itm_wrapping_boots], def_attrib|level(1),wp(40),knows_common,refugee_face1,refugee_face2], ["caravan_master","Caravan Master","Caravan Masters",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse,0,0,fac_commoners, [itm_sword_medieval_c,itm_fur_coat,itm_hide_boots,itm_saddle_horse, itm_saddle_horse,itm_saddle_horse,itm_saddle_horse, itm_leather_jacket, itm_leather_cap], def_attrib|level(9),wp(100),knows_common|knows_riding_4|knows_ironflesh_3,mercenary_face_1, mercenary_face_2], ["kidnapped_girl","Kidnapped Girl","Kidnapped Girls",tf_hero|tf_female|tf_randomize_face|tf_unmoveable_in_party_window,0,reserved,fac_commoners, [itm_dress,itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2,woman_face_1, woman_face_2], #This troop is the troop marked as soldiers_end ["town_walker_1","Townsman","Townsmen",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners, [itm_short_tunic, itm_linen_tunic,itm_fur_coat, itm_coarse_tunic, itm_tabard, itm_leather_vest, itm_arena_tunic_white, itm_leather_apron, itm_shirt, itm_arena_tunic_green, itm_arena_tunic_blue, itm_woolen_hose, itm_nomad_boots, itm_blue_hose, itm_hide_boots, itm_ankle_boots, itm_leather_boots, itm_fur_hat, itm_leather_cap, itm_straw_hat, itm_felt_hat], def_attrib|level(4),wp(60),knows_common,man_face_young_1, man_face_old_2], ["town_walker_2","Townswoman","Townswomen",tf_female|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners, [itm_blue_dress, itm_dress, itm_woolen_dress, itm_peasant_dress, itm_woolen_hose, itm_blue_hose, itm_wimple_a, itm_wimple_with_veil, itm_female_hood], def_attrib|level(2),wp(40),knows_common,woman_face_1,woman_face_2], ["village_walker_1","Villager","Villagers",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners, [itm_short_tunic, itm_linen_tunic, itm_coarse_tunic, itm_leather_vest, itm_leather_apron, itm_shirt, itm_woolen_hose, itm_nomad_boots, itm_blue_hose, itm_hide_boots, itm_ankle_boots, itm_leather_boots, itm_fur_hat, itm_leather_cap, itm_straw_hat, itm_felt_hat], def_attrib|level(4),wp(60),knows_common,man_face_younger_1, man_face_older_2], ["village_walker_2","Villager","Villagers",tf_female|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners, [itm_blue_dress, itm_dress, itm_woolen_dress, itm_peasant_dress, itm_woolen_hose, itm_blue_hose, itm_wimple_a, itm_wimple_with_veil, itm_female_hood], def_attrib|level(2),wp(40),knows_common,woman_face_1,woman_face_2], ["spy_walker_1","Townsman","Townsmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_commoners, [itm_short_tunic, itm_linen_tunic, itm_coarse_tunic, itm_tabard, itm_leather_vest, itm_robe, itm_leather_apron, itm_shirt, itm_woolen_hose, itm_nomad_boots, itm_blue_hose, itm_hide_boots, itm_ankle_boots, itm_leather_boots, itm_fur_hat, itm_leather_cap, itm_straw_hat, itm_felt_hat], def_attrib|level(4),wp(60),knows_common,man_face_middle_1, man_face_old_2], ["spy_walker_2","Townswoman","Townswomen",tf_female|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_commoners, [itm_blue_dress, itm_dress, itm_woolen_dress, itm_peasant_dress, itm_woolen_hose, itm_blue_hose, itm_wimple_a, itm_wimple_with_veil, itm_female_hood], def_attrib|level(2),wp(40),knows_common,woman_face_1,woman_face_2], # Ryan END # Zendar ["tournament_master","Tournament Master","Tournament Master",tf_hero, scn_zendar_center|entry(1),reserved, fac_commoners,[itm_nomad_armor,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common,0x000000000008414401e28f534c8a2d09], ["trainer","Trainer","Trainer",tf_hero, scn_zendar_center|entry(2),reserved, fac_commoners,[itm_leather_jerkin,itm_hide_boots],def_attrib|level(2),wp(20),knows_common,0x00000000000430c701ea98836781647f], ["Constable_Hareck","Constable Hareck","Constable Hareck",tf_hero, scn_zendar_center|entry(5),reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,0x00000000000c41c001fb15234eb6dd3f], # Ryan BEGIN ["Ramun_the_slave_trader","Ramun, the slave trader","Ramun, the slave trader",tf_hero, no_scene,reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,0x0000000fd5105592385281c55b8e44eb00000000001d9b220000000000000000], ["guide","Quick Jimmy","Quick Jimmy",tf_hero, no_scene,0, fac_commoners,[itm_coarse_tunic,itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, 0x00000000000c318301f24e38a36e38e3], # Ryan END ["Xerina","Xerina","Xerina",tf_hero|tf_female, scn_the_happy_boar|entry(5),reserved, fac_commoners,[itm_leather_jerkin,itm_hide_boots],def_attrib|str_15|agi_15|level(39),wp(312),knows_power_strike_5|knows_ironflesh_5|knows_riding_6|knows_power_draw_4|knows_athletics_8|knows_shield_3,0x00000001ac0820074920561d0b51e6ed00000000001d40ed0000000000000000], ["Dranton","Dranton","Dranton",tf_hero, scn_the_happy_boar|entry(2),reserved, fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|str_15|agi_14|level(42),wp(324),knows_power_strike_5|knows_ironflesh_7|knows_riding_4|knows_power_draw_4|knows_athletics_4|knows_shield_3,0x0000000a460c3002470c50f3502879f800000000001ce0a00000000000000000], ["Kradus","Kradus","Kradus",tf_hero, scn_the_happy_boar|entry(3),reserved, fac_commoners,[itm_padded_leather,itm_hide_boots],def_attrib|str_15|agi_14|level(43),wp(270),knows_power_strike_5|knows_ironflesh_7|knows_riding_4|knows_power_draw_4|knows_athletics_4|knows_shield_3,0x0000000f5b1052c61ce1a9521db1375200000000001ed31b0000000000000000], #Tutorial ["tutorial_trainer","Training Ground Master","Training Ground Master",tf_hero, scn_training_ground|entry(2),reserved, fac_commoners,[itm_robe,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common,0x000000000008414401e28f534c8a2d09], #Sargoth #halkard, hardawk. lord_taucard lord_caupard. lord_paugard #Salt mine ["Galeas","Galeas","Galeas",tf_hero, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,0x000000000004718201c073191a9bb10c], #Dhorak keep ["farmer_from_bandit_village","Farmer","Farmers",tf_guarantee_armor,no_scene,reserved,fac_commoners, [itm_linen_tunic,itm_coarse_tunic,itm_shirt,itm_nomad_boots,itm_wrapping_boots], def_attrib|level(4),wp(60),knows_common,man_face_middle_1, man_face_older_2], ["trainer_1","Trainer","Trainer",tf_hero, scn_training_ground_ranged_melee_1|entry(6),reserved, fac_commoners,[itm_leather_jerkin,itm_hide_boots],def_attrib|level(2),wp(20),knows_common,0x0000000d0d1030c74ae8d661b651c6840000000000000e220000000000000000], ["trainer_2","Trainer","Trainer",tf_hero, scn_training_ground_ranged_melee_2|entry(6),reserved, fac_commoners,[itm_nomad_vest,itm_hide_boots],def_attrib|level(2),wp(20),knows_common,0x0000000e5a04360428ec253846640b5d0000000000000ee80000000000000000], ["trainer_3","Trainer","Trainer",tf_hero, scn_training_ground_ranged_melee_3|entry(6),reserved, fac_commoners,[itm_padded_leather,itm_hide_boots],def_attrib|level(2),wp(20),knows_common,0x0000000e4a0445822ca1a11ab1e9eaea0000000000000f510000000000000000], ["trainer_4","Trainer","Trainer",tf_hero, scn_training_ground_ranged_melee_4|entry(6),reserved, fac_commoners,[itm_leather_jerkin,itm_hide_boots],def_attrib|level(2),wp(20),knows_common,0x0000000e600452c32ef8e5bb92cf1c970000000000000fc20000000000000000], ["trainer_5","Trainer","Trainer",tf_hero, scn_training_ground_ranged_melee_5|entry(6),reserved, fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|level(2),wp(20),knows_common,0x0000000e77082000150049a34c42ec960000000000000e080000000000000000], # Ransom brokers. ["ransom_broker_1","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["ransom_broker_2","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_tabard,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["ransom_broker_3","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["ransom_broker_4","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_short_tunic,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["ransom_broker_5","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_gambeson,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["ransom_broker_6","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_blue_gambeson,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["ransom_broker_7","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_red_gambeson,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["ransom_broker_8","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["ransom_broker_9","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["ransom_broker_10","Ransom_Broker","Ransom_Broker",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], # Tavern traveler. ["tavern_traveler_1","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["tavern_traveler_2","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_tabard,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["tavern_traveler_3","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_vest,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["tavern_traveler_4","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_blue_gambeson,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["tavern_traveler_5","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_short_tunic,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["tavern_traveler_6","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["tavern_traveler_7","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["tavern_traveler_8","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_tabard,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["tavern_traveler_9","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["tavern_traveler_10","Traveller","Traveller",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], # Tavern traveler. ["tavern_bookseller_1","Book_Merchant","Book_Merchant",tf_hero|tf_is_merchant|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots, itm_book_tactics, itm_book_persuasion, itm_book_wound_treatment_reference, itm_book_leadership, itm_book_intelligence, itm_book_training_reference, itm_book_surgery_reference],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], ["tavern_bookseller_2","Book_Merchant","Book_Merchant",tf_hero|tf_is_merchant|tf_randomize_face, 0, reserved, fac_commoners,[itm_fur_coat,itm_hide_boots, itm_book_wound_treatment_reference, itm_book_leadership, itm_book_intelligence, itm_book_trade, itm_book_engineering, itm_book_weapon_mastery],def_attrib|level(5),wp(20),knows_common,merchant_face_1, merchant_face_2], # Tavern minstrel. ["tavern_minstrel_1","Minstrel","Minstrel",tf_hero|tf_randomize_face, 0, reserved, fac_commoners,[itm_leather_jacket,itm_hide_boots],def_attrib|level(5),wp(20),knows_common,merchant_face_1,merchant_face_2], #NPC system changes begin #Companions ["npc1","Borcha","Borcha",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_khergit_armor,itm_nomad_boots,itm_knife], str_8|agi_7|int_12|cha_7|level(3),wp(60),knows_tracker_npc| knows_ironflesh_1|knows_power_strike_1|knows_pathfinding_3|knows_athletics_2|knows_tracking_1|knows_riding_2, #skills 2/3 player at that level 0x00000004bf086143259d061a9046e23500000000001db52c0000000000000000], ["npc2","Marnid","Marnid", tf_hero|tf_unmoveable_in_party_window, 0,reserved, fac_commoners,[itm_linen_tunic,itm_hide_boots,itm_club], str_7|agi_7|int_11|cha_6|level(1),wp(40),knows_merchant_npc| knows_trade_2|knows_weapon_master_1|knows_ironflesh_1|knows_wound_treatment_1|knows_athletics_2|knows_first_aid_1|knows_leadership_1, 0x000000019d004001570b893712c8d28d00000000001dc8990000000000000000], ["npc3","Ymira","Ymira",tf_female|tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_dress,itm_woolen_hose,itm_knife], str_6|agi_9|int_11|cha_6|level(1),wp(20),knows_merchant_npc| knows_wound_treatment_1|knows_trade_1|knows_first_aid_3|knows_surgery_1|knows_athletics_1|knows_riding_1, 0x0000000083040001583b6db8dec5925b00000000001d80980000000000000000], ["npc4","Rolf","Rolf",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_leather_jerkin,itm_nomad_boots, itm_sword_medieval_a], str_10|agi_9|int_13|cha_10|level(10),wp(110),knows_warrior_npc| knows_weapon_master_2|knows_power_strike_2|knows_riding_2|knows_athletics_2|knows_power_throw_2|knows_first_aid_1|knows_surgery_1|knows_tactics_2|knows_leadership_2, 0x000000057f1074002c75c6a8a58ad72e00000000001e1a890000000000000000], ["npc5","Baheshtur","Baheshtur",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_nomad_vest,itm_nomad_boots, itm_sword_khergit_1], str_9|agi_9|int_12|cha_7|level(5),wp(90),knows_warrior_npc| knows_riding_2|knows_horse_archery_3|knows_power_draw_3|knows_leadership_2|knows_weapon_master_1, 0x000000088910318b5c6f972328324a6200000000001cd3310000000000000000], ["npc6","Firentis","Firentis",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_tabard,itm_nomad_boots, itm_sword_medieval_a], str_10|agi_12|int_10|cha_5|level(6),wp(105),knows_warrior_npc| knows_riding_2|knows_weapon_master_2|knows_power_strike_2|knows_athletics_3|knows_trainer_1|knows_leadership_1, 0x00000002050052036a1895d0748f3ca30000000000000f0b0000000000000000], ["npc7","Deshavi","Deshavi",tf_female|tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_ragged_outfit,itm_wrapping_boots, itm_hunting_bow, itm_arrows, itm_quarter_staff], str_8|agi_9|int_10|cha_6|level(2),wp(80),knows_tracker_npc| knows_tracking_2|knows_athletics_2|knows_spotting_1|knows_pathfinding_1|knows_power_draw_2, 0x00000001fc08400533a15297634d44f400000000001e02db0000000000000000], ["npc8","Matheld","Matheld",tf_female|tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_tribal_warrior_outfit,itm_nomad_boots, itm_sword_viking_1], str_9|agi_10|int_9|cha_10|level(7),wp(90),knows_warrior_npc| knows_weapon_master_3|knows_power_strike_2|knows_athletics_2|knows_leadership_3|knows_tactics_1, 0x00000005800c000637db8314e331e76e00000000001c46db0000000000000000], ["npc9","Alayen","Alayen",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_tabard,itm_nomad_boots, itm_sword_medieval_b_small], str_11|agi_8|int_7|cha_8|level(2),wp(100),knows_warrior_npc| knows_weapon_master_1|knows_riding_1|knows_athletics_1|knows_leadership_1|knows_tactics_1|knows_power_strike_1, 0x000000030100300f499d5b391b6db8d300000000001dc2e10000000000000000], ["npc10","Bunduk","Bunduk",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_padded_leather,itm_nomad_boots, itm_crossbow, itm_bolts, itm_pickaxe], str_12|agi_8|int_9|cha_11|level(9),wp(105),knows_warrior_npc| knows_weapon_master_3|knows_tactics_1|knows_leadership_1|knows_ironflesh_3|knows_trainer_2|knows_first_aid_2, 0x0000000a3f081006572c91c71c8d46cb00000000001e468a0000000000000000], ["npc11","Katrin","Katrin",tf_female|tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_leather_apron, itm_falchion, itm_wrapping_boots], str_8|agi_11|int_10|cha_10|level(8),wp(70),knows_merchant_npc| knows_weapon_master_1|knows_first_aid_1|knows_wound_treatment_2|knows_ironflesh_3|knows_inventory_management_5, 0x0000000d7f0400035915aa226b4d975200000000001ea49e0000000000000000], ["npc12","Jeremus","Jeremus",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_pilgrim_disguise,itm_nomad_boots, itm_staff], str_8|agi_7|int_13|cha_7|level(4),wp(30), knows_merchant_npc| knows_ironflesh_1|knows_power_strike_1|knows_surgery_4|knows_wound_treatment_3|knows_first_aid_3, 0x000000078000500e4f8ba62a9cd5d36d00000000001e36250000000000000000], ["npc13","Nizar","Nizar",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_nomad_robe,itm_nomad_boots, itm_scimitar, itm_courser], str_7|agi_7|int_12|cha_8|level(3),wp(80),knows_warrior_npc| knows_riding_2|knows_leadership_2|knows_athletics_2|knows_ironflesh_2|knows_power_strike_1|knows_weapon_master_1, 0x00000004bf0475c85f4e9592de4e574c00000000001e369c0000000000000000], ["npc14","Lezalit","Lezalit",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_nobleman_outfit,itm_nomad_boots, itm_sword_medieval_b_small], str_9|agi_8|int_11|cha_8|level(5),wp(100),knows_warrior_npc| knows_trainer_4|knows_weapon_master_3|knows_leadership_2|knows_power_strike_1, 0x00000001a410259144d5d1d6eb55e96a00000000001db0db0000000000000000], ["npc15","Artimenner","Artimenner",tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_rich_outfit,itm_nomad_boots, itm_sword_medieval_b_small], str_9|agi_9|int_12|cha_8|level(7),wp(80),knows_warrior_npc| knows_tactics_2|knows_engineer_4|knows_trade_3|knows_tracking_1|knows_spotting_1, 0x0000000f2e1021862b4b9123594eab5300000000001d55360000000000000000], ["npc16","Klethi","Klethi",tf_female|tf_hero|tf_unmoveable_in_party_window, 0, reserved, fac_commoners,[itm_peasant_dress,itm_nomad_boots, itm_dagger, itm_throwing_knives], str_7|agi_11|int_8|cha_7|level(2),wp(80),knows_tracker_npc| knows_power_throw_3|knows_athletics_2|knows_power_strike_1, 0x00000000000c100739ce9c805d2f381300000000001cc7ad0000000000000000], #NPC system changes end ["kingdom_heroes_including_player_begin", "kingdom_heroes_including_player_begin", "kingdom_heroes_including_player_begin", tf_hero, 0,reserved, fac_kingdom_1,[], lord_attrib,wp(220),knows_lord_1, 0x000000000010918a01f248377289467d], #governers olgrel rasevas Horse Bodywear Footwear_in Footwear_out Armor Weapon Shield Headwaer ["kingdom_1_lord", "King Harlaus", "Kingdom 1 Lord", tf_hero, 0,reserved, fac_kingdom_1,[itm_charger, itm_rich_outfit, itm_blue_hose, itm_iron_greaves, itm_plate_armor, itm_gauntlets, itm_bastard_sword_b, itm_tab_shield_heater_cav_b, itm_great_helmet], knight_attrib_5,wp(220),knight_skills_5|knows_trainer_5, 0x0000000f45041105241acd2b5a66a86900000000001e98310000000000000000,swadian_face_older_2], ["kingdom_2_lord", "King Yaroglek", "Kingdom 2 Lord", tf_hero, 0,reserved, fac_kingdom_2,[itm_hunter, itm_courtly_outfit, itm_leather_boots, itm_mail_chausses, itm_heraldic_mail_with_surcoat, itm_gauntlets, itm_military_pick, itm_tab_shield_kite_cav_b, itm_helmet_with_neckguard], knight_attrib_5,wp(220),knight_skills_5|knows_trainer_4, 0x0000000ec50001400a2269f919dee11700000000001cc57d0000000000000000, vaegir_face_old_2], ["kingdom_3_lord", "Sanjar Khan", "Kingdom 3 Lord", tf_hero, 0,reserved, fac_kingdom_3,[itm_courser, itm_nomad_robe, itm_leather_boots, itm_splinted_greaves, itm_khergit_guard_armor, itm_scale_gauntlets, itm_sword_khergit_3, itm_tab_shield_small_round_c, itm_guard_helmet], knight_attrib_5,wp(220),knight_skills_5|knows_trainer_6, 0x0000000cee0051cc44be2d14d370c65c00000000001ed6df0000000000000000,khergit_face_old_2], ["kingdom_4_lord", "King Ragnar", "Kingdom 4 Lord", tf_hero, 0,reserved, fac_kingdom_4,[itm_hunter, itm_nobleman_outfit, itm_leather_boots, itm_mail_boots, itm_cuir_bouilli, itm_gauntlets, itm_great_axe, itm_tab_shield_round_e, itm_nordic_helmet], knight_attrib_5,wp(220),knight_skills_5|knows_trainer_4, 0x0000000e2c0c028a068e8c18557b12a500000000001c0fe80000000000000000, nord_face_older_2], ["kingdom_5_lord", "King Graveth", "Kingdom 5 Lord", tf_hero, 0,reserved, fac_kingdom_5,[itm_warhorse, itm_tabard, itm_leather_boots, itm_splinted_leather_greaves, itm_heraldic_mail_with_tabard, itm_gauntlets, itm_bastard_sword_b, itm_tab_shield_heater_cav_b, itm_spiked_helmet], knight_attrib_3,wp(220),knight_skills_4|knows_trainer_5, 0x0000000efc04119225848dac5d50d62400000000001d48b80000000000000000, rhodok_face_old_2], # Imbrea Belinda Ruby Qaelmas Rose Willow # Alin Ganzo Zelka Rabugti # Qlurzach Ruhbus Givea_alsev Belanz Bendina # Dunga Agatha Dibus Crahask # Horse Bodywear Armor Footwear_in Footwear_out Headwear Weapon Shield #Swadian civilian clothes: itm_courtly_outfit itm_gambeson itm_blue_gambeson itm_red_gambeson itm_nobleman_outfit itm_rich_outfit itm_short_tunic itm_tabard ["knight_1_1", "Lord Klargus", "knight_1_1", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_courtly_outfit, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_splinted_greaves, itm_great_helmet, itm_sword_medieval_c, itm_scale_gauntlets, itm_tab_shield_heater_cav_a], knight_attrib_1,wp(130),knight_skills_1|knows_trainer_1|knows_trainer_3, 0x0000000c3e08601414ab4dc6e39296b200000000001e231b0000000000000000, swadian_face_middle_2], ["knight_1_2", "Lord Plais", "knight_1_2", tf_hero, 0, reserved, fac_kingdom_1, [itm_steppe_horse, itm_gambeson, itm_heraldic_mail_with_surcoat, itm_blue_hose, itm_mail_boots, itm_nasal_helmet, itm_scale_gauntlets, itm_fighting_pick, itm_tab_shield_heater_c], knight_attrib_2,wp(160),knight_skills_2, 0x0000000c0f08000458739a9a1476199800000000001fb6f10000000000000000, swadian_face_old_2], ["knight_1_3", "Lord Mirchaud", "knight_1_3", tf_hero, 0, reserved, fac_kingdom_1, [itm_courser, itm_blue_gambeson, itm_mail_hauberk, itm_woolen_hose, itm_mail_chausses, itm_guard_helmet, itm_gauntlets, itm_sword_two_handed_b, itm_tab_shield_heater_cav_b], knight_attrib_3,wp(190),knight_skills_3, 0x0000000c0610351048e325361d7236cd00000000001d532a0000000000000000, swadian_face_older_2], ["knight_1_4", "Lord Stamar", "knight_1_4", tf_hero, 0, reserved, fac_kingdom_1, [itm_courser, itm_red_gambeson, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_iron_greaves, itm_guard_helmet, itm_gauntlets, itm_bastard_sword_a, itm_tab_shield_heater_cav_b], knight_attrib_4,wp(220),knight_skills_4, 0x0000000c03104490280a8cb2a24196ab00000000001eb4dc0000000000000000, swadian_face_older_2], ["knight_1_5", "Lord Ryis", "knight_1_5", tf_hero, 0, reserved, fac_kingdom_1, [itm_warhorse, itm_nobleman_outfit, itm_coat_of_plates, itm_leather_boots, itm_splinted_leather_greaves, itm_winged_great_helmet, itm_gauntlets,itm_bastard_sword_b, itm_sword_two_handed_a, itm_tab_shield_heater_d], knight_attrib_5,wp(250),knight_skills_5, 0x0000000c330855054aa9aa431a48d74600000000001ed5240000000000000000, swadian_face_older_2], ["knight_1_6", "Lord Meltor", "knight_1_6", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_rich_outfit, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_mail_boots, itm_guard_helmet, itm_gauntlets, itm_fighting_pick, itm_tab_shield_heater_c], knight_attrib_1,wp(130),knight_skills_1, 0x0000000c2a0805442b2c6cc98c8dbaac00000000001d389b0000000000000000, swadian_face_middle_2], ["knight_1_7", "Lord Beranz", "knight_1_7", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_ragged_outfit, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_splinted_greaves, itm_guard_helmet, itm_gauntlets, itm_sword_medieval_c, itm_sword_two_handed_a, itm_tab_shield_heater_c], knight_attrib_2,wp(160),knight_skills_2, 0x0000000c380c30c2392a8e5322a5392c00000000001e5c620000000000000000, swadian_face_old_2], ["knight_1_8", "Lord Rafard", "knight_1_8", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_short_tunic, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_mail_chausses, itm_nasal_helmet, itm_scale_gauntlets, itm_bastard_sword_a, itm_tab_shield_heater_cav_a], knight_attrib_3,wp(190),knight_skills_3|knows_trainer_6, 0x0000000c3f10000532d45203954e192200000000001e47630000000000000000, swadian_face_older_2], ["knight_1_9", "Lord Regas", "knight_1_9", tf_hero, 0, reserved, fac_kingdom_1, [itm_hunter, itm_rich_outfit, itm_mail_hauberk, itm_woolen_hose, itm_mail_chausses, itm_great_helmet, itm_gauntlets, itm_sword_viking_3, itm_sword_two_handed_a, itm_tab_shield_heater_d], knight_attrib_4,wp(210),knight_skills_4, 0x0000000c5c0840034895654c9b660c5d00000000001e34530000000000000000, swadian_face_older_2], ["knight_1_10", "Lord Grainwad", "knight_1_0", tf_hero, 0, reserved, fac_kingdom_1, [itm_hunter, itm_tabard, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_boots, itm_flat_topped_helmet, itm_gauntlets, itm_bastard_sword_b, itm_sword_two_handed_b, itm_tab_shield_heater_cav_b], knight_attrib_5,wp(290),knight_skills_5|knows_trainer_5, 0x0000000c1e001500589dae4094aa291c00000000001e37a80000000000000000, swadian_face_older_2], ["knight_1_11", "Lord Devlian", "knight_1_1", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_courtly_outfit, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_splinted_greaves, itm_great_helmet, itm_gauntlets, itm_sword_medieval_c, itm_tab_shield_heater_c], knight_attrib_1,wp(130),knight_skills_1, 0x000000095108144657a1ba3ad456e8cb00000000001e325a0000000000000000, swadian_face_middle_2], ["knight_1_12", "Lord Rafarch", "knight_1_2", tf_hero, 0, reserved, fac_kingdom_1, [itm_steppe_horse, itm_gambeson, itm_heraldic_mail_with_surcoat, itm_blue_hose, itm_mail_boots, itm_nasal_helmet, itm_scale_gauntlets, itm_fighting_pick, itm_tab_shield_heater_cav_b], knight_attrib_2,wp(190),knight_skills_2|knows_trainer_4, 0x0000000c010c42c14d9d6918bdb336e200000000001dd6a30000000000000000, swadian_face_old_2], ["knight_1_13", "Lord Rochabarth", "knight_1_3", tf_hero, 0, reserved, fac_kingdom_1, [itm_courser, itm_blue_gambeson, itm_mail_hauberk, itm_woolen_hose, itm_mail_chausses, itm_winged_great_helmet, itm_gauntlets, itm_sword_two_handed_a, itm_tab_shield_heater_cav_a], knight_attrib_3,wp(210),knight_skills_3, 0x0000000c150045c6365d8565932a8d6400000000001ec6940000000000000000, swadian_face_older_2], ["knight_1_14", "Lord Delinard", "knight_1_4", tf_hero, 0, reserved, fac_kingdom_1, [itm_courser, itm_red_gambeson, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_iron_greaves, itm_guard_helmet, itm_gauntlets, itm_bastard_sword_a, itm_tab_shield_heater_cav_b], knight_attrib_4,wp(240),knight_skills_4, 0x0000000c0f0c320627627238dcd6599400000000001c573d0000000000000000, swadian_face_older_2], ["knight_1_15", "Lord Haringoth", "knight_1_5", tf_hero, 0, reserved, fac_kingdom_1, [itm_warhorse, itm_nobleman_outfit, itm_coat_of_plates, itm_leather_boots, itm_splinted_leather_greaves, itm_flat_topped_helmet, itm_gauntlets, itm_bastard_sword_b, itm_tab_shield_heater_d], knight_attrib_5,wp(260),knight_skills_5|knows_trainer_3, 0x0000000cb700210214ce89db276aa2f400000000001d36730000000000000000, swadian_face_older_2], ["knight_1_16", "Lord Despin", "knight_1_6", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_rich_outfit, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_mail_boots, itm_great_helmet, itm_gauntlets, itm_fighting_pick, itm_sword_two_handed_a, itm_tab_shield_heater_cav_a], knight_attrib_1,wp(120),knight_skills_1, 0x00000008200012033d9b6d4a92ada53500000000001cc1180000000000000000, swadian_face_middle_2], ["knight_1_17", "Lord Montewar", "knight_1_7", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_ragged_outfit, itm_heraldic_mail_with_surcoat, itm_nomad_boots, itm_splinted_greaves, itm_great_helmet, itm_gauntlets, itm_sword_medieval_c, itm_sword_two_handed_a, itm_tab_shield_heater_cav_a], knight_attrib_2,wp(150),knight_skills_2, 0x0000000c4d0840d24a9b2ab4ac2a332400000000001d34db0000000000000000, swadian_face_old_2], ["knight_1_18", "Lord Clais", "knight_1_8", tf_hero, 0, reserved, fac_kingdom_1, [itm_saddle_horse, itm_short_tunic, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_chausses, itm_winged_great_helmet, itm_gauntlets, itm_bastard_sword_a, itm_sword_two_handed_a, itm_tab_shield_heater_d], knight_attrib_3,wp(180),knight_skills_3|knows_trainer_4, 0x0000000c370c1194546469ca6c4e450e00000000001ebac40000000000000000, swadian_face_older_2], ["knight_1_19", "Lord Deglan", "knight_1_9", tf_hero, 0, reserved, fac_kingdom_1, [itm_hunter, itm_rich_outfit, itm_mail_hauberk, itm_woolen_hose, itm_mail_chausses, itm_guard_helmet, itm_gauntlets, itm_sword_medieval_c, itm_tab_shield_heater_d], knight_attrib_4,wp(200),knight_skills_4|knows_trainer_6, 0x0000000c0c1064864ba34e2ae291992b00000000001da8720000000000000000, swadian_face_older_2], ["knight_1_20", "Lord Tredian", "knight_1_0", tf_hero, 0, reserved, fac_kingdom_1, [itm_hunter, itm_tabard, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_boots, itm_winged_great_helmet, itm_gauntlets, itm_bastard_sword_b, itm_sword_two_handed_b, itm_tab_shield_heater_cav_b], knight_attrib_5,wp(240),knight_skills_5|knows_trainer_5, 0x0000000c0a08038736db74c6a396a8e500000000001db8eb0000000000000000, swadian_face_older_2], ["knight_2_1", "Lord Vuldrat", "knight_2_1", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_fur_coat, itm_padded_cloth, itm_nomad_boots, itm_splinted_leather_greaves, itm_skullcap, itm_mail_mittens, itm_sword_viking_3, itm_tab_shield_kite_c], knight_attrib_1,wp(130),knight_skills_1|knows_trainer_3, 0x00000005590011c33d9b6d4a92ada53500000000001cc1180000000000000000, vaegir_face_middle_2], ["knight_2_2", "Lord Naldera", "knight_2_2", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_rich_outfit, itm_lamellar_armor, itm_woolen_hose, itm_mail_chausses, itm_nasal_helmet, itm_mail_mittens, itm_shortened_military_scythe, itm_tab_shield_kite_cav_a], knight_attrib_2,wp(160),knight_skills_2, 0x0000000c2a0015d249b68b46a98e176400000000001d95a40000000000000000, vaegir_face_old_2], ["knight_2_3", "Lord Meriga", "knight_2_3", tf_hero, 0, reserved, fac_kingdom_2, [itm_hunter, itm_short_tunic, itm_mail_hauberk, itm_woolen_hose, itm_mail_chausses, itm_nordic_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_cav_b], knight_attrib_3,wp(190),knight_skills_3, 0x0000000c131031c546a38a2765b4c86000000000001e58d30000000000000000, vaegir_face_older_2], ["knight_2_4", "Lord Khavel", "knight_2_4", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_courtly_outfit, itm_lamellar_armor, itm_leather_boots, itm_mail_boots, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_bastard_sword_b, itm_tab_shield_kite_cav_b], knight_attrib_4,wp(220),knight_skills_4, 0x0000000c2f0832c748f272540d8ab65900000000001d34e60000000000000000, vaegir_face_older_2], ["knight_2_5", "Lord Doru", "knight_2_5", tf_hero, 0, reserved, fac_kingdom_2, [itm_hunter, itm_rich_outfit, itm_haubergeon, itm_leather_boots, itm_mail_chausses, itm_segmented_helmet, itm_scale_gauntlets, itm_bastard_sword_b, itm_tab_shield_kite_d], knight_attrib_5,wp(250),knight_skills_5, 0x0000000e310061435d76bb5f55bad9ad00000000001ed8ec0000000000000000, vaegir_face_older_2], ["knight_2_6", "Lord Belgaru", "knight_2_6", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_nomad_vest, itm_padded_cloth, itm_woolen_hose, itm_mail_chausses, itm_khergit_guard_helmet, itm_mail_mittens, itm_sword_viking_3, itm_tab_shield_kite_c], knight_attrib_1,wp(130),knight_skills_1|knows_trainer_3, 0x0000000a0100421038da7157aa4e430a00000000001da8bc0000000000000000, vaegir_face_middle_2], ["knight_2_7", "Lord Ralcha", "Ralcha", tf_hero, 0, reserved, fac_kingdom_2, [itm_steppe_horse, itm_leather_jacket, itm_mail_hauberk, itm_leather_boots, itm_mail_boots, itm_nordic_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_cav_a], knight_attrib_2,wp(160),knight_skills_2|knows_trainer_4, 0x0000000c04100153335ba9390b2d277500000000001d89120000000000000000, vaegir_face_old_2], ["knight_2_8", "Lord Vlan", "knight_2_8", tf_hero, 0, reserved, fac_kingdom_2, [itm_hunter, itm_nomad_robe, itm_nomad_vest, itm_woolen_hose, itm_mail_chausses, itm_nasal_helmet, itm_scale_gauntlets, itm_shortened_military_scythe, itm_tab_shield_kite_d], knight_attrib_3,wp(200),knight_skills_3|knows_trainer_5, 0x0000000c00046581234e8da2cdd248db00000000001f569c0000000000000000, vaegir_face_older_2], ["knight_2_9", "Lord Mleza", "knight_2_9", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_rich_outfit, itm_haubergeon, itm_leather_boots, itm_mail_chausses, itm_kettle_hat, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_d], knight_attrib_4,wp(230),knight_skills_4, 0x0000000c160451d2136469c4d9b159ad00000000001e28f10000000000000000, vaegir_face_older_2], ["knight_2_10", "Lord Nelag", "knight_2_0", tf_hero, 0, reserved, fac_kingdom_2, [itm_warhorse, itm_fur_coat, itm_lamellar_armor, itm_woolen_hose, itm_mail_boots, itm_great_helmet, itm_scale_gauntlets, itm_military_pick, itm_tab_shield_kite_cav_b], knight_attrib_5,wp(260),knight_skills_5|knows_trainer_6, 0x0000000f7c00520e66b76edd5cd5eb6e00000000001f691e0000000000000000, vaegir_face_older_2], ["knight_2_11", "Lord Crahask", "knight_2_1", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_leather_jacket, itm_padded_cloth, itm_nomad_boots, itm_splinted_leather_greaves, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_sword_viking_3, itm_tab_shield_kite_cav_a], knight_attrib_1,wp(130),knight_skills_1, 0x0000000c1d0821d236acd6991b74d69d00000000001e476c0000000000000000, vaegir_face_middle_2], ["knight_2_12", "Lord Bracha", "knight_2_2", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_rich_outfit, itm_lamellar_armor, itm_woolen_hose, itm_mail_chausses, itm_nasal_helmet, itm_mail_mittens, itm_great_bardiche, itm_tab_shield_kite_cav_a], knight_attrib_2,wp(170),knight_skills_2, 0x0000000c0f04024b2509d5d53944c6a300000000001d5b320000000000000000, vaegir_face_old_2], ["knight_2_13", "Lord Druli", "knight_2_3", tf_hero, 0, reserved, fac_kingdom_2, [itm_hunter, itm_short_tunic, itm_mail_hauberk, itm_woolen_hose, itm_mail_chausses, itm_nordic_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_cav_b], knight_attrib_3,wp(190),knight_skills_3, 0x0000000c680432d3392230cb926d56ca00000000001da69b0000000000000000, vaegir_face_older_2], ["knight_2_14", "Lord Marmun", "knight_2_4", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_courtly_outfit, itm_lamellar_armor, itm_leather_boots, itm_mail_boots, itm_guard_helmet, itm_scale_gauntlets, itm_shortened_military_scythe, itm_tab_shield_kite_cav_b], knight_attrib_4,wp(220),knight_skills_4|knows_trainer_6, 0x0000000c27046000471bd2e93375b52c00000000001dd5220000000000000000, vaegir_face_older_2], ["knight_2_15", "Lord Gastya", "knight_2_5", tf_hero, 0, reserved, fac_kingdom_2, [itm_hunter, itm_rich_outfit, itm_haubergeon, itm_leather_boots, itm_mail_chausses, itm_segmented_helmet, itm_scale_gauntlets, itm_bastard_sword_b, itm_shortened_military_scythe, itm_tab_shield_kite_cav_b], knight_attrib_5,wp(250),knight_skills_5, 0x0000000de50052123b6bb36de5d6eb7400000000001dd72c0000000000000000, vaegir_face_older_2], ["knight_2_16", "Lord Harish", "knight_2_6", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_nomad_vest, itm_padded_cloth, itm_woolen_hose, itm_mail_chausses, itm_nordic_helmet, itm_mail_mittens, itm_great_bardiche, itm_tab_shield_kite_c], knight_attrib_1,wp(120),knight_skills_1, 0x000000085f00000539233512e287391d00000000001db7200000000000000000, vaegir_face_middle_2], ["knight_2_17", "Lord Taisa", "Ralcha", tf_hero, 0, reserved, fac_kingdom_2, [itm_steppe_horse, itm_leather_jacket, itm_mail_hauberk, itm_leather_boots, itm_mail_boots, itm_guard_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_cav_a], knight_attrib_2,wp(150),knight_skills_2, 0x0000000a070c4387374bd19addd2a4ab00000000001e32cc0000000000000000, vaegir_face_old_2], ["knight_2_18", "Lord Valishin", "knight_2_8", tf_hero, 0, reserved, fac_kingdom_2, [itm_hunter, itm_nomad_robe, itm_nomad_vest, itm_woolen_hose, itm_mail_chausses, itm_nasal_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_cav_a], knight_attrib_3,wp(180),knight_skills_3, 0x0000000b670012c23d9b6d4a92ada53500000000001cc1180000000000000000, vaegir_face_older_2], ["knight_2_19", "Lord Rudin", "knight_2_9", tf_hero, 0, reserved, fac_kingdom_2, [itm_saddle_horse, itm_rich_outfit, itm_haubergeon, itm_leather_boots, itm_mail_chausses, itm_guard_helmet, itm_scale_gauntlets, itm_fighting_pick, itm_shortened_military_scythe, itm_tab_shield_kite_d], knight_attrib_4,wp(210),knight_skills_4|knows_trainer_4, 0x0000000e070050853b0a6e4994ae272a00000000001db4e10000000000000000, vaegir_face_older_2], ["knight_2_20", "Lord Kumipa", "knight_2_0", tf_hero, 0, reserved, fac_kingdom_2, [itm_warhorse, itm_fur_coat, itm_lamellar_armor, itm_woolen_hose, itm_mail_boots, itm_great_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_kite_cav_b], knight_attrib_5,wp(240),knight_skills_5|knows_trainer_5, 0x0000000f800021c63b0a6e4994ae272a00000000001db4e10000000000000000, vaegir_face_older_2], #khergit civilian clothes: itm_leather_vest, itm_nomad_vest, itm_nomad_robe, itm_lamellar_vest,itm_tribal_warrior_outfit ["knight_3_1", "Lord Alagur", "knight_3_1", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_leather_vest, itm_studded_leather_coat,itm_nomad_boots, itm_mail_boots, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_leather_gloves, itm_sword_khergit_3, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_1,wp(130),knight_skills_1|knows_trainer_3|knows_power_draw_4, 0x000000043000318b54b246b7094dc39c00000000001d31270000000000000000, khergit_face_middle_2], ["knight_3_2", "Lord Tonju", "knight_3_2", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_nomad_vest, itm_lamellar_armor, itm_hide_boots, itm_mail_boots, itm_khergit_cavalry_helmet, itm_scale_gauntlets, itm_leather_gloves, itm_shortened_military_scythe, itm_tab_shield_small_round_b, itm_khergit_bow, itm_arrows], knight_attrib_2,wp(160),knight_skills_2|knows_power_draw_4, 0x0000000c280461004929b334ad632aa200000000001e05120000000000000000, khergit_face_old_2], ["knight_3_3", "Lord Belir", "knight_3_3", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_nomad_robe, itm_lamellar_armor,itm_nomad_boots, itm_splinted_leather_greaves, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_fighting_pick, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_3,wp(190),knight_skills_3|knows_trainer_5|knows_power_draw_4, 0x0000000e880062c53b0a6e4994ae272a00000000001db4e10000000000000000, khergit_face_older_2], ["knight_3_4", "Lord Asugan", "knight_3_4", tf_hero, 0, reserved, fac_kingdom_3, [itm_courser, itm_lamellar_vest, itm_mail_and_plate, itm_hide_boots, itm_splinted_greaves, itm_khergit_cavalry_helmet, itm_scale_gauntlets, itm_shortened_military_scythe, itm_tab_shield_small_round_c], knight_attrib_4,wp(220),knight_skills_4|knows_power_draw_4, 0x0000000c23085386391b5ac72a96d95c00000000001e37230000000000000000, khergit_face_older_2], ["knight_3_5", "Lord Brula", "knight_3_5", tf_hero, 0, reserved, fac_kingdom_3, [itm_charger, itm_ragged_outfit, itm_lamellar_vest, itm_hide_boots, itm_mail_boots, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_sword_khergit_3, itm_tab_shield_small_round_c], knight_attrib_5,wp(250),knight_skills_5|knows_power_draw_4, 0x0000000efe0051ca4b377b4964b6eb6500000000001f696c0000000000000000, khergit_face_older_2], ["knight_3_6", "Lord Imirza", "knight_3_6", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_tribal_warrior_outfit,itm_hide_boots, itm_splinted_leather_greaves, itm_khergit_cavalry_helmet, itm_scale_gauntlets, itm_sword_khergit_4, itm_tab_shield_small_round_b], knight_attrib_1,wp(130),knight_skills_1|knows_power_draw_4, 0x00000006f600418b54b246b7094dc31a00000000001d37270000000000000000, khergit_face_middle_2], ["knight_3_7", "Lord Urumuda","knight_3_7", tf_hero, 0, reserved, fac_kingdom_3, [itm_courser, itm_leather_vest,itm_leather_boots, itm_hide_boots, itm_skullcap, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_sword_khergit_3, itm_tab_shield_small_round_b], knight_attrib_2,wp(160),knight_skills_2|knows_power_draw_4, 0x0000000bdd00510a44be2d14d370c65c00000000001ed6df0000000000000000, khergit_face_old_2], ["knight_3_8", "Lord Kramuk", "knight_3_8", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_nomad_vest, itm_lamellar_armor, itm_woolen_hose, itm_splinted_greaves, itm_khergit_cavalry_helmet, itm_scale_gauntlets, itm_great_bardiche, itm_tab_shield_small_round_c], knight_attrib_3,wp(190),knight_skills_3|knows_power_draw_4, 0x0000000abc00518b5af4ab4b9c8e596400000000001dc76d0000000000000000, khergit_face_older_2], ["knight_3_9", "Lord Chaurka","knight_3_9", tf_hero, 0, reserved, fac_kingdom_3, [itm_hunter, itm_nomad_robe, itm_lamellar_vest, itm_leather_boots, itm_splinted_leather_greaves, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_military_pick, itm_tab_shield_small_round_c], knight_attrib_4,wp(220),knight_skills_4|knows_power_draw_4, 0x0000000a180441c921a30ea68b54971500000000001e54db0000000000000000, khergit_face_older_2], ["knight_3_10", "Lord Sebula","knight_3_0", tf_hero, 0, reserved, fac_kingdom_3, [itm_warhorse, itm_lamellar_vest, itm_lamellar_armor, itm_hide_boots, itm_mail_chausses, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_sword_khergit_4, itm_shortened_military_scythe, itm_tab_shield_small_round_c], knight_attrib_5,wp(250),knight_skills_5|knows_trainer_6|knows_power_draw_4, 0x0000000a3b00418c5b36c686d920a76100000000001c436f0000000000000000, khergit_face_older_2], ["knight_3_11", "Lord Tulug", "knight_3_1", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_leather_vest, itm_studded_leather_coat, itm_nomad_boots, itm_mail_boots, itm_khergit_cavalry_helmet, itm_leather_gloves, itm_sword_khergit_4, itm_tab_shield_small_round_b, itm_khergit_bow, itm_arrows], knight_attrib_1,wp(150),knight_skills_1|knows_power_draw_4, 0x00000007d100534b44962d14d370c65c00000000001ed6df0000000000000000, khergit_face_middle_2], ["knight_3_12", "Lord Nasugei", "knight_3_2", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_nomad_vest, itm_lamellar_armor, itm_hide_boots, itm_mail_boots, itm_khergit_guard_helmet, itm_leather_gloves, itm_sword_khergit_3, itm_tab_shield_small_round_b], knight_attrib_2,wp(190),knight_skills_2|knows_power_draw_4, 0x0000000bf400610c5b33d3c9258edb6c00000000001eb96d0000000000000000, khergit_face_old_2], ["knight_3_13", "Lord Urubay","knight_3_3", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_nomad_robe, itm_lamellar_vest, itm_nomad_boots, itm_splinted_leather_greaves, itm_khergit_cavalry_helmet, itm_scale_gauntlets, itm_fighting_pick, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_3,wp(200),knight_skills_3|knows_trainer_3|knows_power_draw_4, 0x0000000bfd0061c65b6eb33b25d2591d00000000001f58eb0000000000000000, khergit_face_older_2], ["knight_3_14", "Lord Hugu", "knight_3_4", tf_hero, 0, reserved, fac_kingdom_3, [itm_courser, itm_lamellar_vest, itm_lamellar_vest, itm_hide_boots, itm_splinted_greaves, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_shortened_military_scythe, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_4,wp(300),knight_skills_4|knows_trainer_6|knows_power_draw_4, 0x0000000b6900514144be2d14d370c65c00000000001ed6df0000000000000000, khergit_face_older_2], ["knight_3_15", "Lord Tansugai", "knight_3_5", tf_hero, 0, reserved, fac_kingdom_3, [itm_charger, itm_ragged_outfit, itm_lamellar_vest, itm_hide_boots, itm_mail_boots, itm_khergit_cavalry_helmet, itm_sword_khergit_4, itm_shortened_military_scythe, itm_tab_shield_small_round_c], knight_attrib_5,wp(240),knight_skills_5|knows_trainer_4|knows_power_draw_4, 0x0000000c360c524b6454465b59b9d93500000000001ea4860000000000000000, khergit_face_older_2], ["knight_3_16", "Lord Tirida","knight_3_6", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_tribal_warrior_outfit, itm_lamellar_vest, itm_hide_boots, itm_splinted_leather_greaves, itm_khergit_guard_helmet, itm_leather_gloves, itm_sword_khergit_4, itm_tab_shield_small_round_b, itm_khergit_bow, itm_arrows], knight_attrib_1,wp(120),knight_skills_1|knows_power_draw_4, 0x0000000c350c418438ab85b75c61b8d300000000001d21530000000000000000, khergit_face_middle_2], ["knight_3_17", "Lord Ulusamai", "knight_3_7", tf_hero, 0, reserved, fac_kingdom_3, [itm_courser, itm_leather_vest, itm_lamellar_vest, itm_leather_boots, itm_mail_boots, itm_khergit_guard_helmet, itm_leather_gloves, itm_great_bardiche, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_2,wp(150),knight_skills_2|knows_power_draw_4, 0x0000000c3c0821c647264ab6e68dc4d500000000001e42590000000000000000, khergit_face_old_2], ["knight_3_18", "Lord Karaban", "knight_3_8", tf_hero, 0, reserved, fac_kingdom_3, [itm_saddle_horse, itm_nomad_vest, itm_lamellar_vest, itm_hide_boots, itm_splinted_greaves, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_war_axe, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_3,wp(180),knight_skills_3|knows_trainer_4|knows_power_draw_4, 0x0000000c0810500347ae7acd0d3ad74a00000000001e289a0000000000000000, khergit_face_older_2], ["knight_3_19", "Lord Akadan","knight_3_9", tf_hero, 0, reserved, fac_kingdom_3, [itm_hunter, itm_nomad_robe, itm_lamellar_vest, itm_leather_boots, itm_splinted_leather_greaves, itm_khergit_cavalry_helmet, itm_scale_gauntlets, itm_sword_khergit_4, itm_shortened_military_scythe, itm_tab_shield_small_round_c], knight_attrib_4,wp(210),knight_skills_4|knows_trainer_5|knows_power_draw_4, 0x0000000c1500510528f50d52d20b152300000000001d66db0000000000000000, khergit_face_older_2], ["knight_3_20", "Lord Dundush","knight_3_0", tf_hero, 0, reserved, fac_kingdom_3, [itm_warhorse, itm_lamellar_vest, itm_lamellar_armor, itm_hide_boots, itm_mail_chausses, itm_khergit_guard_helmet, itm_scale_gauntlets, itm_sword_khergit_4, itm_tab_shield_small_round_c, itm_khergit_bow, itm_arrows], knight_attrib_5,wp(240),knight_skills_5|knows_power_draw_4, 0x0000000f7800620d66b76edd5cd5eb6e00000000001f691e0000000000000000, khergit_face_older_2], ["knight_4_1", "Lord Aedin", "knight_4_1", tf_hero, 0, reserved, fac_kingdom_4, [itm_rich_outfit, itm_banded_armor, itm_woolen_hose, itm_mail_boots, itm_nordic_helmet, itm_mail_mittens, itm_great_axe, itm_tab_shield_round_d, itm_throwing_axes], knight_attrib_1,wp(130),knight_skills_1, 0x0000000c13002254340eb1d91159392d00000000001eb75a0000000000000000, nord_face_middle_2], ["knight_4_2", "Lord Irya", "knight_4_2", tf_hero, 0, reserved, fac_kingdom_4, [ itm_short_tunic, itm_banded_armor, itm_blue_hose, itm_splinted_greaves, itm_nordic_helmet, itm_scale_gauntlets, itm_one_handed_battle_axe_c, itm_tab_shield_round_d, itm_throwing_axes], knight_attrib_2,wp(160),knight_skills_2|knows_trainer_3, 0x0000000c1610218368e29744e9a5985b00000000001db2a10000000000000000, nord_face_old_2], ["knight_4_3", "Lord Olaf", "knight_4_3", tf_hero, 0, reserved, fac_kingdom_4, [itm_warhorse, itm_rich_outfit, itm_heraldic_mail_with_tabard, itm_nomad_boots, itm_mail_chausses, itm_scale_gauntlets, itm_nasal_helmet, itm_great_axe, itm_tab_shield_round_e, itm_throwing_axes], knight_attrib_3,wp(190),knight_skills_3, 0x0000000c03040289245a314b744b30a400000000001eb2a90000000000000000, nord_face_older_2], ["knight_4_4", "Lord Reamald", "knight_4_4", tf_hero, 0, reserved, fac_kingdom_4, [itm_hunter, itm_leather_vest, itm_banded_armor, itm_woolen_hose, itm_mail_boots, itm_scale_gauntlets, itm_nordic_helmet, itm_fighting_pick, itm_tab_shield_round_e, itm_throwing_axes], knight_attrib_4,wp(210),knight_skills_4, 0x0000000c3f1001ca3d6955b26a8939a300000000001e39b60000000000000000, nord_face_older_2], ["knight_4_5", "Lord Turya", "knight_4_5", tf_hero, 0, reserved, fac_kingdom_4, [ itm_fur_coat, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_splinted_leather_greaves, itm_scale_gauntlets, itm_nordic_helmet, itm_bastard_sword_b, itm_tab_shield_round_e, itm_throwing_axes, itm_throwing_axes], knight_attrib_5,wp(250),knight_skills_5, 0x0000000ff508330546dc4a59422d450c00000000001e51340000000000000000, nord_face_older_2], ["knight_4_6", "Lord Gundur", "knight_4_6", tf_hero, 0, reserved, fac_kingdom_4, [ itm_nomad_robe, itm_banded_armor, itm_nomad_boots, itm_mail_chausses, itm_nordic_helmet, itm_mail_mittens, itm_war_axe, itm_tab_shield_round_d], knight_attrib_1,wp(130),knight_skills_1, 0x00000005b00011813d9b6d4a92ada53500000000001cc1180000000000000000, nord_face_middle_2], ["knight_4_7", "Lord Harald", "knight_4_7", tf_hero, 0, reserved, fac_kingdom_4, [ itm_fur_coat, itm_studded_leather_coat, itm_nomad_boots, itm_mail_boots, itm_nasal_helmet, itm_mail_mittens, itm_sword_viking_3, itm_shortened_military_scythe, itm_tab_shield_round_d], knight_attrib_2,wp(160),knight_skills_2|knows_trainer_4, 0x00000006690002873d9b6d4a92ada53500000000001cc1180000000000000000, nord_face_old_2], ["knight_4_8", "Lord Knudarr", "knight_4_8", tf_hero, 0, reserved, fac_kingdom_4, [ itm_rich_outfit, itm_mail_and_plate, itm_woolen_hose, itm_mail_chausses, itm_segmented_helmet, itm_scale_gauntlets, itm_war_axe, itm_tab_shield_round_e, itm_throwing_axes], knight_attrib_3,wp(190),knight_skills_3, 0x0000000f830051c53b026e4994ae272a00000000001db4e10000000000000000, nord_face_older_2], ["knight_4_9", "Lord Haeda", "knight_4_9", tf_hero, 0, reserved, fac_kingdom_4, [itm_warhorse, itm_nomad_robe, itm_haubergeon, itm_blue_hose, itm_mail_boots, itm_guard_helmet, itm_scale_gauntlets, itm_arrows, itm_long_bow, itm_one_handed_battle_axe_c, itm_tab_shield_round_e], knight_attrib_4,wp(220),knight_skills_4|knows_trainer_5|knows_power_draw_4, 0x0000000c230401c6349c2e9b2168eb1a00000000001eb0630000000000000000, nord_face_older_2], ["knight_4_10", "Lord Turegor", "knight_4_0", tf_hero, 0, reserved, fac_kingdom_4, [itm_hunter, itm_courtly_outfit, itm_coat_of_plates, itm_nomad_boots, itm_splinted_greaves, itm_scale_gauntlets, itm_winged_great_helmet,itm_great_axe, itm_tab_shield_round_e], knight_attrib_5,wp(250),knight_skills_5|knows_trainer_6, 0x000000084b0002063d9b6d4a92ada53500000000001cc1180000000000000000, nord_face_older_2], ["knight_4_11", "Lord Logarson", "knight_4_1", tf_hero, 0, reserved, fac_kingdom_4, [ itm_rich_outfit, itm_banded_armor, itm_woolen_hose, itm_mail_boots, itm_nordic_helmet, itm_mail_mittens, itm_great_bardiche, itm_tab_shield_round_d], knight_attrib_1,wp(140),knight_skills_1, 0x0000000ca100224d56a5d5c65c70c40a00000000001d54de0000000000000000, nord_face_middle_2], ["knight_4_12", "Lord Aeric", "knight_4_2", tf_hero, 0, reserved, fac_kingdom_4, [ itm_short_tunic, itm_banded_armor, itm_blue_hose, itm_splinted_greaves, itm_nordic_helmet, itm_mail_mittens, itm_one_handed_battle_axe_c, itm_tab_shield_round_d], knight_attrib_2,wp(200),knight_skills_2, 0x0000000b9500020824936cc51cb5bb2500000000001dd4d80000000000000000, nord_face_old_2], ["knight_4_13", "Lord Faarn", "knight_4_3", tf_hero, 0, reserved, fac_kingdom_4, [itm_warhorse, itm_rich_outfit, itm_heraldic_mail_with_tabard, itm_nomad_boots, itm_mail_chausses, itm_scale_gauntlets, itm_nasal_helmet, itm_war_axe, itm_tab_shield_round_e], knight_attrib_3,wp(250),knight_skills_3|knows_trainer_3, 0x0000000a300012c439233512e287391d00000000001db7200000000000000000, nord_face_older_2], ["knight_4_14", "Lord Bulba", "knight_4_4", tf_hero, 0, reserved, fac_kingdom_4, [ itm_leather_vest, itm_banded_armor, itm_woolen_hose, itm_mail_boots, itm_nordic_helmet, itm_scale_gauntlets, itm_fighting_pick, itm_tab_shield_round_e, itm_throwing_axes], knight_attrib_4,wp(200),knight_skills_4, 0x0000000c0700414f2cb6aa36ea50a69d00000000001dc55c0000000000000000, nord_face_older_2], ["knight_4_15", "Lord Rayeck", "knight_4_5", tf_hero, 0, reserved, fac_kingdom_4, [itm_hunter, itm_leather_jacket, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_scale_gauntlets, itm_splinted_leather_greaves, itm_nordic_helmet, itm_shortened_military_scythe, itm_tab_shield_round_e], knight_attrib_5,wp(290),knight_skills_5|knows_trainer_6, 0x0000000d920801831715d1aa9221372300000000001ec6630000000000000000, nord_face_older_2], ["knight_4_16", "Lord Dirigun", "knight_4_6", tf_hero, 0, reserved, fac_kingdom_4, [ itm_nomad_robe, itm_banded_armor, itm_nomad_boots, itm_mail_chausses, itm_nordic_helmet, itm_mail_mittens, itm_war_axe, itm_tab_shield_round_d, itm_throwing_axes], knight_attrib_1,wp(120),knight_skills_1, 0x000000099700124239233512e287391d00000000001db7200000000000000000, nord_face_middle_2], ["knight_4_17", "Lord Marayirr", "knight_4_7", tf_hero, 0, reserved, fac_kingdom_4, [ itm_fur_coat, itm_banded_armor, itm_nomad_boots, itm_mail_boots, itm_nasal_helmet, itm_mail_mittens, itm_sword_viking_3, itm_tab_shield_round_d, itm_throwing_axes], knight_attrib_2,wp(150),knight_skills_2|knows_trainer_4, 0x0000000c2f0442036d232a2324b5b81400000000001e55630000000000000000, nord_face_old_2], ["knight_4_18", "Lord Gearth", "knight_4_8", tf_hero, 0, reserved, fac_kingdom_4, [ itm_rich_outfit, itm_mail_and_plate, itm_woolen_hose, itm_mail_chausses, itm_segmented_helmet, itm_scale_gauntlets, itm_sword_viking_3, itm_shortened_military_scythe, itm_tab_shield_round_d], knight_attrib_3,wp(180),knight_skills_3, 0x0000000c0d00118866e22e3d9735a72600000000001eacad0000000000000000, nord_face_older_2], ["knight_4_19", "Lord Surdun", "knight_4_9", tf_hero, 0, reserved, fac_kingdom_4, [itm_warhorse, itm_nomad_robe, itm_haubergeon, itm_blue_hose, itm_mail_boots, itm_guard_helmet, itm_scale_gauntlets, itm_one_handed_battle_axe_c, itm_tab_shield_round_e, itm_throwing_axes], knight_attrib_4,wp(210),knight_skills_4|knows_trainer_5, 0x0000000c0308225124e26d4a6295965a00000000001d23e40000000000000000, nord_face_older_2], ["knight_4_20", "Lord Gerlad", "knight_4_0", tf_hero, 0, reserved, fac_kingdom_4, [itm_hunter, itm_courtly_outfit, itm_coat_of_plates, itm_nomad_boots, itm_splinted_greaves, itm_scale_gauntlets, itm_winged_great_helmet,itm_great_axe, itm_tab_shield_round_e, itm_throwing_axes], knight_attrib_5,wp(240),knight_skills_5, 0x0000000f630052813b6bb36de5d6eb7400000000001dd72c0000000000000000, nord_face_older_2], ["knight_5_1", "Lord Matheas", "knight_5_1", tf_hero, 0, reserved, fac_kingdom_5, [itm_saddle_horse, itm_tabard, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_boots, itm_guard_helmet, itm_leather_gloves, itm_fighting_pick, itm_tab_shield_heater_c], knight_attrib_1,wp(130),knight_skills_1|knows_trainer_3, 0x0000000a1b0c00483adcbaa5ac9a34a200000000001ca2d40000000000000000, rhodok_face_middle_2], ["knight_5_2", "Lord Gutlans", "knight_5_2", tf_hero, 0, reserved, fac_kingdom_5, [itm_courser, itm_red_gambeson, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_mail_boots, itm_nasal_helmet, itm_leather_gloves, itm_military_pick, itm_sword_two_handed_a, itm_tab_shield_heater_c], knight_attrib_2,wp(160),knight_skills_2|knows_trainer_4, 0x0000000c390c659229136db45a75251300000000001f16930000000000000000, rhodok_face_old_2], ["knight_5_3", "Lord Laruqen", "knight_5_3", tf_hero, 0, reserved, fac_kingdom_5, [itm_hunter, itm_short_tunic, itm_mail_and_plate, itm_nomad_boots, itm_splinted_leather_greaves, itm_kettle_hat, itm_gauntlets, itm_shortened_military_scythe, itm_tab_shield_heater_d], knight_attrib_3,wp(190),knight_skills_3, 0x0000000c2f10415108b1aacba27558d300000000001d329c0000000000000000, rhodok_face_older_2], ["knight_5_4", "Lord Raichs", "knight_5_4", tf_hero, 0, reserved, fac_kingdom_5, [itm_hunter, itm_leather_jacket, itm_brigandine_a, itm_woolen_hose, itm_splinted_greaves, itm_flat_topped_helmet, itm_gauntlets, itm_bastard_sword_a, itm_tab_shield_heater_d], knight_attrib_4,wp(220),knight_skills_4, 0x0000000c3c005110345c59d56975ba1200000000001e24e40000000000000000, rhodok_face_older_2], ["knight_5_5", "Lord Reland", "knight_5_5", tf_hero, 0, reserved, fac_kingdom_5, [itm_hunter, itm_rich_outfit, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_mail_boots, itm_great_helmet, itm_gauntlets, itm_shortened_military_scythe, itm_tab_shield_heater_d], knight_attrib_5,wp(250),knight_skills_5, 0x0000000c060400c454826e471092299a00000000001d952d0000000000000000, rhodok_face_older_2], ["knight_5_6", "Lord Tarchias", "knight_5_6", tf_hero, 0, reserved, fac_kingdom_5, [itm_sumpter_horse, itm_ragged_outfit, itm_heraldic_mail_with_tabard, itm_woolen_hose, itm_splinted_greaves, itm_gauntlets, itm_skullcap, itm_sword_two_handed_b, itm_tab_shield_heater_c], knight_attrib_1,wp(130),knight_skills_1, 0x0000000c040804d2293c46a6a5669ce400000000001db7120000000000000000, rhodok_face_middle_2], ["knight_5_7", "Lord Gharmall", "knight_5_7", tf_hero, 0, reserved, fac_kingdom_5, [itm_saddle_horse, itm_coarse_tunic, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_chausses, itm_gauntlets, itm_nasal_helmet, itm_bastard_sword_a, itm_tab_shield_heater_c], knight_attrib_2,wp(160),knight_skills_2, 0x0000000c3a0455c443d46e4c8b91291a00000000001ca51b0000000000000000, rhodok_face_old_2], ["knight_5_8", "Lord Talbar", "knight_5_8", tf_hero, 0, reserved, fac_kingdom_5, [itm_saddle_horse, itm_courtly_outfit, itm_heraldic_mail_with_tabard, itm_woolen_hose, itm_mail_boots, itm_nasal_helmet, itm_gauntlets, itm_military_pick, itm_sword_two_handed_b, itm_tab_shield_heater_c], knight_attrib_3,wp(190),knight_skills_3|knows_trainer_3, 0x0000000c2c0844d42914d19b2369b4ea00000000001e331b0000000000000000, rhodok_face_older_2], ["knight_5_9", "Lord Rimusk", "knight_5_9", tf_hero, 0, reserved, fac_kingdom_5, [itm_warhorse, itm_leather_jacket, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_splinted_leather_greaves, itm_kettle_hat, itm_gauntlets, itm_great_bardiche, itm_tab_shield_heater_d], knight_attrib_4,wp(220),knight_skills_4|knows_trainer_6, 0x0000000c130461054af448eb19cd40e400000000001d488a0000000000000000, rhodok_face_older_2], ["knight_5_10", "Lord Falsevor", "knight_5_0", tf_hero, 0, reserved, fac_kingdom_5, [itm_warhorse, itm_rich_outfit, itm_heraldic_mail_with_tabard, itm_blue_hose, itm_mail_chausses, itm_great_helmet, itm_gauntlets, itm_bastard_sword_a, itm_tab_shield_heater_d], knight_attrib_5,wp(250),knight_skills_5|knows_trainer_4, 0x00000008e20011063d9b6d4a92ada53500000000001cc1180000000000000000, rhodok_face_older_2], ["knight_5_11", "Lord Etrosq", "knight_5_1", tf_hero, 0, reserved, fac_kingdom_5, [itm_saddle_horse, itm_tabard, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_boots, itm_skullcap, itm_leather_gloves, itm_fighting_pick, itm_tab_shield_heater_c], knight_attrib_1,wp(130),knight_skills_1, 0x0000000c170c14874752adb6eb3228d500000000001c955c0000000000000000, rhodok_face_middle_2], ["knight_5_12", "Lord Kurnias", "knight_5_2", tf_hero, 0, reserved, fac_kingdom_5, [itm_courser, itm_red_gambeson, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_mail_boots, itm_nasal_helmet, itm_leather_gloves, itm_military_pick, itm_tab_shield_heater_c], knight_attrib_2,wp(160),knight_skills_2|knows_trainer_5, 0x0000000c080c13d056ec8da85e3126ed00000000001d4ce60000000000000000, rhodok_face_old_2], ["knight_5_13", "Lord Tellrog", "knight_5_3", tf_hero, 0, reserved, fac_kingdom_5, [itm_hunter, itm_short_tunic, itm_mail_and_plate, itm_nomad_boots, itm_splinted_leather_greaves, itm_winged_great_helmet, itm_gauntlets, itm_sword_two_handed_a, itm_tab_shield_heater_d], knight_attrib_3,wp(190),knight_skills_3, 0x0000000cbf10100562a4954ae731588a00000000001d6b530000000000000000, rhodok_face_older_2], ["knight_5_14", "Lord Tribidan", "knight_5_4", tf_hero, 0, reserved, fac_kingdom_5, [itm_hunter, itm_leather_jacket, itm_brigandine_a, itm_woolen_hose, itm_splinted_greaves, itm_flat_topped_helmet, itm_gauntlets, itm_bastard_sword_a, itm_tab_shield_heater_d], knight_attrib_4,wp(220),knight_skills_4, 0x0000000c330805823baa77556c4e331a00000000001cb9110000000000000000, rhodok_face_older_2], ["knight_5_15", "Lord Gerluchs", "knight_5_5", tf_hero, 0, reserved, fac_kingdom_5, [itm_hunter, itm_rich_outfit, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_mail_boots, itm_great_helmet, itm_gauntlets, itm_sword_two_handed_a, itm_tab_shield_heater_d], knight_attrib_5,wp(250),knight_skills_5, 0x0000000d51000106370c4d4732b536de00000000001db9280000000000000000, rhodok_face_older_2], ["knight_5_16", "Lord Fudreim", "knight_5_6", tf_hero, 0, reserved, fac_kingdom_5, [itm_sumpter_horse, itm_ragged_outfit, itm_heraldic_mail_with_tabard, itm_woolen_hose, itm_splinted_greaves, itm_guard_helmet, itm_leather_gloves, itm_fighting_pick, itm_tab_shield_heater_c], knight_attrib_1,wp(120),knight_skills_1, 0x0000000c06046151435b5122a37756a400000000001c46e50000000000000000, rhodok_face_middle_2], ["knight_5_17", "Lord Nealcha", "knight_5_7", tf_hero, 0, reserved, fac_kingdom_5, [itm_saddle_horse, itm_coarse_tunic, itm_heraldic_mail_with_surcoat, itm_leather_boots, itm_mail_chausses, itm_nasal_helmet, itm_leather_gloves, itm_bastard_sword_a, itm_tab_shield_heater_c], knight_attrib_2,wp(150),knight_skills_2, 0x0000000c081001d3465c89a6a452356300000000001cda550000000000000000, rhodok_face_old_2], ["knight_5_18", "Lord Fraichin", "knight_5_8", tf_hero, 0, reserved, fac_kingdom_5, [itm_saddle_horse, itm_courtly_outfit, itm_heraldic_mail_with_tabard, itm_woolen_hose, itm_mail_boots, itm_nasal_helmet, itm_gauntlets, itm_military_pick, itm_tab_shield_heater_d], knight_attrib_3,wp(180),knight_skills_3, 0x0000000a3d0c13c3452aa967276dc95c00000000001dad350000000000000000, rhodok_face_older_2], ["knight_5_19", "Lord Trimbau", "knight_5_9", tf_hero, 0, reserved, fac_kingdom_5, [itm_warhorse, itm_leather_jacket, itm_heraldic_mail_with_tabard, itm_leather_boots, itm_splinted_leather_greaves, itm_kettle_hat, itm_gauntlets, itm_fighting_pick, itm_sword_two_handed_a, itm_tab_shield_heater_d], knight_attrib_4,wp(210),knight_skills_4|knows_trainer_5, 0x0000000c3f08038245545e3b236a68de00000000001e37230000000000000000, rhodok_face_older_2], ["knight_5_20", "Lord Reichsin", "knight_5_0", tf_hero, 0, reserved, fac_kingdom_5, [itm_warhorse, itm_rich_outfit, itm_heraldic_mail_with_tabard, itm_blue_hose, itm_mail_chausses, itm_great_helmet, itm_gauntlets, itm_bastard_sword_b, itm_tab_shield_heater_d], knight_attrib_5,wp(240),knight_skills_5|knows_trainer_6, 0x0000000d8a00514544be2d14d370c65c00000000001ed6df0000000000000000, rhodok_face_older_2], ["kingdom_1_pretender", "Lady Isolla of Suno", "Kingdom 1 Lord", tf_hero|tf_female|tf_unmoveable_in_party_window, 0,reserved, fac_kingdom_1,[itm_charger, itm_rich_outfit, itm_blue_hose, itm_iron_greaves, itm_mail_shirt, itm_sword_medieval_c_small, itm_tab_shield_small_round_c, itm_bascinet], lord_attrib,wp(220),knows_lord_1, 0x00000000ef00000237dc71b90c31631200000000001e371b0000000000000000], #claims pre-salic descent ["kingdom_2_pretender", "Prince Valdym the Bastard", "Kingdom 2 Lord", tf_hero|tf_unmoveable_in_party_window, 0,reserved, fac_kingdom_2,[itm_hunter, itm_courtly_outfit, itm_leather_boots, itm_mail_chausses, itm_lamellar_armor, itm_military_pick, itm_tab_shield_heater_b, itm_flat_topped_helmet], lord_attrib,wp(220),knows_lord_1, 0x00000000200412142452ed631b30365c00000000001c94e80000000000000000, vaegir_face_middle_2], #had his patrimony falsified ["kingdom_3_pretender", "Dustum Khan", "Kingdom 3 Lord", tf_hero|tf_unmoveable_in_party_window, 0,reserved, fac_kingdom_3,[itm_courser, itm_nomad_robe, itm_leather_boots, itm_splinted_greaves, itm_khergit_guard_armor, itm_sword_khergit_2, itm_tab_shield_small_round_c, itm_segmented_helmet], lord_attrib,wp(220),knows_lord_1, 0x000000065504310b30d556b51238f66100000000001c256d0000000000000000, khergit_face_middle_2], #of the family ["kingdom_4_pretender", "Lethwin Far-Seeker", "Kingdom 4 Lord", tf_hero|tf_unmoveable_in_party_window, 0,reserved, fac_kingdom_4,[itm_hunter, itm_tabard, itm_leather_boots, itm_mail_boots, itm_brigandine_a, itm_sword_medieval_c, itm_tab_shield_heater_cav_a, itm_kettle_hat], lord_attrib,wp(220),knows_lord_1, 0x00000004340c01841d89949529a6776a00000000001c910a0000000000000000, nord_face_young_2], #dispossessed and wronged ["kingdom_5_pretender", "Lord Kastor of Veluca", "Kingdom 5 Lord", tf_hero|tf_unmoveable_in_party_window, 0,reserved, fac_kingdom_5,[itm_warhorse, itm_nobleman_outfit, itm_leather_boots, itm_splinted_leather_greaves, itm_mail_hauberk, itm_sword_medieval_c, itm_tab_shield_heater_d, itm_spiked_helmet], lord_attrib,wp(220),knows_lord_1, 0x0000000bed1031051da9abc49ecce25e00000000001e98680000000000000000, rhodok_face_old_2], #republican ## ["kingdom_1_lord_a", "Kingdom 1 Lord A", "Kingdom 1 Lord A", tf_hero, 0,reserved, fac_kingdom_1,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], ## ["kingdom_1_lord_b", "Kingdom 1 Lord B", "Kingdom 1 Lord B", tf_hero, 0,reserved, fac_kingdom_2,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], ## ["kingdom_1_lord_c", "Kingdom 1 Lord C", "Kingdom 1 Lord C", tf_hero, 0,reserved, fac_kingdom_3,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], ## ["kingdom_1_lord_d", "Kingdom 1 Lord D", "Kingdom 1 Lord D", tf_hero, 0,reserved, fac_kingdom_1,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], ## ["kingdom_1_lord_e", "Kingdom 1 Lord E", "Kingdom 1 Lord E", tf_hero, 0,reserved, fac_kingdom_1,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], ## ["kingdom_1_lord_f", "Kingdom 1 Lord F", "Kingdom 1 Lord F", tf_hero, 0,reserved, fac_kingdom_1,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], ## ["kingdom_1_lord_g", "Kingdom 1 Lord G", "Kingdom 1 Lord G", tf_hero, 0,reserved, fac_kingdom_1,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], ## ["kingdom_1_lord_h", "Kingdom 1 Lord H", "Kingdom 1 Lord H", tf_hero, 0,reserved, fac_kingdom_2,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], ## ["kingdom_1_lord_i", "Kingdom 1 Lord I", "Kingdom 1 Lord I", tf_hero, 0,reserved, fac_kingdom_2,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], ## ["kingdom_1_lord_j", "Kingdom 1 Lord J", "Kingdom 1 Lord J", tf_hero, 0,reserved, fac_kingdom_2,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], ## ["kingdom_1_lord_k", "Kingdom 1 Lord K", "Kingdom 1 Lord K", tf_hero, 0,reserved, fac_kingdom_2,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], ## ["kingdom_1_lord_l", "Kingdom 1 Lord L", "Kingdom 1 Lord L", tf_hero, 0,reserved, fac_kingdom_3,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], ## ["kingdom_1_lord_m", "Kingdom 1 Lord M", "Kingdom 1 Lord M", tf_hero, 0,reserved, fac_kingdom_3,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], ## ["kingdom_1_lord_n", "Kingdom 1 Lord N", "Kingdom 1 Lord N", tf_hero, 0,reserved, fac_kingdom_3,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x00000000000c710201fa51b7286db721], # ["town_1_ruler_a", "King Harlaus", "King Harlaus", tf_hero, scn_town_1_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_courtly_outfit,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000010908101e36db44b75b6dd], # ["town_2_ruler_a", "Duke Taugard", "Duke Taugard", tf_hero, scn_town_2_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_courtly_outfit,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000000310401e06db86375f6da], # ["town_3_ruler_a", "Count Grimar", "Count Grimar", tf_hero, scn_town_3_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000004430301e46136eb75bc0a], # ["town_4_ruler_a", "Count Haxalye", "Count Haxalye", tf_hero, scn_town_4_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000010918701e77136e905bc0e # ["town_5_ruler_a", "Count Belicha", "Count Belicha", tf_hero, scn_town_5_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x00000000000421c801e7713729c5b8ce], # ["town_6_ruler_a", "Count Nourbis", "Count Nourbis", tf_hero, scn_town_6_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x00000000000c640501e371b72bcdb724], # ["town_7_ruler_a", "Count Rhudolg", "Count Rhudolg", tf_hero, scn_town_7_castle|entry(9),reserved, fac_swadians,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x00000000000c710201fa51b7286db721], # ["town_8_ruler_b", "King Yaroglek", "King_yaroglek", tf_hero, scn_town_8_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000000128801f294ca6d66d555], # ["town_9_ruler_b", "Count Aolbrug", "Count_Aolbrug", tf_hero, scn_town_9_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000004234401f26a271c8d38ea], # ["town_10_ruler_b","Count Rasevas", "Count_Rasevas", tf_hero, scn_town_10_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x00000000001032c201f38e269372471c], # ["town_11_ruler_b","Count Leomir", "Count_Leomir", tf_hero, scn_town_11_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x00000000000c538001f55148936d3895], # ["town_12_ruler_b","Count Haelbrad","Count_Haelbrad",tf_hero, scn_town_12_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x00000000000410c701f38598ac8aaaab], # ["town_13_ruler_b","Count Mira", "Count_Mira", tf_hero, scn_town_13_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000004204401f390c515555594], # ["town_14_ruler_b","Count Camechaw","Count_Camechaw",tf_hero, scn_town_14_castle|entry(9),reserved, fac_vaegirs,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_a", "Kingdom 2 Lord A", "Kingdom 2 Lord A", tf_hero, 0,reserved, fac_kingdom_10,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_b", "Kingdom 2 Lord B", "Kingdom 2 Lord B", tf_hero, 0,reserved, fac_kingdom_11,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_c", "Kingdom 2 Lord C", "Kingdom 2 Lord C", tf_hero, 0,reserved, fac_kingdom_12,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_d", "Kingdom 2 Lord D", "Kingdom 2 Lord D", tf_hero, 0,reserved, fac_kingdom_10,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_e", "Kingdom 2 Lord E", "Kingdom 2 Lord E", tf_hero, 0,reserved, fac_kingdom_10,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_f", "Kingdom 2 Lord F", "Kingdom 2 Lord F", tf_hero, 0,reserved, fac_kingdom_10,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_g", "Kingdom 2 Lord G", "Kingdom 2 Lord G", tf_hero, 0,reserved, fac_kingdom_10,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_h", "Kingdom 2 Lord H", "Kingdom 2 Lord H", tf_hero, 0,reserved, fac_kingdom_11,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_i", "Kingdom 2 Lord I", "Kingdom 2 Lord I", tf_hero, 0,reserved, fac_kingdom_11,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_j", "Kingdom 2 Lord J", "Kingdom 2 Lord J", tf_hero, 0,reserved, fac_kingdom_11,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_k", "Kingdom 2 Lord K", "Kingdom 2 Lord K", tf_hero, 0,reserved, fac_kingdom_10,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_l", "Kingdom 2 Lord L", "Kingdom 2 Lord L", tf_hero, 0,reserved, fac_kingdom_12,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_m", "Kingdom 2 Lord M", "Kingdom 2 Lord M", tf_hero, 0,reserved, fac_kingdom_12,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], ## ["kingdom_2_lord_n", "Kingdom 2 Lord N", "Kingdom 2 Lord N", tf_hero, 0,reserved, fac_kingdom_12,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots,itm_coat_of_plates],lord_attrib|level(38),wp(220),knows_common, 0x000000000008318101f390c515555594], #Royal family members ["knight_1_1_wife","Lady Anna","knight_1_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_1, [ itm_lady_dress_ruby , itm_turret_hat_ruby, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000055910200107632d675a92b92d00000000001e45620000000000000000], ["knight_2_1_wife","Lady Junitha","knight_2_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_2, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000007c0101002588caf17142ab93d00000000001ddfa40000000000000000], ["knight_3_1_wife","Lady Borge","knight_3_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_3, [ itm_nomad_vest, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000056e082002471c91c8aa2a130b00000000001d48a40000000000000000], ["knight_4_1_wife","Lady Jadeth","knight_4_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_4, [ itm_court_dress , itm_wimple_with_veil, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000054b100003274d65d2d239eb1300000000001d49080000000000000000], ["knight_5_1_wife","Lady Brina","knight_5_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_5, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000007e900200416ed96e88b8d595a00000000001cb8ac0000000000000000], ["knight_1_2_wife","Lady Nelda","knight_1_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_1, [ itm_lady_dress_ruby , itm_turret_hat_ruby, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000054f08100232636aa90d6e194b00000000001e43130000000000000000], ["knight_2_2_wife","Lady Katia","knight_2_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_2, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000008c00c20032aa5ae36b4259b9300000000001da6a50000000000000000], ["knight_3_2_wife","Lady Tuan","knight_3_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_3, [ itm_nomad_vest, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000008ec0820062ce4d246b38e632e00000000001d52910000000000000000], ["knight_4_2_wife","Lady Miar","knight_4_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_4, [ itm_court_dress , itm_wimple_with_veil, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000058610000664d3693664f0c54b00000000001d332d0000000000000000], ["knight_5_2_wife","Lady Aliena","knight_5_1_wife",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_5, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000057008200222d432cf6d4a2ae300000000001d37a10000000000000000], ["knight_1_1_daughter","Lady Bela","knight_1_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_1, [ itm_lady_dress_blue, itm_turret_hat_blue, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000018f0410064854c742db74b52200000000001d448b0000000000000000], ["knight_2_1_daughter","Lady Seomis","knight_2_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_2, [ itm_peasant_dress , itm_wimple_with_veil, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x0000000007080004782a6cc4ecae4d1e00000000001eb6e30000000000000000], ["knight_3_1_daughter","Lady Chedina","knight_3_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_3, [ itm_nomad_robe , itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000000320c30023ce23a145a8f27a300000000001ea6dc0000000000000000], ["knight_4_1_daughter","Lady Dria","knight_4_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_4, [ itm_peasant_dress, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000000000c000469a4d5cda4b1349c00000000001cd6600000000000000000], ["knight_5_1_daughter","Lady Aneth","knight_5_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_5, [ itm_lady_dress_ruby , itm_wimple_with_veil, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000001b9002002364dd8aa5475d76400000000001db8d30000000000000000], ["knight_1_2_daughter","Lady Elina","knight_1_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_1, [ itm_lady_dress_blue, itm_turret_hat_blue, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000204200629b131e90d6a8ae400000000001e28dd0000000000000000], ["knight_2_2_daughter","Lady Drina","knight_2_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_2, [ itm_peasant_dress , itm_wimple_with_veil, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000054008200638db99d89eccbd3500000000001ec91d0000000000000000], ["knight_3_2_daughter","Lady Ayasu","knight_3_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_3, [ itm_nomad_robe , itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000002a0c200348a28f2a54aa391c00000000001e46d10000000000000000], ["knight_4_2_daughter","Lady Glunde","knight_4_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_4, [ itm_peasant_dress, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x00000000000000021564d196e2aa279400000000001dc4ed0000000000000000], ["knight_5_2_daughter","Lady Reada","knight_5_1_daughter",tf_hero|tf_female|tf_unmoveable_in_party_window,0,reserved,fac_kingdom_5, [ itm_lady_dress_ruby , itm_wimple_with_veil, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000057a0000014123dae69e8e48e200000000001e08db0000000000000000], # ["kingdom_11_lord_daughter","kingdom_11_lord_daughter","kingdom_11_lord_daughter",tf_hero|tf_female,0,reserved,fac_kingdom_10, [ itm_lady_dress_blue , itm_turret_hat_blue, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000008300701c08d34a450ce43], # ["kingdom_13_lord_daughter","kingdom_13_lord_daughter","kingdom_13_lord_daughter",tf_hero|tf_female,0,reserved,fac_kingdom_10, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000008000401db10a45b41d6d8], ## ["kingdom_1_lady_a","kingdom_1_lady_a","kingdom_1_lady_a",tf_hero|tf_female,0,reserved,fac_kingdom_1, [ itm_lady_dress_blue , itm_turret_hat_blue, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000008500201d8ad93708e4694], ## ["kingdom_1_lady_b","kingdom_1_lady_b","kingdom_1_lady_b",tf_hero|tf_female,0,reserved,fac_kingdom_1, [ itm_lady_dress_ruby , itm_turret_hat_ruby, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000004000101c3ae68e0e944ac], ## ["kingdom_2_lady_a","Kingdom 2 Lady a","Kingdom 2 Lady a",tf_hero|tf_female,0,reserved,fac_kingdom_2, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000008100501d8ad93708e4694], ## ["kingdom_2_lady_b","Kingdom 2 Lady b","Kingdom 2 Lady b",tf_hero|tf_female,0,reserved,fac_kingdom_2, [ itm_lady_dress_blue , itm_turret_hat_blue, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000004000401d8ad93708e4694], ## ["kingdom_3_lady_a","Kingdom 3 Lady a","Kingdom 3 Lady a",tf_hero|tf_female,0,reserved,fac_kingdom_3, [ itm_lady_dress_ruby , itm_turret_hat_ruby, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000010500301d8ad93708e4694], ## ## ["kingdom_3_lady_b","Kingdom 3 Lady b","Kingdom 3 Lady b",tf_hero|tf_female,0,reserved,fac_kingdom_3, [ itm_lady_dress_ruby , itm_turret_hat_ruby, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000000100601d8b08d76d14a24], ## ["kingdom_4_lady_a","Kingdom 4 Lady a","Kingdom 4 Lady a",tf_hero|tf_female,0,reserved,fac_kingdom_4, [ itm_lady_dress_green, itm_turret_hat_green, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000010500601d8ad93708e4694], ## ["kingdom_4_lady_b","Kingdom 4 Lady b","Kingdom 4 Lady b",tf_hero|tf_female,0,reserved,fac_kingdom_4, [ itm_lady_dress_blue , itm_turret_hat_blue, itm_leather_boots], def_attrib|level(2),wp(50),knows_common|knows_riding_2, 0x000000000008500201d8ad93708e4694], ["heroes_end", "heroes end", "heroes end", tf_hero, 0,reserved, fac_neutral,[itm_saddle_horse,itm_leather_jacket,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, 0x000000000008318101f390c515555594], #Merchants AT SILAH ZIRH BOT Head_wear ## ["merchant_1", "merchant_1_F", "merchant_1_F",tf_hero|tf_female, 0,0, fac_kingdom_1,[itm_courser, itm_fighting_axe, itm_leather_jerkin, itm_leather_boots, itm_straw_hat], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008200201e54c137a940c91], ## ["merchant_2", "merchant_2", "merchant_2", tf_hero, 0,0, fac_kingdom_2,[itm_saddle_horse, itm_arming_sword, itm_light_leather, itm_woolen_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000000000601db6db6db6db6db], ## ["merchant_3", "merchant_3", "merchant_3", tf_hero, 0,0, fac_kingdom_3,[itm_courser, itm_nordic_sword, itm_leather_jerkin, itm_woolen_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008100701db6db6db6db6db], ## ["merchant_4", "merchant_4_F", "merchant_4_F",tf_hero|tf_female, 0,0, fac_kingdom_4,[itm_saddle_horse, itm_falchion, itm_light_leather, itm_blue_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000010500401e54c137a945c91], ## ["merchant_5", "merchant_5", "merchant_5", tf_hero, 0,0, fac_kingdom_5,[itm_saddle_horse, itm_sword, itm_ragged_outfit, itm_hide_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008038001e54c135a945c91], ## ["merchant_6", "merchant_6", "merchant_6", tf_hero, 0,0, fac_kingdom_1,[itm_saddle_horse, itm_scimitar, itm_leather_jerkin, itm_leather_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000000248e01e54c1b5a945c91], ## ["merchant_7", "merchant_7_F", "merchant_7_F",tf_hero|tf_female, 0,0, fac_kingdom_2,[itm_hunter, itm_arming_sword, itm_padded_leather, itm_blue_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000004200601c98ad39c97557a], ## ["merchant_8", "merchant_8", "merchant_8", tf_hero, 0,0, fac_kingdom_3,[itm_saddle_horse, itm_nordic_sword, itm_light_leather, itm_leather_boots, itm_woolen_hood], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x00000000001095ce01d6aad3a497557a], ## ["merchant_9", "merchant_9", "merchant_9", tf_hero, 0,0, fac_kingdom_4,[itm_saddle_horse, itm_sword, itm_padded_leather, itm_hide_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000010519601ec26ae99898697], ## ["merchant_10","merchant_10","merchant_10",tf_hero, 0,0, fac_merchants,[itm_hunter, itm_bastard_sword, itm_light_leather, itm_woolen_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x00000000000884c401f6837d3294e28a], ## ["merchant_11","merchant_11","merchant_11",tf_hero, 0,0, fac_merchants,[itm_saddle_horse, itm_sword, itm_leather_jacket, itm_woolen_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x00000000000c450501e289dd2c692694], ## ["merchant_12","merchant_12","merchant_12",tf_hero, 0,0, fac_merchants,[itm_hunter, itm_falchion, itm_leather_jerkin, itm_hide_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x00000000000c660a01e5af3cb2763401], ## ["merchant_13","merchant_13","merchant_13",tf_hero, 0,0, fac_merchants,[itm_sumpter_horse, itm_nordic_sword, itm_padded_leather, itm_leather_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x00000000001001d601ec912a89e4d534], ## ["merchant_14","merchant_14","merchant_14",tf_hero, 0,0, fac_merchants,[itm_courser, itm_bastard_sword, itm_light_leather, itm_hide_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000004335601ea2c04a8b6a394], ## ["merchant_15","merchant_15","merchant_15",tf_hero, 0,0, fac_merchants,[itm_saddle_horse, itm_sword, itm_padded_leather, itm_woolen_hose, itm_fur_hat], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008358e01dbf27b6436089d], ## ["merchant_16","merchant_16_F","merchant_16_F",tf_hero|tf_female, 0,0, fac_merchants,[itm_hunter, itm_bastard_sword, itm_light_leather, itm_hide_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x00000000000c300101db0b9921494add], ## ["merchant_17","merchant_17","merchant_17",tf_hero, 0,0, fac_merchants,[itm_saddle_horse, itm_sword, itm_leather_jacket, itm_blue_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008740f01e945c360976a0a], ## ["merchant_18","merchant_18","merchant_18",tf_hero, 0,0, fac_merchants,[itm_saddle_horse, itm_nordic_sword, itm_padded_leather, itm_leather_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008020c01fc2db3b4c97685], ## ["merchant_19","merchant_19","merchant_19",tf_hero, 0,0, fac_merchants,[itm_saddle_horse, itm_falchion, itm_leather_jerkin, itm_woolen_hose, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000008118301f02af91892725b], ## ["merchant_20","merchant_20_F","merchant_20_F",tf_hero|tf_female, 0,0, fac_merchants,[itm_courser, itm_arming_sword, itm_padded_leather, itm_leather_boots, ], def_attrib|level(15),wp(100),knows_inventory_management_10, 0x000000000010500401f6837d27688212], #Seneschals ["town_1_seneschal", "Town 1 Seneschal", "Town 1 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c218501ef4f5d2ccb0026], ["town_2_seneschal", "Town 2 Seneschal", "Town 2 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000c03cc01cc34a9a467fdfd], ["town_3_seneschal", "Town 3 Seneschal", "Town 3 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c500e01dbb2115a55f3cd], ["town_4_seneschal", "Town 4 Seneschal", "Town 4 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000008035201e6eebaf3f3eb2b], ["town_5_seneschal", "Town 5 Seneschal", "Town 5 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_leather_jerkin, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000000249101e7898999ac54c6], ["town_6_seneschal", "Town 6 Seneschal", "Town 6 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_red_gambeson, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000010360b01cef8b57553d34e], ["town_7_seneschal", "Town 7 Seneschal", "Town 7 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_leather_jerkin, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000000018101f9487aa831dce4], ["town_8_seneschal", "Town 8 Seneschal", "Town 8 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_red_gambeson, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000004715201ea236c60a2bcae], ["town_9_seneschal", "Town 9 Seneschal", "Town 9 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550], ["town_10_seneschal", "Town 10 Seneschal", "Town 10 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_leather_jerkin, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000010230c01ef41badb50465e], ["town_11_seneschal", "Town 11 Seneschal", "Town 11 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_leather_jacket, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008061301fb89acfb95332f], ["town_12_seneschal", "Town 12 Seneschal", "Town 12 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c13ce01dc4723ab936c82], ["town_13_seneschal", "Town 13 Seneschal", "Town 13 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_leather_jerkin, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000008548e01d952a9b25d6d5a], ["town_14_seneschal", "Town 14 Seneschal", "Town 14 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004728b01c293c694944b05], ["town_15_seneschal", "Town 15 Seneschal", "Town 14 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004728b01c293c694944b05], ["town_16_seneschal", "Town 16 Seneschal", "Town 14 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004728b01c293c694944b05], ["town_17_seneschal", "Town 17 Seneschal", "Town 14 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004728b01c293c694944b05], ["town_18_seneschal", "Town 18 Seneschal", "Town 14 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004728b01c293c694944b05], ["castle_1_seneschal", "Castle 1 Seneschal", "Castle 1 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_coarse_tunic, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000010360b01cef8b57553d34e], ["castle_2_seneschal", "Castle 2 Seneschal", "Castle 2 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_nomad_armor, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000008061301fb89acfb95332f], ["castle_3_seneschal", "Castle 3 Seneschal", "Castle 3 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008548e01d952a9b25d6d5a], ["castle_4_seneschal", "Castle 4 Seneschal", "Castle 4 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_linen_tunic, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004715201ea236c60a2bcae], ["castle_5_seneschal", "Castle 5 Seneschal", "Castle 5 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jerkin, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c500e01dbb2115a55f3cd], ["castle_6_seneschal", "Castle 6 Seneschal", "Castle 6 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c03cc01cc34a9a467fdfd], ["castle_7_seneschal", "Castle 7 Seneschal", "Castle 7 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000c13ce01dc4723ab936c82], ["castle_8_seneschal", "Castle 8 Seneschal", "Castle 8 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c218501ef4f5d2ccb0026], ["castle_9_seneschal", "Castle 9 Seneschal", "Castle 9 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jacket, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008035201e6eebaf3f3eb2b], ["castle_10_seneschal", "Castle 10 Seneschal", "Castle 10 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550], ["castle_11_seneschal", "Castle 11 Seneschal", "Castle 11 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550], ["castle_12_seneschal", "Castle 2 Seneschal", "Castle 2 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_nomad_armor, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000008061301fb89acfb95332f], ["castle_13_seneschal", "Castle 3 Seneschal", "Castle 3 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008548e01d952a9b25d6d5a], ["castle_14_seneschal", "Castle 4 Seneschal", "Castle 4 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_linen_tunic, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004715201ea236c60a2bcae], ["castle_15_seneschal", "Castle 5 Seneschal", "Castle 5 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jerkin, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c500e01dbb2115a55f3cd], ["castle_16_seneschal", "Castle 6 Seneschal", "Castle 6 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c03cc01cc34a9a467fdfd], ["castle_17_seneschal", "Castle 7 Seneschal", "Castle 7 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000c13ce01dc4723ab936c82], ["castle_18_seneschal", "Castle 8 Seneschal", "Castle 8 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c218501ef4f5d2ccb0026], ["castle_19_seneschal", "Castle 9 Seneschal", "Castle 9 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jacket, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008035201e6eebaf3f3eb2b], ["castle_20_seneschal", "Castle 20 Seneschal", "Castle 20 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550], ["castle_21_seneschal", "Castle 11 Seneschal", "Castle 11 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550], ["castle_22_seneschal", "Castle 2 Seneschal", "Castle 2 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_nomad_armor, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000008061301fb89acfb95332f], ["castle_23_seneschal", "Castle 3 Seneschal", "Castle 3 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008548e01d952a9b25d6d5a], ["castle_24_seneschal", "Castle 4 Seneschal", "Castle 4 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_linen_tunic, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004715201ea236c60a2bcae], ["castle_25_seneschal", "Castle 5 Seneschal", "Castle 5 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jerkin, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c500e01dbb2115a55f3cd], ["castle_26_seneschal", "Castle 6 Seneschal", "Castle 6 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c03cc01cc34a9a467fdfd], ["castle_27_seneschal", "Castle 7 Seneschal", "Castle 7 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000c13ce01dc4723ab936c82], ["castle_28_seneschal", "Castle 8 Seneschal", "Castle 8 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c218501ef4f5d2ccb0026], ["castle_29_seneschal", "Castle 9 Seneschal", "Castle 9 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jacket, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008035201e6eebaf3f3eb2b], ["castle_30_seneschal", "Castle 20 Seneschal", "Castle 20 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550], ["castle_31_seneschal", "Castle 11 Seneschal", "Castle 11 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550], ["castle_32_seneschal", "Castle 2 Seneschal", "Castle 2 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_nomad_armor, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000008061301fb89acfb95332f], ["castle_33_seneschal", "Castle 3 Seneschal", "Castle 3 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008548e01d952a9b25d6d5a], ["castle_34_seneschal", "Castle 4 Seneschal", "Castle 4 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_linen_tunic, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x000000000004715201ea236c60a2bcae], ["castle_35_seneschal", "Castle 5 Seneschal", "Castle 5 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jerkin, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c500e01dbb2115a55f3cd], ["castle_36_seneschal", "Castle 6 Seneschal", "Castle 6 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_coarse_tunic, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c03cc01cc34a9a467fdfd], ["castle_37_seneschal", "Castle 7 Seneschal", "Castle 7 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000c13ce01dc4723ab936c82], ["castle_38_seneschal", "Castle 8 Seneschal", "Castle 8 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common, 0x00000000000c218501ef4f5d2ccb0026], ["castle_39_seneschal", "Castle 9 Seneschal", "Castle 9 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_leather_jacket, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, 0x000000000008035201e6eebaf3f3eb2b], ["castle_40_seneschal", "Castle 20 Seneschal", "Castle 20 Seneschal", tf_hero|tf_is_merchant, 0,reserved, fac_neutral,[itm_padded_leather, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, 0x00000000000440c601e1cd45cfb38550], #Arena Masters ["town_1_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_1_arena|entry(52),reserved, fac_commoners,[itm_coarse_tunic, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_2_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_2_arena|entry(52),reserved, fac_commoners,[itm_linen_tunic, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_3_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_3_arena|entry(52),reserved, fac_commoners,[itm_nomad_armor, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_4_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_4_arena|entry(52),reserved, fac_commoners,[itm_coarse_tunic, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_5_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_5_arena|entry(52),reserved, fac_commoners,[itm_linen_tunic, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_6_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_6_arena|entry(52),reserved, fac_commoners,[itm_leather_jerkin, itm_leather_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_7_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_7_arena|entry(52),reserved, fac_commoners,[itm_padded_leather, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_8_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_8_arena|entry(52),reserved, fac_commoners,[itm_linen_tunic, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_9_arena_master", "Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_9_arena|entry(52),reserved, fac_commoners,[itm_padded_leather, itm_leather_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_10_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_10_arena|entry(52),reserved, fac_commoners,[itm_nomad_armor, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_11_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_11_arena|entry(52),reserved, fac_commoners,[itm_coarse_tunic, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_12_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_12_arena|entry(52),reserved, fac_commoners,[itm_leather_jerkin, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_13_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_13_arena|entry(52),reserved, fac_commoners,[itm_coarse_tunic, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_14_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_14_arena|entry(52),reserved, fac_commoners,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_15_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_15_arena|entry(52),reserved, fac_commoners,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_16_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_16_arena|entry(52),reserved, fac_commoners,[itm_fur_coat, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_17_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_17_arena|entry(52),reserved, fac_commoners,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], ["town_18_arena_master","Tournament Master","Tournament Master",tf_hero|tf_randomize_face, scn_town_18_arena|entry(52),reserved, fac_commoners,[itm_padded_leather, itm_hide_boots], def_attrib|level(2),wp(20),knows_common,man_face_middle_1, man_face_older_2], # Underground ## ["town_1_crook","Town 1 Crook","Town 1 Crook",tf_hero, 0,0, fac_neutral,[itm_linen_tunic, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, 0x000000000004428401f46e44a27144e3], ## ["town_2_crook","Town 2 Crook","Town 2 Crook",tf_hero|tf_female, 0,0, fac_neutral,[itm_lady_dress_ruby, itm_turret_hat_ruby ],def_attrib|level(2),wp(20),knows_inventory_management_10, 0x000000000004300101c36db6db6db6db], ## ["town_3_crook","Town 3 Crook","Town 3 Crook",tf_hero, 0,0, fac_neutral,[itm_leather_apron, itm_hide_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, 0x00000000000c530701f17944a25164e1], ## ["town_4_crook","Town 4 Crook","Town 4 Crook",tf_hero, 0,0, fac_neutral,[itm_coarse_tunic, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x00000000000c840501f36db6db7134db], ## ["town_5_crook","Town 5 Crook","Town 5 Crook",tf_hero, 0,0, fac_neutral,[itm_red_gambeson, itm_blue_hose ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x00000000000c000601f36db6db7134db], ## ["town_6_crook","Town 6 Crook","Town 6 Crook",tf_hero, 0,0, fac_neutral,[itm_coarse_tunic, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x00000000000c10c801db6db6dd7598aa], ## ["town_7_crook","Town 7 Crook","Town 7 Crook",tf_hero|tf_female, 0,0, fac_neutral,[itm_woolen_dress, itm_woolen_hood ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x000000000010214101de2f64db6db58d], ## ## ["town_8_crook","Town 8 Crook","Town 8 Crook",tf_hero, 0,0, fac_neutral,[itm_leather_jacket, itm_leather_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x000000000010318401c96db4db6db58d], ## ["town_9_crook","Town 9 Crook","Town 9 Crook",tf_hero, 0,0, fac_neutral,[itm_linen_tunic, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x000000000008520501f16db4db6db58d], ## ["town_10_crook","Town 10 Crook","Town 10 Crook",tf_hero, 0,0, fac_neutral,[itm_coarse_tunic, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x000000000008600701f35144db6db8a2], ## ["town_11_crook","Town 11 Crook","Town 11 Crook",tf_hero|tf_female, 0,0, fac_neutral,[itm_blue_dress, itm_wimple_with_veil ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x000000000008408101f386c4db4dd514], ## ["town_12_crook","Town 12 Crook","Town 12 Crook",tf_hero, 0,0, fac_neutral,[itm_coarse_tunic, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x00000000000870c501f386c4f34dbaa1], ## ["town_13_crook","Town 13 Crook","Town 13 Crook",tf_hero, 0,0, fac_neutral,[itm_blue_gambeson, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x00000000000c114901f245caf34dbaa1], ## ["town_14_crook","Town 14 Crook","Town 14 Crook",tf_hero|tf_female, 0,0, fac_neutral,[itm_woolen_dress, itm_turret_hat_ruby ],def_attrib|level(5),wp(20),knows_inventory_management_10, 0x00000000001021c001f545a49b6eb2bc], # Armor Merchants #arena_masters_end = zendar_armorer ["town_1_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_2_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face|tf_female|tf_is_merchant, 0, 0, fac_commoners,[itm_woolen_dress, itm_straw_hat ],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], ["town_3_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_arena_tunic_red, itm_hide_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_4_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_red_gambeson, itm_leather_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_5_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_6_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_fur_coat, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_7_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jerkin, itm_blue_hose ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_8_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_padded_leather, itm_leather_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_9_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_blue_gambeson, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_10_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jerkin, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_11_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_fur_coat, itm_leather_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_12_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_red_gambeson, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_13_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jacket, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_14_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face|tf_female|tf_is_merchant, 0, 0, fac_commoners,[itm_woolen_dress, itm_headcloth ],def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], ["town_15_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_blue_gambeson, itm_leather_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_16_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_fur_coat, itm_nomad_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_17_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_fur_coat, itm_hide_boots ],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_18_armorer","Armorer", "Armorer", tf_hero|tf_randomize_face|tf_female|tf_is_merchant, 0, 0, fac_commoners,[itm_woolen_dress, itm_headcloth ],def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], # Weapon merchants ["town_1_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face|tf_female|tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_hide_boots,itm_straw_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], ["town_2_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_shirt, itm_nomad_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_3_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_fur_coat, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_4_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_shirt, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_5_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jerkin, itm_wrapping_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_6_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_7_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_shirt, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_8_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face|tf_female|tf_is_merchant, 0, 0, fac_commoners,[itm_woolen_dress, itm_wrapping_boots,itm_straw_hat],def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], ["town_9_weaponsmith", "Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jerkin, itm_leather_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_10_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_11_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jacket, itm_woolen_hose],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_12_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_shirt, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_13_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_arena_tunic_red, itm_wrapping_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_14_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_arena_tunic_blue, itm_wrapping_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_15_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jacket, itm_woolen_hose],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_16_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_shirt, itm_hide_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_17_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_arena_tunic_green, itm_wrapping_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], ["town_18_weaponsmith","Weaponsmith","Weaponsmith",tf_hero|tf_randomize_face| tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_wrapping_boots],def_attrib|level(5),wp(20),knows_inventory_management_10, mercenary_face_1, mercenary_face_2], #Tavern keepers ["town_1_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_1_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2], ["town_2_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_2_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_leather_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2], ["town_3_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_3_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_hide_boots],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2], ["town_4_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_4_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_leather_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2], ["town_5_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_5_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_hide_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2], ["town_6_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_6_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_hide_boots],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2], ["town_7_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_7_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_leather_boots, itm_headcloth],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2], ["town_8_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_8_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_leather_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2], ["town_9_tavernkeeper", "Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_9_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2], ["town_10_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_10_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_hide_boots],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2], ["town_11_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_11_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2], ["town_12_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_12_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_hide_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2], ["town_13_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_13_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_hide_boots, itm_headcloth],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2], ["town_14_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_14_tavern|entry(9),0, fac_commoners,[itm_shirt, itm_leather_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2], ["town_15_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_15_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_nomad_boots],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2], ["town_16_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_16_tavern|entry(9),0, fac_commoners,[itm_leather_apron, itm_hide_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2], ["town_17_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face|tf_female, scn_town_17_tavern|entry(9),0, fac_commoners,[itm_woolen_dress, itm_hide_boots, itm_headcloth],def_attrib|level(2),wp(20),knows_common, woman_face_1, woman_face_2], ["town_18_tavernkeeper","Tavern_Keeper","Tavern_Keeper",tf_hero|tf_randomize_face, scn_town_18_tavern|entry(9),0, fac_commoners,[itm_shirt, itm_leather_boots],def_attrib|level(2),wp(20),knows_common, mercenary_face_1, mercenary_face_2], #Goods Merchants ["town_1_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_1_store|entry(9),0, fac_commoners, [itm_coarse_tunic, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_2_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_2_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_3_merchant", "Merchant","Merchant",tf_female|tf_hero|tf_randomize_face|tf_is_merchant, scn_town_3_store|entry(9),0, fac_commoners, [itm_dress, itm_leather_boots, itm_straw_hat ],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], ["town_4_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_4_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_5_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_5_store|entry(9),0, fac_commoners, [itm_nomad_armor, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_6_merchant", "Merchant","Merchant",tf_female|tf_hero|tf_randomize_face|tf_is_merchant, scn_town_6_store|entry(9),0, fac_commoners, [itm_woolen_dress, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_7_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_7_store|entry(9),0, fac_commoners, [itm_leather_jerkin,itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_8_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_8_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_9_merchant", "Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_9_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_10_merchant","Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_10_store|entry(9),0, fac_commoners, [itm_leather_jerkin,itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_11_merchant","Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_11_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_12_merchant","Merchant","Merchant",tf_female|tf_hero|tf_randomize_face|tf_is_merchant, scn_town_12_store|entry(9),0, fac_commoners, [itm_woolen_dress, itm_leather_boots, itm_female_hood ],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], ["town_13_merchant","Merchant","Merchant",tf_female|tf_hero|tf_randomize_face|tf_is_merchant, scn_town_13_store|entry(9),0, fac_commoners, [itm_dress, itm_leather_boots, itm_straw_hat ],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], ["town_14_merchant","Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_14_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_15_merchant","Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_15_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_16_merchant","Merchant","Merchant",tf_female|tf_hero|tf_randomize_face|tf_is_merchant, scn_town_16_store|entry(9),0, fac_commoners, [itm_woolen_dress, itm_leather_boots, itm_female_hood ],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], ["town_17_merchant","Merchant","Merchant",tf_female|tf_hero|tf_randomize_face|tf_is_merchant, scn_town_17_store|entry(9),0, fac_commoners, [itm_dress, itm_leather_boots, itm_straw_hat ],def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], ["town_18_merchant","Merchant","Merchant", tf_hero|tf_randomize_face|tf_is_merchant, scn_town_18_store|entry(9),0, fac_commoners, [itm_leather_apron, itm_leather_boots ],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["salt_mine_merchant","Barezan","Barezan", tf_hero|tf_is_merchant, scn_salt_mine|entry(1),0, fac_commoners, [itm_leather_apron, itm_leather_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, 0x00000000000c528601ea69b6e46dbdb6], # Horse Merchants ["town_1_horse_merchant","Horse Merchant","Town 1 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant|tf_female, 0, 0, fac_commoners,[itm_blue_dress, itm_blue_hose, itm_female_hood], def_attrib|level(2),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], ["town_2_horse_merchant","Horse Merchant","Town 2 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_linen_tunic, itm_nomad_boots,], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_3_horse_merchant","Horse Merchant","Town 3 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_nomad_armor, itm_hide_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_4_horse_merchant","Horse Merchant","Town 4 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jerkin, itm_nomad_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_5_horse_merchant","Horse Merchant","Town 5 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant|tf_female, 0, 0, fac_commoners,[itm_dress, itm_woolen_hose, itm_woolen_hood], def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], ["town_6_horse_merchant","Horse Merchant","Town 6 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_coarse_tunic, itm_hide_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_7_horse_merchant","Horse Merchant","Town 7 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_coarse_tunic, itm_leather_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_8_horse_merchant","Horse Merchant","Town 8 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_coarse_tunic, itm_hide_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_9_horse_merchant","Horse Merchant","Town 9 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jerkin, itm_woolen_hose], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_10_horse_merchant","Horse Merchant","Town 10 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant|tf_female, 0, 0, fac_commoners,[itm_blue_dress, itm_blue_hose, itm_straw_hat], def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], ["town_11_horse_merchant","Horse Merchant","Town 11 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_nomad_armor, itm_leather_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_12_horse_merchant","Horse Merchant","Town 12 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jacket, itm_hide_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_13_horse_merchant","Horse Merchant","Town 13 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_14_horse_merchant","Horse Merchant","Town 14 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant|tf_female, 0, 0, fac_commoners,[itm_peasant_dress, itm_blue_hose, itm_headcloth], def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], ["town_15_horse_merchant","Horse Merchant","Town 15 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_nomad_armor, itm_leather_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_16_horse_merchant","Horse Merchant","Town 16 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_leather_jacket, itm_hide_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_17_horse_merchant","Horse Merchant","Town 17 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant, 0, 0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots], def_attrib|level(5),wp(20),knows_inventory_management_10, man_face_young_1, man_face_older_2], ["town_18_horse_merchant","Horse Merchant","Town 18 Horse Merchant",tf_hero|tf_randomize_face|tf_is_merchant|tf_female, 0, 0, fac_commoners,[itm_peasant_dress, itm_blue_hose, itm_headcloth], def_attrib|level(5),wp(20),knows_inventory_management_10, woman_face_1, woman_face_2], #Town Mayors #itm_courtly_outfit itm_gambeson itm_blue_gambeson itm_red_gambeson itm_nobleman_outfit itm_rich_outfit ["town_1_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_courtly_outfit, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_2_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_gambeson, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_3_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_4_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_fur_coat, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_5_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_nobleman_outfit, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_6_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_red_gambeson, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_7_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_rich_outfit, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_8_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_red_gambeson, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_9_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_courtly_outfit, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_10_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_leather_jerkin, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_11_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_leather_jacket, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_12_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_red_gambeson, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_13_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_nobleman_outfit, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_14_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_15_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_leather_jacket, itm_nomad_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_16_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_fur_coat, itm_leather_boots], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_17_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_nobleman_outfit, itm_woolen_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], ["town_18_mayor", "Guild_Master", "Guild_Master", tf_hero|tf_randomize_face, 0,reserved, fac_neutral,[ itm_blue_gambeson, itm_blue_hose], def_attrib|level(2),wp(20),knows_common, man_face_middle_1, mercenary_face_2], #Village stores ["village_1_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_2_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_3_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_4_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_5_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_6_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_7_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_8_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_9_elder", "Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_10_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_11_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_12_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_13_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_14_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_15_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_16_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_leather_warrior_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_17_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_18_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_leather_warrior_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_19_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots, itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_20_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_leather_warrior_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_21_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_22_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_23_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_24_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_25_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_26_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_27_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_28_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_29_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_30_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_31_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_32_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_33_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_34_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_35_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_36_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_37_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_38_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_39_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_40_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_41_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_42_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_43_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_44_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_45_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_46_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_47_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_48_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_49_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_50_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_51_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_52_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_53_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_54_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_55_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_56_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_57_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_58_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_59_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_60_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_61_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_62_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_63_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_64_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_65_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_66_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_67_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_68_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_69_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_70_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_71_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_72_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_73_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_74_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_75_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_76_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_77_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_wrapping_boots, itm_felt_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_78_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_79_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_80_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_81_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_82_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_83_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_wrapping_boots, itm_leather_cap],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_84_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots,itm_fur_hat],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_85_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_86_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_87_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_88_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_fur_coat, itm_hide_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_89_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_coarse_tunic, itm_nomad_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], ["village_90_elder","Village_Elder", "village_1_elder",tf_hero|tf_randomize_face|tf_is_merchant, 0,0, fac_commoners,[itm_robe, itm_wrapping_boots],def_attrib|level(2),wp(20),knows_inventory_management_10, man_face_old_1, man_face_older_2], # Place extra merchants before this point ["merchants_end","merchants_end","merchants_end",tf_hero, 0,0, fac_commoners,[],def_attrib|level(2),wp(20),knows_inventory_management_10,0], # Chests ["zendar_chest","Zendar Chest","Zendar Chest",tf_hero|tf_inactive, 0,reserved, fac_neutral, [],def_attrib|level(18),wp(60),knows_common, 0], ["tutorial_chest_1","Melee Weapons Chest","Melee Weapons Chest",tf_hero|tf_inactive, 0,reserved, fac_neutral,[itm_tutorial_sword, itm_tutorial_axe, itm_tutorial_spear, itm_tutorial_club, itm_tutorial_battle_axe],def_attrib|level(18),wp(60),knows_common, 0], ["tutorial_chest_2","Ranged Weapons Chest","Ranged Weapons Chest",tf_hero|tf_inactive, 0,reserved, fac_neutral,[itm_tutorial_short_bow, itm_tutorial_arrows, itm_tutorial_crossbow, itm_tutorial_bolts, itm_tutorial_throwing_daggers],def_attrib|level(18),wp(60),knows_common, 0], ["bonus_chest_1","Bonus Chest","Bonus Chest",tf_hero|tf_inactive, 0,reserved, fac_neutral,[itm_strange_armor,itm_strange_short_sword],def_attrib|level(18),wp(60),knows_common, 0], ["bonus_chest_2","Bonus Chest","Bonus Chest",tf_hero|tf_inactive, 0,reserved, fac_neutral,[itm_strange_boots,itm_strange_sword],def_attrib|level(18),wp(60),knows_common, 0], ["bonus_chest_3","Bonus Chest","Bonus Chest",tf_hero|tf_inactive, 0,reserved, fac_neutral,[itm_strange_helmet,itm_strange_great_sword],def_attrib|level(18),wp(60),knows_common, 0], # These are used as arrays in the scripts. ["temp_array_a","temp_array_a","temp_array_a",tf_hero|tf_inactive, 0,reserved, fac_neutral,[],def_attrib|level(18),wp(60),knows_common, 0], ["temp_array_b","temp_array_b","temp_array_b",tf_hero|tf_inactive, 0,reserved, fac_neutral,[],def_attrib|level(18),wp(60),knows_common, 0], ["temp_array_c","temp_array_c","temp_array_c",tf_hero|tf_inactive, 0,reserved, fac_neutral,[],def_attrib|level(18),wp(60),knows_common, 0], ["stack_selection_amounts","stack_selection_amounts","stack_selection_amounts",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0], ["stack_selection_ids","stack_selection_ids","stack_selection_ids",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0], ["notification_menu_types","notification_menu_types","notification_menu_types",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0], ["notification_menu_var1","notification_menu_var1","notification_menu_var1",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0], ["notification_menu_var2","notification_menu_var2","notification_menu_var2",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0], ["banner_background_color_array","banner_background_color_array","banner_background_color_array",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0], ## ["black_khergit_guard","Black Khergit Guard","Black Khergit Guard",tf_mounted|tf_guarantee_ranged|tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_helmet|tf_guarantee_armor|tf_guarantee_horse,0,0,fac_black_khergits, ## [itm_arrows,itm_nomad_sabre,itm_scimitar,itm_winged_mace,itm_lance,itm_khergit_bow,itm_khergit_guard_helmet,itm_khergit_cavalry_helmet,itm_khergit_guard_boots,itm_khergit_guard_armor,itm_nomad_shield,itm_steppe_horse,itm_warhorse], ## def_attrib|level(28),wp(140),knows_riding_6|knows_ironflesh_4|knows_horse_archery_6|knows_power_draw_6,khergit_face1, khergit_face2], # Add Extra Quest NPCs below this point ["local_merchant","Local Merchant","Local Merchants",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2], ["tax_rebel","Peasant Rebel","Peasant Rebels",tf_guarantee_armor,0,reserved,fac_commoners, [itm_cleaver,itm_knife,itm_pitch_fork,itm_sickle,itm_club,itm_stones,itm_leather_cap,itm_felt_hat,itm_felt_hat,itm_linen_tunic,itm_coarse_tunic,itm_nomad_boots,itm_wrapping_boots], def_attrib|level(4),wp(60),knows_common,vaegir_face1, vaegir_face2], ["trainee_peasant","Peasant","Peasants",tf_guarantee_armor,0,reserved,fac_commoners, [itm_cleaver,itm_knife,itm_pitch_fork,itm_sickle,itm_club,itm_stones,itm_leather_cap,itm_felt_hat,itm_felt_hat,itm_linen_tunic,itm_coarse_tunic,itm_nomad_boots,itm_wrapping_boots], def_attrib|level(4),wp(60),knows_common,vaegir_face1, vaegir_face2], ["fugitive","Nervous Man","Nervous Men",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners, [itm_short_tunic,itm_linen_tunic,itm_coarse_tunic, itm_tabard, itm_leather_vest, itm_woolen_hose, itm_nomad_boots, itm_blue_hose, itm_wrapping_boots, itm_fur_hat, itm_leather_cap, itm_sword_medieval_b, itm_throwing_daggers], def_attrib|str_24|agi_25|level(26),wp(180),knows_common|knows_power_throw_6|knows_power_strike_6|knows_ironflesh_9,man_face_middle_1, man_face_old_2], ["spy","Ordinary Townsman","Ordinary Townsmen", tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse,0,0,fac_neutral, [itm_sword_viking_1,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves], def_attrib|agi_11|level(20),wp(130),knows_common,man_face_middle_1, man_face_older_2], ["spy_partner","Unremarkable Townsman","Unremarkable Townsmen", tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse,0,0,fac_neutral, [itm_sword_medieval_b,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves], def_attrib|agi_11|level(10),wp(130),knows_common,vaegir_face1, vaegir_face2], ## ["conspirator","Conspirator","Conspirators", tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse,0,0,fac_neutral, ## [itm_sword,itm_leather_jerkin,itm_leather_boots,itm_hunter,itm_leather_gloves], ## def_attrib|agi_11|level(10),wp(130),knows_common,vaegir_face1, vaegir_face2], ## ["conspirator_leader","Conspirator","Conspirators", tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse,0,0,fac_neutral, ## [itm_sword,itm_leather_jerkin,itm_leather_boots,itm_hunter,itm_leather_gloves], ## def_attrib|agi_11|level(10),wp(130),knows_common,vaegir_face1, vaegir_face2], ## ["peasant_rebel","Peasant Rebel","Peasant Rebels",tf_guarantee_armor,0,reserved,fac_peasant_rebels, ## [itm_cleaver,itm_knife,itm_pitch_fork,itm_sickle,itm_club,itm_stones,itm_leather_cap,itm_felt_hat,itm_felt_hat,itm_linen_tunic,itm_coarse_tunic,itm_nomad_boots,itm_wrapping_boots], ## def_attrib|level(4),wp(60),knows_common,vaegir_face1, vaegir_face2], ## ["noble_refugee","Noble Refugee","Noble Refugees",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_noble_refugees, ## [itm_sword,itm_leather_jacket,itm_hide_boots, itm_saddle_horse, itm_leather_jacket, itm_leather_cap], ## def_attrib|level(9),wp(100),knows_common,swadian_face1, swadian_face2], ## ["noble_refugee_woman","Noble Refugee Woman","Noble Refugee Women",tf_female|tf_guarantee_armor|tf_guarantee_boots,0,0,fac_noble_refugees, ## [itm_knife,itm_dagger,itm_hunting_crossbow,itm_dress,itm_robe,itm_woolen_dress, itm_headcloth, itm_woolen_hood, itm_wrapping_boots], ## def_attrib|level(3),wp(45),knows_common,refugee_face1,refugee_face2], ["quick_battle_6_player", "quick_battle_6_player", "quick_battle_6_player", tf_hero, 0, reserved, fac_player_faction, [itm_padded_cloth,itm_nomad_boots, itm_splinted_leather_greaves, itm_skullcap, itm_sword_medieval_b, itm_crossbow, itm_bolts, itm_plate_covered_round_shield], knight_attrib_1,wp(130),knight_skills_1, 0x000000000008010b01f041a9249f65fd], #Player history array ["log_array_entry_type", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2], ["log_array_entry_time", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2], ["log_array_actor", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2], ["log_array_center_object", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2], ["log_array_center_object_lord", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2], ["log_array_center_object_faction", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2], ["log_array_troop_object", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2], ["log_array_troop_object_faction", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2], ["log_array_faction_object", "Local Merchant","Local Merchant",tf_guarantee_boots|tf_guarantee_armor, 0,0, fac_commoners,[itm_leather_apron,itm_leather_boots,itm_butchering_knife],def_attrib|level(5),wp(40),knows_power_strike_1, merchant_face_1, merchant_face_2], ] #Troop upgrade declarations upgrade(troops,"farmer", "watchman") upgrade(troops,"townsman","watchman") upgrade2(troops,"watchman","caravan_guard","mercenary_crossbowman") upgrade2(troops,"caravan_guard","mercenary_swordsman","mercenary_horseman") upgrade(troops,"mercenary_swordsman","hired_blade") upgrade(troops,"mercenary_horseman","mercenary_cavalry") upgrade(troops,"swadian_recruit","swadian_militia") upgrade2(troops,"swadian_militia","swadian_footman","swadian_skirmisher") upgrade2(troops,"swadian_footman","swadian_man_at_arms","swadian_infantry") upgrade(troops,"swadian_infantry","swadian_sergeant") upgrade(troops,"swadian_skirmisher","swadian_crossbowman") upgrade(troops,"swadian_crossbowman","swadian_sharpshooter") upgrade(troops,"swadian_man_at_arms","swadian_knight") upgrade(troops,"vaegir_recruit","vaegir_footman") upgrade2(troops,"vaegir_footman","vaegir_veteran","vaegir_skirmisher") upgrade(troops,"vaegir_skirmisher","vaegir_archer") upgrade(troops,"vaegir_archer","vaegir_marksman") upgrade2(troops,"vaegir_veteran","vaegir_horseman","vaegir_infantry") upgrade(troops,"vaegir_infantry","vaegir_guard") upgrade(troops,"vaegir_horseman","vaegir_knight") upgrade(troops,"khergit_tribesman","khergit_skirmisher") upgrade(troops,"khergit_skirmisher","khergit_horseman") upgrade2(troops,"khergit_horseman","khergit_lancer","khergit_horse_archer") upgrade(troops,"khergit_horse_archer","khergit_veteran_horse_archer") upgrade2(troops,"nord_recruit","nord_footman","nord_huntsman") upgrade(troops,"nord_footman","nord_trained_footman") upgrade(troops,"nord_trained_footman","nord_warrior") upgrade(troops,"nord_warrior","nord_veteran") upgrade(troops,"nord_veteran","nord_champion") upgrade(troops,"nord_huntsman","nord_archer") upgrade(troops,"nord_archer","nord_veteran_archer") upgrade2(troops,"rhodok_tribesman","rhodok_spearman","rhodok_crossbowman") upgrade(troops,"rhodok_spearman","rhodok_trained_spearman") upgrade(troops,"rhodok_trained_spearman","rhodok_veteran_spearman") upgrade(troops,"rhodok_veteran_spearman","rhodok_sergeant") upgrade(troops,"rhodok_crossbowman","rhodok_trained_crossbowman") upgrade(troops,"rhodok_trained_crossbowman","rhodok_sharpshooter") upgrade2(troops,"looter","mountain_bandit", "forest_bandit") upgrade2(troops,"bandit","brigand","mercenary_swordsman") upgrade(troops,"manhunter","slave_driver") #upgrade(troops,"forest_bandit","mercenary_crossbowman") upgrade(troops,"slave_driver","slave_hunter") upgrade(troops,"slave_hunter","slave_crusher") upgrade(troops,"slave_crusher","slaver_chief") upgrade(troops,"follower_woman","hunter_woman") upgrade(troops,"hunter_woman","fighter_woman") upgrade(troops,"fighter_woman","sword_sister") upgrade(troops,"refugee","follower_woman") upgrade(troops,"peasant_woman","follower_woman")
Python
from module_constants import * from header_items import * from header_operations import * from header_triggers import * #################################################################################################################### # Each item record contains the following fields: # 1) Item id: used for referencing items in other files. # The prefix itm_ is automatically added before each item id. # 2) Item name. Name of item as it'll appear in inventory window # 3) List of meshes. Each mesh record is a tuple containing the following fields: # 3.1) Mesh name. # 3.2) Modifier bits that this mesh matches. # Note that the first mesh record is the default. # 4) Item flags. See header_items.py for a list of available flags. # 5) Item capabilities. Used for which animations this item is used with. See header_items.py for a list of available flags. # 6) Item value. # 7) Item stats: Bitwise-or of various stats about the item such as: # weight, abundance, difficulty, head_armor, body_armor,leg_armor, etc... # 8) Modifier bits: Modifiers that can be applied to this item. # 9) [Optional] Triggers: List of simple triggers to be associated with the item. #################################################################################################################### # Some constants for ease of use. imodbits_none = 0 imodbits_horse_basic = imodbit_swaybacked|imodbit_lame|imodbit_spirited|imodbit_heavy|imodbit_stubborn imodbits_cloth = imodbit_tattered | imodbit_ragged | imodbit_sturdy | imodbit_thick | imodbit_hardened imodbits_armor = imodbit_rusty | imodbit_battered | imodbit_crude | imodbit_thick | imodbit_reinforced |imodbit_lordly imodbits_plate = imodbit_cracked | imodbit_rusty | imodbit_battered | imodbit_crude | imodbit_thick | imodbit_reinforced |imodbit_lordly imodbits_polearm = imodbit_cracked | imodbit_bent | imodbit_balanced imodbits_shield = imodbit_cracked | imodbit_battered |imodbit_thick | imodbit_reinforced imodbits_sword = imodbit_rusty | imodbit_chipped | imodbit_balanced |imodbit_tempered imodbits_sword_high = imodbit_rusty | imodbit_chipped | imodbit_balanced |imodbit_tempered|imodbit_masterwork imodbits_axe = imodbit_rusty | imodbit_chipped | imodbit_balanced |imodbit_heavy imodbits_mace = imodbit_rusty | imodbit_chipped | imodbit_balanced |imodbit_heavy imodbits_pick = imodbit_rusty | imodbit_chipped | imodbit_balanced | imodbit_heavy imodbits_bow = imodbit_cracked | imodbit_bent | imodbit_strong |imodbit_masterwork imodbits_crossbow = imodbit_cracked | imodbit_bent | imodbit_masterwork imodbits_missile = imodbit_bent | imodbit_large_bag imodbits_thrown = imodbit_bent | imodbit_heavy| imodbit_balanced| imodbit_large_bag imodbits_horse_good = imodbit_spirited|imodbit_heavy imodbits_good = imodbit_sturdy | imodbit_thick | imodbit_hardened | imodbit_reinforced imodbits_bad = imodbit_rusty | imodbit_chipped | imodbit_tattered | imodbit_ragged | imodbit_cracked | imodbit_bent # Replace winged mace/spiked mace with: Flanged mace / Knobbed mace? # Fauchard (majowski glaive) items = [ # item_name, mesh_name, item_properties, item_capabilities, slot_no, cost, bonus_flags, weapon_flags, scale, view_dir, pos_offset ["no_item","INVALID ITEM", [("practice_sword",0)], itp_type_one_handed_wpn|itp_primary|itp_secondary, itc_longsword, 3,weight(1.5)|spd_rtng(103)|weapon_length(90)|swing_damage(16,blunt)|thrust_damage(10,blunt),imodbits_none], ["horse_meat","Horse Meat", [("raw_meat",0)], itp_type_goods|itp_consumable|itp_food, 0, 12,weight(40)|food_quality(30)|max_ammo(40),imodbits_none], # Items before this point are hardwired and their order should not be changed! ["practice_sword","Practice Sword", [("practice_sword",0)], itp_type_one_handed_wpn|itp_primary|itp_secondary|itp_wooden_parry|itp_wooden_attack, itc_longsword, 3,weight(1.5)|spd_rtng(103)|weapon_length(90)|swing_damage(16,blunt)|thrust_damage(10,blunt),imodbits_none], ["heavy_practice_sword","Heavy Practice Sword", [("heavy_practicesword",0)], itp_type_two_handed_wpn|itp_two_handed|itp_primary|itp_wooden_parry|itp_wooden_attack, itc_greatsword, 21, weight(6.25)|spd_rtng(94)|weapon_length(128)|swing_damage(26,blunt)|thrust_damage(18,blunt),imodbits_none], ["practice_axe", "Practice Axe", [("hatchet",0)], itp_type_one_handed_wpn| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 24 , weight(2) | spd_rtng(95) | weapon_length(75) | swing_damage(20, blunt) | thrust_damage(0, pierce), imodbits_axe], ["arena_axe", "Axe", [("arena_axe",0)], itp_type_one_handed_wpn|itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 137 , weight(1.5)|spd_rtng(100) | weapon_length(69)|swing_damage(23 , blunt) | thrust_damage(0 , pierce),imodbits_axe ], ["arena_sword", "Sword", [("arena_sword_one_handed",0),("sword_medieval_b_scabbard", ixmesh_carry),], itp_type_one_handed_wpn|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 243 , weight(1.5)|spd_rtng(99) | weapon_length(95)|swing_damage(21 , blunt) | thrust_damage(20 , blunt),imodbits_sword_high ], ["arena_sword_two_handed", "Two Handed Sword", [("arena_sword_two_handed",0)], itp_type_two_handed_wpn|itp_two_handed|itp_primary, itc_greatsword|itcf_carry_sword_back, 670 , weight(2.75)|spd_rtng(93) | weapon_length(110)|swing_damage(29 , blunt) | thrust_damage(24 , blunt),imodbits_sword_high ], ["arena_lance", "Lance", [("arena_lance",0)], itp_type_polearm|itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear, 90 , weight(2.5)|spd_rtng(96) | weapon_length(150)|swing_damage(20 , blunt) | thrust_damage(25 , blunt),imodbits_polearm ], ["practice_staff","Practice Staff", [("wooden_staff",0)],itp_type_polearm|itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack,itc_staff|itcf_carry_sword_back,9, weight(2.5)|spd_rtng(103) | weapon_length(118)|swing_damage(16,blunt) | thrust_damage(16,blunt),imodbits_none], ["practice_lance","Practice Lance", [("joust_of_peace",0)], itp_type_polearm|itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack, itc_greatlance, 18,weight(4.25)|spd_rtng(58)|weapon_length(218)|swing_damage(0,blunt)|thrust_damage(15,blunt),imodbits_none], ["practice_shield","Practice Shield", [("shield_round_a",0)], itp_type_shield|itp_wooden_parry|itp_wooden_attack, 0, 20,weight(3.5)|body_armor(1)|hit_points(200)|spd_rtng(100)|weapon_length(50),imodbits_none], ["practice_bow","Practice Bow", [("hunting_bow",0), ("hunting_bow_carry",ixmesh_carry)], itp_type_bow |itp_primary|itp_two_handed,itcf_shoot_bow|itcf_carry_bow_back, 0, weight(1.5)|spd_rtng(90) | shoot_speed(40) | thrust_damage(19, blunt),imodbits_bow ], ## ("hunting_bow",0)], itp_type_bow|itp_two_handed|itp_primary|itp_attach_left_hand, itcf_shoot_bow, 4,weight(1.5)|spd_rtng(90)|shoot_speed(40)|thrust_damage(19,blunt),imodbits_none], ["practice_crossbow", "Practice Crossbow", [("crossbow",0)], itp_type_crossbow |itp_primary|itp_two_handed ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 0, weight(3)|spd_rtng(42)| shoot_speed(68) | thrust_damage(32,blunt)|max_ammo(1),imodbits_crossbow], ["practice_javelin", "Practice Javelin", [("javelin",0),("javelins_quiver", ixmesh_carry)], itp_type_thrown |itp_primary|itp_bonus_against_shield ,itcf_throw_javelin|itcf_carry_quiver_back|itcf_show_holster_when_drawn, 0, weight(5) | spd_rtng(91) | shoot_speed(28) | thrust_damage(27, blunt) | max_ammo(50) | weapon_length(75), imodbits_thrown], ["practice_throwing_daggers", "Throwing Daggers", [("throwing_dagger",0)], itp_type_thrown |itp_primary ,itcf_throw_knife, 0 , weight(3.5)|spd_rtng(102) | shoot_speed(25) | thrust_damage(16, blunt)|max_ammo(10)|weapon_length(0),imodbits_thrown ], ["practice_throwing_daggers_100_amount", "Throwing Daggers", [("throwing_dagger",0)], itp_type_thrown |itp_primary ,itcf_throw_knife, 0 , weight(3.5)|spd_rtng(102) | shoot_speed(25) | thrust_damage(16, blunt)|max_ammo(100)|weapon_length(0),imodbits_thrown ], # ["cheap_shirt","Cheap Shirt", [("shirt",0)], itp_type_body_armor|itp_covers_legs, 0, 4,weight(1.25)|body_armor(3),imodbits_none], ["practice_horse","Practice Horse", [("saddle_horse",0)], itp_type_horse, 0, 37,body_armor(10)|horse_speed(40)|horse_maneuver(37)|horse_charge(14),imodbits_none], ["practice_arrows","Practice Arrows", [("arena_arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(1.5)|weapon_length(95)|max_ammo(80),imodbits_missile], ## ["practice_arrows","Practice Arrows", [("arrow",0),("flying_missile",ixmesh_flying_ammo)], itp_type_arrows, 0, 31,weight(1.5)|weapon_length(95)|max_ammo(80),imodbits_none], ["practice_bolts","Practice Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag", ixmesh_carry),("bolt_bag_b", ixmesh_carry|imodbit_large_bag)], itp_type_bolts, itcf_carry_quiver_right_vertical, 0,weight(2.25)|weapon_length(55)|max_ammo(49),imodbits_missile], ["practice_arrows_10_amount","Practice Arrows", [("arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(1.5)|weapon_length(95)|max_ammo(10),imodbits_missile], ["practice_arrows_100_amount","Practice Arrows", [("arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(1.5)|weapon_length(95)|max_ammo(100),imodbits_missile], ["practice_bolts_9_amount","Practice Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag", ixmesh_carry),("bolt_bag_b", ixmesh_carry|imodbit_large_bag)], itp_type_bolts, itcf_carry_quiver_right_vertical, 0,weight(2.25)|weapon_length(55)|max_ammo(9),imodbits_missile], ["practice_boots", "Practice Boots", [("boot_nomad_a",0)], itp_type_foot_armor |itp_civilian | itp_attach_armature,0, 11 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(10), imodbits_cloth ], ["red_tourney_armor","Red Tourney Armor", [("tourn_armor_a",0)], itp_type_body_armor|itp_covers_legs, 0, 152,weight(15.0)|body_armor(20)|leg_armor(6),imodbits_none], ["blue_tourney_armor","Blue Tourney Armor", [("mail_shirt",0)], itp_type_body_armor|itp_covers_legs, 0, 152,weight(15.0)|body_armor(20)|leg_armor(6),imodbits_none], ["green_tourney_armor","Green Tourney Armor", [("leather_vest",0)], itp_type_body_armor|itp_covers_legs, 0, 152,weight(15.0)|body_armor(20)|leg_armor(6),imodbits_none], ["gold_tourney_armor","Gold Tourney Armor", [("padded_armor",0)], itp_type_body_armor|itp_covers_legs, 0, 152,weight(15.0)|body_armor(20)|leg_armor(6),imodbits_none], ["red_tourney_helmet","Red Tourney Helmet",[("flattop_helmet",0)],itp_type_head_armor,0,126, weight(2)|head_armor(16),imodbits_none], ["blue_tourney_helmet","Blue Tourney Helmet",[("segmented_helm",0)],itp_type_head_armor,0,126, weight(2)|head_armor(16),imodbits_none], ["green_tourney_helmet","Green Tourney Helmet",[("hood_c",0)],itp_type_head_armor,0,126, weight(2)|head_armor(16),imodbits_none], ["gold_tourney_helmet","Gold Tourney Helmet",[("hood_a",0)],itp_type_head_armor,0,126, weight(2)|head_armor(16),imodbits_none], ["arena_shield_red", "Shield", [("arena_shield_red",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 42 , weight(2)|hit_points(360)|body_armor(1)|spd_rtng(100)|weapon_length(60),imodbits_shield ], ["arena_shield_blue", "Shield", [("arena_shield_blue",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 42 , weight(2)|hit_points(360)|body_armor(1)|spd_rtng(100)|weapon_length(60),imodbits_shield ], ["arena_shield_green", "Shield", [("arena_shield_green",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 42 , weight(2)|hit_points(360)|body_armor(1)|spd_rtng(100)|weapon_length(60),imodbits_shield ], ["arena_shield_yellow", "Shield", [("arena_shield_yellow",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 42 , weight(2)|hit_points(360)|body_armor(1)|spd_rtng(100)|weapon_length(60),imodbits_shield ], ["arena_armor_white", "Arena Armor White", [("arena_armorW",0)], itp_type_body_armor |itp_covers_legs ,0, 650 , weight(16)|abundance(100)|head_armor(0)|body_armor(29)|leg_armor(13), imodbits_armor ], ["arena_armor_red", "Arena Armor Red", [("arena_armorR",0)], itp_type_body_armor |itp_covers_legs ,0, 650 , weight(16)|abundance(100)|head_armor(0)|body_armor(29)|leg_armor(13), imodbits_armor ], ["arena_armor_blue", "Arena Armor Blue", [("arena_armorB",0)], itp_type_body_armor |itp_covers_legs ,0, 650 , weight(16)|abundance(100)|head_armor(0)|body_armor(29)|leg_armor(13), imodbits_armor ], ["arena_armor_green", "Arena Armor Green", [("arena_armorG",0)], itp_type_body_armor |itp_covers_legs ,0, 650 , weight(16)|abundance(100)|head_armor(0)|body_armor(29)|leg_armor(13), imodbits_armor ], ["arena_armor_yellow", "Arena Armor Yellow", [("arena_armorY",0)], itp_type_body_armor |itp_covers_legs ,0, 650 , weight(16)|abundance(100)|head_armor(0)|body_armor(29)|leg_armor(13), imodbits_armor ], ["arena_tunic_white", "Arena Tunic White ", [("arena_tunicW",0)], itp_type_body_armor |itp_covers_legs ,0, 47 , weight(2)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(6), imodbits_cloth ], ["arena_tunic_red", "Arena Tunic Red", [("arena_tunicR",0)], itp_type_body_armor |itp_covers_legs ,0, 27 , weight(2)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(6), imodbits_cloth ], ["arena_tunic_blue", "Arena Tunic Blue", [("arena_tunicB",0)], itp_type_body_armor |itp_covers_legs ,0, 27 , weight(2)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(6), imodbits_cloth ], ["arena_tunic_green", "Arena Tunic Green", [("arena_tunicG",0)], itp_type_body_armor |itp_covers_legs ,0, 27 , weight(2)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(6), imodbits_cloth ], ["arena_tunic_yellow", "Arena Tunic Yellow", [("arena_tunicY",0)], itp_type_body_armor |itp_covers_legs ,0, 27 , weight(2)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(6), imodbits_cloth ], #headwear ["arena_helmet_red", "Arena Helmet Red", [("arena_helmetR",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(26)|body_armor(0)|leg_armor(0), imodbits_plate ], ["arena_helmet_blue", "Arena Helmet Blue", [("arena_helmetB",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(26)|body_armor(0)|leg_armor(0), imodbits_plate ], ["arena_helmet_green", "Arena Helmet Green", [("arena_helmetG",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(26)|body_armor(0)|leg_armor(0), imodbits_plate ], ["arena_helmet_yellow", "Arena Helmet Yellow", [("arena_helmetY",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(26)|body_armor(0)|leg_armor(0), imodbits_plate ], ["steppe_helmet_white", "Steppe Helmet White", [("steppe_helmetW",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0), imodbits_plate ], ["steppe_helmet_red", "Steppe Helmet Red", [("steppe_helmetR",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0), imodbits_plate ], ["steppe_helmet_blue", "Steppe Helmet Blue", [("steppe_helmetB",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0), imodbits_plate ], ["steppe_helmet_green", "Steppe Helmet Green", [("steppe_helmetG",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0), imodbits_plate ], ["steppe_helmet_yellow", "Steppe Helmet Yellow", [("steppe_helmetY",0)], itp_type_head_armor|itp_fit_to_head ,0, 187 , weight(1.25)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0), imodbits_plate ], ["tourney_helm_white", "Tourney Helm White", [("tourney_helmR",0)], itp_type_head_armor|itp_covers_head,0, 760 , weight(2.75)|abundance(100)|head_armor(30)|body_armor(0)|leg_armor(0), imodbits_plate ], ["tourney_helm_red", "Tourney Helm Red", [("tourney_helmR",0)], itp_type_head_armor|itp_covers_head,0, 760 , weight(2.75)|abundance(100)|head_armor(30)|body_armor(0)|leg_armor(0), imodbits_plate ], ["tourney_helm_blue", "Tourney Helm Blue", [("tourney_helmB",0)], itp_type_head_armor|itp_covers_head,0, 760 , weight(2.75)|abundance(100)|head_armor(30)|body_armor(0)|leg_armor(0), imodbits_plate ], ["tourney_helm_green", "Tourney Helm Green", [("tourney_helmG",0)], itp_type_head_armor|itp_covers_head,0, 760 , weight(2.75)|abundance(100)|head_armor(30)|body_armor(0)|leg_armor(0), imodbits_plate ], ["tourney_helm_yellow", "Tourney Helm Yellow", [("tourney_helmY",0)], itp_type_head_armor|itp_covers_head,0, 760 , weight(2.75)|abundance(100)|head_armor(30)|body_armor(0)|leg_armor(0), imodbits_plate ], # A treatise on The Method of Mechanical Theorems Archimedes #This book must be at the beginning of readable books ["book_tactics","De Re Militari", [("book_a",0)], itp_type_book, 0, 4000,weight(2)|abundance(100),imodbits_none], ["book_persuasion","Rhetorica ad Herennium", [("book_b",0)], itp_type_book, 0, 5000,weight(2)|abundance(100),imodbits_none], ["book_leadership","The Life of Alixenus the Great", [("book_d",0)], itp_type_book, 0, 4200,weight(2)|abundance(100),imodbits_none], ["book_intelligence","Essays on Logic", [("book_e",0)], itp_type_book, 0, 2900,weight(2)|abundance(100),imodbits_none], ["book_trade","A Treatise on the Value of Things", [("book_f",0)], itp_type_book, 0, 3100,weight(2)|abundance(100),imodbits_none], ["book_weapon_mastery", "On the Art of Fighting with Swords", [("book_d",0)], itp_type_book, 0, 4200,weight(2)|abundance(100),imodbits_none], ["book_engineering","Method of Mechanical Theorems", [("book_open",0)], itp_type_book, 0, 4000,weight(2)|abundance(100),imodbits_none], #Reference books #This book must be at the beginning of reference books ["book_wound_treatment_reference","The Book of Healing", [("book_c",0)], itp_type_book, 0, 3500,weight(2)|abundance(100),imodbits_none], ["book_training_reference","Manual of Arms", [("book_open",0)], itp_type_book, 0, 3500,weight(2)|abundance(100),imodbits_none], ["book_surgery_reference","The Great Book of Surgery", [("book_c",0)], itp_type_book, 0, 3500,weight(2)|abundance(100),imodbits_none], # ["dry_bread", "wheat_sack", itp_type_goods|itp_consumable, 0, slt_none,view_goods,95,weight(2),max_ammo(50),imodbits_none], #foods (first one is smoked_fish) ["smoked_fish","Smoked Fish", [("smoked_fish",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 59,weight(15)|abundance(110)|food_quality(50)|max_ammo(50),imodbits_none], ["dried_meat","Dried Meat", [("smoked_meat",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 72,weight(15)|abundance(100)|food_quality(70)|max_ammo(50),imodbits_none], ["cattle_meat","Beef", [("raw_meat",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 103,weight(20)|abundance(100)|food_quality(80)|max_ammo(70),imodbits_none], ["pork","Pork", [("fried_pig",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 85,weight(15)|abundance(100)|food_quality(70)|max_ammo(50),imodbits_none], ["bread","Bread", [("bread_a",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 32,weight(20)|abundance(110)|food_quality(40)|max_ammo(50),imodbits_none], ["apples","Apples", [("apple_basket",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 44,weight(20)|abundance(110)|food_quality(40)|max_ammo(50),imodbits_none], ["cheese","Cheese", [("cheese_b",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 95,weight(6)|abundance(110)|food_quality(40)|max_ammo(30),imodbits_none], ["chicken","Chicken", [("chicken_roasted",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 75,weight(10)|abundance(110)|food_quality(40)|max_ammo(50),imodbits_none], ["honey","Honey", [("honey_pot",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 136,weight(5)|abundance(110)|food_quality(40)|max_ammo(30),imodbits_none], ["sausages","Sausages", [("sausages",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 60,weight(10)|abundance(110)|food_quality(40)|max_ammo(40),imodbits_none], ["cabbages","Cabbages", [("cabbage",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 30,weight(15)|abundance(110)|food_quality(40)|max_ammo(50),imodbits_none], ["butter","Butter", [("butter_pot",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 150,weight(6)|abundance(110)|food_quality(40)|max_ammo(30),imodbits_none], #other trade goods (first one is wine) ["wine","Wine", [("amphora_slim",0)], itp_merchandise|itp_type_goods|itp_consumable, 0, 141,weight(30)|abundance(60)|max_ammo(50),imodbits_none], ["ale","Ale", [("ale_barrel",0)], itp_merchandise|itp_type_goods|itp_consumable, 0, 84,weight(30)|abundance(70)|max_ammo(50),imodbits_none], ["spice","Spice", [("spice_sack",0)], itp_merchandise|itp_type_goods, 0, 880,weight(40)|abundance(25),imodbits_none], ["salt","Salt", [("salt_sack",0)], itp_merchandise|itp_type_goods, 0, 255,weight(50)|abundance(120),imodbits_none], ["grain","Wheat", [("wheat_sack",0)], itp_merchandise|itp_type_goods|itp_consumable, 0, 77,weight(50)|abundance(110)|food_quality(40)|max_ammo(50),imodbits_none], ["flour","Flour", [("salt_sack",0)], itp_merchandise|itp_type_goods|itp_consumable, 0, 91,weight(50)|abundance(100)|food_quality(45)|max_ammo(50),imodbits_none], ["iron","Iron", [("iron",0)], itp_merchandise|itp_type_goods, 0,264,weight(60)|abundance(60),imodbits_none], ["oil","Oil", [("oil",0)], itp_merchandise|itp_type_goods, 0, 484,weight(50)|abundance(60),imodbits_none], ["pottery","Pottery", [("jug",0)], itp_merchandise|itp_type_goods, 0, 126,weight(50)|abundance(90),imodbits_none], ["linen","Linen", [("linen",0)], itp_merchandise|itp_type_goods, 0, 250,weight(40)|abundance(90),imodbits_none], ["furs","Furs", [("fur_pack",0)], itp_merchandise|itp_type_goods, 0, 391,weight(40)|abundance(90),imodbits_none], ["wool","Wool", [("wool_sack",0)], itp_merchandise|itp_type_goods, 0, 130,weight(40)|abundance(90),imodbits_none], ["velvet","Velvet", [("velvet",0)], itp_merchandise|itp_type_goods, 0, 1025,weight(40)|abundance(30),imodbits_none], ["tools","Tools", [("iron_hammer",0)], itp_merchandise|itp_type_goods, 0, 410,weight(50)|abundance(90),imodbits_none], #************************************************************************************************ # ITEMS before this point are hardcoded into item_codes.h and their order should not be changed! #************************************************************************************************ # Quest Items ["siege_supply","Supplies", [("ale_barrel",0)], itp_type_goods, 0, 96,weight(40)|abundance(70),imodbits_none], ["quest_wine","Wine", [("amphora_slim",0)], itp_type_goods, 0, 46,weight(40)|abundance(60)|max_ammo(50),imodbits_none], ["quest_ale","Ale", [("ale_barrel",0)], itp_type_goods, 0, 31,weight(40)|abundance(70)|max_ammo(50),imodbits_none], # Tutorial Items ["tutorial_sword", "Sword", [("long_sword",0),("scab_longsw_a", ixmesh_carry)], itp_type_one_handed_wpn|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 0 , weight(1.5)|difficulty(0)|spd_rtng(100) | weapon_length(102)|swing_damage(18 , cut) | thrust_damage(15 , pierce),imodbits_sword ], ["tutorial_axe", "Axe", [("iron_ax",0)], itp_type_two_handed_wpn| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 0 , weight(4)|difficulty(0)|spd_rtng(91) | weapon_length(108)|swing_damage(19 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["tutorial_spear", "Spear", [("spear",0)], itp_type_polearm| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear, 0 , weight(4.5)|difficulty(0)|spd_rtng(80) | weapon_length(158)|swing_damage(0 , cut) | thrust_damage(19 , pierce),imodbits_polearm ], ["tutorial_club", "Club", [("club",0)], itp_type_one_handed_wpn| itp_primary|itp_wooden_parry|itp_wooden_attack, itc_scimitar, 0 , weight(2.5)|difficulty(0)|spd_rtng(95) | weapon_length(95)|swing_damage(11 , blunt) | thrust_damage(0 , pierce),imodbits_none ], ["tutorial_battle_axe", "Battle Axe", [("battle_ax",0)], itp_type_two_handed_wpn| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 0 , weight(5)|difficulty(0)|spd_rtng(88) | weapon_length(108)|swing_damage(27 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["tutorial_arrows","Arrows", [("arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(0,pierce)|max_ammo(20),imodbits_missile], ["tutorial_bolts","Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag", ixmesh_carry),("bolt_bag_b", ixmesh_carry|imodbit_large_bag)], itp_type_bolts, itcf_carry_quiver_right_vertical, 0,weight(2.25)|abundance(90)|weapon_length(55)|thrust_damage(0,pierce)|max_ammo(18),imodbits_missile], ["tutorial_short_bow", "Short Bow", [("short_bow",0),("short_bow_carry",ixmesh_carry)], itp_type_bow |itp_primary|itp_two_handed ,itcf_shoot_bow|itcf_carry_bow_back, 0 , weight(1)|difficulty(0)|spd_rtng(98) | shoot_speed(49) | thrust_damage(12 , pierce ),imodbits_bow ], ["tutorial_crossbow", "Crossbow", [("crossbow",0)], itp_type_crossbow |itp_primary|itp_two_handed|itp_cant_reload_on_horseback ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 0 , weight(3)|difficulty(0)|spd_rtng(42)| shoot_speed(68) | thrust_damage(32,pierce)|max_ammo(1),imodbits_crossbow ], ["tutorial_throwing_daggers", "Throwing Daggers", [("throwing_dagger",0)], itp_type_thrown |itp_primary ,itcf_throw_knife, 0 , weight(3.5)|difficulty(0)|spd_rtng(102) | shoot_speed(25) | thrust_damage(16 , cut)|max_ammo(14)|weapon_length(0),imodbits_missile ], ["tutorial_saddle_horse", "Saddle Horse", [("saddle_horse",0)], itp_type_horse, 0, 0,abundance(90)|body_armor(3)|difficulty(0)|horse_speed(40)|horse_maneuver(38)|horse_charge(8),imodbits_horse_basic], ["tutorial_shield", "Kite Shield", [("shield_kite_a",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(150),imodbits_shield ], ["tutorial_staff_no_attack","Staff", [("wooden_staff",0)],itp_type_polearm|itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack,itc_parry_polearm|itcf_carry_sword_back,9, weight(3.5)|spd_rtng(120) | weapon_length(115)|swing_damage(0,blunt) | thrust_damage(0,blunt),imodbits_none], ["tutorial_staff","Staff", [("wooden_staff",0)],itp_type_polearm|itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack,itc_staff|itcf_carry_sword_back,9, weight(3.5)|spd_rtng(120) | weapon_length(115)|swing_damage(16,blunt) | thrust_damage(16,blunt),imodbits_none], # Horses: sumpter horse/ pack horse, saddle horse, steppe horse, warm blood, geldling, stallion, war mount, charger, # Carthorse, hunter, heavy hunter, hackney, palfrey, courser, destrier. ["sumpter_horse","Sumpter Horse", [("sumpter_horse",0)], itp_merchandise|itp_type_horse, 0, 64,abundance(90)|hit_points(110)|body_armor(17)|difficulty(1)|horse_speed(34)|horse_maneuver(33)|horse_charge(9),imodbits_horse_basic], ["saddle_horse","Saddle Horse", [("saddle_horse",0),("horse_c",imodbits_horse_good)], itp_merchandise|itp_type_horse, 0, 112,abundance(90)|body_armor(14)|difficulty(1)|horse_speed(39)|horse_maneuver(36)|horse_charge(8),imodbits_horse_basic], ["steppe_horse","Steppe Horse", [("steppe_horse",0)], itp_merchandise|itp_type_horse, 0, 92,abundance(80)|body_armor(15)|difficulty(2)|horse_speed(37)|horse_maneuver(41)|horse_charge(7),imodbits_horse_basic], ["courser","Courser", [("courser",0)], itp_merchandise|itp_type_horse, 0, 323,abundance(70)|body_armor(16)|difficulty(2)|horse_speed(43)|horse_maneuver(37)|horse_charge(11),imodbits_horse_basic|imodbit_champion], ["hunter","Hunter", [("hunting_horse",0),("hunting_horse",imodbits_horse_good)], itp_merchandise|itp_type_horse, 0, 434,abundance(60)|hit_points(130)|body_armor(29)|difficulty(3)|horse_speed(40)|horse_maneuver(36)|horse_charge(18),imodbits_horse_basic|imodbit_champion], ["warhorse","Warhorse", [("warhorse",0)], itp_merchandise|itp_type_horse, 0, 724,abundance(50)|hit_points(135)|body_armor(52)|difficulty(4)|horse_speed(36)|horse_maneuver(34)|horse_charge(18),imodbits_horse_basic|imodbit_champion], ["charger","Charger", [("charger",0)], itp_merchandise|itp_type_horse, 0, 1411,abundance(40)|hit_points(140)|body_armor(65)|difficulty(4)|horse_speed(35)|horse_maneuver(32)|horse_charge(25),imodbits_horse_basic|imodbit_champion], #whalebone crossbow, yew bow, war bow, arming sword ["arrows","Arrows", [("arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows|itp_merchandise, itcf_carry_quiver_back, 72,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(1,pierce)|max_ammo(30),imodbits_missile], ["khergit_arrows","Khergit Arrows", [("arrow_b",0),("flying_missile",ixmesh_flying_ammo),("quiver_b", ixmesh_carry)], itp_type_arrows|itp_merchandise, itcf_carry_quiver_back_right, 410,weight(3.5)|abundance(30)|weapon_length(95)|thrust_damage(3,pierce)|max_ammo(30),imodbits_missile], ["barbed_arrows","Barbed Arrows", [("barbed_arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver_d", ixmesh_carry)], itp_type_arrows|itp_merchandise, itcf_carry_quiver_back_right, 124,weight(3)|abundance(70)|weapon_length(95)|thrust_damage(2,pierce)|max_ammo(30),imodbits_missile], ["bodkin_arrows","Bodkin Arrows", [("piercing_arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver_c", ixmesh_carry)], itp_type_arrows|itp_merchandise, itcf_carry_quiver_back_right, 350,weight(3)|abundance(50)|weapon_length(91)|thrust_damage(3,pierce)|max_ammo(29),imodbits_missile], ["bolts","Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag", ixmesh_carry),("bolt_bag_b", ixmesh_carry|imodbit_large_bag)], itp_type_bolts|itp_merchandise, itcf_carry_quiver_right_vertical, 64,weight(2.25)|abundance(90)|weapon_length(55)|thrust_damage(1,pierce)|max_ammo(25),imodbits_missile], ["steel_bolts","Steel Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag_c", ixmesh_carry)], itp_type_bolts|itp_merchandise, itcf_carry_quiver_right_vertical, 210,weight(2.5)|abundance(20)|weapon_length(55)|thrust_damage(2,pierce)|max_ammo(25),imodbits_missile], ["cartridges","Cartridges", [("cartridge_a",0)], itp_type_bullets|itp_merchandise, 0, 41,weight(2.25)|abundance(90)|weapon_length(3)|thrust_damage(1,pierce)|max_ammo(40),imodbits_missile], ["pilgrim_disguise", "Pilgrim Disguise", [("pilgrim_outfit",0)], 0| itp_type_body_armor |itp_covers_legs |itp_civilian ,0, 25 , weight(2)|abundance(100)|head_armor(0)|body_armor(19)|leg_armor(8)|difficulty(0) ,imodbits_cloth ], ["pilgrim_hood", "Pilgrim Hood", [("pilgrim_hood",0)], 0| itp_type_head_armor |itp_civilian ,0, 35 , weight(1.25)|abundance(100)|head_armor(14)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], # ARMOR #handwear ["leather_gloves","Leather Gloves", [("lthr_glove_L",0)], itp_merchandise|itp_type_hand_armor,0, 130, weight(0.25)|abundance(120)|body_armor(2)|difficulty(0),imodbits_cloth], ["mail_mittens","Mail Mittens", [("mail_mitten_L",0)], itp_merchandise|itp_type_hand_armor,0, 550, weight(0.5)|abundance(100)|body_armor(4)|difficulty(0),imodbits_armor], ["scale_gauntlets","Scale Gauntlets", [("scale_gaunt_L",0)], itp_merchandise|itp_type_hand_armor,0, 910, weight(0.75)|abundance(100)|body_armor(5)|difficulty(0),imodbits_armor], ["gauntlets","Gauntlets", [("gauntlet_a_L",0),("gauntlet_b_L",imodbit_reinforced)], itp_merchandise|itp_type_hand_armor,0, 1940, weight(1.0)|abundance(100)|body_armor(6)|difficulty(0),imodbits_armor], #footwear ["wrapping_boots", "Wrapping Boots", [("shoe_fur",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature ,0, 3 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(3)|difficulty(0) ,imodbits_cloth ], ["woolen_hose", "Woolen Hose", [("woolen_hose",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature ,0, 6 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(4)|difficulty(0) ,imodbits_cloth ], ["blue_hose", "Blue Hose", [("blue_leggings",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature ,0, 11 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(5)|difficulty(0) ,imodbits_cloth ], ["hunter_boots", "Hunter Boots", [("boot_hunter",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature,0, 19 , weight(1.25)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(9)|difficulty(0) ,imodbits_cloth ], ["hide_boots", "Hide Boots", [("boot_nomad_a",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature,0, 34 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["ankle_boots", "Ankle Boots", [("ankle_boots_a",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature,0, 75 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(12)|difficulty(0) ,imodbits_cloth ], ["nomad_boots", "Nomad Boots", [("boot_nomad_b",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature,0, 116 , weight(1.25)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(14)|difficulty(0) ,imodbits_cloth ], ["leather_boots", "Leather Boots", [("boot_khergit",0)], itp_merchandise| itp_type_foot_armor |itp_civilian | itp_attach_armature,0, 174 , weight(1.25)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(16)|difficulty(0) ,imodbits_cloth ], ["mail_chausses", "Mail Chausses", [("chausses_cm",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature ,0, 410 , weight(3)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(21)|difficulty(0) ,imodbits_armor ], ["splinted_leather_greaves", "Splinted Leather Greaves", [("lthr_greaves",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature,0, 760 , weight(3)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(24)|difficulty(0) ,imodbits_armor ], ["splinted_greaves", "Splinted Greaves", [("spl_greaves",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature,0, 1153 , weight(3.5)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(28)|difficulty(7) ,imodbits_armor ], ["mail_boots", "Mail Boots", [("shoe_cm",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature ,0, 1746 , weight(3)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(31)|difficulty(8) ,imodbits_armor ], ["iron_greaves", "Iron Greaves", [("iron_greaves",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature,0, 2374 , weight(3.5)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(33)|difficulty(9) ,imodbits_armor ], ["black_greaves", "Black Greaves", [("black_greaves",0)], itp_type_foot_armor | itp_attach_armature,0, 3561 , weight(3.5)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(35)|difficulty(0) ,imodbits_armor ], #bodywear ["lady_dress_ruby", "Lady Dress", [("lady_dress_r",0)], itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 500 , weight(3)|abundance(100)|head_armor(0)|body_armor(10)|leg_armor(10)|difficulty(0) ,imodbits_cloth], ["lady_dress_green", "Lady Dress", [("lady_dress_g",0)], itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 500 , weight(3)|abundance(100)|head_armor(0)|body_armor(10)|leg_armor(10)|difficulty(0) ,imodbits_cloth], ["lady_dress_blue", "Lady Dress", [("lady_dress_b",0)], itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 500 , weight(3)|abundance(100)|head_armor(0)|body_armor(10)|leg_armor(10)|difficulty(0) ,imodbits_cloth], ["courtly_outfit", "Courtly Outfit", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian ,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["nobleman_outfit", "Nobleman Outfit", [("nobleman_outfit_b",0)], itp_type_body_armor|itp_covers_legs|itp_civilian ,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(15)|leg_armor(12)|difficulty(0) ,imodbits_cloth ], ["nomad_armor", "Nomad Armor", [("armor_nomad",0)], itp_merchandise| itp_type_body_armor ,0, 25 , weight(2)|abundance(100)|head_armor(0)|body_armor(24)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["khergit_armor", "Khergit Armor", [("armor_nomad_b",0)], itp_merchandise| itp_type_body_armor ,0, 38 , weight(2)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["leather_jacket", "Leather Jacket", [("leather_jacket",0)], itp_merchandise| itp_type_body_armor |itp_civilian ,0, 50 , weight(3)|abundance(100)|head_armor(0)|body_armor(15)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["rawhide_coat", "Rawhide Coat", [("tunic_fur",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0, 12 , weight(5)|abundance(100)|head_armor(0)|body_armor(10)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["leather_armor", "Leather Armor", [("lthr_armor_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 65 , weight(7)|abundance(100)|head_armor(0)|body_armor(18)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["fur_coat", "Fur Coat", [("fur_coat",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs |itp_civilian,0, 117 , weight(6)|abundance(100)|head_armor(0)|body_armor(13)|leg_armor(6)|difficulty(0) ,imodbits_armor ], #for future: ["coat", "Coat", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["leather_coat", "Leather Coat", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["mail_coat", "Coat of Mail", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["long_mail_coat", "Long Coat of Mail", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["sleeveless_mail_coat", "Sleeveless Coat of Mail", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["sleeveless_coat", "Sleeveless Coat", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["hide_coat", "Hide Coat", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["merchant_outfit", "Merchant Outfit", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["homespun_dress", "Homespun Dress", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["thick_coat", "Thick Coat", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["coat_with_cape", "Coat_with_Cape", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["steppe_outfit", "Steppe Outfit", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["nordic_outfit", "Nordic Outfit", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["nordic_armor", "Nordic Armor", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["hide_armor", "Hide Armor", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["cloaked_tunic", "Cloaked Tunic", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["sleeveless_tunic", "Sleeveless Tunic", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["sleeveless_leather_tunic", "Sleeveless Leather Tunic", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["linen_shirt", "Linen_Shirt", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["wool_coat", "Wool_Coat", [("nobleman_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], #end ["dress", "Dress", [("dress",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 6 , weight(1)|abundance(100)|head_armor(0)|body_armor(6)|leg_armor(2)|difficulty(0) ,imodbits_cloth ], ["blue_dress", "Blue Dress", [("blue_dress",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 6 , weight(1)|abundance(100)|head_armor(0)|body_armor(6)|leg_armor(2)|difficulty(0) ,imodbits_cloth ], ["peasant_dress", "Peasant Dress", [("peasant_dress_b",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 6 , weight(1)|abundance(100)|head_armor(0)|body_armor(6)|leg_armor(2)|difficulty(0) ,imodbits_cloth ], ["woolen_dress", "Woolen Dress", [("woolen_dress",0)], itp_merchandise| itp_type_body_armor|itp_civilian |itp_covers_legs ,0, 10 , weight(1.75)|abundance(100)|head_armor(0)|body_armor(8)|leg_armor(2)|difficulty(0) ,imodbits_cloth ], ["shirt", "Shirt", [("shirt",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 3 , weight(1)|abundance(100)|head_armor(0)|body_armor(5)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["linen_tunic", "Linen Tunic", [("linen_tunic",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0, 6 , weight(1)|abundance(100)|head_armor(0)|body_armor(6)|leg_armor(1)|difficulty(0) ,imodbits_cloth ], ["short_tunic", "Rich Tunic", [("cvl_costume_a",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0, 10 , weight(1)|abundance(100)|head_armor(0)|body_armor(7)|leg_armor(1)|difficulty(0) ,imodbits_cloth ], ["robe", "Robe", [("robe",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs |itp_civilian,0, 31 , weight(1.5)|abundance(100)|head_armor(0)|body_armor(8)|leg_armor(6)|difficulty(0) ,imodbits_cloth ], ["coarse_tunic", "Coarse Tunic", [("coarse_tunic",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0, 47 , weight(2)|abundance(100)|head_armor(0)|body_armor(11)|leg_armor(6)|difficulty(0) ,imodbits_cloth ], ["leather_apron", "Leather Apron", [("leather_apron",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0, 61 , weight(3)|abundance(100)|head_armor(0)|body_armor(12)|leg_armor(7)|difficulty(0) ,imodbits_cloth ], ["tabard", "Tabard", [("tabard_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs |itp_civilian,0, 107 , weight(3)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(6)|difficulty(0) ,imodbits_cloth ], ["leather_vest", "Leather Vest", [("leather_vest",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 146 , weight(4)|abundance(100)|head_armor(0)|body_armor(15)|leg_armor(7)|difficulty(0) ,imodbits_cloth ], ["steppe_armor", "Steppe Armor", [("lamellar_leather",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 195 , weight(5)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(8)|difficulty(0) ,imodbits_cloth ], ["gambeson", "Gambeson", [("white_gambeson",0)], itp_merchandise| itp_type_body_armor|itp_covers_legs|itp_civilian,0, 260 , weight(5)|abundance(100)|head_armor(0)|body_armor(20)|leg_armor(5)|difficulty(0) ,imodbits_cloth ], ["blue_gambeson", "Blue Gambeson", [("blue_gambeson",0)], itp_merchandise| itp_type_body_armor|itp_covers_legs|itp_civilian,0, 270 , weight(5)|abundance(100)|head_armor(0)|body_armor(21)|leg_armor(5)|difficulty(0) ,imodbits_cloth ], ["red_gambeson", "Red Gambeson", [("red_gambeson",0)], itp_merchandise| itp_type_body_armor|itp_covers_legs|itp_civilian,0, 275 , weight(5)|abundance(100)|head_armor(0)|body_armor(21)|leg_armor(5)|difficulty(0) ,imodbits_cloth ], ["padded_cloth", "Padded Cloth", [("aketon_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 297 , weight(11)|abundance(100)|head_armor(0)|body_armor(22)|leg_armor(6)|difficulty(0) ,imodbits_cloth ], ["leather_jerkin", "Leather Jerkin", [("leather_jerkin",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0, 321 , weight(6)|abundance(100)|head_armor(0)|body_armor(23)|leg_armor(6)|difficulty(0) ,imodbits_cloth ], ["nomad_vest", "Nomad Vest", [("nomad_vest_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 360 , weight(7)|abundance(50)|head_armor(0)|body_armor(22)|leg_armor(8)|difficulty(0) ,imodbits_cloth ], ["ragged_outfit", "Ragged Outfit", [("ragged_outfit_a",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0, 390 , weight(7)|abundance(100)|head_armor(0)|body_armor(23)|leg_armor(9)|difficulty(0) ,imodbits_cloth ], ["padded_leather", "Padded Leather", [("padded_leather",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian,0, 454 , weight(12)|abundance(100)|head_armor(0)|body_armor(27)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["tribal_warrior_outfit", "Tribal Warrior Outfit", [("tribal_warrior_outfit_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs|itp_civilian ,0, 520 , weight(14)|abundance(100)|head_armor(0)|body_armor(30)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], ["nomad_robe", "Nomad Robe", [("nomad_robe_a",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs |itp_civilian,0, 610 , weight(15)|abundance(100)|head_armor(0)|body_armor(32)|leg_armor(10)|difficulty(0) ,imodbits_cloth ], #["heraldric_armor", "Heraldric Armor", [("tourn_armor_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 442 , weight(17)|abundance(100)|head_armor(0)|body_armor(35)|leg_armor(8)|difficulty(7) ,imodbits_armor ], ["studded_leather_coat", "Studded Leather Coat", [("std_lthr_coat",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 690 , weight(14)|abundance(100)|head_armor(0)|body_armor(34)|leg_armor(10)|difficulty(7) ,imodbits_armor ], ["byrnie", "Byrnie", [("byrnie_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 795 , weight(17)|abundance(100)|head_armor(0)|body_armor(39)|leg_armor(6)|difficulty(7) ,imodbits_armor ], #["blackwhite_surcoat", "Black and White Surcoat", [("surcoat_blackwhite",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 348 , weight(16)|abundance(100)|head_armor(0)|body_armor(33)|leg_armor(8)|difficulty(7) ,imodbits_armor ], #["green_surcoat", "Green Surcoat", [("surcoat_green",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 348 , weight(16)|abundance(100)|head_armor(0)|body_armor(33)|leg_armor(8)|difficulty(7) ,imodbits_armor ], #["blue_surcoat", "Blue Surcoat", [("surcoat_blue",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 350 , weight(16)|abundance(100)|head_armor(0)|body_armor(33)|leg_armor(8)|difficulty(7) ,imodbits_armor ], #["red_surcoat", "Red Surcoat", [("surcoat_red",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 350 , weight(16)|abundance(100)|head_armor(0)|body_armor(33)|leg_armor(8)|difficulty(7) ,imodbits_armor ], ["haubergeon", "Haubergeon", [("haubergeon_a",0),("haubergeon_b",imodbits_good)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 863 , weight(18)|abundance(100)|head_armor(0)|body_armor(41)|leg_armor(6)|difficulty(6) ,imodbits_armor ], ["mail_shirt", "Mail Shirt", [("mail_shirt",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 920 , weight(19)|abundance(100)|head_armor(0)|body_armor(37)|leg_armor(12)|difficulty(7) ,imodbits_armor ], ["mail_hauberk", "Mail Hauberk", [("hauberk_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 1190 , weight(19)|abundance(100)|head_armor(0)|body_armor(40)|leg_armor(12)|difficulty(7) ,imodbits_armor ], ["lamellar_vest", "Lamellar Vest", [("nmd_warrior_a",0)], itp_merchandise| itp_type_body_armor |itp_civilian |itp_covers_legs ,0, 1370 , weight(18)|abundance(100)|head_armor(0)|body_armor(46)|leg_armor(8)|difficulty(7) ,imodbits_cloth ], ["mail_with_surcoat", "Mail with Surcoat", [("mail_long_surcoat",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 1544 , weight(22)|abundance(100)|head_armor(0)|body_armor(42)|leg_armor(14)|difficulty(7) ,imodbits_armor ], ["surcoat_over_mail", "Surcoat over Mail", [("surcoat_over_mail",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 1720 , weight(22)|abundance(100)|head_armor(0)|body_armor(43)|leg_armor(14)|difficulty(7) ,imodbits_armor ], #["lamellar_cuirass", "Lamellar Cuirass", [("lamellar_armor",0)], itp_type_body_armor |itp_covers_legs,0, 1020 , weight(25)|abundance(100)|head_armor(0)|body_armor(43)|leg_armor(15)|difficulty(9) ,imodbits_armor ], ["brigandine_a", "Brigandine", [("brigandine_a",0)], itp_merchandise| itp_type_body_armor|itp_covers_legs,0, 1830 , weight(19)|abundance(100)|head_armor(0)|body_armor(46)|leg_armor(12)|difficulty(0) ,imodbits_armor ], ["lamellar_armor", "Lamellar Armor", [("lamellar_armor_b",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 2410 , weight(25)|abundance(100)|head_armor(0)|body_armor(48)|leg_armor(13)|difficulty(0) ,imodbits_armor ], ["banded_armor", "Banded Armor", [("reinf_jerkin",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 2710 , weight(23)|abundance(100)|head_armor(0)|body_armor(49)|leg_armor(14)|difficulty(8) ,imodbits_armor ], ["cuir_bouilli", "Cuir Bouilli", [("hard_lthr_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 3100 , weight(24)|abundance(100)|head_armor(0)|body_armor(50)|leg_armor(15)|difficulty(8) ,imodbits_armor ], ["coat_of_plates", "Coat of Plates", [("coat_of_plates",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 3828 , weight(25)|abundance(100)|head_armor(0)|body_armor(52)|leg_armor(16)|difficulty(8) ,imodbits_armor ], ["plate_armor", "Plate Armor", [("plate_armor",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 6553 , weight(27)|abundance(100)|head_armor(0)|body_armor(55)|leg_armor(17)|difficulty(9) ,imodbits_plate ], ["black_armor", "Black Armor", [("black_armor",0)], itp_type_body_armor |itp_covers_legs ,0, 9496 , weight(28)|abundance(100)|head_armor(0)|body_armor(57)|leg_armor(18)|difficulty(10) ,imodbits_plate ], ["heraldic_mail_with_surcoat", "Heraldic Mail with Surcoat", [("heraldic_armor_a",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 3454 , weight(22)|abundance(100)|head_armor(0)|body_armor(49)|leg_armor(17)|difficulty(7) ,imodbits_armor, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heraldic_armor_a", ":agent_no", ":troop_no")])]], ##["heraldic_mail_with_tunic", "Heraldic_Mail", [("heraldic_armor_b",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, ## 3520 , weight(22)|abundance(100)|head_armor(0)|body_armor(50)|leg_armor(16)|difficulty(7) ,imodbits_armor, ## [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heraldic_armor_b", ":agent_no", ":troop_no")])]], ##["heraldic_mail_with_tunic_b", "Heraldic_Mail", [("heraldic_armor_c",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, ## 3610 , weight(22)|abundance(100)|head_armor(0)|body_armor(50)|leg_armor(16)|difficulty(7) ,imodbits_armor, ## [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heraldic_armor_c", ":agent_no", ":troop_no")])]], ["heraldic_mail_with_tabard", "Heraldic_Mail_with_Tabard", [("heraldic_armor_d",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 3654 , weight(21)|abundance(100)|head_armor(0)|body_armor(51)|leg_armor(15)|difficulty(7) ,imodbits_armor, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heraldic_armor_d", ":agent_no", ":troop_no")])]], ["turret_hat_ruby", "Turret Hat", [("turret_hat_r",0)], itp_type_head_armor |itp_civilian|itp_fit_to_head ,0, 70 , weight(0.5)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["turret_hat_blue", "Turret Hat", [("turret_hat_b",0)], itp_type_head_armor |itp_civilian|itp_fit_to_head ,0, 80 , weight(0.5)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["turret_hat_green", "Barbette", [("turret_hat_g",0)],itp_merchandise|itp_type_head_armor|itp_civilian|itp_fit_to_head,0,70, weight(0.5)|abundance(100)|head_armor(6)|body_armor(0)|leg_armor(0)|difficulty(0),imodbits_cloth], ["head_wrappings","head_wrapping",[("head_wrapping",0)],itp_type_head_armor|itp_fit_to_head,0,16, weight(0.25)|head_armor(3),imodbit_tattered | imodbit_ragged | imodbit_sturdy | imodbit_thick], ["court_hat", "Turret Hat", [("court_hat",0)], itp_type_head_armor |itp_civilian|itp_fit_to_head ,0, 80 , weight(0.5)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["wimple_a", "Wimple", [("wimple_a",0)],itp_merchandise|itp_type_head_armor|itp_civilian|itp_fit_to_head,0,10, weight(0.5)|abundance(100)|head_armor(4)|body_armor(0)|leg_armor(0)|difficulty(0),imodbits_cloth], ["wimple_with_veil", "Wimple with Veil", [("wimple_b",0)],itp_merchandise|itp_type_head_armor|itp_civilian|itp_fit_to_head,0,10, weight(0.5)|abundance(100)|head_armor(4)|body_armor(0)|leg_armor(0)|difficulty(0),imodbits_cloth], ["straw_hat", "Straw Hat", [("straw_hat",0)],itp_merchandise|itp_type_head_armor|itp_civilian,0,9, weight(1)|abundance(100)|head_armor(2)|body_armor(0)|leg_armor(0)|difficulty(0),imodbits_cloth], ["common_hood", "Hood", [("hood_a",0),("hood_b",0),("hood_c",0),("hood_d",0)],itp_merchandise|itp_type_head_armor|itp_civilian,0,9, weight(1)|abundance(100)|head_armor(10)|body_armor(0)|leg_armor(0)|difficulty(0),imodbits_cloth], ["headcloth", "Headcloth", [("headcloth",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 1 , weight(0.5)|abundance(100)|head_armor(4)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["woolen_hood", "Woolen Hood", [("woolen_hood",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 4 , weight(1)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["fur_hat", "Fur Hat", [("hat_fur_a",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 4 , weight(0.5)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["nomad_cap", "Nomad Cap", [("helmet_fur_a",0),("helmet_fur_a",imodbits_good)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 6 , weight(0.75)|abundance(100)|head_armor(10)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["steppe_cap", "Steppe Cap", [("helmet_fur_b",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 14 , weight(1)|abundance(100)|head_armor(12)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["padded_coif", "Padded Coif", [("padded_coif",0)], itp_merchandise| itp_type_head_armor ,0, 6 , weight(1)|abundance(100)|head_armor(11)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["woolen_cap", "Woolen Cap", [("woolen_cap",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 2 , weight(1)|abundance(100)|head_armor(6)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["felt_hat", "Felt Hat", [("felt_hat_a",0),("felt_hat_b",imodbits_good)], itp_merchandise| itp_type_head_armor |itp_civilian,0, 4 , weight(1)|abundance(100)|head_armor(8)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["leather_cap", "Leather Cap", [("leather_cap",0)], itp_merchandise| itp_type_head_armor|itp_civilian ,0, 6 , weight(1)|abundance(100)|head_armor(10)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["arming_cap", "Arming Cap", [("linen_arming_cap",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 6 , weight(1)|abundance(100)|head_armor(10)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["female_hood", "Lady's Hood", [("woolen_hood",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 9 , weight(1)|abundance(100)|head_armor(10)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["leather_steppe_cap_a", "Leather Steppe Cap", [("nomad_cap_a",0)], itp_merchandise|itp_type_head_armor ,0, 24 , weight(1)|abundance(100)|head_armor(12)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["leather_steppe_cap_b", "Leather Steppe Cap", [("leather_steppe_cap_a",0)], itp_merchandise|itp_type_head_armor ,0, 36 , weight(1)|abundance(100)|head_armor(14)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["leather_steppe_cap_c", "Leather Steppe Cap", [("leather_steppe_cap_b",0)], itp_merchandise|itp_type_head_armor ,0, 51 , weight(1)|abundance(100)|head_armor(16)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["leather_warrior_cap", "Leather Warrior Cap", [("skull_cap_new_b",0)], itp_merchandise| itp_type_head_armor |itp_civilian ,0, 14 , weight(1)|abundance(100)|head_armor(18)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ], ["skullcap", "Skullcap", [("skull_cap_new_a",0)], itp_merchandise| itp_type_head_armor ,0, 60 , weight(1.0)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_plate ], ["mail_coif", "Mail Coif", [("mail_coif",0)], itp_merchandise| itp_type_head_armor ,0, 71 , weight(1.25)|abundance(100)|head_armor(22)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_armor ], ["footman_helmet", "Footman's_Helmet", [("skull_cap_new",0)], itp_merchandise| itp_type_head_armor ,0, 95 , weight(1.5)|abundance(100)|head_armor(24)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_plate ], ["nasal_helmet", "Nasal Helmet", [("nasal_helmet_b",0)], itp_merchandise| itp_type_head_armor ,0, 121 , weight(1.25)|abundance(100)|head_armor(26)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ], ["norman_helmet", "Helmet with Cap", [("norman_helmet_a",0)], itp_merchandise| itp_type_head_armor|itp_fit_to_head ,0, 147 , weight(1.25)|abundance(100)|head_armor(28)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ], ["segmented_helmet", "Segmented Helmet", [("segmented_helm_new",0)], itp_merchandise| itp_type_head_armor ,0, 174 , weight(1.25)|abundance(100)|head_armor(31)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ], ["kettle_hat", "Kettle Hat", [("kettle_hat_new",0)], itp_merchandise| itp_type_head_armor,0, 193 , weight(1.5)|abundance(100)|head_armor(33)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ], ["helmet_with_neckguard", "Helmet with Neckguard", [("neckguard_helm_new",0)], itp_merchandise| itp_type_head_armor ,0, 233 , weight(1.75)|abundance(100)|head_armor(35)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ], ["spiked_helmet", "Spiked Helmet", [("spiked_helmet_new",0)], itp_merchandise| itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(38)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ], ["nordic_helmet", "Nordic Helmet", [("helmet_w_eyeguard_new",0)], itp_merchandise| itp_type_head_armor ,0, 340 , weight(2)|abundance(100)|head_armor(40)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ], ["flat_topped_helmet", "Flat Topped Helmet", [("flattop_helmet_new",0)], itp_merchandise| itp_type_head_armor ,0, 411 , weight(2)|abundance(100)|head_armor(42)|body_armor(0)|leg_armor(0)|difficulty(8) ,imodbits_plate ], #TODO: #["skullcap_b", "Skullcap_b", [("skull_cap_new_b",0)], itp_merchandise| itp_type_head_armor ,0, 71 , weight(1.5)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_plate ], ["bascinet", "Bascinet", [("bascinet_avt_new",0),("bascinet_avt_new1",imodbit_crude|imodbit_rusty),("bascinet_avt_new2",imodbits_good)], itp_merchandise|itp_type_head_armor ,0, 479 , weight(2.25)|abundance(100)|head_armor(45)|body_armor(0)|leg_armor(0)|difficulty(8) ,imodbits_plate ], ["guard_helmet", "Guard Helmet", [("reinf_helmet_new",0)], itp_merchandise| itp_type_head_armor ,0, 555 , weight(2.5)|abundance(100)|head_armor(47)|body_armor(0)|leg_armor(0)|difficulty(9) ,imodbits_plate ], ["black_helmet", "Black Helmet", [("black_helm",0)], itp_type_head_armor ,0, 638 , weight(2.75)|abundance(100)|head_armor(50)|body_armor(0)|leg_armor(0)|difficulty(9) ,imodbits_plate ], ["great_helmet", "Great Helmet", [("great_helm_a",0)], itp_merchandise| itp_type_head_armor|itp_covers_head,0, 980 , weight(2.75)|abundance(100)|head_armor(53)|body_armor(0)|leg_armor(0)|difficulty(10) ,imodbits_plate ], ["winged_great_helmet", "Winged Great Helmet", [("maciejowski_helmet_new",0)], itp_merchandise|itp_type_head_armor|itp_covers_head,0, 1240 , weight(2.75)|abundance(100)|head_armor(55)|body_armor(0)|leg_armor(0)|difficulty(10) ,imodbits_plate ], #WEAPONS ["wooden_stick", "Wooden Stick", [("wooden_stick",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry|itp_wooden_attack, itc_scimitar, 4 , weight(2.5)|difficulty(0)|spd_rtng(99) | weapon_length(90)|swing_damage(13 , blunt) | thrust_damage(0 , pierce),imodbits_none ], ["cudgel", "Cudgel", [("club",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry|itp_wooden_attack, itc_scimitar, 4 , weight(2.5)|difficulty(0)|spd_rtng(99) | weapon_length(90)|swing_damage(13 , blunt) | thrust_damage(0 , pierce),imodbits_none ], ["hammer", "Hammer", [("iron_hammer",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar, 7 , weight(2)|difficulty(0)|spd_rtng(100) | weapon_length(55)|swing_damage(14 , blunt) | thrust_damage(0 , pierce),imodbits_mace ], ["club", "Club", [("club",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry|itp_wooden_attack, itc_scimitar, 11 , weight(2.5)|difficulty(0)|spd_rtng(95) | weapon_length(95)|swing_damage(15 , blunt) | thrust_damage(0 , pierce),imodbits_none ], ["winged_mace", "Winged Mace", [("winged_mace",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip, 122 , weight(3.5)|difficulty(0)|spd_rtng(99) | weapon_length(80)|swing_damage(21 , blunt) | thrust_damage(0 , pierce),imodbits_mace ], ["spiked_mace", "Spiked Mace", [("spiked_mace",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip, 180 , weight(3.5)|difficulty(0)|spd_rtng(95) | weapon_length(90)|swing_damage(22 , blunt) | thrust_damage(0 , pierce),imodbits_pick ], ["military_hammer", "Military Hammer", [("iron_hammer",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 317 , weight(4)|difficulty(0)|spd_rtng(92) | weapon_length(90)|swing_damage(25 , blunt) | thrust_damage(0 , pierce),imodbits_mace ], ["maul", "Maul", [("maul_b",0)], itp_type_two_handed_wpn|itp_merchandise| itp_primary|itp_two_handed|itp_wooden_parry|itp_wooden_attack, itc_nodachi|itcf_carry_spear, 97 , weight(6)|difficulty(11)|spd_rtng(84) | weapon_length(79)|swing_damage(33 , blunt) | thrust_damage(0 , pierce),imodbits_mace ], ["sledgehammer", "Sledgehammer", [("maul_c",0)], itp_type_two_handed_wpn|itp_merchandise|itp_primary|itp_two_handed|itp_wooden_parry|itp_wooden_attack, itc_nodachi|itcf_carry_spear, 101 , weight(7)|difficulty(12)|spd_rtng(82) | weapon_length(82)|swing_damage(35 , blunt) | thrust_damage(0 , pierce),imodbits_mace ], ["warhammer", "Warhammer", [("maul_d",0)], itp_type_two_handed_wpn|itp_merchandise|itp_primary|itp_two_handed|itp_wooden_parry|itp_wooden_attack, itc_nodachi|itcf_carry_spear, 309 , weight(9)|difficulty(14)|spd_rtng(85) | weapon_length(75)|swing_damage(38 , blunt) | thrust_damage(0 , pierce),imodbits_mace ], ["pickaxe", "Pickaxe", [("rusty_pick",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 27 , weight(3)|difficulty(0)|spd_rtng(96) | weapon_length(80)|swing_damage(19 , pierce) | thrust_damage(0 , pierce),imodbits_pick ], ["spiked_club", "Spiked Club", [("spiked_club",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip, 83 , weight(3)|difficulty(0)|spd_rtng(97) | weapon_length(97)|swing_damage(21 , pierce) | thrust_damage(0 , pierce),imodbits_mace ], ["fighting_pick", "Fighting Pick", [("rusty_pick",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 108 , weight(3.5)|difficulty(0)|spd_rtng(94) | weapon_length(90)|swing_damage(25 , pierce) | thrust_damage(0 , pierce),imodbits_pick ], ["military_pick", "Military Pick", [("steel_pick",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 142 , weight(4)|difficulty(0)|spd_rtng(90) | weapon_length(90)|swing_damage(27 , pierce) | thrust_damage(0 , pierce),imodbits_pick ], ["morningstar", "Morningstar", [("mace_morningstar",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 205 , weight(5.5)|difficulty(13)|spd_rtng(75) | weapon_length(98)|swing_damage(29 , pierce) | thrust_damage(0 , pierce),imodbits_mace ], ["sickle", "Sickle", [("sickle",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_secondary|itp_no_parry|itp_wooden_parry, itc_cleaver, 1 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(40)|swing_damage(20 , cut) | thrust_damage(0 , pierce),imodbits_none ], ["cleaver", "Cleaver", [("cleaver",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_secondary|itp_no_parry|itp_wooden_parry, itc_cleaver, 3 , weight(1.5)|difficulty(0)|spd_rtng(103) | weapon_length(30)|swing_damage(24 , cut) | thrust_damage(0 , pierce),imodbits_none ], ["knife", "Knife", [("peasant_knife",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_secondary|itp_no_parry, itc_dagger|itcf_carry_dagger_front_left, 4 , weight(0.5)|difficulty(0)|spd_rtng(110) | weapon_length(40)|swing_damage(21 , cut) | thrust_damage(13 , pierce),imodbits_sword ], ["butchering_knife", "Butchering Knife", [("khyber_knife",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_secondary|itp_no_parry, itc_dagger|itcf_carry_dagger_front_right, 13 , weight(0.75)|difficulty(0)|spd_rtng(108) | weapon_length(60)|swing_damage(24 , cut) | thrust_damage(17 , pierce),imodbits_sword ], ["dagger", "Dagger", [("dagger",0),("scab_dagger",ixmesh_carry),("dagger_b",imodbits_good),("dagger_b_scabbard",ixmesh_carry|imodbits_good)], itp_type_one_handed_wpn|itp_merchandise|itp_primary|itp_secondary|itp_no_parry, itc_dagger|itcf_carry_dagger_front_left|itcf_show_holster_when_drawn, 17 , weight(0.75)|difficulty(0)|spd_rtng(112) | weapon_length(47)|swing_damage(22 , cut) | thrust_damage(19 , pierce),imodbits_sword_high ], #["nordic_sword", "Nordic Sword", [("viking_sword",0),("scab_vikingsw", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 142 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(98)|swing_damage(27 , cut) | thrust_damage(19 , pierce),imodbits_sword ], #["arming_sword", "Arming Sword", [("b_long_sword",0),("scab_longsw_b", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 156 , weight(1.5)|difficulty(0)|spd_rtng(101) | weapon_length(100)|swing_damage(25 , cut) | thrust_damage(22 , pierce),imodbits_sword ], #["sword", "Sword", [("long_sword",0),("scab_longsw_a", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 148 , weight(1.5)|difficulty(0)|spd_rtng(100) | weapon_length(102)|swing_damage(26 , cut) | thrust_damage(23 , pierce),imodbits_sword ], ["falchion", "Falchion", [("falchion",0)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip, 105 , weight(2.5)|difficulty(8)|spd_rtng(96) | weapon_length(73)|swing_damage(30 , cut) | thrust_damage(0 , pierce),imodbits_sword ], #["broadsword", "Broadsword", [("broadsword",0),("scab_broadsword", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 122 , weight(2.5)|difficulty(8)|spd_rtng(91) | weapon_length(101)|swing_damage(27 , cut) | thrust_damage(0 , pierce),imodbits_sword ], ["scimitar", "Scimitar", [("scimeter",0),("scab_scimeter", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 108 , weight(1.5)|difficulty(0)|spd_rtng(105) | weapon_length(97)|swing_damage(29 , cut) | thrust_damage(0 , pierce),imodbits_sword_high ], #["nomad_sabre", "Nomad Sabre", [("shashqa",0),("scab_shashqa", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 115 , weight(1.75)|difficulty(0)|spd_rtng(101) | weapon_length(100)|swing_damage(27 , cut) | thrust_damage(0 , pierce),imodbits_sword ], #["bastard_sword", "Bastard Sword", [("bastard_sword",0),("scab_bastardsw", ixmesh_carry)], itp_type_two_handed_wpn|itp_merchandise| itp_primary, itc_bastardsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 279 , weight(2.25)|difficulty(9)|spd_rtng(102) | weapon_length(120)|swing_damage(33 , cut) | thrust_damage(27 , pierce),imodbits_sword ], ["great_sword", "Great Sword", [("b_bastard_sword",0),("scab_bastardsw_b", ixmesh_carry)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary, itc_greatsword|itcf_carry_sword_back|itcf_show_holster_when_drawn, 423 , weight(2.75)|difficulty(10)|spd_rtng(95) | weapon_length(125)|swing_damage(39 , cut) | thrust_damage(31 , pierce),imodbits_sword_high ], ["sword_of_war", "Sword of War", [("b_bastard_sword",0),("scab_bastardsw_b", ixmesh_carry)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary, itc_greatsword|itcf_carry_sword_back|itcf_show_holster_when_drawn, 524 , weight(3)|difficulty(11)|spd_rtng(93) | weapon_length(130)|swing_damage(40 , cut) | thrust_damage(31 , pierce),imodbits_sword_high ], ["hatchet", "Hatchet", [("hatchet",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 3 , weight(2)|difficulty(0)|spd_rtng(97) | weapon_length(60)|swing_damage(23 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["hand_axe", "Hand Axe", [("hatchet",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 24 , weight(2)|difficulty(7)|spd_rtng(95) | weapon_length(75)|swing_damage(27 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["fighting_axe", "Fighting Axe", [("fighting_ax",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 77 , weight(2.5)|difficulty(9)|spd_rtng(92) | weapon_length(90)|swing_damage(31 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["axe", "Axe", [("iron_ax",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 65 , weight(4)|difficulty(8)|spd_rtng(91) | weapon_length(108)|swing_damage(32 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["voulge", "Voulge", [("voulge",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 129 , weight(4.5)|difficulty(8)|spd_rtng(87) | weapon_length(119)|swing_damage(35 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["battle_axe", "Battle Axe", [("battle_ax",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 240 , weight(5)|difficulty(9)|spd_rtng(88) | weapon_length(108)|swing_damage(41 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["war_axe", "War Axe", [("war_ax",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 264 , weight(5)|difficulty(10)|spd_rtng(86) | weapon_length(110)|swing_damage(43 , cut) | thrust_damage(0 , pierce),imodbits_axe ], #["double_axe", "Double Axe", [("dblhead_ax",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 359 , weight(6.5)|difficulty(12)|spd_rtng(85) | weapon_length(95)|swing_damage(43 , cut) | thrust_damage(0 , pierce),imodbits_axe ], #["great_axe", "Great Axe", [("great_ax",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 415 , weight(7)|difficulty(13)|spd_rtng(82) | weapon_length(120)|swing_damage(45 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["sword_two_handed_b", "Two Handed Sword", [("sword_two_handed_b",0)], itp_type_two_handed_wpn|itp_merchandise|itp_always_loot| itp_two_handed|itp_primary, itc_greatsword|itcf_carry_sword_back, 670 , weight(2.75)|difficulty(10)|spd_rtng(93) | weapon_length(110)|swing_damage(40 , cut) | thrust_damage(27 , pierce),imodbits_sword_high ], ["sword_two_handed_a", "Great Sword", [("sword_two_handed_a",0)], itp_type_two_handed_wpn|itp_merchandise|itp_always_loot|itp_two_handed|itp_primary, itc_greatsword|itcf_carry_sword_back, 1123 , weight(2.75)|difficulty(10)|spd_rtng(89) | weapon_length(120)|swing_damage(42 , cut) | thrust_damage(28 , pierce),imodbits_sword_high ], ["bastard_sword_a", "Bastard Sword", [("bastard_sword_a",0),("bastard_sword_a_scabbard", ixmesh_carry)], itp_type_two_handed_wpn|itp_merchandise| itp_primary, itc_bastardsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 294 , weight(2.25)|difficulty(9)|spd_rtng(98) | weapon_length(101)|swing_damage(37 , cut) | thrust_damage(26 , pierce),imodbits_sword_high ], ["bastard_sword_b", "Heavy Bastard Sword", [("bastard_sword_b",0),("bastard_sword_b_scabbard", ixmesh_carry)], itp_type_two_handed_wpn|itp_merchandise| itp_primary, itc_bastardsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 526 , weight(2.25)|difficulty(9)|spd_rtng(96) | weapon_length(105)|swing_damage(37 , cut) | thrust_damage(28 , pierce),imodbits_sword_high ], ["one_handed_war_axe_a", "One Handed War Axe", [("one_handed_war_axe_a",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 87 , weight(1.5)|difficulty(9)|spd_rtng(100) | weapon_length(60)|swing_damage(32 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["one_handed_war_axe_b", "One Handed War Axe", [("one_handed_war_axe_b",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 137 , weight(1.5)|difficulty(9)|spd_rtng(98) | weapon_length(61)|swing_damage(34 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["one_handed_battle_axe_a", "One Handed Battle Axe", [("one_handed_battle_axe_a",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 102 , weight(1.5)|difficulty(9)|spd_rtng(97) | weapon_length(69)|swing_damage(34 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["one_handed_battle_axe_b", "One Handed Battle Axe", [("one_handed_battle_axe_b",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 171 , weight(1.75)|difficulty(9)|spd_rtng(96) | weapon_length(70)|swing_damage(36 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["one_handed_battle_axe_c", "One Handed Battle Axe", [("one_handed_battle_axe_c",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_secondary|itp_bonus_against_shield|itp_wooden_parry, itc_scimitar|itcf_carry_axe_left_hip, 294 , weight(2.0)|difficulty(9)|spd_rtng(95) | weapon_length(72)|swing_damage(38 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["two_handed_axe", "Two_Handed_Axe", [("two_handed_battle_axe_a",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 110 , weight(4.5)|difficulty(10)|spd_rtng(90) | weapon_length(90)|swing_damage(40 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["two_handed_battle_axe_2", "Two_Handed_War_Axe", [("two_handed_battle_axe_b",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 202 , weight(4.5)|difficulty(10)|spd_rtng(92) | weapon_length(92)|swing_damage(47 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["two_handed_battle_axe_3", "Voulge", [("two_handed_battle_axe_c",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 258 , weight(4.5)|difficulty(10)|spd_rtng(87) | weapon_length(100)|swing_damage(48 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["bardiche", "Bardiche", [("two_handed_battle_axe_d",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 311 , weight(4.5)|difficulty(10)|spd_rtng(87) | weapon_length(102)|swing_damage(50 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["great_axe", "Great_Axe", [("two_handed_battle_axe_e",0)], itp_type_two_handed_wpn|itp_merchandise| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 446 , weight(4.5)|difficulty(10)|spd_rtng(90) | weapon_length(96)|swing_damage(51 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["great_bardiche", "Great_Bardiche", [("two_handed_battle_axe_f",0)], itp_type_two_handed_wpn|itp_always_loot|itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 617 , weight(4.5)|difficulty(10)|spd_rtng(90) | weapon_length(116)|swing_damage(47 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["shortened_military_scythe", "Shortened Military Scythe", [("two_handed_battle_scythe_a",0)], itp_type_two_handed_wpn|itp_merchandise|itp_always_loot| itp_two_handed|itp_primary, itc_nodachi|itcf_carry_sword_back, 264 , weight(3.0)|difficulty(10)|spd_rtng(90) | weapon_length(112)|swing_damage(44 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["sword_medieval_a", "Sword", [("sword_medieval_a",0),("sword_medieval_a_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 163 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(27 , cut) | thrust_damage(22 , pierce),imodbits_sword_high ], #["sword_medieval_a_long", "Sword", [("sword_medieval_a_long",0),("sword_medieval_a_long_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 156 , weight(1.5)|difficulty(0)|spd_rtng(97) | weapon_length(105)|swing_damage(25 , cut) | thrust_damage(22 , pierce),imodbits_sword ], ["sword_medieval_b", "Sword", [("sword_medieval_b",0),("sword_medieval_b_scabbard", ixmesh_carry),("sword_rusty_a",imodbit_rusty),("sword_rusty_a_scabbard", ixmesh_carry|imodbit_rusty)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 243 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(28 , cut) | thrust_damage(23 , pierce),imodbits_sword_high ], ["sword_medieval_b_small", "Short Sword", [("sword_medieval_b_small",0),("sword_medieval_b_small_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 152 , weight(1.5)|difficulty(0)|spd_rtng(102) | weapon_length(85)|swing_damage(26, cut) | thrust_damage(24, pierce),imodbits_sword_high ], ["sword_medieval_c", "Arming Sword", [("sword_medieval_c",0),("sword_medieval_c_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 410 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(29 , cut) | thrust_damage(24 , pierce),imodbits_sword_high ], ["sword_medieval_c_small", "Short Arming Sword", [("sword_medieval_c_small",0),("sword_medieval_c_small_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 243 , weight(1.5)|difficulty(0)|spd_rtng(103) | weapon_length(86)|swing_damage(26, cut) | thrust_damage(24 , pierce),imodbits_sword_high ], #["sword_medieval_d", "sword_medieval_d", [("sword_medieval_d",0),("sword_medieval_d_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, # 131 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(24 , cut) | thrust_damage(21 , pierce),imodbits_sword ], #["sword_medieval_d_long", "sword_medieval_d_long", [("sword_medieval_d_long",0),("sword_medieval_d_long_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, # 156 , weight(1.5)|difficulty(0)|spd_rtng(97) | weapon_length(105)|swing_damage(25 , cut) | thrust_damage(22 , pierce),imodbits_sword ], #["sword_medieval_e", "sword_medieval_e", [("sword_medieval_e",0),("sword_medieval_e_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, # 131 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(24 , cut) | thrust_damage(21 , pierce),imodbits_sword ], ["sword_viking_1", "Nordic Sword", [("sword_viking_c",0),("sword_viking_c_scabbard ", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 147 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(94)|swing_damage(28 , cut) | thrust_damage(20 , pierce),imodbits_sword_high ] , ["sword_viking_2", "Nordic Sword", [("sword_viking_b",0),("sword_viking_b_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 276 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(29 , cut) | thrust_damage(21 , pierce),imodbits_sword_high ], ["sword_viking_2_small", "Nordic Short Sword", [("sword_viking_b_small",0),("sword_viking_b_small_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 162 , weight(1.25)|difficulty(0)|spd_rtng(103) | weapon_length(85)|swing_damage(28 , cut) | thrust_damage(21 , pierce),imodbits_sword_high ], ["sword_viking_3", "Nordic Sword", [("sword_viking_a",0),("sword_viking_a_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 394 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(95)|swing_damage(30 , cut) | thrust_damage(21 , pierce),imodbits_sword_high ], #["sword_viking_a_long", "sword_viking_a_long", [("sword_viking_a_long",0),("sword_viking_a_long_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, # 142 , weight(1.5)|difficulty(0)|spd_rtng(97) | weapon_length(105)|swing_damage(27 , cut) | thrust_damage(19 , pierce),imodbits_sword ], ["sword_viking_3_small", "Nordic Sword", [("sword_viking_a_small",0),("sword_viking_a_small_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 280 , weight(1.25)|difficulty(0)|spd_rtng(103) | weapon_length(86)|swing_damage(29 , cut) | thrust_damage(21 , pierce),imodbits_sword_high ], #["sword_viking_c_long", "sword_viking_c_long", [("sword_viking_c_long",0),("sword_viking_c_long_scabbard ", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, # 142 , weight(1.5)|difficulty(0)|spd_rtng(95) | weapon_length(105)|swing_damage(27 , cut) | thrust_damage(19 , pierce),imodbits_sword ] , ["sword_khergit_1", "Nomad Sabre", [("khergit_sword_b",0),("khergit_sword_b_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 105 , weight(1.25)|difficulty(0)|spd_rtng(100) | weapon_length(97)|swing_damage(29 , cut),imodbits_sword_high ], ["sword_khergit_2", "Sabre", [("khergit_sword_c",0),("khergit_sword_c_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 191 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(97)|swing_damage(30 , cut),imodbits_sword_high ], ["sword_khergit_3", "Sabre", [("khergit_sword_a",0),("khergit_sword_a_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 294 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(98)|swing_damage(31 , cut),imodbits_sword_high ], ["sword_khergit_4", "Heavy Sabre", [("khergit_sword_d",0),("khergit_sword_d_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 384 , weight(1.75)|difficulty(0)|spd_rtng(96) | weapon_length(96)|swing_damage(33 , cut),imodbits_sword_high ], ["mace_1", "spiked_club", [("mace_d",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip, 45 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(62)|swing_damage(19 , pierce) | thrust_damage(0 , pierce),imodbits_mace ], ["mace_2", "Knobbed_Mace", [("mace_a",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip, 98 , weight(2.5)|difficulty(0)|spd_rtng(98) | weapon_length(60)|swing_damage(21 , blunt) | thrust_damage(0 , pierce),imodbits_mace ], ["mace_3", "Spiked Mace", [("mace_c",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip, 152 , weight(2.5)|difficulty(0)|spd_rtng(98) | weapon_length(62)|swing_damage(23 , blunt) | thrust_damage(0 , pierce),imodbits_mace ], ["mace_4", "Winged_Mace", [("mace_b",0)], itp_type_one_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip, 212 , weight(2.5)|difficulty(0)|spd_rtng(98) | weapon_length(60)|swing_damage(24 , blunt) | thrust_damage(0 , pierce),imodbits_mace ], ["club_with_spike_head", "Club_with_Spike", [("mace_e",0)], itp_type_two_handed_wpn|itp_merchandise| itp_primary|itp_wooden_parry, itc_bastardsword|itcf_carry_axe_back, 72 , weight(3.5)|difficulty(9)|spd_rtng(103) | weapon_length(80)|swing_damage(26 , blunt) | thrust_damage(25 , pierce),imodbits_mace ], ["scythe", "Scythe", [("scythe",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear, 43 , weight(3)|difficulty(0)|spd_rtng(79) | weapon_length(182)|swing_damage(19 , cut) | thrust_damage(14 , pierce),imodbits_polearm ], ["pitch_fork", "Pitch Fork", [("pitch_fork",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear, 19 , weight(3.5)|difficulty(0)|spd_rtng(83) | weapon_length(154)|swing_damage(0 , blunt) | thrust_damage(18 , pierce),imodbits_polearm ], ["military_fork", "Military Fork", [("military_fork",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear, 153 , weight(4.5)|difficulty(0)|spd_rtng(88) | weapon_length(135)|swing_damage(0 , blunt) | thrust_damage(23 , pierce),imodbits_polearm ], ["battle_fork", "Battle Fork", [("battle_fork",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear, 282 , weight(4.5)|difficulty(0)|spd_rtng(87) | weapon_length(142)|swing_damage(0 , blunt) | thrust_damage(24 , pierce),imodbits_polearm ], ["boar_spear", "Boar Spear", [("spear",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear|itcf_carry_spear, 76 , weight(4)|difficulty(0)|spd_rtng(81) | weapon_length(157)|swing_damage(0 , cut) | thrust_damage(23 , pierce),imodbits_polearm ], #["spear", "Spear", [("spear",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear|itcf_carry_spear, 173 , weight(4.5)|difficulty(0)|spd_rtng(80) | weapon_length(158)|swing_damage(17 , blunt) | thrust_damage(23 , pierce),imodbits_polearm ], ["jousting_lance", "Jousting Lance", [("joust_of_peace",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_greatlance, 158 , weight(5)|difficulty(0)|spd_rtng(61) | weapon_length(218)|swing_damage(0 , cut) | thrust_damage(17 , blunt),imodbits_polearm ], #["lance", "Lance", [("pike",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear, 196 , weight(5)|difficulty(0)|spd_rtng(72) | weapon_length(170)|swing_damage(0 , cut) | thrust_damage(20 , pierce),imodbits_polearm ], #["great_lance", "Great Lance", [("heavy_lance",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_greatlance, 237 , weight(5)|difficulty(0)|spd_rtng(55) | weapon_length(215)|swing_damage(0 , cut) | thrust_damage(21 , pierce),imodbits_polearm ], ["double_sided_lance", "Double Sided Lance", [("lance_dblhead",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff, 261 , weight(5.5)|difficulty(0)|spd_rtng(80) | weapon_length(130)|swing_damage(0 , cut) | thrust_damage(27 , pierce),imodbits_polearm ], #["pike", "Pike", [("pike",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_two_handed|itp_wooden_parry, itc_spear, # 212 , weight(6)|difficulty(0)|spd_rtng(77) | weapon_length(167)|swing_damage(0 , blunt) | thrust_damage(23 , pierce),imodbits_polearm ], ["glaive", "Glaive", [("glaive",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_two_handed|itp_wooden_parry, itc_staff|itcf_carry_spear, 352 , weight(4.5)|difficulty(0)|spd_rtng(83) | weapon_length(157)|swing_damage(38 , cut) | thrust_damage(21 , pierce),imodbits_polearm ], ["poleaxe", "Poleaxe", [("pole_ax",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_two_handed|itp_wooden_parry, itc_staff, 384 , weight(6.5)|difficulty(0)|spd_rtng(77) | weapon_length(180)|swing_damage(37 , cut) | thrust_damage(21 , pierce),imodbits_polearm ], ["polehammer", "Polehammer", [("pole_hammer",0)], itp_type_polearm| itp_spear|itp_primary|itp_two_handed|itp_wooden_parry, itc_staff, 169 , weight(7)|difficulty(14)|spd_rtng(73) | weapon_length(130)|swing_damage(29 , blunt) | thrust_damage(25 , blunt),imodbits_polearm ], ["staff", "Staff", [("wooden_staff",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack, itc_staff|itcf_carry_sword_back, 36 , weight(1.5)|difficulty(0)|spd_rtng(100) | weapon_length(130)|swing_damage(18 , blunt) | thrust_damage(19 , blunt),imodbits_polearm ], ["quarter_staff", "Quarter Staff", [("quarter_staff",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry|itp_wooden_attack, itc_staff|itcf_carry_sword_back, 60 , weight(2)|difficulty(0)|spd_rtng(104) | weapon_length(140)|swing_damage(20 , blunt) | thrust_damage(20 , blunt),imodbits_polearm ], ["iron_staff", "Iron Staff", [("iron_staff",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield, itc_staff|itcf_carry_sword_back, 202 , weight(2)|difficulty(0)|spd_rtng(97) | weapon_length(140)|swing_damage(25 , blunt) | thrust_damage(26 , blunt),imodbits_polearm ], ["shortened_spear", "Shortened_Spear", [("spear_g_1-9m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear, 53 , weight(2.0)|difficulty(0)|spd_rtng(102) | weapon_length(120)|swing_damage(19 , blunt) | thrust_damage(25 , pierce),imodbits_polearm ], ["spear", "Spear", [("spear_h_2-15m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear, 75 , weight(2.25)|difficulty(0)|spd_rtng(98) | weapon_length(135)|swing_damage(20 , blunt) | thrust_damage(26 , pierce),imodbits_polearm ], ["war_spear", "War_Spear", [("spear_i_2-3m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear, 90 , weight(2.5)|difficulty(0)|spd_rtng(96) | weapon_length(150)|swing_damage(20 , blunt) | thrust_damage(27 , pierce),imodbits_polearm ], #TODO:["shortened_spear", "shortened_spear", [("spear_e_2-1m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear, # 65 , weight(2.0)|difficulty(0)|spd_rtng(98) | weapon_length(110)|swing_damage(17 , blunt) | thrust_damage(23 , pierce),imodbits_polearm ], #TODO:["spear_2-4m", "spear", [("spear_e_2-25m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_staff|itcf_carry_spear, # 67 , weight(2.0)|difficulty(0)|spd_rtng(95) | weapon_length(125)|swing_damage(17 , blunt) | thrust_damage(23 , pierce),imodbits_polearm ], ["spear_e_2-5m", "Military Scythe", [("spear_e_2-5m",0),("spear_c_2-5m",imodbits_bad)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear|itcf_carry_spear, 145 , weight(2.5)|difficulty(10)|spd_rtng(93) | weapon_length(155)|swing_damage(36 , cut) | thrust_damage(25 , pierce),imodbits_polearm ], ["light_lance", "Light Lance", [("spear_b_2-75m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear, 89 , weight(2.5)|difficulty(0)|spd_rtng(90) | weapon_length(175)|swing_damage(16 , blunt) | thrust_damage(27 , pierce),imodbits_polearm ], ["lance", "Lance", [("spear_d_2-8m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear, 110 , weight(2.5)|difficulty(0)|spd_rtng(88) | weapon_length(180)|swing_damage(16 , blunt) | thrust_damage(26 , pierce),imodbits_polearm ], ["heavy_lance", "Heavy Lance", [("spear_f_2-9m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear, 130 , weight(2.75)|difficulty(10)|spd_rtng(85) | weapon_length(190)|swing_damage(16 , blunt) | thrust_damage(26 , pierce),imodbits_polearm ], ["pike", "Pike", [("spear_a_3m",0)], itp_type_polearm|itp_merchandise| itp_cant_use_on_horseback|itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear, 125 , weight(3.0)|difficulty(0)|spd_rtng(81) | weapon_length(245)|swing_damage(16 , blunt) | thrust_damage(26 , pierce),imodbits_polearm ], ##["spear_e_3-25m", "Spear_3-25m", [("spear_e_3-25m",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear|itcf_carry_spear, ## 150 , weight(4.5)|difficulty(0)|spd_rtng(81) | weapon_length(225)|swing_damage(19 , blunt) | thrust_damage(23 , pierce),imodbits_polearm ], ["ashwood_pike", "Ashwood Pike", [("pike",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_two_handed|itp_wooden_parry, itc_cutting_spear, 205 , weight(3.5)|difficulty(11)|spd_rtng(90) | weapon_length(170)|swing_damage(19 , blunt) | thrust_damage(29, pierce),imodbits_polearm ], ["awlpike", "Awlpike", [("pike",0)], itp_type_polearm|itp_merchandise| itp_spear|itp_primary|itp_two_handed|itp_wooden_parry, itc_cutting_spear|itcf_carry_spear, 378 , weight(3.5)|difficulty(12)|spd_rtng(92) | weapon_length(160)|swing_damage(30 , cut) | thrust_damage(31 , pierce),imodbits_polearm ], # SHIELDS ["wooden_shield", "Wooden Shield", [("shield_round_a",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 42 , weight(2)|hit_points(360)|body_armor(1)|spd_rtng(100)|weapon_length(50),imodbits_shield ], ##["wooden_shield", "Wooden Shield", [("shield_round_a",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 42 , weight(2)|hit_points(360)|body_armor(1)|spd_rtng(100)|weapon_length(50),imodbits_shield, #["round_shield", "Round Shield", [("shield_round_c",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 64 , weight(2)|hit_points(400)|body_armor(1)|spd_rtng(100)|weapon_length(50),imodbits_shield ], ["nordic_shield", "Nordic Shield", [("shield_round_b",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 95 , weight(2)|hit_points(440)|body_armor(1)|spd_rtng(100)|weapon_length(50),imodbits_shield ], #["kite_shield", "Kite Shield", [("shield_kite_a",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], #["kite_shield_", "Kite Shield", [("shield_kite_b",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], #["large_shield", "Large Shield", [("shield_kite_c",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 165 , weight(2.5)|hit_points(520)|body_armor(1)|spd_rtng(80)|weapon_length(92),imodbits_shield ], #["battle_shield", "Battle Shield", [("shield_kite_d",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 196 , weight(3)|hit_points(560)|body_armor(1)|spd_rtng(78)|weapon_length(94),imodbits_shield ], ["fur_covered_shield", "Fur Covered Shield", [("shield_kite_m",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 227 , weight(3.5)|hit_points(600)|body_armor(1)|spd_rtng(76)|weapon_length(81),imodbits_shield ], #["heraldric_shield", "Heraldric Shield", [("shield_heraldic",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 301 , weight(3.5)|hit_points(640)|body_armor(1)|spd_rtng(83)|weapon_length(65),imodbits_shield ], #["heater_shield", "Heater Shield", [("shield_heater_a",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 477 , weight(3.5)|hit_points(710)|body_armor(4)|spd_rtng(80)|weapon_length(60),imodbits_shield ], ["steel_shield", "Steel Shield", [("shield_dragon",0)], itp_merchandise|itp_type_shield, itcf_carry_round_shield, 697 , weight(4)|hit_points(700)|body_armor(17)|spd_rtng(61)|weapon_length(40),imodbits_shield ], #["nomad_shield", "Nomad Shield", [("shield_wood_b",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 12 , weight(2)|hit_points(260)|body_armor(6)|spd_rtng(110)|weapon_length(30),imodbits_shield ], ["plate_covered_round_shield", "Plate_Covered_Round_Shield", [("shield_round_e",0)], 0, itcf_carry_round_shield, 140 , weight(4)|hit_points(330)|body_armor(16)|spd_rtng(90)|weapon_length(40),imodbits_shield ], ["leather_covered_round_shield", "Leather_Covered_Round_Shield", [("shield_round_d",0)], itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 80 , weight(2.5)|hit_points(310)|body_armor(8)|spd_rtng(96)|weapon_length(40),imodbits_shield ], ["hide_covered_round_shield", "Hide_Covered_Round_Shield", [("shield_round_f",0)], itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 40 , weight(2)|hit_points(260)|body_armor(3)|spd_rtng(100)|weapon_length(40),imodbits_shield ], ["shield_heater_c", "Heater Shield", [("shield_heater_c",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 277 , weight(3.5)|hit_points(410)|body_armor(2)|spd_rtng(80)|weapon_length(50),imodbits_shield ], #["shield_heater_d", "Heater Shield", [("shield_heater_d",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 477 , weight(3.5)|hit_points(710)|body_armor(4)|spd_rtng(80)|weapon_length(60),imodbits_shield ], #["shield_kite_g", "Kite Shield g", [("shield_kite_g",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], #["shield_kite_h", "Kite Shield h", [("shield_kite_h",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], #["shield_kite_i", "Kite Shield i ", [("shield_kite_i",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], #["shield_kite_k", "Kite Shield k", [("shield_kite_k",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], ["norman_shield_1", "Kite Shield", [("norman_shield_1",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], ["norman_shield_2", "Kite Shield", [("norman_shield_2",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], ["norman_shield_3", "Kite Shield", [("norman_shield_3",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], ["norman_shield_4", "Kite Shield", [("norman_shield_4",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], ["norman_shield_5", "Kite Shield", [("norman_shield_5",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], ["norman_shield_6", "Kite Shield", [("norman_shield_6",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], ["norman_shield_7", "Kite Shield", [("norman_shield_7",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], ["norman_shield_8", "Kite Shield", [("norman_shield_8",0)], itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),imodbits_shield ], ["tab_shield_round_a", "Old Round Shield", [("tableau_shield_round_5",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 26 , weight(2.5)|hit_points(350)|body_armor(0)|spd_rtng(93)|weapon_length(50),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_round_shield_5", ":agent_no", ":troop_no")])]], ["tab_shield_round_b", "Plain Round Shield", [("tableau_shield_round_3",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 65 , weight(3)|hit_points(460)|body_armor(2)|spd_rtng(90)|weapon_length(50),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_round_shield_3", ":agent_no", ":troop_no")])]], ["tab_shield_round_c", "Round_Shield", [("tableau_shield_round_2",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 105 , weight(3.5)|hit_points(540)|body_armor(4)|spd_rtng(87)|weapon_length(50),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner","tableau_round_shield_2", ":agent_no", ":troop_no")])]], ["tab_shield_round_d", "Heavy Round_Shield", [("tableau_shield_round_1",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 210 , weight(4)|hit_points(600)|body_armor(6)|spd_rtng(84)|weapon_length(50),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_round_shield_1", ":agent_no", ":troop_no")])]], ["tab_shield_round_e", "Huscarl's Round_Shield", [("tableau_shield_round_4",0)], itp_merchandise|itp_type_shield, itcf_carry_round_shield, 430 , weight(4.5)|hit_points(690)|body_armor(8)|spd_rtng(81)|weapon_length(50),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_round_shield_4", ":agent_no", ":troop_no")])]], ["tab_shield_kite_a", "Old Kite Shield", [("tableau_shield_kite_1" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 33 , weight(2)|hit_points(285)|body_armor(0)|spd_rtng(96)|weapon_length(60),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_kite_shield_1", ":agent_no", ":troop_no")])]], ["tab_shield_kite_b", "Plain Kite Shield", [("tableau_shield_kite_3" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 70 , weight(2.5)|hit_points(365)|body_armor(2)|spd_rtng(93)|weapon_length(60),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_kite_shield_3", ":agent_no", ":troop_no")])]], ["tab_shield_kite_c", "Kite Shield", [("tableau_shield_kite_2" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 156 , weight(3)|hit_points(435)|body_armor(5)|spd_rtng(90)|weapon_length(60),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_kite_shield_2", ":agent_no", ":troop_no")])]], ["tab_shield_kite_d", "Heavy Kite Shield", [("tableau_shield_kite_2" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 320 , weight(3.5)|hit_points(515)|body_armor(8)|spd_rtng(87)|weapon_length(60),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_kite_shield_2", ":agent_no", ":troop_no")])]], ["tab_shield_kite_cav_a", "Horseman's Kite Shield", [("tableau_shield_kite_4" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 205 , weight(2)|hit_points(310)|body_armor(10)|spd_rtng(103)|weapon_length(40),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_kite_shield_4", ":agent_no", ":troop_no")])]], ["tab_shield_kite_cav_b", "Knightly Kite Shield", [("tableau_shield_kite_4" ,0)], itp_merchandise|itp_type_shield, itcf_carry_kite_shield, 360 , weight(2.5)|hit_points(370)|body_armor(16)|spd_rtng(100)|weapon_length(40),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_kite_shield_4", ":agent_no", ":troop_no")])]], ["tab_shield_heater_a", "Old Heater Shield", [("tableau_shield_heater_1" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 36 , weight(2)|hit_points(280)|body_armor(1)|spd_rtng(96)|weapon_length(60),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heater_shield_1", ":agent_no", ":troop_no")])]], ["tab_shield_heater_b", "Plain Heater Shield", [("tableau_shield_heater_1" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 74 , weight(2.5)|hit_points(360)|body_armor(3)|spd_rtng(93)|weapon_length(60),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heater_shield_1", ":agent_no", ":troop_no")])]], ["tab_shield_heater_c", "Heater Shield", [("tableau_shield_heater_1" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 160 , weight(3)|hit_points(430)|body_armor(6)|spd_rtng(90)|weapon_length(60),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heater_shield_1", ":agent_no", ":troop_no")])]], ["tab_shield_heater_d", "Heavy Heater Shield", [("tableau_shield_heater_1" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 332 , weight(3.5)|hit_points(510)|body_armor(9)|spd_rtng(87)|weapon_length(60),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heater_shield_1", ":agent_no", ":troop_no")])]], ["tab_shield_heater_cav_a", "Horseman's Heater Shield", [("tableau_shield_heater_2" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 229 , weight(2)|hit_points(300)|body_armor(12)|spd_rtng(103)|weapon_length(40),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heater_shield_2", ":agent_no", ":troop_no")])]], ["tab_shield_heater_cav_b", "Knightly Heater Shield", [("tableau_shield_heater_2" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield, 390 , weight(2.5)|hit_points(360)|body_armor(18)|spd_rtng(100)|weapon_length(40),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heater_shield_2", ":agent_no", ":troop_no")])]], ["tab_shield_pavise_a", "Old Board Shield", [("tableau_shield_pavise_2" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield, 60 , weight(3.5)|hit_points(510)|body_armor(0)|spd_rtng(89)|weapon_length(84),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_pavise_shield_2", ":agent_no", ":troop_no")])]], ["tab_shield_pavise_b", "Plain Board Shield", [("tableau_shield_pavise_2" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield, 114 , weight(4)|hit_points(640)|body_armor(1)|spd_rtng(85)|weapon_length(84),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_pavise_shield_2", ":agent_no", ":troop_no")])]], ["tab_shield_pavise_c", "Board Shield", [("tableau_shield_pavise_1" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield, 210 , weight(4.5)|hit_points(760)|body_armor(2)|spd_rtng(81)|weapon_length(84),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_pavise_shield_1", ":agent_no", ":troop_no")])]], ["tab_shield_pavise_d", "Heavy Board Shield", [("tableau_shield_pavise_1" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield, 370 , weight(5)|hit_points(980)|body_armor(3)|spd_rtng(78)|weapon_length(84),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_pavise_shield_1", ":agent_no", ":troop_no")])]], ["tab_shield_small_round_a", "Plain Cavalry Shield", [("tableau_shield_small_round_3",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 96 , weight(2)|hit_points(310)|body_armor(3)|spd_rtng(105)|weapon_length(40),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_small_round_shield_3", ":agent_no", ":troop_no")])]], ["tab_shield_small_round_b", "Round Cavalry Shield", [("tableau_shield_small_round_1",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_round_shield, 195 , weight(2.5)|hit_points(370)|body_armor(9)|spd_rtng(103)|weapon_length(40),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_small_round_shield_1", ":agent_no", ":troop_no")])]], ["tab_shield_small_round_c", "Elite Cavalry Shield", [("tableau_shield_small_round_2",0)], itp_merchandise|itp_type_shield, itcf_carry_round_shield, 370 , weight(3)|hit_points(420)|body_armor(14)|spd_rtng(100)|weapon_length(40),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_small_round_shield_2", ":agent_no", ":troop_no")])]], #RANGED ["jarid", "Jarid", [("jarid_new",0),("jarid_quiver", ixmesh_carry)], itp_type_thrown |itp_merchandise|itp_primary|itp_bonus_against_shield ,itcf_throw_javelin|itcf_carry_quiver_back|itcf_show_holster_when_drawn, 209 , weight(4)|difficulty(2)|spd_rtng(89) | shoot_speed(27) | thrust_damage(33 , pierce)|max_ammo(7)|weapon_length(65),imodbits_thrown ], ["javelin", "Javelin", [("javelin",0),("javelins_quiver", ixmesh_carry)], itp_type_thrown |itp_merchandise|itp_primary|itp_bonus_against_shield ,itcf_throw_javelin|itcf_carry_quiver_back|itcf_show_holster_when_drawn, 75 , weight(5)|difficulty(1)|spd_rtng(91) | shoot_speed(28) | thrust_damage(28 , pierce)|max_ammo(7)|weapon_length(75),imodbits_thrown ], ["stones", "Stones", [("throwing_stone",0)], itp_type_thrown |itp_merchandise|itp_primary ,itcf_throw_stone, 1 , weight(4)|difficulty(0)|spd_rtng(97) | shoot_speed(30) | thrust_damage(11 , blunt)|max_ammo(18)|weapon_length(8),imodbit_large_bag ], ["throwing_knives", "Throwing Knives", [("throwing_knife",0)], itp_type_thrown |itp_merchandise|itp_primary ,itcf_throw_knife, 76 , weight(3.5)|difficulty(0)|spd_rtng(121) | shoot_speed(25) | thrust_damage(19 , cut)|max_ammo(15)|weapon_length(0),imodbits_thrown ], ["throwing_daggers", "Throwing Daggers", [("throwing_dagger",0)], itp_type_thrown |itp_merchandise|itp_primary ,itcf_throw_knife, 193 , weight(3.5)|difficulty(0)|spd_rtng(110) | shoot_speed(24) | thrust_damage(25 , cut)|max_ammo(14)|weapon_length(0),imodbits_thrown ], ["throwing_axes", "Throwing Axes", [("francisca",0)], itp_type_thrown |itp_merchandise|itp_primary|itp_bonus_against_shield,itcf_throw_axe,241, weight(5)|difficulty(1)|spd_rtng(99) | shoot_speed(20) | thrust_damage(38,cut)|max_ammo(7)|weapon_length(53),imodbits_thrown ], ["hunting_bow", "Hunting Bow", [("hunting_bow",0),("hunting_bow_carry",ixmesh_carry)], itp_type_bow |itp_merchandise|itp_primary|itp_two_handed,itcf_shoot_bow|itcf_carry_bow_back, 17 , weight(1)|difficulty(0)|spd_rtng(100) | shoot_speed(48) | thrust_damage(15 , pierce),imodbits_bow ], ["short_bow", "Short Bow", [("short_bow",0),("short_bow_carry",ixmesh_carry)], itp_type_bow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_bow|itcf_carry_bow_back, 58 , weight(1)|difficulty(1)|spd_rtng(98) | shoot_speed(52) | thrust_damage(18 , pierce ),imodbits_bow ], ["nomad_bow", "Nomad Bow", [("nomad_bow",0),("nomad_bow_case", ixmesh_carry)], itp_type_bow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_bow|itcf_carry_bowcase_left|itcf_show_holster_when_drawn, 164 , weight(1.25)|difficulty(2)|spd_rtng(96) | shoot_speed(53) | thrust_damage(20 , pierce),imodbits_bow ], ["long_bow", "Long Bow", [("long_bow",0),("long_bow_carry",ixmesh_carry)], itp_type_bow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_bow|itcf_carry_bow_back, 145 , weight(1.75)|difficulty(3)|spd_rtng(82) | shoot_speed(54) | thrust_damage(22 , pierce),imodbits_bow ], ["khergit_bow", "Khergit Bow", [("khergit_bow",0),("khergit_bow_case", ixmesh_carry)], itp_type_bow |itp_merchandise|itp_primary|itp_two_handed,itcf_shoot_bow|itcf_carry_bowcase_left|itcf_show_holster_when_drawn, 269 , weight(1.25)|difficulty(3)|spd_rtng(95) | shoot_speed(56) | thrust_damage(21 ,pierce),imodbits_bow ], ["strong_bow", "Strong Bow", [("strong_bow",0),("strong_bow_case", ixmesh_carry)], itp_type_bow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_bow|itcf_carry_bowcase_left|itcf_show_holster_when_drawn, 437 , weight(1.25)|difficulty(3)|spd_rtng(94) | shoot_speed(57) | thrust_damage(23 ,pierce),imodbit_cracked | imodbit_bent | imodbit_masterwork ], ["war_bow", "War Bow", [("war_bow",0),("war_bow_carry",ixmesh_carry)],itp_type_bow|itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_bow|itcf_carry_bow_back, 728 , weight(1.5)|difficulty(4)|spd_rtng(93) | shoot_speed(58) | thrust_damage(25 ,pierce),imodbits_bow ], ["hunting_crossbow", "Hunting Crossbow", [("crossbow",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 22 , weight(2.25)|difficulty(0)|spd_rtng(47) | shoot_speed(50) | thrust_damage(28 , pierce)|max_ammo(1),imodbits_crossbow ], ["light_crossbow", "Light Crossbow", [("light_crossbow",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 67 , weight(2.5)|difficulty(8)|spd_rtng(45) | shoot_speed(59) | thrust_damage(34 , pierce)|max_ammo(1),imodbits_crossbow ], ["crossbow", "Crossbow", [("crossbow",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_use_on_horseback ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 182 , weight(3)|difficulty(8)|spd_rtng(43) | shoot_speed(68) | thrust_damage(38,pierce)|max_ammo(1),imodbits_crossbow ], ["heavy_crossbow", "Heavy Crossbow", [("heavy_crossbow",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_use_on_horseback ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 349 , weight(3.5)|difficulty(9)|spd_rtng(41) | shoot_speed(72) | thrust_damage(46 ,pierce)|max_ammo(1),imodbits_crossbow ], ["sniper_crossbow", "Siege Crossbow", [("heavy_crossbow",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_use_on_horseback ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 683 , weight(3.75)|difficulty(10)|spd_rtng(37) | shoot_speed(74) | thrust_damage(49 ,pierce)|max_ammo(1),imodbits_crossbow ], ["flintlock_pistol", "Flintlock Pistol", [("flintlock_pistol",0)], itp_type_pistol |itp_merchandise|itp_primary ,itcf_shoot_pistol|itcf_reload_pistol, 230 , weight(1.5)|difficulty(0)|spd_rtng(38) | shoot_speed(160) | thrust_damage(41 ,pierce)|max_ammo(1)|accuracy(65),imodbits_none, [(ti_on_weapon_attack, [(play_sound,"snd_pistol_shot"),(position_move_x, pos1,27),(position_move_y, pos1,36),(particle_system_burst, "psys_pistol_smoke", pos1, 15)])]], ["torch", "Torch", [("club",0)], itp_type_one_handed_wpn|itp_primary, itc_scimitar, 11 , weight(2.5)|difficulty(0)|spd_rtng(95) | weapon_length(95)|swing_damage(11 , blunt) | thrust_damage(0 , pierce),imodbits_none, [(ti_on_init_item, [(set_position_delta,0,60,0),(particle_system_add_new, "psys_torch_fire"),(particle_system_add_new, "psys_torch_smoke"),(set_current_color,150, 130, 70),(add_point_light, 10, 30), ])]], ##["short_sword", "Short Sword", ## [("sword_norman",0),("sword_norman_scabbard", ixmesh_carry),("sword_norman_rusty",imodbit_rusty),("sword_norman_rusty_scabbard", ixmesh_carry|imodbit_rusty)], ## itp_type_one_handed_wpn|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 183 , weight(1.25)|difficulty(0)|spd_rtng(103) | weapon_length(75)|swing_damage(25 , cut) | thrust_damage(19 , pierce),imodbits_sword ], ["strange_armor", "Strange Armor", [("samurai_armor",0)], itp_type_body_armor |itp_covers_legs ,0, 1259 , weight(18)|abundance(100)|head_armor(0)|body_armor(38)|leg_armor(19)|difficulty(7) ,imodbits_armor ], ["strange_boots", "Strange Boots", [("samurai_boots",0)], itp_type_foot_armor | itp_attach_armature,0, 465 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(21)|difficulty(0) ,imodbits_cloth ], ["strange_helmet", "Strange Helmet", [("samurai_helmet",0)], itp_type_head_armor ,0, 824 , weight(2)|abundance(100)|head_armor(44)|body_armor(0)|leg_armor(0)|difficulty(7) ,imodbits_plate ], ["strange_sword", "Strange Sword", [("katana",0),("katana_scabbard",ixmesh_carry)], itp_type_two_handed_wpn| itp_primary, itc_bastardsword|itcf_carry_katana|itcf_show_holster_when_drawn, 679 , weight(2.0)|difficulty(9)|spd_rtng(108) | weapon_length(95)|swing_damage(32 , cut) | thrust_damage(18 , pierce),imodbits_sword ], ["strange_great_sword", "Strange Great Sword", [("no_dachi",0),("no_dachi_scabbard",ixmesh_carry)], itp_type_two_handed_wpn|itp_two_handed|itp_primary, itc_nodachi|itcf_carry_sword_back|itcf_show_holster_when_drawn, 920 , weight(3.5)|difficulty(11)|spd_rtng(92) | weapon_length(125)|swing_damage(38 , cut) | thrust_damage(0 , pierce),imodbits_axe ], ["strange_short_sword", "Strange Short Sword", [("wakizashi",0),("wakizashi_scabbard",ixmesh_carry)], itp_type_one_handed_wpn|itp_primary, itc_longsword|itcf_carry_wakizashi|itcf_show_holster_when_drawn, 321 , weight(1.25)|difficulty(0)|spd_rtng(108) | weapon_length(65)|swing_damage(25 , cut) | thrust_damage(19 , pierce),imodbits_sword ], ["court_dress", "Court Dress", [("court_dress",0)], itp_type_body_armor|itp_covers_legs|itp_civilian ,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(14)|leg_armor(4)|difficulty(0) ,imodbits_cloth ], ["rich_outfit", "Rich Outfit", [("merchant_outf",0)], itp_type_body_armor|itp_covers_legs|itp_civilian ,0, 348 , weight(4)|abundance(100)|head_armor(0)|body_armor(16)|leg_armor(4)|difficulty(0) ,imodbits_cloth ], ["khergit_guard_armor", "Khergit Guard Armor", [("lamellar_armor_a",0)], itp_type_body_armor|itp_covers_legs ,0, 348 , weight(14)|abundance(100)|head_armor(0)|body_armor(34)|leg_armor(8)|difficulty(0) ,imodbits_armor ], #["leather_steppe_cap_c", "Leather Steppe Cap", [("leather_steppe_cap_c",0)], itp_type_head_armor ,0, 51 , weight(2)|abundance(100)|head_armor(18)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["felt_steppe_cap", "Felt Steppe Cap", [("felt_steppe_cap",0)], itp_type_head_armor ,0, 237 , weight(2)|abundance(100)|head_armor(16)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["khergit_war_helmet", "Khergit War Helmet", [("khergit_war_helmet",0)], itp_type_head_armor ,0, 322 , weight(2)|abundance(100)|head_armor(31)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["khergit_helmet", "Khergit Helmet", [("khergit_guard_helmet",0)], itp_type_head_armor ,0, 361 , weight(2)|abundance(100)|head_armor(33)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], #["khergit_sword", "Khergit Sword", [("khergit_sword",0),("khergit_sword_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 183 , weight(1.25)|difficulty(0)|spd_rtng(100) | weapon_length(97)|swing_damage(23 , cut) | thrust_damage(14 , pierce),imodbits_sword ], ["khergit_guard_boots", "Khergit Guard Boots", [("lamellar_boots_a",0)], itp_type_foot_armor | itp_attach_armature,0, 254 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(20)|difficulty(0) ,imodbits_cloth ], ["khergit_guard_helmet", "Khergit Guard Helmet", [("lamellar_helmet_a",0)], itp_type_head_armor ,0, 433 , weight(2)|abundance(100)|head_armor(36)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["khergit_cavalry_helmet", "Khergit Cavalry Helmet", [("lamellar_helmet_b",0)], itp_type_head_armor ,0, 433 , weight(2)|abundance(100)|head_armor(36)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["black_hood", "Black Hood", [("hood_black",0)], itp_type_head_armor|itp_merchandise ,0, 193 , weight(2)|abundance(100)|head_armor(18)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["light_leather", "Light Leather", [("light_leather",0)], itp_type_body_armor|itp_covers_legs|itp_merchandise ,0, 352 , weight(5)|abundance(100)|head_armor(0)|body_armor(26)|leg_armor(7)|difficulty(0) ,imodbits_armor ], ["light_leather_boots", "Light Leather Boots", [("light_leather_boots",0)], itp_type_foot_armor |itp_merchandise| itp_attach_armature,0, 91 , weight(1)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(15)|difficulty(0) ,imodbits_cloth ], ["mail_and_plate", "Mail and Plate", [("mail_and_plate",0)], itp_type_body_armor|itp_covers_legs ,0, 593 , weight(16)|abundance(100)|head_armor(0)|body_armor(34)|leg_armor(12)|difficulty(0) ,imodbits_armor ], ["light_mail_and_plate", "Light Mail and Plate", [("light_mail_and_plate",0)], itp_type_body_armor|itp_covers_legs ,0, 532 , weight(10)|abundance(100)|head_armor(0)|body_armor(32)|leg_armor(12)|difficulty(0) ,imodbits_armor ], ["byzantion_helmet_a", "Byzantion Helmet", [("byzantion_helmet_a",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["magyar_helmet_a", "Magyar Helmet", [("magyar_helmet_a",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["rus_helmet_a", "Rus Helmet", [("rus_helmet_a",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["sipahi_helmet_a", "Sipahi Helmet", [("sipahi_helmet_a",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["shahi", "Shahi", [("shahi",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ["rabati", "Rabati", [("rabati",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ], ]
Python
import string import types from module_info import * from module_mission_templates import * from process_common import * from process_operations import * mission_template_name_pos = 0 mission_template_flags_pos = 1 mission_template_types_pos = 2 mission_template_desc_pos = 3 mission_template_groups_pos =4 mission_template_triggers_pos = 5 def save_triggers(file,template_name,triggers,variable_list,variable_uses,tag_uses,quick_strings): file.write("%d\n"%len(triggers)) for i in xrange(len(triggers)): trigger = triggers[i] file.write("%f %f %f "%(trigger[trigger_check_pos],trigger[trigger_delay_pos],trigger[trigger_rearm_pos])) save_statement_block(file, 0, 1, trigger[trigger_conditions_pos] , variable_list,variable_uses,tag_uses,quick_strings) save_statement_block(file, 0, 1, trigger[trigger_consequences_pos], variable_list,variable_uses,tag_uses,quick_strings) file.write("\n") file.write("\n") def save_mission_template_group(file,entry): if (len(entry[5]) > 8): print "ERROR: Too many item_overrides!" error() file.write("%d %d %d %d %d %d "%(entry[0],entry[1],entry[2],entry[3],entry[4], len(entry[5]))) for item_override in entry[5]: add_tag_use(tag_uses,tag_item,item_override) file.write("%d "%(item_override)) file.write("\n") def save_mission_templates(variables,variable_uses,tag_uses,quick_strings): file = open(export_dir + "mission_templates.txt","w") file.write("missionsfile version 1\n") file.write(" %d\n"%(len(mission_templates))) for mission_template in mission_templates: file.write("mst_%s %s %d "%(convert_to_identifier(mission_template[mission_template_name_pos]),convert_to_identifier(mission_template[mission_template_name_pos]),mission_template[mission_template_flags_pos])) file.write(" %d\n"%(mission_template[mission_template_types_pos])) file.write("%s \n"%(string.replace(mission_template[mission_template_desc_pos]," ","_"))) file.write("\n%d "%len(mission_template[mission_template_groups_pos])) for group in mission_template[mission_template_groups_pos]: save_mission_template_group(file,group) save_triggers(file,convert_to_identifier(mission_template[mission_template_name_pos]), mission_template[mission_template_triggers_pos],variables,variable_uses,tag_uses,quick_strings) file.write("\n") file.close() def save_python_header(): file = open("./ID_mission_templates.py","w") for i_mission_template in xrange(len(mission_templates)): file.write("mst_%s = %d\n"%(mission_templates[i_mission_template][0],i_mission_template)) file.close() print "Exporting mission_template data..." save_python_header() variable_uses = [] variables = load_variables(export_dir, variable_uses) tag_uses = load_tag_uses(export_dir) quick_strings = load_quick_strings(export_dir) save_mission_templates(variables,variable_uses,tag_uses,quick_strings) save_variables(export_dir,variables,variable_uses) save_tag_uses(export_dir,tag_uses) save_quick_strings(export_dir,quick_strings) #print "Finished." """ ( "defense_1",mtf_battle_mode,stand_fast, "You wait, your weapons ready, your senses alert. Some of your companions start to sing an old song, trying to forget their fear. You smile and let your thoughts wander away for a second. Then the lookout's cry shatters the melancholy: 'Enemies! They are coming'", [ (2,mtef_leader_only,0,group(1),1), (2,mtef_no_leader,0,group(1),3), (0,mtef_no_leader,0,group(1),0), (4,mtef_enemy_party|mtef_reverse_order,0,group(2)|aif_start_alarmed,5)], [], [ (ti_val(0), ti_val(0), ti_once, [[mission_cookie_eq,0,0],[store_mission_timer_a,1],[ge,reg(1),10],[store_enemy_count,2],[lt,reg(2),3]], [[add_reinforcements_to_entry,3,3],[reset_mission_timer_a],[increment_mission_cookie,0]]), (ti_val(0), ti_val(0), ti_once, [[mission_cookie_eq,0,1],[store_mission_timer_a,1],[ge,reg(1),10],[store_enemy_count,2],[lt,reg(2),3]], [[add_reinforcements_to_entry,3,3],[reset_mission_timer_a],[increment_mission_cookie,0]]), (ti_val(0), ti_val(0), ti_once, [[mission_cookie_eq,5,0],[store_mission_timer_b,1],[ge,reg(1),10],[store_friend_count,2],[lt,reg(2),3]], [[add_reinforcements_to_entry,2,2],[reset_mission_timer_b],[increment_mission_cookie,5]]), (ti_val(0), ti_val(0), ti_once, [[mission_cookie_eq,5,1],[store_mission_timer_b,1],[ge,reg(1),10],[store_friend_count,2],[lt,reg(2),3]], [[add_reinforcements_to_entry,2,2],[reset_mission_timer_b],[increment_mission_cookie,5]]), (ti_val(0), ti_val(0), ti_once, [[all_enemies_defeated,2]], [[set_mission_result,1] ,[finish_mission,1]]), (ti_val(0), ti_val(0), ti_once, [[main_hero_fallen]], [[set_mission_result,-1],[finish_mission,1]]), ], ), ( "chase_1",mtf_battle_mode,chase, "You close up on the enemy thinking that this will be an easy victory. But as you come within shooting range, enemy fighters stop fleeing and turn to meet you. Perhaps they are experienced enough to know that they can't outrun you. Or perhaps their warrior pride triumphed over their fear. Whatever it is, these men now seem to be willing to put up a fight and your job will not be easy", [(0,mtef_leader_only,0,group(1),1),(0,mtef_regulars_only,0,group(1),1),(1,mtef_regulars_only|mtef_enemy_party,0,aisb_hit_run,1),(2,mtef_regulars_only|mtef_enemy_party,0,0,2),(3,mtef_regulars_only|mtef_enemy_party,0,0,1),(4,mtef_regulars_only|mtef_enemy_party,0,group(2),2)], [], [ (ti_val(0), ti_val(0), ti_once, [[all_enemies_defeated,2]], [[set_mission_result,1] ,[finish_mission,1]]), (ti_val(0), ti_val(0), ti_once, [[main_hero_fallen]], [[set_mission_result,-1],[finish_mission,1]]), ], ), ( "slip_siege_fight_1",mtf_battle_mode,retreat_fight, "You lead your retreating party through a back road which, oddly enough, seems to be completely unguarded.\ You decide to proceed with extreme caution. Very soon, you spot a movement in the bushes ahead.\ Not taking any chances, you send an arrow into the bushes. The arrow sinks behind leaves and immediately produces\ a sharp cry followed by some heavy cursing. Within seconds, a score of armored warriors rush out of hiding places.", [(2,mtef_leader_only,0,group(1),1),(2,mtef_no_leader,0,group(1)|aif_start_alarmed,3),(3,mtef_enemy_party|mtef_reverse_order,0,aif_start_alarmed,6)], # [(0,mtef_leader_only,0,group(1),1),(0,mtef_regulars_only,0,group(1),2|mtnf_const|mtnf_rand),(3,mtef_regulars_only|mtef_enemy_party,0,aif_start_alarmed,2|mtnf_const),(4,mtef_regulars_only|mtef_enemy_party,0,aif_start_alarmed,2|mtnf_const|mtnf_rand)], [], [ (ti_val(0), ti_val(0), ti_once, [[all_enemies_defeated,3]], [[set_mission_result,1] ,[finish_mission,1]]), (ti_val(0), ti_val(0), ti_once, [[main_hero_fallen]], [[set_mission_result,-1],[finish_mission,1]]), ], ), """
Python
from module_info import * import os print "Initializing..." try: os.remove(export_dir + 'tag_uses.txt') except: a = [] try: os.remove(export_dir + 'quick_strings.txt') except: a = []
Python
#!/usr/bin/python """A scraper for formspring.me that saves all of a users questions and answers. It stores them into a sqlite database. To see how to use this script, run it without any arguments. When the formspring API goes public, remove the 'beta-' from the variable called API_LOCATION below. """ __author__ = 'meltingwax@gmail.com' API_LOCATION = 'http://beta-api.formspring.me' import os import sys import urllib2 try: import json except ImportError: try: import simplejson as json except ImportError: print 'Could not find json module. Try installing simplejson: ' print ' http://code.google.com/p/simplejson/' sys.exit(1) import sqlite3 def main(): username, db_fname = parse_args() if os.path.exists(db_fname): print 'sqlite database', db_fname, 'exists, would you like to overwrite (Y/n)?', answer = None while True: # a valid answer either breaks the loop or exits the program if answer is not None: print 'Invalid response. Enter (Y/n):', answer = raw_input() if answer == 'Y': os.remove(db_fname) break elif answer == 'n': print 'Bye.' sys.exit(1) db_conn = sqlite3.connect(db_fname) db = db_conn.cursor() db.execute(""" CREATE TABLE questions ( id INTEGER PRIMARY KEY, question TEXT, answer TEXT, time TEXT, username TEXT )""") db_conn.commit() last_min_id = None while True: # breaks when recieves empty result list, or error list_url = '%s/answered/list/%s.json' % (API_LOCATION, username) if last_min_id is not None: list_url += '?max_id=%d' % last_min_id api_resp = urllib2.urlopen(list_url).read() resp_dict = json.loads(api_resp) if resp_dict['status'] == 'error': print 'The API returned an error, halting: %s' % resp_dict['error'] sys.exit(1) items_list = resp_dict['response'] if items_list: print 'Fetched %d items' % len(items_list) else: break for item in items_list: insert_item(item, db) db_conn.commit() last_min_id = int(items_list[-1]['id']) print 'All done.' def insert_item(item, db): item_id = int(item['id']) question = item['question'] answer = item['answer'] time = item['time'] if isinstance(item['asked_by'], dict): username = item['asked_by']['username'] else: username = '' db.execute('INSERT INTO questions (id, question, answer, time, username) ' 'VALUES (?, ?, ?, ?, ?)', (item_id, question, answer, time, username)) def parse_args(): args = sys.argv[1:] if len(args) != 2: print '%s <username> <sqlite_db>' % sys.argv[0] sys.exit(1) else: return args if __name__ == '__main__': main()
Python
#!/usr/bin/python """A tool to report some statistics about a formspring account based on a sqlite database generated with formspringscrape. To see how to use this, run it without any arguments. """ import collections import operator import os import re import sqlite3 import sys NUM_MOST_COMMON_WORDS = 15 # Stop words that are not to be included in word counts. This is a superset # of the list at: http://www.webconfs.com/stop-words.php STOP_WORDS = set(['-', 'a', "a's", 'able', 'about', 'above', 'abroad', 'according', 'accordingly', 'across', 'actually', 'adj', 'after', 'afterwards', 'again', 'against', 'ago', 'ahead', "ain't", 'all', 'allow', 'allows', 'almost', 'alone', 'along', 'alongside', 'already', 'also', 'although', 'always', 'am', 'amid', 'amidst', 'among', 'amongst', 'an', 'and', 'another', 'any', 'anybody', 'anyhow', 'anyone', 'anything', 'anyway', 'anyways', 'anywhere', 'apart', 'appear', 'appreciate', 'appropriate', 'are', "aren't", 'around', 'as', 'aside', 'ask', 'asking', 'associated', 'at', 'available', 'away', 'awfully', 'back', 'backward', 'backwards', 'be', 'became', 'because', 'become', 'becomes', 'becoming', 'been', 'before', 'beforehand', 'begin', 'behind', 'being', 'believe', 'below', 'beside', 'besides', 'best', 'better', 'between', 'beyond', 'both', 'brief', 'but', 'by', "c'mon", "c's", 'came', 'can', "can't", 'cannot', 'cant', 'caption', 'cause', 'causes', 'certain', 'certainly', 'changes', 'clearly', 'co', 'co.', 'com', 'come', 'comes', 'concerning', 'consequently', 'consider', 'considering', 'contain', 'containing', 'contains', 'corresponding', 'could', "couldn't", 'course', 'currently', 'dare', "daren't", 'definitely', 'described', 'despite', 'did', "didn't", 'different', 'directly', 'do', 'does', "doesn't", 'doing', "don't", 'done', 'down', 'downwards', 'during', 'each', 'edu', 'eg', 'eight', 'eighty', 'either', 'else', 'elsewhere', 'end', 'ending', 'enough', 'entirely', 'especially', 'et', 'etc', 'even', 'ever', 'evermore', 'every', 'everybody', 'everyone', 'everything', 'everywhere', 'ex', 'exactly', 'example', 'except', 'fairly', 'far', 'farther', 'few', 'fewer', 'fifth', 'first', 'five', 'followed', 'following', 'follows', 'for', 'forever', 'former', 'formerly', 'forth', 'forward', 'found', 'four', 'from', 'further', 'furthermore', 'get', 'gets', 'getting', 'given', 'gives', 'go', 'goes', 'going', 'gone', 'got', 'gotten', 'greetings', 'had', "hadn't", 'half', 'happens', 'hardly', 'has', "hasn't", 'have', "haven't", 'having', 'he', "he'd", "he'll", "he's", 'hello', 'help', 'hence', 'her', 'here', "here's", 'hereafter', 'hereby', 'herein', 'hereupon', 'hers', 'herself', 'hi', 'him', 'himself', 'his', 'hither', 'hopefully', 'how', 'howbeit', 'however', 'hundred', "i'd", "i'll", "i'm", "i've", 'i', 'ie', 'if', 'ignored', 'immediate', 'in', 'inasmuch', 'inc', 'inc.', 'indeed', 'indicate', 'indicated', 'indicates', 'inner', 'inside', 'insofar', 'instead', 'into', 'inward', 'is', "isn't", 'it', "it'd", "it'll", "it's", 'its', 'itself', 'just', 'k', 'keep', 'keeps', 'kept', 'know', 'known', 'knows', 'lot', 'last', 'lately', 'later', 'latter', 'latterly', 'least', 'less', 'lest', 'let', "let's", 'like', 'liked', 'likely', 'likewise', 'little', 'look', 'looking', 'looks', 'low', 'lower', 'ltd', 'made', 'mainly', 'make', 'makes', 'many', 'may', 'maybe', "mayn't", 'me', 'mean', 'meantime', 'meanwhile', 'merely', 'might', "mightn't", 'mine', 'minus', 'miss', 'more', 'moreover', 'most', 'mostly', 'mr', 'mrs', 'much', 'must', "mustn't", 'my', 'myself', 'name', 'namely', 'nd', 'near', 'nearly', 'necessary', 'need', "needn't", 'needs', 'neither', 'never', 'neverf', 'neverless', 'nevertheless', 'new', 'next', 'nine', 'ninety', 'no', 'no-one', 'nobody', 'non', 'none', 'nonetheless', 'noone', 'nor', 'normally', 'not', 'nothing', 'notwithstanding', 'novel', 'now', 'nowhere', 'obviously', 'of', 'off', 'often', 'oh', 'ok', 'okay', 'old', 'on', 'once', 'one', "one's", 'ones', 'only', 'onto', 'opposite', 'or', 'other', 'others', 'otherwise', 'ought', "oughtn't", 'our', 'ours', 'ourselves', 'out', 'outside', 'over', 'overall', 'own', 'particular', 'particularly', 'past', 'per', 'perhaps', 'placed', 'please', 'plus', 'possible', 'presumably', 'probably', 'provided', 'provides', 'que', 'quite', 'qv', 'rather', 'rd', 're', 'really', 'reasonably', 'recent', 'recently', 'regarding', 'regardless', 'regards', 'relatively', 'respectively', 'right', 'round', 'said', 'same', 'saw', 'say', 'saying', 'says', 'second', 'secondly', 'see', 'seeing', 'seem', 'seemed', 'seeming', 'seems', 'seen', 'self', 'selves', 'sensible', 'sent', 'serious', 'seriously', 'seven', 'several', 'shall', "shan't", 'she', "she'd", "she'll", "she's", 'should', "shouldn't", 'since', 'six', 'so', 'some', 'somebody', 'someday', 'somehow', 'someone', 'something', 'sometime', 'sometimes', 'somewhat', 'somewhere', 'soon', 'sorry', 'specified', 'specify', 'specifying', 'still', 'sub', 'such', 'sup', 'sure', "t's", 'take', 'taken', 'taking', 'tell', 'tends', 'th', 'than', 'thank', 'thanks', 'thanx', 'that', "that'll", "that's", "that've", 'thats', 'the', 'their', 'theirs', 'them', 'themselves', 'then', 'thence', 'there', "there'd", "there'll", "there're", "there's", "there've", 'thereafter', 'thereby', 'therefore', 'therein', 'theres', 'thereupon', 'these', 'they', "they'd", "they'll", "they're", "they've", 'thing', 'things', 'think', 'third', 'thirty', 'this', 'thorough', 'thoroughly', 'those', 'though', 'three', 'through', 'throughout', 'thru', 'thus', 'till', 'to', 'together', 'too', 'took', 'toward', 'towards', 'tried', 'tries', 'truly', 'try', 'trying', 'twice', 'two', 'un', 'under', 'underneath', 'undoing', 'unfortunately', 'unless', 'unlike', 'unlikely', 'until', 'unto', 'up', 'upon', 'upwards', 'us', 'use', 'used', 'useful', 'uses', 'using', 'usually', 'v', 'value', 'various', 'versus', 'very', 'via', 'viz', 'vs', 'want', 'wants', 'was', "wasn't", 'way', 'we', "we'd", "we'll", "we're", "we've", 'welcome', 'well', 'went', 'were', "weren't", 'what', "what'll", "what's", "what've", 'whatever', 'when', 'whence', 'whenever', 'where', "where's", 'whereafter', 'whereas', 'whereby', 'wherein', 'whereupon', 'wherever', 'whether', 'which', 'whichever', 'while', 'whilst', 'whither', 'who', "who'd", "who'll", "who's", 'whoever', 'whole', 'whom', 'whomever', 'whose', 'why', 'will', 'willing', 'wish', 'with', 'within', 'without', "won't", 'wonder', 'would', "wouldn't", 'yes', 'yet', 'you', "you'd", "you'll", "you're", "you've", 'your', 'yours', 'yourself', 'yourselves', 'zero']) def main(): db_fname, = parse_args() if not os.path.exists(db_fname): print 'The sqlite database', db_fname, 'does not exist.' sys.exit(1) db_conn = sqlite3.connect(db_fname) db = db_conn.cursor() # I know an online algorithm may be more efficient, but I don't think # the time savings are that significant for the intended use case. items = [] Item = collections.namedtuple('Item', 'id question answer time username') db.execute('SELECT id, question, answer, time, username FROM questions') for item_id, question, answer, time, username in db.fetchall(): username = username or 'Anonymous' item = Item(item_id, question, answer, time, username) items.append(item) # Most common askers user_counts = collections.defaultdict(int) # default 0 for username in [item.username for item in items]: user_counts[username] += 1 most_common_askers = sorted(user_counts.items(), key=operator.itemgetter(1), reverse=True)[:NUM_MOST_COMMON_WORDS] # Most common question words and answer words question_word_counts = get_word_counts((item.question for item in items)) most_common_question_words = sorted(question_word_counts.items(), key=operator.itemgetter(1), reverse=True)[:NUM_MOST_COMMON_WORDS] answer_word_counts = get_word_counts((item.answer for item in items)) most_common_answer_words = sorted(answer_word_counts.items(), key=operator.itemgetter(1), reverse=True)[:NUM_MOST_COMMON_WORDS] # Mean and median length for questions and answers mean_question_len = mean([len(item.question) for item in items]) mean_answer_len = mean([len(item.answer) for item in items]) median_question_len = median([len(item.question) for item in items]) median_answer_len = median([len(item.answer) for item in items]) # Final Report print '---------------------------------------' print ' Overall Statistics' print '---------------------------------------' print 'Most common askers:' print ' ', print ', '.join('%s (%d)' % t for t in most_common_askers) print print 'Total questions/answers:', len(items) print print '----------------------------------------' print ' Question and Answer Statistics' print '---------------------------------------' print 'Most common question words:' print ' ', print ', '.join('%s (%d)' % t for t in most_common_question_words) print print 'Most common answer words:' print ' ', print ', '.join('%s (%d)' % t for t in most_common_answer_words) print print 'Mean question length: %.2f characters' % mean_question_len print 'Median question length: %d characters' % median_question_len print print 'Mean answer length: %.2f characters' % mean_answer_len print 'Median answer length: %d characters' % median_answer_len print def parse_args(): args = sys.argv[1:] if len(args) != 1: print '%s <sqlite_db>' % sys.argv[0] sys.exit(1) else: return args def get_word_counts(list_of_texts): """Extracts all actual words from a list of blocks of english text. Removes any punctuation. Example: "hello, my name is daniel! oh my, sup??" -> {'hello':1, 'my':2, 'name':1, 'is':1, 'daniel':1, 'sup':1} """ tokens = [] for text in list_of_texts: tokens += text.split() words = [] for token in tokens: token = token.lower() token = re.sub('(\!|\?|\.|\,)+$', '', token) token = re.sub('\-,\",\>,\<', '', token) words.append(token) word_counts = collections.defaultdict(int) for word in words: if word and word not in STOP_WORDS: word_counts[word] += 1 return word_counts def mean(ls): return sum(ls) / float(len(ls)) def median(ls): n = len(ls) j = int(len(ls)/2) if n % 2 == 0: return float(ls[j] + ls[j-1]) / 2 else: return ls[j] if __name__ == '__main__': main()
Python
#!/usr/bin/python """A scraper for formspring.me that saves all of a users questions and answers. It stores them into a sqlite database. To see how to use this script, run it without any arguments. When the formspring API goes public, remove the 'beta-' from the variable called API_LOCATION below. """ __author__ = 'meltingwax@gmail.com' API_LOCATION = 'http://beta-api.formspring.me' import os import sys import urllib2 try: import json except ImportError: try: import simplejson as json except ImportError: print 'Could not find json module. Try installing simplejson: ' print ' http://code.google.com/p/simplejson/' sys.exit(1) import sqlite3 def main(): username, db_fname = parse_args() if os.path.exists(db_fname): print 'sqlite database', db_fname, 'exists, would you like to overwrite (Y/n)?', answer = None while True: # a valid answer either breaks the loop or exits the program if answer is not None: print 'Invalid response. Enter (Y/n):', answer = raw_input() if answer == 'Y': os.remove(db_fname) break elif answer == 'n': print 'Bye.' sys.exit(1) db_conn = sqlite3.connect(db_fname) db = db_conn.cursor() db.execute(""" CREATE TABLE questions ( id INTEGER PRIMARY KEY, question TEXT, answer TEXT, time TEXT, username TEXT )""") db_conn.commit() last_min_id = None while True: # breaks when recieves empty result list, or error list_url = '%s/answered/list/%s.json' % (API_LOCATION, username) if last_min_id is not None: list_url += '?max_id=%d' % last_min_id api_resp = urllib2.urlopen(list_url).read() resp_dict = json.loads(api_resp) if resp_dict['status'] == 'error': print 'The API returned an error, halting: %s' % resp_dict['error'] sys.exit(1) items_list = resp_dict['response'] if items_list: print 'Fetched %d items' % len(items_list) else: break for item in items_list: insert_item(item, db) db_conn.commit() last_min_id = int(items_list[-1]['id']) print 'All done.' def insert_item(item, db): item_id = int(item['id']) question = item['question'] answer = item['answer'] time = item['time'] if isinstance(item['asked_by'], dict): username = item['asked_by']['username'] else: username = '' db.execute('INSERT INTO questions (id, question, answer, time, username) ' 'VALUES (?, ?, ?, ?, ?)', (item_id, question, answer, time, username)) def parse_args(): args = sys.argv[1:] if len(args) != 2: print '%s <username> <sqlite_db>' % sys.argv[0] sys.exit(1) else: return args if __name__ == '__main__': main()
Python
#!/usr/bin/python """A tool to report some statistics about a formspring account based on a sqlite database generated with formspringscrape. To see how to use this, run it without any arguments. """ import collections import operator import os import re import sqlite3 import sys NUM_MOST_COMMON_WORDS = 15 # Stop words that are not to be included in word counts. This is a superset # of the list at: http://www.webconfs.com/stop-words.php STOP_WORDS = set(['-', 'a', "a's", 'able', 'about', 'above', 'abroad', 'according', 'accordingly', 'across', 'actually', 'adj', 'after', 'afterwards', 'again', 'against', 'ago', 'ahead', "ain't", 'all', 'allow', 'allows', 'almost', 'alone', 'along', 'alongside', 'already', 'also', 'although', 'always', 'am', 'amid', 'amidst', 'among', 'amongst', 'an', 'and', 'another', 'any', 'anybody', 'anyhow', 'anyone', 'anything', 'anyway', 'anyways', 'anywhere', 'apart', 'appear', 'appreciate', 'appropriate', 'are', "aren't", 'around', 'as', 'aside', 'ask', 'asking', 'associated', 'at', 'available', 'away', 'awfully', 'back', 'backward', 'backwards', 'be', 'became', 'because', 'become', 'becomes', 'becoming', 'been', 'before', 'beforehand', 'begin', 'behind', 'being', 'believe', 'below', 'beside', 'besides', 'best', 'better', 'between', 'beyond', 'both', 'brief', 'but', 'by', "c'mon", "c's", 'came', 'can', "can't", 'cannot', 'cant', 'caption', 'cause', 'causes', 'certain', 'certainly', 'changes', 'clearly', 'co', 'co.', 'com', 'come', 'comes', 'concerning', 'consequently', 'consider', 'considering', 'contain', 'containing', 'contains', 'corresponding', 'could', "couldn't", 'course', 'currently', 'dare', "daren't", 'definitely', 'described', 'despite', 'did', "didn't", 'different', 'directly', 'do', 'does', "doesn't", 'doing', "don't", 'done', 'down', 'downwards', 'during', 'each', 'edu', 'eg', 'eight', 'eighty', 'either', 'else', 'elsewhere', 'end', 'ending', 'enough', 'entirely', 'especially', 'et', 'etc', 'even', 'ever', 'evermore', 'every', 'everybody', 'everyone', 'everything', 'everywhere', 'ex', 'exactly', 'example', 'except', 'fairly', 'far', 'farther', 'few', 'fewer', 'fifth', 'first', 'five', 'followed', 'following', 'follows', 'for', 'forever', 'former', 'formerly', 'forth', 'forward', 'found', 'four', 'from', 'further', 'furthermore', 'get', 'gets', 'getting', 'given', 'gives', 'go', 'goes', 'going', 'gone', 'got', 'gotten', 'greetings', 'had', "hadn't", 'half', 'happens', 'hardly', 'has', "hasn't", 'have', "haven't", 'having', 'he', "he'd", "he'll", "he's", 'hello', 'help', 'hence', 'her', 'here', "here's", 'hereafter', 'hereby', 'herein', 'hereupon', 'hers', 'herself', 'hi', 'him', 'himself', 'his', 'hither', 'hopefully', 'how', 'howbeit', 'however', 'hundred', "i'd", "i'll", "i'm", "i've", 'i', 'ie', 'if', 'ignored', 'immediate', 'in', 'inasmuch', 'inc', 'inc.', 'indeed', 'indicate', 'indicated', 'indicates', 'inner', 'inside', 'insofar', 'instead', 'into', 'inward', 'is', "isn't", 'it', "it'd", "it'll", "it's", 'its', 'itself', 'just', 'k', 'keep', 'keeps', 'kept', 'know', 'known', 'knows', 'lot', 'last', 'lately', 'later', 'latter', 'latterly', 'least', 'less', 'lest', 'let', "let's", 'like', 'liked', 'likely', 'likewise', 'little', 'look', 'looking', 'looks', 'low', 'lower', 'ltd', 'made', 'mainly', 'make', 'makes', 'many', 'may', 'maybe', "mayn't", 'me', 'mean', 'meantime', 'meanwhile', 'merely', 'might', "mightn't", 'mine', 'minus', 'miss', 'more', 'moreover', 'most', 'mostly', 'mr', 'mrs', 'much', 'must', "mustn't", 'my', 'myself', 'name', 'namely', 'nd', 'near', 'nearly', 'necessary', 'need', "needn't", 'needs', 'neither', 'never', 'neverf', 'neverless', 'nevertheless', 'new', 'next', 'nine', 'ninety', 'no', 'no-one', 'nobody', 'non', 'none', 'nonetheless', 'noone', 'nor', 'normally', 'not', 'nothing', 'notwithstanding', 'novel', 'now', 'nowhere', 'obviously', 'of', 'off', 'often', 'oh', 'ok', 'okay', 'old', 'on', 'once', 'one', "one's", 'ones', 'only', 'onto', 'opposite', 'or', 'other', 'others', 'otherwise', 'ought', "oughtn't", 'our', 'ours', 'ourselves', 'out', 'outside', 'over', 'overall', 'own', 'particular', 'particularly', 'past', 'per', 'perhaps', 'placed', 'please', 'plus', 'possible', 'presumably', 'probably', 'provided', 'provides', 'que', 'quite', 'qv', 'rather', 'rd', 're', 'really', 'reasonably', 'recent', 'recently', 'regarding', 'regardless', 'regards', 'relatively', 'respectively', 'right', 'round', 'said', 'same', 'saw', 'say', 'saying', 'says', 'second', 'secondly', 'see', 'seeing', 'seem', 'seemed', 'seeming', 'seems', 'seen', 'self', 'selves', 'sensible', 'sent', 'serious', 'seriously', 'seven', 'several', 'shall', "shan't", 'she', "she'd", "she'll", "she's", 'should', "shouldn't", 'since', 'six', 'so', 'some', 'somebody', 'someday', 'somehow', 'someone', 'something', 'sometime', 'sometimes', 'somewhat', 'somewhere', 'soon', 'sorry', 'specified', 'specify', 'specifying', 'still', 'sub', 'such', 'sup', 'sure', "t's", 'take', 'taken', 'taking', 'tell', 'tends', 'th', 'than', 'thank', 'thanks', 'thanx', 'that', "that'll", "that's", "that've", 'thats', 'the', 'their', 'theirs', 'them', 'themselves', 'then', 'thence', 'there', "there'd", "there'll", "there're", "there's", "there've", 'thereafter', 'thereby', 'therefore', 'therein', 'theres', 'thereupon', 'these', 'they', "they'd", "they'll", "they're", "they've", 'thing', 'things', 'think', 'third', 'thirty', 'this', 'thorough', 'thoroughly', 'those', 'though', 'three', 'through', 'throughout', 'thru', 'thus', 'till', 'to', 'together', 'too', 'took', 'toward', 'towards', 'tried', 'tries', 'truly', 'try', 'trying', 'twice', 'two', 'un', 'under', 'underneath', 'undoing', 'unfortunately', 'unless', 'unlike', 'unlikely', 'until', 'unto', 'up', 'upon', 'upwards', 'us', 'use', 'used', 'useful', 'uses', 'using', 'usually', 'v', 'value', 'various', 'versus', 'very', 'via', 'viz', 'vs', 'want', 'wants', 'was', "wasn't", 'way', 'we', "we'd", "we'll", "we're", "we've", 'welcome', 'well', 'went', 'were', "weren't", 'what', "what'll", "what's", "what've", 'whatever', 'when', 'whence', 'whenever', 'where', "where's", 'whereafter', 'whereas', 'whereby', 'wherein', 'whereupon', 'wherever', 'whether', 'which', 'whichever', 'while', 'whilst', 'whither', 'who', "who'd", "who'll", "who's", 'whoever', 'whole', 'whom', 'whomever', 'whose', 'why', 'will', 'willing', 'wish', 'with', 'within', 'without', "won't", 'wonder', 'would', "wouldn't", 'yes', 'yet', 'you', "you'd", "you'll", "you're", "you've", 'your', 'yours', 'yourself', 'yourselves', 'zero']) def main(): db_fname, = parse_args() if not os.path.exists(db_fname): print 'The sqlite database', db_fname, 'does not exist.' sys.exit(1) db_conn = sqlite3.connect(db_fname) db = db_conn.cursor() # I know an online algorithm may be more efficient, but I don't think # the time savings are that significant for the intended use case. items = [] Item = collections.namedtuple('Item', 'id question answer time username') db.execute('SELECT id, question, answer, time, username FROM questions') for item_id, question, answer, time, username in db.fetchall(): username = username or 'Anonymous' item = Item(item_id, question, answer, time, username) items.append(item) # Most common askers user_counts = collections.defaultdict(int) # default 0 for username in [item.username for item in items]: user_counts[username] += 1 most_common_askers = sorted(user_counts.items(), key=operator.itemgetter(1), reverse=True)[:NUM_MOST_COMMON_WORDS] # Most common question words and answer words question_word_counts = get_word_counts((item.question for item in items)) most_common_question_words = sorted(question_word_counts.items(), key=operator.itemgetter(1), reverse=True)[:NUM_MOST_COMMON_WORDS] answer_word_counts = get_word_counts((item.answer for item in items)) most_common_answer_words = sorted(answer_word_counts.items(), key=operator.itemgetter(1), reverse=True)[:NUM_MOST_COMMON_WORDS] # Mean and median length for questions and answers mean_question_len = mean([len(item.question) for item in items]) mean_answer_len = mean([len(item.answer) for item in items]) median_question_len = median([len(item.question) for item in items]) median_answer_len = median([len(item.answer) for item in items]) # Final Report print '---------------------------------------' print ' Overall Statistics' print '---------------------------------------' print 'Most common askers:' print ' ', print ', '.join('%s (%d)' % t for t in most_common_askers) print print 'Total questions/answers:', len(items) print print '----------------------------------------' print ' Question and Answer Statistics' print '---------------------------------------' print 'Most common question words:' print ' ', print ', '.join('%s (%d)' % t for t in most_common_question_words) print print 'Most common answer words:' print ' ', print ', '.join('%s (%d)' % t for t in most_common_answer_words) print print 'Mean question length: %.2f characters' % mean_question_len print 'Median question length: %d characters' % median_question_len print print 'Mean answer length: %.2f characters' % mean_answer_len print 'Median answer length: %d characters' % median_answer_len print def parse_args(): args = sys.argv[1:] if len(args) != 1: print '%s <sqlite_db>' % sys.argv[0] sys.exit(1) else: return args def get_word_counts(list_of_texts): """Extracts all actual words from a list of blocks of english text. Removes any punctuation. Example: "hello, my name is daniel! oh my, sup??" -> {'hello':1, 'my':2, 'name':1, 'is':1, 'daniel':1, 'sup':1} """ tokens = [] for text in list_of_texts: tokens += text.split() words = [] for token in tokens: token = token.lower() token = re.sub('(\!|\?|\.|\,)+$', '', token) token = re.sub('\-,\",\>,\<', '', token) words.append(token) word_counts = collections.defaultdict(int) for word in words: if word and word not in STOP_WORDS: word_counts[word] += 1 return word_counts def mean(ls): return sum(ls) / float(len(ls)) def median(ls): n = len(ls) j = int(len(ls)/2) if n % 2 == 0: return float(ls[j] + ls[j-1]) / 2 else: return ls[j] if __name__ == '__main__': main()
Python
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools, set a download mirror, or use an alternate download directory, you can do so by supplying the appropriate options to ``use_setuptools()``. This file can also be run as a script to install or upgrade setuptools. """ import sys DEFAULT_VERSION = "0.6c8" DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3] md5_data = { 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca', 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb', 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b', 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a', 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618', 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac', 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5', 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4', 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c', 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b', 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27', 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277', 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa', 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e', 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e', 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f', 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2', 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc', 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167', 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64', 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d', 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20', 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab', 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53', 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2', 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e', 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372', 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902', 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de', 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b', } import sys, os def _validate_md5(egg_name, data): if egg_name in md5_data: from md5 import md5 digest = md5(data).hexdigest() if digest != md5_data[egg_name]: print >>sys.stderr, ( "md5 validation of %s failed! (Possible download problem?)" % egg_name ) sys.exit(2) return data def use_setuptools( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, download_delay=15 ): """Automatically find/download setuptools and make it available on sys.path `version` should be a valid setuptools version number that is available as an egg for download under the `download_base` URL (which should end with a '/'). `to_dir` is the directory where setuptools will be downloaded, if it is not already available. If `download_delay` is specified, it should be the number of seconds that will be paused before initiating a download, should one be required. If an older version of setuptools is installed, this routine will print a message to ``sys.stderr`` and raise SystemExit in an attempt to abort the calling script. """ was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules def do_download(): egg = download_setuptools(version, download_base, to_dir, download_delay) sys.path.insert(0, egg) import setuptools; setuptools.bootstrap_install_from = egg try: import pkg_resources except ImportError: return do_download() try: pkg_resources.require("setuptools>="+version); return except pkg_resources.VersionConflict, e: if was_imported: print >>sys.stderr, ( "The required version of setuptools (>=%s) is not available, and\n" "can't be installed while this script is running. Please install\n" " a more recent version first, using 'easy_install -U setuptools'." "\n\n(Currently using %r)" ) % (version, e.args[0]) sys.exit(2) else: del pkg_resources, sys.modules['pkg_resources'] # reload ok return do_download() except pkg_resources.DistributionNotFound: return do_download() def download_setuptools( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay = 15 ): """Download setuptools from a specified location and return its filename `version` should be a valid setuptools version number that is available as an egg for download under the `download_base` URL (which should end with a '/'). `to_dir` is the directory where the egg will be downloaded. `delay` is the number of seconds to pause before an actual download attempt. """ import urllib2, shutil egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) url = download_base + egg_name saveto = os.path.join(to_dir, egg_name) src = dst = None if not os.path.exists(saveto): # Avoid repeated downloads try: from distutils import log if delay: log.warn(""" --------------------------------------------------------------------------- This script requires setuptools version %s to run (even to display help). I will attempt to download it for you (from %s), but you may need to enable firewall access for this script first. I will start the download in %d seconds. (Note: if this machine does not have network access, please obtain the file %s and place it in this directory before rerunning this script.) ---------------------------------------------------------------------------""", version, download_base, delay, url ); from time import sleep; sleep(delay) log.warn("Downloading %s", url) src = urllib2.urlopen(url) # Read/write all in one block, so we don't create a corrupt file # if the download is interrupted. data = _validate_md5(egg_name, src.read()) dst = open(saveto,"wb"); dst.write(data) finally: if src: src.close() if dst: dst.close() return os.path.realpath(saveto) def main(argv, version=DEFAULT_VERSION): """Install or upgrade setuptools and EasyInstall""" try: import setuptools except ImportError: egg = None try: egg = download_setuptools(version, delay=0) sys.path.insert(0,egg) from setuptools.command.easy_install import main return main(list(argv)+[egg]) # we're done here finally: if egg and os.path.exists(egg): os.unlink(egg) else: if setuptools.__version__ == '0.0.1': print >>sys.stderr, ( "You have an obsolete version of setuptools installed. Please\n" "remove it from your system entirely before rerunning this script." ) sys.exit(2) req = "setuptools>="+version import pkg_resources try: pkg_resources.require(req) except pkg_resources.VersionConflict: try: from setuptools.command.easy_install import main except ImportError: from easy_install import main main(list(argv)+[download_setuptools(delay=0)]) sys.exit(0) # try to force an exit else: if argv: from setuptools.command.easy_install import main main(argv) else: print "Setuptools version",version,"or greater has been installed." print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' def update_md5(filenames): """Update our built-in md5 registry""" import re from md5 import md5 for name in filenames: base = os.path.basename(name) f = open(name,'rb') md5_data[base] = md5(f.read()).hexdigest() f.close() data = [" %r: %r,\n" % it for it in md5_data.items()] data.sort() repl = "".join(data) import inspect srcfile = inspect.getsourcefile(sys.modules[__name__]) f = open(srcfile, 'rb'); src = f.read(); f.close() match = re.search("\nmd5_data = {\n([^}]+)}", src) if not match: print >>sys.stderr, "Internal error!" sys.exit(2) src = src[:match.start(1)] + repl + src[match.end(1):] f = open(srcfile,'w') f.write(src) f.close() if __name__=='__main__': if len(sys.argv)>2 and sys.argv[1]=='--md5update': update_md5(sys.argv[2:]) else: main(sys.argv[1:])
Python
from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup(name='Formosa', version='0.2dev', description='Package for processing user input to Web applications', author='Nick Murphy', author_email='njmurphy@gmail.com', packages=find_packages())
Python
""" Translation of raw user input into validated Python values. The field protocol consists of the following three methods: - ``required(self)``: Return whether a value is mandatory for the field. - ``has_value(self, input)``: Return whether a value has been provided for the field in the given ``MultiDict`` of user input. This method should return true even if the input value is invalid or malformed. In brief, it should return whether translation will raise an exception or return a non-``None`` value. - ``translate(self, input)``: Transform a subset of a ``MultiDict`` into an atomic Python value, or raise either ``TranslationError`` or ``ErrorSet`` if input is malformed. For fields that expect only one parameter, only the value with the final matching key in the ``MultiDict`` of input is used, unless otherwise noted. """ import re import hashlib import datetime from formosa import TranslationError, ErrorSet, Form __all__ = ['TranslationError', 'String', 'Integer', 'Float', 'Decimal', 'Password', 'Regex', 'Email', 'Date', 'Time', 'Choice', 'MultiChoice', 'Boolean', 'Toggle', 'File', 'ZipCode', 'Phone', 'SubForm'] class String(object): """Field for strings.""" messages = {'not_empty': 'A value is required', 'too_short_sing': 'Value must be at least one character', 'too_short_pl': 'Value must be at least %d characters', 'too_long_sing': 'Value may be no more than one character', 'too_long_pl': 'Value may be no more than %d characters'} def __init__(self, param, allow_empty=False, max_length=None, min_length=None, alt_messages={}): """Create a new field for strings. Note the order of ``max_length`` and ``min_length``!""" self.param = param self.allow_empty = allow_empty self.min_length = min_length self.max_length = max_length self.messages = dict(self.__class__.messages, **alt_messages) def required(self): """Return whether the field is mandatory.""" return (not self.allow_empty) def has_value(self, input): """Return whether a value has been provided for the field in the given ``MultiDict`` of input.""" return (input.get(self.param, '').strip() != '') def translate(self, input): """Translate the field from a ``MultiDict`` of values.""" value = input.get(self.param, '').strip() if value == '': if not self.allow_empty: raise TranslationError(self.messages['not_empty']) else: return None if self.min_length is not None and len(value) < self.min_length: if self.min_length == 1: raise TranslationError(self.messages['too_short_sing']) else: raise TranslationError(self.messages['too_short_pl'] % self.min_length) elif self.max_length is not None and len(value) > self.max_length: if self.max_length == 1: raise TranslationError(self.messages['too_long_sing']) else: raise TranslationError(self.messages['too_long_pl'] % self.max_length) else: return value class Integer(object): """Field to hold integer values.""" messages = {'not_empty': 'A value is required', 'malformed': 'Please enter a whole number', 'too_small': 'Value may not be less than %s', 'too_large': 'Value may be no greater than %s'} _pattern = re.compile('^-?[0-9]+$') def __init__(self, param, allow_empty=False, min=None, max=None, alt_messages={}): """Create a new field for integer values.""" self.param = param self.allow_empty = allow_empty self.min = min self.max = max self.messages = dict(self.__class__.messages, **alt_messages) def required(self): """Return whether the field is mandatory.""" return (not self.allow_empty) def has_value(self, input): """Return whether a value has been provided for the field in the given ``MultiDict`` of input.""" return (input.get(self.param, '').strip() != '') def translate(self, input): """Translate the field from a ``MultiDict`` of values.""" value = input.get(self.param, '').strip() if value == '': if not self.allow_empty: raise TranslationError(self.messages['not_empty']) else: return None elif not self._pattern.search(value): raise TranslationError(self.messages['malformed']) value = int(value) if self.min is not None and value < self.min: raise TranslationError(self.messages['too_small'] % self.min) elif self.max is not None and value > self.max: raise TranslationError(self.messages['too_large'] % self.max) else: return value class Float(object): """Field to hold floating-point values.""" messages = {'not_empty': 'A value is required', 'malformed': 'Please enter a number', 'too_small_closed': 'Value may not be less than %s', 'too_small_open': 'Value must be greater than %s', 'too_large_closed': 'Value may be no greater than %s', 'too_large_open': 'Value must be less than %s'} _pattern = re.compile('^-?(?:[0-9]*\.)?[0-9]+$') def __init__(self, param, allow_empty=False, min=None, max=None, min_is_open=False, max_is_open=False, alt_messages={}): """Create a field for floating point values.""" self.param = param self.allow_empty = allow_empty self.min = min self.max = max self.min_is_open = min_is_open self.max_is_open = max_is_open self.messages = dict(self.__class__.messages, **alt_messages) def required(self): """Return whether the field is mandatory.""" return (not self.allow_empty) def has_value(self, input): """Return whether a value has been provided for the field in the given ``MultiDict`` of input.""" return (input.get(self.param, '').strip() != '') def translate(self, input): """Translate the field from a ``MultiDict`` of values.""" value = input.get(self.param, '').strip() if value == '': if not self.allow_empty: raise TranslationError(self.messages['not_empty']) else: return None elif not self._pattern.search(value): raise TranslationError(self.messages['malformed']) value = float(value) if self.min is not None: if self.min_is_open: if value <= self.min: raise TranslationError(self.messages['too_small_open'] % self.min) else: if value < self.min: raise TranslationError(self.messages['too_small_closed'] % self.min) if self.max is not None: if self.max_is_open: if value >= self.max: raise TranslationError(self.messages['too_large_open'] % self.max) else: if value > self.max: raise TranslationError(self.messages['too_large_closed'] % self.max) return value class Decimal(object): """Field for arbitrary precision numbers, implemented using the ``decimal`` module from the standard library.""" messages = {'not_empty': 'A value is required', 'malformed': 'Please enter a number', 'too_significant_sing': 'Number may have at most one significant digit', 'too_significant_pl': 'Number may have at most %d significant digits', 'too_precise_sing': 'At most one digit may be to the right of the decimal point', 'too_precise_pl': 'At most %d digits may be to the right of the decimal point', 'too_small_closed': 'Value may not be less than %s', 'too_small_open': 'Value must be greater than %s', 'too_large_closed': 'Value may be no greater than %s', 'too_large_open': 'Value must be less than %s'} _pattern = re.compile('^-?(?:[0-9]*\.)?[0-9]+$') def __init__(self, param, precision, scale, allow_empty=False, min=None, max=None, min_is_open=False, max_is_open=False, alt_messages={}): """Create a new field for arbitrary precision numbers, with ``precision`` significant digits in the entire number, and ``scale`` digits to the right of the decimal point.""" self.param = param self.precision = precision self.scale = scale self.allow_empty = allow_empty self.min = min self.max = max self.min_is_open = min_is_open self.max_is_open = max_is_open self.messages = dict(self.__class__.messages, **alt_messages) def required(self): """Return whether the field is mandatory.""" return (not self.allow_empty) def has_value(self, input): """Return whether a value has been provided for the field in the given ``MultiDict`` of input.""" return (input.get(self.param, '').strip() != '') def translate(self, input): """Translate the field from a ``MultiDict`` of values.""" value = input.get(self.param, '').strip() if value == '': if not self.allow_empty: raise TranslationError(self.messages['not_empty']) else: return None elif not self._pattern.search(value): raise TranslationError(self.messages['malformed']) parts = value.split('.') l = len(parts[0]) r = len(parts[1]) if len(parts) > 1 else 0 if r > self.scale: if self.scale == 1: raise TranslationError(self.messages['too_precise_sing']) else: raise TranslationError(self.messages['too_precise_pl'] % self.scale) elif l + r > self.precision: if self.precision == 1: raise TranslationError(self.messages['too_significant_sing']) else: raise TranslationError(self.messages['too_significant_pl'] % self.precision) from decimal import Decimal value = Decimal(value) if self.min is not None: if self.min_is_open: if value <= self.min: raise TranslationError(self.messages['too_small_open'] % self.min) else: if value < self.min: raise TranslationError(self.messages['too_small_closed'] % self.min) if self.max is not None: if self.max_is_open: if value >= self.max: raise TranslationError(self.messages['too_large_open'] % self.max) else: if value > self.max: raise TranslationError(self.messages['too_large_closed'] % self.max) return value class Password(String): """Field for passwords.""" def __init__(self, param, salt, allow_empty=False, min_length=6, max_length=12, algorithm=hashlib.md5, alt_messages={}): """Create a field for passwords. If input is given, assert that it is between ``min_length`` and ``max_length`` characters in length. Prepend ``salt`` to the input, and hash the results with the given hashing algorithm from ``hashlib``.""" super(Password, self).__init__(param, allow_empty, max_length, min_length, alt_messages) self.salt = salt self.algorithm = algorithm def translate(self, input): """Translate the field from a ``MultiDict`` of values. Return the digestion from the specified hashing algorithm in hexadecimal string notation.""" value = super(Password, self).translate(input) if value is None: return None else: return self.algorithm(self.salt + value).hexdigest() class Regex(String): """A field that is validated by a specifiable regular expression, and otherwise treated as a string. Note that, like all other fields in this module, leading and trailing whitespace are stripped from input -- it is a subclass of ``String``, after all. This is done before checking against the pattern, so any pattern that expects such whitespace will fail to match. Also note that empty input is converted to ``None``, and pattern matching is skipped.""" messages = dict(String.messages) messages['malformed'] = 'Please enter a valid value' def __init__(self, param, pattern, allow_empty=False, max_length=None, min_length=None, alt_messages={}): """Create a new regular expression-validated field.""" super(Regex, self).__init__(param, allow_empty, max_length, min_length, alt_messages) self.pattern = re.compile(pattern) def translate(self, input): """Translate the field from a ``MultiDict`` of values.""" value = super(Regex, self).translate(input) if value is None: return value elif not self.pattern.search(value): raise TranslationError(self.messages['malformed']) else: return value class Email(Regex): """A field for e-mail addresses.""" messages = dict(Regex.messages) messages['malformed'] = 'Please enter a valid e-mail address' _pattern = re.compile('^[a-zA-Z0-9._\-+]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$') def __init__(self, param, allow_empty=False, max_length=None, alt_messages={}): """Create a new field for e-mail addresses.""" super(Email, self).__init__(param, self._pattern, allow_empty, max_length, None, alt_messages) class Date(object): """Field for dates.""" messages = {'not_empty': 'A value is required', 'malformed': 'Please enter a valid date', 'too_early': 'Date may be no earlier than %s', 'too_late': 'Date may be no later than %s'} _pattern = re.compile('^(?P<m>\d{1,2})/(?P<d>\d{1,2})/(?P<y>\d{4})$') def __init__(self, param, allow_empty=False, min=None, max=None, alt_messages={}): """Create a new field for dates.""" self.param = param self.allow_empty = allow_empty self.min = min self.max = max self.messages = dict(self.__class__.messages, **alt_messages) def required(self): """Return whether the field is mandatory.""" return (not self.allow_empty) def has_value(self, input): """Return whether a value has been provided for the field in the given ``MultiDict`` of input.""" return (input.get(self.param, '').strip() != '') def translate(self, input): """Translate the field from a ``MultiDict`` of values.""" value = input.get(self.param, '').strip() if value == '': if not self.allow_empty: raise TranslationError(self.messages['not_empty']) else: return None match = self._pattern.search(value) if not match: raise TranslationError(self.messages['malformed']) else: parts = match.groupdict() try: value = datetime.date(int(parts['y']), int(parts['m']), int(parts['d'])) except ValueError: raise TranslationError(self.messages['malformed']) if self.min is not None and value < self.min: raise TranslationError(self.messages['too_early'] % self._format_date(self.min)) elif self.max is not None and value > self.max: raise TranslationError(self.messages['too_late'] % self._format_date(self.max)) else: return value def _format_date(self, date): return '%s %d, %d' % (date.strftime('%B'), date.day, date.year) class Time(object): """Field for times on a 12-hour clock.""" messages = {'not_empty': 'A value is required', 'incomplete': 'Please enter a complete time', 'malformed': 'Please enter a valid time', 'too_early': 'Time may be no earlier than %s', 'too_late': 'Time may be no later than %s'} _int_pattern = re.compile('^[0-9]+$') _ampm_pattern = re.compile('^(?:AM|PM)$') def __init__(self, hour_param, minute_param, ampm_param, allow_empty=False, min=None, max=None, tzinfo=None, alt_messages={}): """Create a new field for times.""" self.hour_param = hour_param self.minute_param = minute_param self.ampm_param = ampm_param self.allow_empty = allow_empty self.min = min self.max = max self.tzinfo = tzinfo self.messages = dict(self.__class__.messages, **alt_messages) def required(self): """Return whether the field is mandatory.""" return (not self.allow_empty) def has_value(self, input): """Return whether a value has been provided for the field in the given ``MultiDict`` of input.""" return ((input.get(self.hour_param, '').strip() != '') or (input.get(self.minute_param, '').strip() != '') or (input.get(self.ampm_param, '').strip() != '')) def translate(self, input): """Translate the field from a ``MultiDict`` of values.""" hour = input.get(self.hour_param, '').strip() minute = input.get(self.minute_param, '').strip() ampm = input.get(self.ampm_param, '').strip() empty = [hour == '', minute == '', ampm == ''] if all(empty): if not self.allow_empty: raise TranslationError(self.messages['not_empty']) else: return None elif any(empty): raise TranslationError(self.messages['incomplete']) elif not self._int_pattern.search(hour) \ or not self._int_pattern.search(minute) \ or not self._ampm_pattern.search(ampm): raise TranslationError(self.messages['malformed']) try: hour = int(hour) minute = int(minute) except ValueError: raise TranslationError(self.messages['malformed']) if not (1 <= hour <= 12 and 0 <= minute < 60): raise TranslationError(self.messages['malformed']) if ampm == 'AM' and hour == 12: hour = 0 elif ampm == 'PM' and hour < 12: hour += 12 value = datetime.time(hour, minute, tzinfo=self.tzinfo) if self.min is not None and value < self.min: raise TranslationError(self.messages['too_early'] % self._format_time(self.min)) elif self.max is not None and value > self.max: raise TranslationError(self.messages['too_late'] % self._format_time(self.max)) else: return value def _format_time(self, time): hour = time.strftime('%I') if hour.find('0') == 0: hour = hour[1] return hour + time.strftime(':%M %p') class Choice(object): """Field for choosing an item from a set of options. Please note that options must be specified as strings. Most often, however, choices are to be made from among sets of objects of a particular class as loaded from the database. As such, it is recommended that such selectors be implemented as a subclass, where a one-to-one mapping between the primary keys of the collection's objects and a string representation thereof can be established, and enforced by wrapping ``translate()``.""" messages = {'not_empty': 'A value is required', 'invalid': 'Please make a valid selection'} def __init__(self, param, options, allow_empty=False, alt_messages={}): """Create a new field for a choice from a set of strings. ``options`` is an iterable of strings (with a ``set`` offering the best performance). Because user input is stripped, its values should have no leading or trailing whitespace. It should also not contain the empty string, as it is discarded from user input.""" self.param = param self.options = options self.allow_empty = allow_empty self.messages = dict(self.__class__.messages, **alt_messages) def required(self): """Return whether the field is mandatory.""" return (not self.allow_empty) def has_value(self, input): """Return whether a value has been provided for the field in the given ``MultiDict`` of input.""" return (input.get(self.param, '').strip() != '') def translate(self, input): """Translate the field from a ``MultiDict`` of values.""" value = input.get(self.param, '').strip() if value == '': if not self.allow_empty: raise TranslationError(self.messages['not_empty']) else: return None elif value not in self.options: raise TranslationError(self.messages['invalid']) else: return value class MultiChoice(object): """Field for multiple choices from among a set of strings. See ``Choice`` for details.""" messages = {'invalid': 'Please make a valid selection', 'choose_sing': 'Please make a selection', 'choose_pl': 'Please select %d options from the list', 'too_few_sing': 'You must make at least one selection', 'too_few_pl': 'You must make at least %d selections', 'too_many_sing': 'You may make at most one selection', 'too_many_pl': 'You may make at most %d selections'} def __init__(self, param, options, min_choices=1, max_choices=None, alt_messages={}): """Create a new field for choices from a set of values. ``options`` is an iterable of strings (with a ``set`` offering the best performance). Because user input is stripped, its values should have no leading or trailing whitespace. It should also not contain the empty string, as it is discarded from user input. Assert that the user must make between ``min_choices`` and ``max_choices`` selections. If ``max_choices`` is ``None``, the user may select any number of options.""" self.options = options self.param = param self.min_choices = min_choices self.max_choices = max_choices self.messages = dict(self.__class__.messages, **alt_messages) def required(self): """Return whether the field is mandatory.""" return (self.min_choices > 0) def has_value(self, input): """Return whether a value has been provided for the field in the given ``MultiDict`` of input.""" return any(i.strip() for i in input.getall(self.param)) def translate(self, input): """Translate the field from a ``MultiDict`` of values.""" choices = set(i for i in (j.strip() for j in input.getall(self.param)) if i != '') invalids = choices - set(self.options) if invalids: raise TranslationError(self.messages['invalid']) num_choices = len(choices) if num_choices < self.min_choices: if self.min_choices == self.max_choices: if self.min_choices == 1: raise TranslationError(self.messages['choose_sing']) else: raise TranslationError(self.messages['choose_pl'] % self.min_choices) elif self.min_choices == 1: raise TranslationError(self.messages['too_few_sing']) else: raise TranslationError(self.messages['too_few_pl'] % self.min_choices) if self.max_choices is not None and num_choices > self.max_choices: if self.max_choices == 1: raise TranslationError(self.messages['too_many_sing']) else: raise TranslationError(self.messages['too_many_pl'] % self.max_choices) return choices class Boolean(Choice): """Field for truth values following a three-valued logic (i.e. true, false, and unknown or not applicable); in brief, a nullable boolean. True is represented by the string ``'true'``, and falseness is represented by ``'false'``; case is significant. An absence of value is denoted by ``''`` or a missing parameter in the ``MultiDict`` of input.""" def __init__(self, param, allow_empty=False, alt_messages={}): """Create a new field for nullable boolean values.""" super(Boolean, self).__init__(param, set(['true', 'false']), allow_empty, alt_messages) def translate(self, input): """Translate the field from a ``MultiDict`` of values.""" value = super(Boolean, self).translate(input) return {'true': True, 'false': False, None: None}[value] class Toggle(object): """Field that has two states, either on or off. Falseness is represented by an absent value or an empty string; truth is represented by anything else. A typical visual representation for this field is a single checkbox. Toggles are different from other fields in that an absence of value is a meaningful state (i.e. falseness). The concept of requiredness is therefore not well-defined for them. They also may never fail validation.""" def __init__(self, param): """Create a new toggle field.""" self.param = param def required(self): """Return ``True``, as it is impossible to omit a value.""" return True def has_value(self, input): """Return whether a value has been provided for the field in the given ``MultiDict`` of input. This is another unintuitive method. While translate() always returns a non-null value, it is indeed possible (and likely) for no value to be provided as input, which evaluates to falseness.""" return (input.get(self.param, '').strip() != '') def translate(self, input): """Translate the field from a ``MultiDict`` of values.""" return (input.get(self.param, '').strip() != '') class File(object): """Field for uploaded files.""" messages = {'not_empty': 'A value is required', 'invalid_type': 'The uploaded file is of an invalid format', 'too_big': 'File may be no larger than %s'} def __init__(self, param, allow_empty=False, valid_types=None, max_size=2097152, alt_messages={}): """Create a new field for uploaded files. If ``valid_types`` is given, require that any uploaded file be of a MIME type listed in the iterable. Limit uploads to at most ``max_size`` bytes, unless ``max_size`` is ``None``.""" self.param = param self.allow_empty = allow_empty self.valid_types = valid_types self.max_size = max_size self.messages = dict(self.__class__.messages, **alt_messages) def required(self): """Return whether the field is mandatory.""" return (not self.allow_empty) def has_value(self, input): """Return whether a value has been provided for the field in the given ``MultiDict`` of input.""" return (input.get(self.param, '') != '') def translate(self, input): """Translate the field from a ``MultiDict`` of values.""" value = input.get(self.param, '') if value == '': if not self.allow_empty: raise TranslationError(self.messages['not_empty']) else: return None if self.valid_types: from mimetypes import guess_type if guess_type(value.filename)[0] not in self.valid_types: raise TranslationError(self.messages['invalid_type']) if self.max_size: if len(value.value) > self.max_size: raise TranslationError(self.messages['too_big'] % self._format_file_size(self.max_size)) return value def _format_file_size(self, bytes): if bytes < 1024: if bytes == 1: return '1 byte' else: return '%d bytes' % bytes elif bytes < 1048576: return '%.1f KB' % (bytes / 1024.0) elif bytes < 1073741824: return '%.1f MB' % (bytes / 1048576.0) else: return '%.1f GB' % (bytes / 1073741824.0) class ZipCode(Regex): """Field for United States postal codes.""" messages = dict(Regex.messages) messages['malformed'] = 'Please enter a valid five- or nine-digit ZIP code' def __init__(self, param, allow_empty=False, alt_messages={}): """Create a new field for ZIP codes.""" super(ZipCode, self).__init__(param, re.compile('^\d{5}(?:-\d{4})?$'), allow_empty, max_length=10, alt_messages=alt_messages) class Phone(Regex): """Field for United States telephone numbers.""" messages = dict(Regex.messages) messages['malformed'] = 'Please enter a valid telephone number' def __init__(self, param, allow_empty=False, alt_messages={}): """Create a new field for telephone numbers.""" super(Phone, self).__init__(param, re.compile('^\d{3}-\d{3}-\d{4}$'), allow_empty, max_length=12, alt_messages=alt_messages) class SubForm(Form): """Container for a set of fields to be treated together as a single field. A typical use case for this field is to treat as whole a set of fields, where the set itself is optional but some member fields are required if any values are given. This would correspond to the other end of an nullable foreign key in a relational database. While there is a certain amount of isolation from it, it should still be recognized that child fields belong to the same form as their parent field. In particular, care must be taken when assigning names of request parameters to fields, as they use the same namespace as the rest of the form. The recommended way to accommodate this is to introduce some sort of prefix for the parameter names of child fields, for example ``'address_street'``, ``'address_city'``, etc.""" messages = {'required': 'Section is required'} def __init__(self, fields, validators=[], allow_empty=False): """Create a new sub-form, where ``fields`` maps names to fields, ``validators`` is an iterable of validation objects, and ``allow_empty`` indicates whether a value is required for the set of fields.""" super(SubForm, self).__init__(fields, validators) self.allow_empty = allow_empty def required(self): """Return whether the field is mandatory.""" return (not self.allow_empty) def has_value(self, input): """Return whether a value has been given for any of the child fields in the given ``MultiDict`` of input.""" return any(i.has_value(input) for i in self.fields.itervalues()) def translate(self, input): """Translate the field from a ``MultiDict`` of values. If the field is not required, and none of its child fields has a value, return ``None``. Otherwise, process each child field. Raise ``TranslationError`` if the field is required but none of its child fields has a value, or ``ErrorSet`` if translation fails for of any of the child fields.""" if not self.has_value(input): if self.required(): raise TranslationError(self.messages['required']) else: return None else: return super(SubForm, self).translate(input)
Python
from nose.tools import assert_raises from datetime import date from webob.multidict import MultiDict as MD from formosa import ErrorSet, Form, fields, validators class TestErrorSet(object): def setup(self): self.errors = ErrorSet() self.errors.add('Please enter a value', set(['name'])) self.errors.add('Please enter a value', set(['age'])) self.errors.add('Value already taken', set(['uid'])) self.errors.add('Enter at least one value', set(['opt1', 'opt2', 'opt3'])) self.errors.add('Something', set(['opt3', 'uid'])) self.errors.add('Blah', set(['opt3'])) self.errors.add('Blah', set(['name'])) self.errors.add('One more thing', set(['age', 'opt2'])) self.errors.add('Something global') self.address_errors = ErrorSet() self.address_errors.add('Please enter a value', set(['street1'])) self.address_errors.add('Please enter a valid state', set(['state'])) self.errors.add(self.address_errors, set(['address'])) def test_exceptionhood(self): assert isinstance(self.errors, Exception) def test_adding(self): old_errors = self.errors.errors() old_targets = self.errors.targets() self.errors.add('Please enter a value', set(['name'])) assert self.errors.errors() == old_errors assert self.errors.targets() == old_targets def test_length(self): assert len(self.errors) == 10 def test_targets(self): assert self.errors.targets() \ == set([frozenset(['name']), frozenset(['age']), frozenset(['uid']), frozenset(['opt1', 'opt2', 'opt3']), frozenset(['opt3', 'uid']), frozenset(['opt3']), frozenset(['age', 'opt2']), frozenset(), frozenset(['address'])]) def test_iter_targets(self): assert set(self.errors.iter_targets()) == self.errors.targets() def test_targets_for(self): assert_raises(KeyError, self.errors.targets_for, 'Not an error') assert self.errors.targets_for('Please enter a value') \ == set([frozenset(['name']), frozenset(['age'])]) assert self.errors.targets_for('Something global') \ == set([frozenset()]) assert self.errors.targets_for('Something') \ == set([frozenset(['opt3', 'uid'])]) def test_errors(self): assert self.errors.errors() \ == set(['Please enter a value', 'Value already taken', 'Enter at least one value', 'Something', 'Blah', 'One more thing', 'Something global', self.address_errors]) def test_iter_errors(self): assert set(self.errors.iter_errors()) == self.errors.errors() def test_errors_for(self): assert_raises(KeyError, self.errors.errors_for, set(['foofield'])) assert self.errors.errors_for(set(['opt3'])) == set(['Blah']) assert self.errors.errors_for(set(['opt3', 'uid'])) \ == set(['Something']) assert self.errors.errors_for(set(['name'])) \ == set(['Please enter a value', 'Blah']) def test_has_target(self): assert self.errors.has_target(set([])) assert self.errors.has_target(set(['opt3', 'uid'])) assert not self.errors.has_target(set(['opt2'])) def test_has_partial_target(self): assert self.errors.has_partial_target(set(['opt1'])) assert self.errors.has_partial_target(set(['opt1', 'opt2'])) assert self.errors.has_partial_target(set(['opt1', 'opt3'])) assert self.errors.has_partial_target(set(['opt2', 'opt3'])) assert self.errors.has_partial_target(set(['opt1', 'opt2', 'opt3'])) def test_sorted_targets(self): assert self.errors.sorted_targets(['name', 'age', 'uid', 'opt1', 'opt2', 'opt3', 'address']) \ == [(), ('name',), ('age',), ('uid',), ('opt3',), ('address',), ('age', 'opt2'), ('uid', 'opt3'), ('opt1', 'opt2', 'opt3')] assert self.errors.sorted_targets(['opt3', 'opt2', 'opt1', 'address', 'name', 'uid', 'age']) \ == [(), ('opt3',), ('address',), ('name',), ('uid',), ('age',), ('opt3', 'uid'), ('opt2', 'age'), ('opt3', 'opt2', 'opt1')] def test_str(self): assert set(str(self.errors).split('\n')) \ == set(['* Blah [opt3]', '* Something [opt3, uid]', '* Blah [name]', '* Please enter a value [name]', '* Please enter a value [age]', '* Something global []', '* Enter at least one value [opt1, opt2, opt3]', '* [address]', ' * Please enter a valid state [state]', ' * Please enter a value [street1]', '* Value already taken [uid]', '* One more thing [age, opt2]']) # XXX Replace this with fields.SubForm once it is written class ErrorSetField(object): def translate(self, input): if input.get('foo') != 'bar': errors = ErrorSet() errors.add('A value is required', set(['city'])) errors.add('Please choose a valid U.S. state', set(['state'])) raise errors else: return 'Aqui' class TestForm(object): def setup(self): self.address_child_fields \ = {'street1': fields.String('street1', False, 30), 'street2': fields.String('street2', True, 30), 'city': fields.String('city', False, 20), 'state': fields.String('state', False, 2, 2), 'zip': fields.ZipCode('zip')} self.address_field = fields.SubForm(self.address_child_fields) self.form = Form({'eid': fields.Regex('eid', '^E-[0-9]{4,}$'), 'name': fields.String('name', max_length=50), 'start_date': fields.Date('start_date'), 'opt1': fields.String('opt1', True, max_length=50), 'opt2': fields.String('opt2', True, max_length=50), 'opt3': fields.String('opt3', True, max_length=50), 'address': self.address_field, 'notes': fields.String('notes', True, max_length=1000)}, [validators.AtLeast(1, ('opt1', 'opt2', 'opt3'))]) def test_invalid_input(self): try: self.form.translate(MD(eid='E-123', name=' ', start_date='8/10/2007')) except ErrorSet, e: assert e.targets() == set([frozenset(['name']), frozenset(['eid']), frozenset(['opt1', 'opt3', 'opt2']), frozenset(['address'])]) else: assert False, 'Excepted errors' def test_valid_input(self): input = self.form.translate(MD(eid='E-1234', name=' Foo', start_date='8/10/2007', opt1='testing!', other='foobar', xyzzy='foofoo', street1='123 Test St.', city='Testville', state='MN', zip='56303')) assert input == {'eid': 'E-1234', 'name': 'Foo', 'notes': None, 'start_date': date(2007, 8, 10), 'opt1': 'testing!', 'opt2': None, 'opt3': None, 'address': {'street1': '123 Test St.', 'street2': None, 'state': 'MN', 'zip': '56303', 'city': 'Testville'}}
Python
""" Higher-level constraints on mappings of translated user input. Fields provide what might be considered rudimentary validation during translation, but they are limited in scope to single values. Because validators work on entire dictionaries of values, they can implement much more elaborate rules enforcing patterns on user input. To avoid indeterminate cases, most validators enforce their constraints only if all the keys they expect are present in the subject ``dict`` being validated. """ from formosa import ValidationError __all__ = ['ValidationError', 'Same', 'Different', 'AtLeast', 'AtMost', 'OnlyIf', 'Ascending', 'Descending', 'EqualTo', 'Unique', 'IfAnyThen'] class Same(object): """Validator to assert that a set of values are all equal to each other.""" messages = {'not_equal': 'Values are not the same'} def __init__(self, keys, alt_messages={}): """Create a validator where all the values from the specified keys must be equal.""" self.keys = keys self.messages = dict(self.__class__.messages, **alt_messages) def validate(self, subject): """Raise ``ValidationError`` if any of the specified values from ``subject`` are not equal. Skip validation if any value from ``subject`` is missing or ``None``.""" if any((not subject.has_key(i)) or (subject[i] is None) for i in self.keys): return elif any(subject[i] != subject[j] for i in self.keys for j in self.keys): raise ValidationError(self.messages['not_equal'], self.keys) class Different(object): """Validator to assert that a set of values are all different from one another.""" messages = {'not_different': 'Values must be different'} def __init__(self, keys, alt_messages={}): """Create a validator where all the values from the specified keys must be different.""" self.keys = keys self.messages = dict(self.__class__.messages, **alt_messages) def validate(self, subject): """Raise ``ValidationError`` if any of the specified values from ``subject`` are equal. Skip validation if any value from ``subject`` is missing or ``None``.""" if any((not subject.has_key(i)) or (subject[i] is None) for i in self.keys): return elif any(subject[i] == subject[j] for i in self.keys for j in self.keys if i != j): raise ValidationError(self.messages['not_different'], self.keys) class AtLeast(object): """Validator to assert that at least a certain number of values are not ``None``.""" messages = {'too_few_sing': 'At least one value must be entered', 'too_few_pl': 'At least %d values must be entered'} def __init__(self, min, keys, alt_messages={}): """Create a validator where at least ``min`` values from the specified subset of keys must not be ``None``.""" self.min = min self.keys = keys self.messages = dict(self.__class__.messages, **alt_messages) def validate(self, subject): """Raise ``ValidationError`` if fewer than the specified minumum number of values in ``subject`` are not ``None``. Skip validation if ``subject`` is missing one or more key.""" try: num = len([i for i in self.keys if subject[i] is not None]) except KeyError: return if num < self.min: if self.min == 1: raise ValidationError(self.messages['too_few_sing'], self.keys) else: raise ValidationError(self.messages['too_few_pl'] % self.min, self.keys) class AtMost(object): """Validator to assert that no more than a certain number of values are not ``None``.""" messages = {'too_many_sing': 'No more than one value may be entered', 'too_many_pl': 'No more than %d values may be entered'} def __init__(self, max, keys, alt_messages={}): """Create a new validator where no more than ``max`` values from the specified subset of keys may be not ``None``.""" self.max = max self.keys = keys self.messages = dict(self.__class__.messages, **alt_messages) def validate(self, subject): """Raise ``ValidationError`` if more than the specified maximum number of values in ``subject`` are not ``None``. Skip validation if ``subject`` is missing one or more key.""" try: num = len([i for i in self.keys if subject[i] is not None]) except KeyError: return if num > self.max: if self.max == 1: raise ValidationError(self.messages['too_many_sing'], self.keys) else: raise ValidationError(self.messages['too_many_pl'] % self.max, self.keys) class OnlyIf(object): """Validator for when a set of fields may have values only if every field in another set does. It is strongly recommended that an alternative message be provided to instances of this validator, as the default message is not (and cannot be) very meaningful.""" messages = {'reqs_not_met': 'Value may not be be entered unless the dependencies are met'} def __init__(self, contingent_keys, required_keys, alt_messages={}): """Create a new validator such that all fields with keys in the iterable ``contingent_key`` must be ``None`` unless every field with keys in ``required_keys`` is not ``None``.""" self.contingent_keys = contingent_keys self.required_keys = required_keys self.messages = dict(self.__class__.messages, **alt_messages) def validate(self, subject): """Raise ``ValidationError`` if one or more contingent field has a value without all required field also having values.""" try: num_contingent = len([i for i in self.contingent_keys if subject[i] is not None]) num_required = len([i for i in self.required_keys if subject[i] is not None]) except KeyError: return if num_contingent > 0 and num_required < len(self.required_keys): raise ValidationError(self.messages['reqs_not_met'], self.contingent_keys) class Ascending(object): """Validator to assert that a series of values are given in ascending order.""" messages = {'not_ascending': 'Values are not in ascending order'} def __init__(self, keys, strict=False, alt_messages={}): """Create a new validator to assert that the corresponding values of the iterable ``keys`` are in ascending order. If ``strict`` is true, compare with ``>``, otherwise compare with ``>=``.""" self.keys = keys self.strict = strict self.messages = dict(self.__class__.messages, **alt_messages) def validate(self, subject): """Raise ``ValidationError`` if a value in ``subject`` is out of order.""" last = None for key in self.keys: try: current = subject[key] except KeyError: return if last is not None: if (self.strict and last >= current) \ or (not self.strict and last > current): raise ValidationError(self.messages['not_ascending'], self.keys) last = current class Descending(object): """Validator to assert that a series of values are given in descending order.""" messages = {'not_descending': 'Values are not in descending order'} def __init__(self, keys, strict=False, alt_messages={}): """Create a new validator to assert that the corresponding values of the iterable ``keys`` are in descending order. If ``strict`` is true, compare with ``<``, otherwise compare with ``<=``.""" self.keys = keys self.strict = strict self.messages = dict(self.__class__.messages, **alt_messages) def validate(self, subject): """Raise ``ValidationError`` if a value in ``subject`` is out of order.""" last = None for key in self.keys: try: current = subject[key] except KeyError: return if last is not None: if (self.strict and last <= current) \ or (not self.strict and last < current): raise ValidationError(self.messages['not_descending'], self.keys) last = current class EqualTo(object): """Validator to assert that a set of fields are equal to a specific value according to ``==``.""" messages = {'not_equal': 'Invalid value'} def __init__(self, value, keys, alt_messages={}): """Create a validator where each value from the specified keys must be equal to ``value``.""" self.value = value self.keys = keys self.messages = dict(self.__class__.messages, **alt_messages) def validate(self, subject): """Raise ``ValidationError`` if any of the specified values from ``subject`` is not equal to the reference value. Skip validation if any value from ``subject`` is missing or ``None``.""" if any((not subject.has_key(i)) or (subject[i] is None) for i in self.keys): return elif any(subject[i] != self.value for i in self.keys): raise ValidationError(self.messages['not_equal'], self.keys) class Unique(object): """Validator to assert that a set of values are unique to a corresponding set of SQLAlchemy model properties.""" messages = {'not_unique_sing': 'Value has already been taken', 'not_unique_pl': 'The given values have already been taken'} def __init__(self, session, mapper_or_class, propkeys, inst=None, alt_messages={}): """Create a new validator to check for the uniqueness of values corresponding to a subset of a model's properties. - ``session``: SQLAlchemy session to be queried - ``mapper_or_class``: Mapper or mapped class to be queried - ``propkeys``: Mapping of property names to keys in the subject. The validator queries for instances of the mapped class that have these values. - ``inst``: If only one object is found when querying the session, and if it ``is`` ``inst``, pass validation.""" self.session = session self.mapper_or_class = mapper_or_class self.propkeys = propkeys self.inst = inst self.messages = dict(self.__class__.messages, **alt_messages) def validate(self, subject): """Raise ``ValidationError`` if one or more objects is found with the values in ``subject`` as indicated by ``propkeys``, unless only one object is found and it is the same as the object specified by ``inst``. Skip validation if any of the specified values from ``subject`` (i.e. those specified by the values in ``propkeys``) is either missing or ``None``.""" if any((not subject.has_key(i)) or (subject[i] is None) for i in self.propkeys.itervalues()): return try: criteria = dict((prop, subject[key]) for (prop, key) in self.propkeys.iteritems()) except KeyError: return query = self.session.query(self.mapper_or_class).filter_by(**criteria) count = query.count() invalid = False if count == 1: if not self.inst or self.inst != query.one(): invalid = True elif count > 1: invalid = True else: invalid = False if invalid: msg = 'not_unique_sing' if len(self.propkeys) == 1 \ else 'not_unique_pl' raise ValidationError(self.messages[msg], self.propkeys.keys()) class IfAnyThen(object): """Validator to assert that if any field from one set has been specified, then each field from another set must have a value.""" messages = {'required_sing': 'A value is required', 'required_pl': 'Values are required'} def __init__(self, if_set, then_set, alt_messages={}): """Create a new validator such that each field from ``then_set`` is required if any field from ``if_set`` is given.""" self.if_set = if_set self.then_set = then_set self.messages = dict(self.__class__.messages, **alt_messages) def validate(self, subject): """Raise ``ValidationError`` if one or more values from ``if_set`` is present but any value from ``then_set`` is missing.""" def given(field): return (subject.has_key(field) and subject[field] is not None) if any(given(i) for i in self.if_set) \ and any(not given(i) for i in self.then_set): msg = self.messages['require_sing' if len(self.then_set) == 1 else 'required_pl'] raise ValidationError(msg, self.then_set)
Python
""" Processing of user input to Web applications. Because the Web is not a trusted environment, all input is considered tainted. Further, as HTTP is a simple protocol, only one type of data may be given as input: strings. It is the job of this module to enable applications to assert that input is well-formed and valid, and to translate it to native Python values. """ __all__ = ['FormosaException', 'TranslationError', 'ValidationError', 'ErrorSet', 'Form'] class FormosaException(Exception): """Base class for Formosa exceptions.""" pass class TranslationError(FormosaException): """Exception for when translation of a field fails.""" pass class ValidationError(FormosaException): """Exception raised when a higher-level validation constraint fails.""" def __init__(self, message, keys): """Create a new exception for failed validation, where ``message`` describes the reason for failure, and ``keys`` is an iterable of the offending keys in the subject.""" self.message = message self.keys = keys def __str__(self): return self.message class ErrorSet(FormosaException): """Exception for failed translation of user input. Instances serve as containers mapping errors to the fields to which they apply. An error may be either a simple error message string, or it may be another ``ErrorSet`` instance in the case of nested errors. Each error (be it a message or an ``ErrorSet`` object) is associated with an iterable of zero or more field names, which is called the *target*. While the same error may be mapped to more than target, an error may be mapped to the same target only once. The order in which field names are given is insignificant.""" def __init__(self): super(ErrorSet, self).__init__() self._errors = {} def add(self, error, target=None): """Associate an error with the given iterable of target field names. Ignore the order of the field names.""" if error not in self._errors: self._errors[error] = set() self._errors[error].add(frozenset(target or ())) def __len__(self): """Return the number of times each error maps to a different target.""" return sum(len(i) for i in self._errors.itervalues()) def targets(self): """Return the set of targets to which errors have been assigned.""" targets = set() for i in self._errors.itervalues(): for j in i: targets.add(j) return targets def iter_targets(self): """Yield each target to which an error has been assigned.""" for i in self._errors.itervalues(): for j in i: yield j def errors(self): """Return all errors that have been added to the collection.""" return set(self._errors.keys()) def iter_errors(self): """Iterate over the errors that have been added to the collection.""" return self._errors.iterkeys() def has_target(self, target): """Return whether an error has been assigned to the given iterable of field names.""" targetset = set(target) return any(i == targetset for i in self.targets()) def has_partial_target(self, target): """Return whether the given iterable of field names forms an improper subset of any target.""" targetset = set(target) return any(targetset.issubset(i) for i in self.targets()) def errors_for(self, target): """Return a set of errors that have been assigned to ``target``, an iterable of field names whose order is insignificant. Raise ``KeyError`` if no errors have been assigned.""" if not self.has_target(target): raise KeyError('%r is not a target' % target) targetset = set(target) return set(msg for msg, targets in self._errors.iteritems() if targetset in targets) def targets_for(self, error): """Return a set of targets to which ``error`` has been assigned. Raise ``KeyError`` if no such error has been added.""" return self._errors[error] def sorted_targets(self, field_order): """Return the error set's targets sorted primarily by the number of fields in the target, and then by the position of the first field in each target list as indicated by ``field_order``.""" def cmp_fields(x, y): xi = yi = -1 for i, value in enumerate(field_order): if value == x: xi = i elif value == y: yi = i return cmp(xi, yi) targets_by_size = {} for target in self.iter_targets(): sorted_fields = tuple(sorted(target, cmp_fields)) try: targets_by_size[len(target)].add(sorted_fields) except KeyError: targets_by_size[len(target)] = set() targets_by_size[len(target)].add(sorted_fields) for i in targets_by_size: targets_by_size[i] = list(targets_by_size[i]) targets_by_size[i].sort(lambda x, y: cmp_fields(x[0], y[0])) targetlist = [] for i in sorted(targets_by_size): targetlist += targets_by_size[i] return targetlist def __str__(self): return self._pretty_print(self) def _pretty_print(self, errorset, depth=0, step=2): messages = [] indent = (' ' * depth * step) for target in errorset.targets(): targetlabel = ', '.join(sorted(target)) for error in errorset.errors_for(target): if isinstance(error, basestring): messages.append('%s* %s [%s]' % (indent, error, targetlabel)) elif isinstance(error, ErrorSet): messages.append('%s* [%s]' % (indent, targetlabel)) messages.append(self._pretty_print(error, depth + 1)) return '\n'.join(messages) class Form(object): """Translator of user input into Python values. Forms translate a ``MultiDict`` of user input to a ``dict`` of validated Python values suitable for safe use by an application. A form is composed by any number of fields, and each field is assigned a key. This key is where the field's translated value is stored in the resulting ``dict``. Forms may also have any number of validators to enforce higher-order constraints across multiple fields. Validators execute after the form's fields have been translated. Validators execute even if one or more fields raise ``TranslationError``, though any offending field is omitted from their input. (Because of this, most validators skip validation if one or more expected value is missing.)""" def __init__(self, fields, validators=[]): """Create a new form with the ``fields``, a mapping of keys to fields, and optional iterable of ``validators``.""" self.fields = fields self.validators = validators def translate(self, input): """Return a ``dict`` of valid Python values translated from a ``MultiDict`` of user input. Raise ``ErrorSet`` if one or more field raises ``TranslationError``, or if any validator raises ``ValidationError``.""" values = {} errors = ErrorSet() for key, field in self.fields.iteritems(): try: values[key] = field.translate(input) except TranslationError, e: errors.add(e.message, set([key])) except ErrorSet, e: errors.add(e, set([key])) for validator in self.validators: try: validator.validate(values) except ValidationError, e: errors.add(e.message, e.keys) if errors: raise errors else: return values
Python
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools, set a download mirror, or use an alternate download directory, you can do so by supplying the appropriate options to ``use_setuptools()``. This file can also be run as a script to install or upgrade setuptools. """ import sys DEFAULT_VERSION = "0.6c8" DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3] md5_data = { 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca', 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb', 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b', 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a', 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618', 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac', 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5', 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4', 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c', 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b', 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27', 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277', 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa', 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e', 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e', 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f', 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2', 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc', 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167', 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64', 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d', 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20', 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab', 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53', 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2', 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e', 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372', 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902', 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de', 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b', } import sys, os def _validate_md5(egg_name, data): if egg_name in md5_data: from md5 import md5 digest = md5(data).hexdigest() if digest != md5_data[egg_name]: print >>sys.stderr, ( "md5 validation of %s failed! (Possible download problem?)" % egg_name ) sys.exit(2) return data def use_setuptools( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, download_delay=15 ): """Automatically find/download setuptools and make it available on sys.path `version` should be a valid setuptools version number that is available as an egg for download under the `download_base` URL (which should end with a '/'). `to_dir` is the directory where setuptools will be downloaded, if it is not already available. If `download_delay` is specified, it should be the number of seconds that will be paused before initiating a download, should one be required. If an older version of setuptools is installed, this routine will print a message to ``sys.stderr`` and raise SystemExit in an attempt to abort the calling script. """ was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules def do_download(): egg = download_setuptools(version, download_base, to_dir, download_delay) sys.path.insert(0, egg) import setuptools; setuptools.bootstrap_install_from = egg try: import pkg_resources except ImportError: return do_download() try: pkg_resources.require("setuptools>="+version); return except pkg_resources.VersionConflict, e: if was_imported: print >>sys.stderr, ( "The required version of setuptools (>=%s) is not available, and\n" "can't be installed while this script is running. Please install\n" " a more recent version first, using 'easy_install -U setuptools'." "\n\n(Currently using %r)" ) % (version, e.args[0]) sys.exit(2) else: del pkg_resources, sys.modules['pkg_resources'] # reload ok return do_download() except pkg_resources.DistributionNotFound: return do_download() def download_setuptools( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay = 15 ): """Download setuptools from a specified location and return its filename `version` should be a valid setuptools version number that is available as an egg for download under the `download_base` URL (which should end with a '/'). `to_dir` is the directory where the egg will be downloaded. `delay` is the number of seconds to pause before an actual download attempt. """ import urllib2, shutil egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) url = download_base + egg_name saveto = os.path.join(to_dir, egg_name) src = dst = None if not os.path.exists(saveto): # Avoid repeated downloads try: from distutils import log if delay: log.warn(""" --------------------------------------------------------------------------- This script requires setuptools version %s to run (even to display help). I will attempt to download it for you (from %s), but you may need to enable firewall access for this script first. I will start the download in %d seconds. (Note: if this machine does not have network access, please obtain the file %s and place it in this directory before rerunning this script.) ---------------------------------------------------------------------------""", version, download_base, delay, url ); from time import sleep; sleep(delay) log.warn("Downloading %s", url) src = urllib2.urlopen(url) # Read/write all in one block, so we don't create a corrupt file # if the download is interrupted. data = _validate_md5(egg_name, src.read()) dst = open(saveto,"wb"); dst.write(data) finally: if src: src.close() if dst: dst.close() return os.path.realpath(saveto) def main(argv, version=DEFAULT_VERSION): """Install or upgrade setuptools and EasyInstall""" try: import setuptools except ImportError: egg = None try: egg = download_setuptools(version, delay=0) sys.path.insert(0,egg) from setuptools.command.easy_install import main return main(list(argv)+[egg]) # we're done here finally: if egg and os.path.exists(egg): os.unlink(egg) else: if setuptools.__version__ == '0.0.1': print >>sys.stderr, ( "You have an obsolete version of setuptools installed. Please\n" "remove it from your system entirely before rerunning this script." ) sys.exit(2) req = "setuptools>="+version import pkg_resources try: pkg_resources.require(req) except pkg_resources.VersionConflict: try: from setuptools.command.easy_install import main except ImportError: from easy_install import main main(list(argv)+[download_setuptools(delay=0)]) sys.exit(0) # try to force an exit else: if argv: from setuptools.command.easy_install import main main(argv) else: print "Setuptools version",version,"or greater has been installed." print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' def update_md5(filenames): """Update our built-in md5 registry""" import re from md5 import md5 for name in filenames: base = os.path.basename(name) f = open(name,'rb') md5_data[base] = md5(f.read()).hexdigest() f.close() data = [" %r: %r,\n" % it for it in md5_data.items()] data.sort() repl = "".join(data) import inspect srcfile = inspect.getsourcefile(sys.modules[__name__]) f = open(srcfile, 'rb'); src = f.read(); f.close() match = re.search("\nmd5_data = {\n([^}]+)}", src) if not match: print >>sys.stderr, "Internal error!" sys.exit(2) src = src[:match.start(1)] + repl + src[match.end(1):] f = open(srcfile,'w') f.write(src) f.close() if __name__=='__main__': if len(sys.argv)>2 and sys.argv[1]=='--md5update': update_md5(sys.argv[2:]) else: main(sys.argv[1:])
Python
from googlevoice import Voice,util voice = Voice() voice.login() util.pprint(voice.settings)
Python
from googlevoice import Voice voice = Voice() voice.login() for message in voice.sms().messages: if message.isRead: message.delete()
Python
from googlevoice import Voice,util voice = Voice() voice.login() folder = voice.search(util.input('Search query: ')) util.print_('Found %s messages: ', len(folder)) util.pprint(folder.messages)
Python
# #SMS test via Google Voice # #John Nagle # nagle@animats.com # from googlevoice import Voice import sys import BeautifulSoup def extractsms(htmlsms) : """ extractsms -- extract SMS messages from BeautifulSoup tree of Google Voice SMS HTML. Output is a list of dictionaries, one per message. """ msgitems = [] # accum message items here # Extract all conversations by searching for a DIV with an ID at top level. tree = BeautifulSoup.BeautifulSoup(htmlsms) # parse HTML into tree conversations = tree.findAll("div",attrs={"id" : True},recursive=False) for conversation in conversations : # For each conversation, extract each row, which is one SMS message. rows = conversation.findAll(attrs={"class" : "gc-message-sms-row"}) for row in rows : # for all rows # For each row, which is one message, extract all the fields. msgitem = {"id" : conversation["id"]} # tag this message with conversation ID spans = row.findAll("span",attrs={"class" : True}, recursive=False) for span in spans : # for all spans in row cl = span["class"].replace('gc-message-sms-', '') msgitem[cl] = (" ".join(span.findAll(text=True))).strip() # put text in dict msgitems.append(msgitem) # add msg dictionary to list return msgitems voice = Voice() voice.login() voice.sms() for msg in extractsms(voice.sms.html): print str(msg)
Python
from googlevoice import Voice,util voice = Voice() voice.login() util.pprint(voice.phones)
Python
from googlevoice import Voice download_dir = '.' voice = Voice() voice.login() for message in voice.voicemail().messages: message.download(download_dir)
Python
from googlevoice import Voice from googlevoice.util import input voice = Voice() voice.login() phoneNumber = input('Number to send message to: ') text = input('Message text: ') voice.send_sms(phoneNumber, text)
Python
from googlevoice import Voice,util voice = Voice() voice.login() for message in voice.voicemail().messages: util.print_(message)
Python
from googlevoice import Voice,util,settings voice = Voice() voice.login() for feed in settings.FEEDS: util.print_(feed.title()) for message in getattr(voice, feed)().messages: util.print_('\t', message)
Python
from googlevoice import Voice from googlevoice.util import input voice = Voice() voice.login() outgoingNumber = input('Number to call: ') forwardingNumber = input('Number to call from [optional]: ') or None voice.call(outgoingNumber, forwardingNumber) if input('Calling now... cancel?[y/N] ').lower() == 'y': voice.cancel(outgoingNumber, forwardingNumber)
Python
from distutils.core import setup README = """Python Google Voice ==================== Joe McCall & Justin Quick Exposing the Google Voice "API" to the Python language ------------------------------------------------------- Google Voice for Python Allows you to place calls, send sms, download voicemail, and check the various folders of your Google Voice Accounts. You can use the Python API or command line script to schedule calls, check for new recieved calls/sms, or even sync your recorded voicemails/calls. Works for Python 2 and Python 3 Full documentation is available up at http://sphinxdoc.github.com/pygooglevoice/ """ setup( name = "pygooglevoice", version = '0.5', url = 'http://code.google.com/p/pygooglevoice', author = 'Justin Quick and Joe McCall', author_email='justquick@gmail.com, joe@mcc4ll.us', description = 'Python 2/3 Interface for Google Voice', long_description = README, packages = ['googlevoice'], scripts = ['bin/gvoice','bin/asterisk-gvoice-setup', 'bin/gvi'] )
Python
DEFAULT_CONFIG = """ [auth] # Google Account email address (one associated w/ your Voice account) email= # Raw password used or login password= [gvoice] # Number to place calls from (eg, your google voice number) forwardingNumber= # Default phoneType for your forwardingNumber as defined below # 1 - Home # 2 - Mobile # 3 - Work # 7 - Gizmo phoneType=2 """ DEBUG = False LOGIN = 'https://www.google.com/accounts/ClientLogin' SERVICE = 'grandcentral' FEEDS = ('inbox', 'starred', 'all', 'spam', 'trash', 'voicemail', 'sms', 'recorded', 'placed', 'received', 'missed') BASE = 'https://www.google.com/voice/' LOGOUT = BASE + 'account/signout' INBOX = BASE + '#inbox' CALL = BASE + 'call/connect/' CANCEL = BASE + 'call/cancel/' DEFAULT_FORWARD = BASE + 'settings/editDefaultForwarding/' FORWARD = BASE + 'settings/editForwarding/' DELETE = BASE + 'inbox/deleteMessages/' MARK = BASE + 'inbox/mark/' STAR = BASE + 'inbox/star/' SMS = BASE + 'sms/send/' DOWNLOAD = BASE + 'media/send_voicemail/' BALANCE = BASE + 'settings/billingcredit/' XML_SEARCH = BASE + 'inbox/search/' XML_CONTACTS = BASE + 'contacts/' XML_RECENT = BASE + 'inbox/recent/' XML_INBOX = XML_RECENT + 'inbox/' XML_STARRED = XML_RECENT + 'starred/' XML_ALL = XML_RECENT + 'all/' XML_SPAM = XML_RECENT + 'spam/' XML_TRASH = XML_RECENT + 'trash/' XML_VOICEMAIL = XML_RECENT + 'voicemail/' XML_SMS = XML_RECENT + 'sms/' XML_RECORDED = XML_RECENT + 'recorded/' XML_PLACED = XML_RECENT + 'placed/' XML_RECEIVED = XML_RECENT + 'received/' XML_MISSED = XML_RECENT + 'missed/'
Python
from googlevoice import Voice, util from os import path, remove from unittest import TestCase, main class VoiceTest(TestCase): voice = Voice() voice.login() outgoing = util.input('Outgoing number (blank to ignore call tests): ') forwarding = None if outgoing: forwarding = util.input('Forwarding number [optional]: ') or None if outgoing: def test_1call(self): self.voice.call(self.outgoing, self.forwarding) def test_sms(self): self.voice.send_sms(self.outgoing, 'i sms u') def test_2cancel(self): self.voice.cancel(self.outgoing, self.forwarding) def test_special(self): self.assert_(self.voice.special) def test_inbox(self): self.assert_(self.voice.inbox) def test_balance(self): self.assert_(self.voice.settings['credits']) def test_search(self): self.assert_(len(self.voice.search('joe'))) def test_disable_enable(self): self.voice.phones[0].disable() self.voice.phones[0].enable() def test_download(self): msg = list(self.voice.voicemail.messages)[0] fn = '%s.mp3' % msg.id if path.isfile(fn): remove(fn) self.voice.download(msg) self.assert_(path.isfile(fn)) def test_zlogout(self): self.voice.logout() self.assert_(self.voice.special is None) def test_config(self): from conf import config self.assert_(config.forwardingNumber) self.assert_(str(config.phoneType) in '1237') self.assertEqual(config.get('wtf'), None) if __name__ == '__main__': main()
Python
from conf import config from util import * import settings import os if settings.DEBUG: import logging logging.basicConfig() log = logging.getLogger('PyGoogleVoice') log.setLevel(logging.DEBUG) else: log = None class Voice(object): """ Main voice instance for interacting with the Google Voice service Handles login/logout and most of the baser HTTP methods """ def __init__(self): install_opener(build_opener(HTTPCookieProcessor(CookieJar()))) for name in settings.FEEDS: setattr(self, name, self.__get_xml_page(name)) ###################### # Some handy methods ###################### def special(self): """ Returns special identifier for your session (if logged in) """ if hasattr(self, '_special') and getattr(self, '_special'): return self._special try: try: regex = bytes("('_rnr_se':) '(.+)'", 'utf8') except TypeError: regex = bytes("('_rnr_se':) '(.+)'") except NameError: regex = r"('_rnr_se':) '(.+)'" try: response = self.__do_page('inbox', data=None, headers = {'Authorization': 'GoogleLogin auth=%s' % self._auth }) sp = re.search(regex, response.read()).group(2) except AttributeError: sp = None self._special = sp return sp special = property(special) def login(self, email=None, passwd=None): """ Login to the service using your Google Voice account Credentials will be propmpted for if not given as args or in the ``~/.gvoice`` config file """ if hasattr(self, '_special') and getattr(self, '_special'): return self if email is None: email = config.email if email is None: email = input('Email address: ') if passwd is None: passwd = config.password if passwd is None: from getpass import getpass passwd = getpass() response = self.__do_page('login', {'accountType': 'HOSTED_OR_GOOGLE' ,'Email': email, 'Passwd': passwd, 'service': 'grandcentral' }) respMap = dict( line.strip().split('=', 1) for line in response.readlines() ) response.close() if respMap.has_key('Auth'): self._auth = respMap['Auth'] elif respMap.has_key('Error'): if respMap['Error'] == 'CaptchaRequired': raise LoginError('Clear the captcha at: %s' % respMap['Url']) raise LoginError(respMap['Error']) del email, passwd, respMap try: assert self.special except (AssertionError, AttributeError): raise LoginError return self def logout(self): """ Logs out an instance and makes sure it does not still have a session """ self.__do_page('logout') if hasattr(self,"_auth"): del self._auth if self.special != None: del self._special assert self.special == None return self def call(self, outgoingNumber, forwardingNumber=None, phoneType=None, subscriberNumber=None): """ Make a call to an ``outgoingNumber`` from your ``forwardingNumber`` (optional). If you pass in your ``forwardingNumber``, please also pass in the correct ``phoneType`` """ if forwardingNumber is None: forwardingNumber = config.forwardingNumber if phoneType is None: phoneType = config.phoneType self.__validate_special_page('call', { 'outgoingNumber': outgoingNumber, 'forwardingNumber': forwardingNumber, 'subscriberNumber': subscriberNumber or 'undefined', 'phoneType': phoneType, 'remember': '1' }) __call__ = call def cancel(self, outgoingNumber=None, forwardingNumber=None): """ Cancels a call matching outgoing and forwarding numbers (if given). Will raise an error if no matching call is being placed """ self.__validate_special_page('cancel', { 'outgoingNumber': outgoingNumber or 'undefined', 'forwardingNumber': forwardingNumber or 'undefined', 'cancelType': 'C2C', }) def phones(self): """ Returns a list of ``Phone`` instances attached to your account. """ return [Phone(self, data) for data in self.contacts['phones'].values()] phones = property(phones) def settings(self): """ Dict of current Google Voice settings """ return AttrDict(self.contacts['settings']) settings = property(settings) def send_sms(self, phoneNumber, text): """ Send an SMS message to a given ``phoneNumber`` with the given ``text`` message """ self.__validate_special_page('sms', {'phoneNumber': phoneNumber, 'text': text}) def search(self, query): """ Search your Google Voice Account history for calls, voicemails, and sms Returns ``Folder`` instance containting matching messages """ return self.__get_xml_page('search', data='?q=%s' % quote(query))() def download(self, msg, adir=None): """ Download a voicemail or recorded call MP3 matching the given ``msg`` which can either be a ``Message`` instance, or a SHA1 identifier. Saves files to ``adir`` (defaults to current directory). Message hashes can be found in ``self.voicemail().messages`` for example. Returns location of saved file. """ from os import path,getcwd if isinstance(msg, Message): msg = msg.id assert is_sha1(msg), 'Message id not a SHA1 hash' if adir is None: adir = getcwd() try: response = self.__do_page('download', msg) except: raise DownloadError fn = path.join(adir, '%s.mp3' % msg) fo = open(fn, 'wb') fo.write(response.read()) fo.close() return fn def contacts(self): """ Partial data of your Google Account Contacts related to your Voice account. For a more comprehensive suite of APIs, check out http://code.google.com/apis/contacts/docs/1.0/developers_guide_python.html """ if hasattr(self, '_contacts'): return self._contacts self._contacts = self.__get_xml_page('contacts')() return self._contacts contacts = property(contacts) ###################### # Helper methods ###################### def __do_page(self, page, data=None, headers={}): """ Loads a page out of the settings and pass it on to urllib Request """ page = page.upper() if isinstance(data, dict) or isinstance(data, tuple): data = urlencode(data) headers.update({'User-Agent': 'PyGoogleVoice/0.5'}) if log: log.debug('%s?%s - %s' % (getattr(settings, page)[22:], data or '', headers)) if page in ('DOWNLOAD','XML_SEARCH'): return urlopen(Request(getattr(settings, page) + data, None, headers)) if data: headers.update({'Content-type': 'application/x-www-form-urlencoded;charset=utf-8'}) headers.update({'Content-length': '%d' % len(data)}) try: return urlopen(Request(getattr(settings, page), data, headers)) except (HTTPError), e: return e def __validate_special_page(self, page, data={}, **kwargs): """ Validates a given special page for an 'ok' response """ data.update(kwargs) load_and_validate(self.__do_special_page(page, data)) _Phone__validate_special_page = __validate_special_page def __do_special_page(self, page, data=None, headers={}): """ Add self.special to request data """ assert self.special and self._auth, 'You must login before using this page' if isinstance(data, tuple): data += ('_rnr_se', self.special) elif isinstance(data, dict): data.update({'_rnr_se': self.special}) headers.update({'Authorization': 'GoogleLogin auth=%s' % self._auth}) return self.__do_page(page, data, headers) _Phone__do_special_page = __do_special_page def __get_xml_page(self, page, data=None, headers={}): """ Return XMLParser instance generated from given page """ return XMLParser(self, page, lambda: self.__do_special_page('XML_%s' % page.upper(), data, headers).read()) def __messages_post(self, page, *msgs, **kwargs): """ Performs message operations, eg deleting,staring,moving """ data = kwargs.items() for msg in msgs: if isinstance(msg, Message): msg = msg.id assert is_sha1(msg), 'Message id not a SHA1 hash' data += (('messages',msg),) return self.__do_special_page(page, dict(data)) _Message__messages_post = __messages_post
Python
import re from sys import stdout from xml.parsers.expat import ParserCreate from time import gmtime from datetime import datetime from pprint import pprint try: from urllib2 import build_opener,install_opener, \ HTTPCookieProcessor,Request,urlopen,HTTPError from urllib import urlencode,quote except ImportError: from urllib.request import build_opener,install_opener, \ HTTPCookieProcessor,Request,urlopen,HTTPError from urllib.parse import urlencode,quote try: from http.cookiejar import LWPCookieJar as CookieJar except ImportError: from cookielib import LWPCookieJar as CookieJar try: from json import loads except ImportError: from simplejson import loads try: input = raw_input except NameError: input = input sha1_re = re.compile(r'^[a-fA-F0-9]{40}$') def print_(*values, **kwargs): """ Implementation of Python3's print function Prints the values to a stream, or to sys.stdout by default. Optional keyword arguments: file: a file-like object (stream); defaults to the current sys.stdout. sep: string inserted between values, default a space. end: string appended after the last value, default a newline. """ fo = kwargs.pop('file', stdout) fo.write(kwargs.pop('sep', ' ').join(map(str, values))) fo.write(kwargs.pop('end', '\n')) fo.flush() def is_sha1(s): """ Returns ``True`` if the string is a SHA1 hash """ return bool(sha1_re.match(s)) def validate_response(response): """ Validates that the JSON response is A-OK """ try: assert 'ok' in response and response['ok'] except AssertionError: raise ValidationError('There was a problem with GV: %s' % response) def load_and_validate(response): """ Loads JSON data from http response then validates """ validate_response(loads(response.read())) class ValidationError(Exception): """ Bombs when response code back from Voice 500s """ class LoginError(Exception): """ Occurs when login credentials are incorrect """ class ParsingError(Exception): """ Happens when XML feed parsing fails """ class JSONError(Exception): """ Failed JSON deserialization """ class DownloadError(Exception): """ Cannot download message, probably not in voicemail/recorded """ class ForwardingError(Exception): """ Forwarding number given was incorrect """ class AttrDict(dict): def __getattr__(self, attr): if attr in self: return self[attr] class Phone(AttrDict): """ Wrapper for phone objects used for phone specific methods Attributes are: * id: int * phoneNumber: i18n phone number * formattedNumber: humanized phone number string * we: data dict * wd: data dict * verified: bool * name: strign label * smsEnabled: bool * scheduleSet: bool * policyBitmask: int * weekdayTimes: list * dEPRECATEDDisabled: bool * weekdayAllDay: bool * telephonyVerified * weekendTimes: list * active: bool * weekendAllDay: bool * enabledForOthers: bool * type: int (1 - Home, 2 - Mobile, 3 - Work, 4 - Gizmo) """ def __init__(self, voice, data): self.voice = voice super(Phone, self).__init__(data) def enable(self,): """ Enables this phone for usage """ return self.__call_forwarding() def disable(self): """ Disables this phone """ return self.__call_forwarding('0') def __call_forwarding(self, enabled='1'): """ Enables or disables this phone """ self.voice.__validate_special_page('default_forward', {'enabled':enabled, 'phoneId': self.id}) def __str__(self): return self.phoneNumber def __repr__(self): return '<Phone %s>' % self.phoneNumber class Message(AttrDict): """ Wrapper for all call/sms message instances stored in Google Voice Attributes are: * id: SHA1 identifier * isTrash: bool * displayStartDateTime: datetime * star: bool * isSpam: bool * startTime: gmtime * labels: list * displayStartTime: time * children: str * note: str * isRead: bool * displayNumber: str * relativeStartTime: str * phoneNumber: str * type: int """ def __init__(self, folder, id, data): assert is_sha1(id), 'Message id not a SHA1 hash' self.folder = folder self.id = id super(AttrDict, self).__init__(data) self['startTime'] = gmtime(int(self['startTime'])/1000) self['displayStartDateTime'] = datetime.strptime( self['displayStartDateTime'], '%m/%d/%y %I:%M %p') self['displayStartTime'] = self['displayStartDateTime'].time() def delete(self, trash=1): """ Moves this message to the Trash. Use ``message.delete(0)`` to move it out of the Trash. """ self.folder.voice.__messages_post('delete', self.id, trash=trash) def star(self, star=1): """ Star this message. Use ``message.star(0)`` to unstar it. """ self.folder.voice.__messages_post('star', self.id, star=star) def mark(self, read=1): """ Mark this message as read. Use ``message.mark(0)`` to mark it as unread. """ self.folder.voice.__messages_post('mark', self.id, read=read) def download(self, adir=None): """ Download the message MP3 (if any). Saves files to ``adir`` (defaults to current directory). Message hashes can be found in ``self.voicemail().messages`` for example. Returns location of saved file. """ return self.folder.voice.download(self, adir) def __str__(self): return self.id def __repr__(self): return '<Message #%s (%s)>' % (self.id, self.phoneNumber) class Folder(AttrDict): """ Folder wrapper for feeds from Google Voice Attributes are: * totalSize: int (aka ``__len__``) * unreadCounts: dict * resultsPerPage: int * messages: list of Message instances """ def __init__(self, voice, name, data): self.voice = voice self.name = name super(AttrDict, self).__init__(data) def messages(self): """ Returns a list of all messages in this folder """ return [Message(self, *i) for i in self['messages'].items()] messages = property(messages) def __len__(self): return self['totalSize'] def __repr__(self): return '<Folder %s (%s)>' % (self.name, len(self)) class XMLParser(object): """ XML Parser helper that can dig json and html out of the feeds. The parser takes a ``Voice`` instance, page name, and function to grab data from. Calling the parser calls the data function once, sets up the ``json`` and ``html`` attributes and returns a ``Folder`` instance for the given page:: >>> o = XMLParser(voice, 'voicemail', lambda: 'some xml payload') >>> o() ... <Folder ...> >>> o.json ... 'some json payload' >>> o.data ... 'loaded json payload' >>> o.html ... 'some html payload' """ attr = None def start_element(self, name, attrs): if name in ('json','html'): self.attr = name def end_element(self, name): self.attr = None def char_data(self, data): if self.attr and data: setattr(self, self.attr, getattr(self, self.attr) + data) def __init__(self, voice, name, datafunc): self.json, self.html = '','' self.datafunc = datafunc self.voice = voice self.name = name def __call__(self): self.json, self.html = '','' parser = ParserCreate() parser.StartElementHandler = self.start_element parser.EndElementHandler = self.end_element parser.CharacterDataHandler = self.char_data try: data = self.datafunc() parser.Parse(data, 1) except: raise ParsingError return self.folder def folder(self): """ Returns associated ``Folder`` instance for given page (``self.name``) """ return Folder(self.voice, self.name, self.data) folder = property(folder) def data(self): """ Returns the parsed json information after calling the XMLParser """ try: return loads(self.json) except: raise JSONError data = property(data)
Python
""" This project aims to bring the power of the Google Voice API to the Python language in a simple, easy-to-use manner. Currently it allows you to place calls, send sms, download voicemails/recorded messages, and search the various folders of your Google Voice Accounts. You can use the Python API or command line script to schedule calls, check for new received calls/sms, or even sync your recorded voicemails/calls. Works for Python 2 and Python 3 """ __author__ = 'Justin Quick and Joe McCall' __email__ = 'justquick@gmail.com, joe@mcc4ll.us', __copyright__ = 'Copyright 2009, Justin Quick and Joe McCall' __credits__ = ['Justin Quick','Joe McCall','Jacob Feisley','John Nagle'] __license__ = 'New BSD' __version__ = '0.5' from voice import Voice from util import Phone, Message, Folder
Python
from ConfigParser import ConfigParser, NoOptionError import os import settings class Config(ConfigParser): """ ``ConfigParser`` subclass that looks into your home folder for a file named ``.gvoice`` and parses configuration data from it. """ def __init__(self): self.fname = os.path.expanduser('~/.gvoice') if not os.path.exists(self.fname): try: f = open(self.fname, 'w') except IOError: return f.write(settings.DEFAULT_CONFIG) f.close() ConfigParser.__init__(self) try: self.read([self.fname]) except IOError: return def get(self, option, section='gvoice'): try: return ConfigParser.get(self, section, option).strip() or None except NoOptionError: return def set(self, option, value, section='gvoice'): return ConfigParser.set(self, section, option, value) def phoneType(self): try: return int(self.get('phoneType')) except TypeError: return def save(self): f = open(self.fname, 'w') self.write(f) f.close() phoneType = property(phoneType) forwardingNumber = property(lambda self: self.get('forwardingNumber')) email = property(lambda self: self.get('email','auth')) password = property(lambda self: self.get('password','auth')) secret = property(lambda self: self.get('secret')) config = Config()
Python
#!/usr/bin/python import socket import sys import struct import time # debug VERBOSE = True def D(msg): if VERBOSE: print(msg) # "struct fbinfo" is defined in $T/system/core/adb/framebuffer_service.c def fbinfo_unpack(data): keys = ("version", "bpp", "size", "width", "height", "red_offset", "red_length", "blue_offset", "blue_length", "green_offset", "green_length", "alpha_offset", "alpha_length" ) # the data is little-endian values = struct.unpack("<IIIIIIIIIIIII",data) D("dump struct fbinfo") i = 0 for key in keys: D("%14s: %-12d" % (key, values[i])) i = i + 1 def save(): f = open('dump', 'w') while True: data = s.recv(4096 * 16) if data == "": break f.write(data) f.close() def communicate(cmd=None): if cmd != None: buf = "%04x%s" % (len(cmd), cmd) D("<< " + buf) s.send(buf) data = s.recv(4096) D(">> [%s]" % len(data)) D(data) if data[0:4] == 'FAIL': return False else: return True target = '' # use getopt module in future for arg in sys.argv: if arg == '-q': VERBOSE = False if target != 'any': # compatiable with "adb -d", redirect commands to usb if arg == '-d': target = 'usb' # compatiable with "adb -e", redirect commands to emulator elif arg == '-e': target = 'local' if target == '': target ='any' s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) D("connecting") try: s.connect(("localhost", 5037)) except socket.error: print 'Cannot connect to localhost:5037' print socket.error sys.exit(0) D("connected") if not communicate("host:transport-%s" % target): sys.exit(1) #communicate("host:transport-usb:shell:ls /data") communicate("framebuffer:") data = s.recv(52) fbinfo_unpack(data) t0 = float(time.time()) save() t1 = float(time.time()) print t1 - t0
Python
import unittest from tempfile import NamedTemporaryFile from forpp import TextBlock, Parser, FunctionBlock, IfBlock, ForppException, ForBlock, MacroBlock class TestReplace(unittest.TestCase): def test_expand_simple_variable(self): string = [ '<FOO>' ] exp = [ 'hello' ] block = TextBlock(string, macros={'FOO': MacroBlock('FOO', lines=['hello'])}) res = block.expand() self.assertEqual(res, exp) def test_expand_expression(self): string = [ '<FOO+1>', '<FOO-2>', '<FOO/3>', '<FOO*4>', ] exp = [ '2', '-1', '0', '4', ] block = TextBlock(string, macros={'FOO': MacroBlock('FOO', lines=['1'])}) res = block.expand() self.assertEqual(res, exp) def test_expand_function_with_one_arg(self): string = [ 'FOO( 1 )' ] exp = [ '2' ] block = TextBlock(string, macros={'FOO': FunctionBlock('FOO', ['ARG1'], lines=['<ARG1+1>'])}) res = block.expand() self.assertEqual(res, exp) def test_expand_function_with_multiple_args(self): string = [ 'FOO( integer, 2, var )' ] exp = [ 'integer, dimension(2) :: var' ] args = ['TYPE', 'DIM', 'NAME'] fcn_lines = ['<TYPE>, dimension(<DIM>) :: <NAME>'] block = TextBlock(string, macros={'FOO': FunctionBlock('FOO', args, lines=fcn_lines)}) res = block.expand() self.assertEqual(res, exp) def test_expand_function_with_args_with_braces(self): string = [ 'FOO( integer(kind=4), 2, var )' ] exp = [ 'integer(kind=4), dimension(2) :: var' ] args = ['TYPE', 'DIM', 'NAME'] fcn_lines = ['<TYPE>, dimension(<DIM>) :: <NAME>'] block = TextBlock(string, macros={'FOO': FunctionBlock('FOO', args, lines=fcn_lines)}) res = block.expand() self.assertEqual(res, exp) def test_expand_if_clause(self): tests = ['<DIM> == 0', '<DIM> == 1', None] test_blocks = [ ['if branch'], ['elseif branch'], ['else branch'] ] if_block = IfBlock(tests, test_blocks, macros={'DIM': MacroBlock('DIM', lines=['0'])}) string = [ if_block ] exp = [ 'if branch' ] block = TextBlock(string) res = block.expand() self.assertEqual(res, exp) def test_expand_elseif_clause(self): tests = ['<DIM> == 0', '<DIM> == 1', None] test_blocks = [ ['if branch'], ['elseif branch'], ['else branch'] ] if_block = IfBlock(tests, test_blocks, macros={'DIM': TextBlock('1')}) string = [ if_block ] exp = [ 'elseif branch' ] block = TextBlock(string) res = block.expand() self.assertEqual(res, exp) def test_expand_else_clause(self): tests = ['<DIM> == 0', '<DIM> == 1', None] test_blocks = [ ['if branch'], ['elseif branch'], ['else branch'] ] if_block = IfBlock(tests, test_blocks, macros={'DIM': TextBlock('3')}) string = [ if_block ] exp = [ 'else branch' ] block = TextBlock(string) res = block.expand() self.assertEqual(res, exp) def test_expand_for_block(self): lines = [ 'integer :: var<VAR>' ] exp = [ 'integer :: var1', 'integer :: var2', 'integer :: var3', ] block = ForBlock('VAR', '[1, 2, 3]', lines=lines) res = block.expand() self.assertEqual(res, exp) def test_expand_for_block_with_nested_function(self): lines = [ 'FOO( <VAR> )' ] exp = [ 'integer :: var1', 'integer :: var2', 'integer :: var3', ] macros = {'FOO': FunctionBlock('FOO', ['ARG1'], lines=['integer :: var<ARG1>'])} block = ForBlock('VAR', '[1, 2, 3]', lines=lines, macros=macros) res = block.expand() self.assertEqual(res, exp) class TestParse(unittest.TestCase): def test_create_new_parser(self): parser = Parser(None) def test_parse_empty_string(self): parser = Parser(None) res = parser.parse(["\n"]) exp = [ '\n' ] self.assertEqual(parser.macros, {}) self.assertEqual(res, exp) def test_parse_simple_single_line_define(self): parser = Parser(None) res = parser.parse(["!#DEFINE NAME Value\n"]) exp = [] self.assertEqual(parser.macros.keys(), ['NAME']) self.assertEqual(parser.macros['NAME'].Type, 'DEFINE') self.assertEqual(res, exp) def test_parse_define_block(self): parser = Parser(None) res = parser.parse([ '!#DEFINE NAME\n', 'Value\n', '!#END DEFINE', ]) exp = [] self.assertEqual(parser.macros.keys(), ['NAME']) self.assertEqual(parser.macros['NAME'].Type, 'DEFINE') self.assertEqual(res, exp) def test_parse_non_empty_strign(self): parser = Parser(None) res = parser.parse(["module main\n"]) exp = [ 'module main\n' ] self.assertEqual(parser.macros, {}) self.assertEqual(res, exp) def test_multi_line_simple_define(self): parser = Parser(None) res = parser.parse([ "!#DEFINE NAME Some \\\n", "! multi line \\\n", "! define\n" ]) exp = [] self.assertEqual(parser.macros.keys(), ['NAME']) self.assertEqual(parser.macros['NAME'].Type, 'DEFINE') self.assertEqual(res, exp) def test_for_block(self): parser = Parser(None) res = parser.parse([ "!#FOR VAR IN [1, 2, 3]\n", " integer :: var<VAR>\n", "!#END FOR\n" ]) self.assertEqual(res[0].Type, 'FOR') self.assertEqual(res[0].var, 'VAR') self.assertEqual(res[0]._list, ['1', '2', '3']) def test_parse_define_containing_block(self): parser = Parser(None) res = parser.parse([ "!#DEFINE BEGIN_SUITE( NAME, USES )", "module test_<NAME>_mod", " use pFUnit", "!# FOR USE IN <USES>", " use <USE>", "!# END FOR", " implicit none", "!#END DEFINE" ]) exp = [] self.assertEqual(res, []) self.assertEqual(parser.macros.keys(), ['BEGIN_SUITE']) self.assertEqual(parser.macros['BEGIN_SUITE']._lines, [ "module test_<NAME>_mod", " use pFUnit", "!# FOR USE IN <USES>", " use <USE>", "!# END FOR", " implicit none", ]) def test_nested_for_block(self): parser = Parser(None) res = parser.parse([ "!#FOR VAR IN [1,2,3]", "!# IF <VAR> == 0", " integer :: var", "!# ELSE", " integer, dimension(<VAR>) :: var", "!# END IF", " integer :: i", "!#END FOR" ]) exp = [ "!# IF <VAR> == 0", " integer :: var", "!# ELSE", " integer, dimension(<VAR>) :: var", "!# END IF", " integer :: i", ] self.assertEqual(res[0].Type, 'FOR') self.assertEqual(res[0].var, 'VAR') self.assertEqual(res[0]._list, ['1','2','3']) self.assertEqual(res[0]._lines, exp) def test_parse_simple_if_block(self): parser = Parser(None) res = parser.parse([ "!#IF <VAR> == 0", " if block", "!#END IF", ]) exp = [ " if block", ] self.assertEqual(res[0].Type, 'IF') self.assertEqual(res[0]._tests, ['<VAR> == 0']) self.assertEqual(res[0]._test_lines, { '<VAR> == 0': [' if block'], }) def test_parse_if_elseif_block(self): parser = Parser(None) res = parser.parse([ "!#IF <VAR> == 0", " if block", "!#ELSEIF <VAR> == 1", " elseif block", "!#END IF", ]) exp = [ " if block", ] self.assertEqual(res[0].Type, 'IF') self.assertEqual(res[0]._tests, ['<VAR> == 0', '<VAR> == 1']) self.assertEqual(res[0]._test_lines, { '<VAR> == 0': [' if block'], '<VAR> == 1': [' elseif block'], }) def test_parse_if_elseif_else_block(self): parser = Parser(None) res = parser.parse([ "!#IF <VAR> == 0", " if block", "!#ELSEIF <VAR> == 1", " elseif block", "!#ELSE", " else block", "!#END IF", ]) exp = [ " if block", ] self.assertEqual(res[0].Type, 'IF') self.assertEqual(res[0]._tests, ['<VAR> == 0', '<VAR> == 1', None]) self.assertEqual(res[0]._test_lines, { '<VAR> == 0': [' if block'], '<VAR> == 1': [' elseif block'], None: [' else block'], }) def test_parse_include(self): parser = Parser(None) tmpfile = NamedTemporaryFile(delete=False) tmpfile.writelines([ "!#DEFINE MACRO \\\n", "! macro value\n", "!#IF <VAR> == 0\n", " if block\n", "!#END IF\n", ]) tmpfile.close() try: res = parser.parse([ "!#INCLUDE %s" % tmpfile.name, ]) exp = [ " if block", ] self.assertEqual(res[0].Type, 'IF') self.assertEqual(parser.macros.keys(), ['MACRO']) finally: import os os.remove(os.path.abspath(tmpfile.name)) def test_parse_set(self): parent = TextBlock() block = TextBlock(parent=parent) parser = Parser(block) res = parser.parse([ "!#SET VAR Value", ]) self.assertEqual(res, []) self.assertEqual(parser.macros, {}) self.assertEqual(block._macros, {}) self.assertEqual(parent._macros.keys(), ['VAR']) self.assertEqual(parent._macros['VAR']._lines, ['Value']) def test_parse_append_to_empty_list(self): parent = TextBlock(macros={'VAR': '[]'}) block = TextBlock(parent=parent) parser = Parser(block) res = parser.parse([ "!#APPEND VAR Value", ]) self.assertEqual(res, []) self.assertEqual(parser.macros, {}) self.assertEqual(block._macros, {}) self.assertEqual(parent._macros.keys(), ['VAR']) self.assertEqual(parent._macros['VAR']._lines, ['[Value]']) def test_parse_append_to_list_of_one_elemnent(self): parent = TextBlock(macros={'VAR': '[Value]'}) block = TextBlock(parent=parent) parser = Parser(block) res = parser.parse([ "!#APPEND VAR AnotherValue", ]) self.assertEqual(res, []) self.assertEqual(parser.macros, {}) self.assertEqual(block._macros, {}) self.assertEqual(parent._macros.keys(), ['VAR']) self.assertEqual(parent._macros['VAR']._lines, ['[Value, AnotherValue]']) def test_parse_not_terminated_define_block(self): parser = Parser(None) self.assertRaises(ForppException, lambda: parser.parse([ '!#DEFINE NAME\n', 'Value\n', ])) if __name__ == '__main__': unittest.main()
Python
#!/usr/bin/env python import sys import re from collections import deque from itertools import izip_longest, izip #======================================================================================================================= class ForppException(Exception): pass #======================================================================================================================= class ParseException(ForppException): pass #======================================================================================================================= class DefineMatch(object): def __init__(self, name, args, value): self._groupdict = {'name': name, 'args': args, 'value': value} def groupdict(self): return self._groupdict def group(self, name): return self._groupdict[name] class DefineMatcher(object): def __init__(self): self._re = re.compile(r'^!#\s*DEFINE\s+(?P<name>[a-zA-Z_]+)\s*(?P<text>.*)$') def match(self, line): match = self._re.search(line) if not match: return None name = match.group('name') text = match.group('text').strip() if text.startswith('('): idx = 1 depth = 1 while depth: if text[idx] == ')': depth -= 1 if text[idx] == '(': depth += 1 idx += 1 args = text[:idx] value = text[idx:] else: args = None value = text return DefineMatch(name, args, value) class FunctionMatch(object): def __init__(self, name, args, start, length): self._groupdict = {'name': name, 'args': args} self._start = start self._end = start + length def groupdict(self): return self._groupdict def group(self, name): return self._groupdict[name] def start(self): return self._start def end(self): return self._end class FunctionMatcher(object): def __init__(self, names): self._names = names self._re = re.compile(r'(\b|^)(?P<name>[a-zA-Z_][a-zA-Z_1-9]*)\s*(?P<text>.*)') def search(self, line): match = self._re.search(line) if not match: return None name = match.group('name') text = match.group('text').strip() if name not in self._names: return None if text.startswith('('): idx = 1 depth = 1 while depth: if text[idx] == ')': depth -= 1 if text[idx] == '(': depth += 1 idx += 1 args = text[:idx] length = len(name) + idx else: args = None length = len(name) return FunctionMatch(name, args, match.start(), length) FORPP_RE = re.compile(r'^!#\s*(?P<command>\S+).*$') END_RE = re.compile(r'^!#\s*END\s+(?P<command>\S+)\s*$') DEFINE_RE = re.compile(r'^!#\s*DEFINE\s+(?P<name>[a-zA-Z_]+)\s*(?P<args>\(.*\))?(?P<value>.*)\s*$') #DEFINE_RE = DefineMatcher() FOR_RE = re.compile(r'^!#\s*FOR\s+(?P<var>\S+)\s+IN\s+(?P<list>.*)\s*$') IF_RE = re.compile(r'^!#\s*IF\s+(?P<test>.*)\s*$') ELSEIF_RE = re.compile(r'^!#\s*ELSE\s*IF\s+(?P<test>.*)\s*$') ELSE_RE = re.compile(r'^!#\s*ELSE\s*$') SET_RE = re.compile(r'^!#\s*SET\s+(?P<name>\S+)\s+(?P<value>.*)\s*$') INCLUDE_RE = re.compile(r'^!#\s*INCLUDE\s+(?P<file_name>\S+)\s*$') APPEND_RE = re.compile(r'^!#\s*APPEND\s+(?P<name>\S+)\s+(?P<value>.*)\s*$') VAR_RE = re.compile(r'<(?P<name>[a-zA-Z_][a-zA-Z_1-9]*)(?P<expr>(?P<op>[\+-/\*])(?P<num>\d+))?>') FUNCTION_RE = re.compile(r'(\b|^)([a-zA-Z_][a-zA-Z_1-9]*)(\([^)]*\)).*') OP_MAP = { '+': int.__add__, '-': int.__sub__, '/': int.__div__, '*': int.__mul__, } #======================================================================================================================= def split_args(arg_string): depth = 0 idx = 0 args = [] buf = '' while idx < len(arg_string): char = arg_string[idx] if char == '(': depth += 1 buf += char elif char == ')': depth -= 1 buf += char elif char == ',' and depth == 0: args.append(buf) buf = '' else: buf += char idx += 1 if buf: args.append(buf.strip()) return args #======================================================================================================================= def parse_list(list_string): depth = 0 idx = 0 buf = '' lst = [] list_string = list_string.strip() if list_string[0] == '[' and list_string[-1] == ']': list_string = list_string[1:-1] elif list_string[0] == '(' and list_string[-1] == ')': list_string = list_string[1:-1] else: raise ForppException('Invalid list %s' % list_string) while idx < len(list_string): char = list_string[idx] if char == '(': depth += 1 buf += char elif char == ')': depth -= 1 buf += char elif char == ',' and depth == 0: lst.append(buf.strip()) buf = '' else: buf += char idx += 1 if buf: lst.append(buf.strip()) #idx = 0 #while idx < len(lst): # item = lst[idx] # if (item[0] == '[' and item[-1] == ']') or (item[0] == '(' and item[-1] == ')'): # lst[idx] = parse_list(item) # idx += 1 return lst #======================================================================================================================= class Parser(object): def __init__(self, caller): self._macros = {} self._tests = [] self._test_blocks = [] self._caller = caller def _parse_define(self): match = DEFINE_RE.match(self._block_definition) name = match.group('name') args = match.group('args') value = match.group('value') if value: lines = [value] else: lines = self._block_lines if args is not None: if not args: self._macros[name] = FunctionBlock(name, None, lines=lines, parent=self._caller) else: self._macros[name] = FunctionBlock(name, split_args(args), lines=lines, parent=self._caller) else: self._macros[name] = MacroBlock(name, lines=lines, parent=self._caller) def _parse_for(self): match = FOR_RE.match(self._block_definition) var = match.group('var') lst = match.group('list') return ForBlock(var, lst, lines=self._block_lines, parent=self._caller) def _parse_if(self): match = (IF_RE.match(self._block_definition) or ELSEIF_RE.match(self._block_definition) or ELSE_RE.match(self._block_definition)) if 'test' in match.groupdict(): test = match.group('test') else: test = None self._tests.append(test) self._test_blocks.append(self._block_lines) return IfBlock(self._tests, self._test_blocks, parent=self._caller) def _parse_elseif(self): match = IF_RE.match(self._block_definition) or ELSEIF_RE.match(self._block_definition) test = match.group('test') self._tests.append(test) self._test_blocks.append(self._block_lines) def _parse_set(self): match = SET_RE.match(self._block_definition) parent = self._caller while parent._parent is not None: parent = parent._parent name = match.group('name') value = match.group('value') lines = TextBlock([value], parent=self._caller).expand() parent._macros[name] = MacroBlock(name, lines=lines, parent=self._caller) def _parse_include(self): match = INCLUDE_RE.match(self._block_definition) file_name = match.group('file_name') lines = open(file_name).readlines() for line in lines[::-1]: self._lines.appendleft(line) def _parse_append(self): match = APPEND_RE.match(self._block_definition) name = match.group('name') value = match.group('value') parent = self._caller while parent._parent is not None: parent = parent._parent lst = parent._macros[name] if lst[-1] != ']': raise ForppException('Invalid list %s' % lst) if len(lst) > 2: lst = lst[:-1] + ', ' + value + lst[-1] else: lst = lst[:-1] + value + lst[-1] parent._macros[name] = MacroBlock(name, lines=[lst], parent=self._caller) METHOD_MAP = { 'DEFINE': _parse_define, 'FOR': _parse_for, 'IF': _parse_if, 'SET': _parse_set, 'APPEND': _parse_append, 'INCLUDE': _parse_include, } def _build_block(self, command): block = Parser.METHOD_MAP[command](self) if block: self._output.append(block) self._block_lines = [] self._block_definition = None def _parse_block_line(self, line): match = FORPP_RE.match(line) if match: command = match.group('command') if command == 'END': end_command = END_RE.match(line).group('command') if end_command != self._block_types[-1]: raise ForppException('Mismatched END expected %s, found %s' % (self._block_types[-1], end_command)) self._block_types.pop() if not self._block_types: self._build_block(end_command) else: self._block_lines.append(line) elif command in ('ELSEIF', 'ELSE'): if self._block_types[-1] != 'IF': raise ForppException('%s found not in IF block' % command) if len(self._block_types) > 1: self._block_lines.append(line) else: self._parse_elseif() self._block_definition = line self._block_lines = [] else: if not self._is_single_line_command(line): self._block_types.append(command) self._block_lines.append(line) else: self._block_lines.append(line) def _is_single_line_command(self, line): match = DEFINE_RE.match(line) if match and match.group('value'): return True if INCLUDE_RE.match(line) or SET_RE.match(line) or APPEND_RE.match(line): return True return False def _parse_line(self, line): match = FORPP_RE.match(line) if match: command = match.group('command') if command in ('END', 'ELSEIF', 'ELSE'): raise ForppException('Unexpected %s found' % command) if self._is_single_line_command(line): self._block_definition = line self._build_block(command) else: self._block_definition = line self._block_types.append(command) else: self._output.append(line) def parse(self, lines): self._output = [] self._lines = deque(lines) self._block_lines = [] self._block_types = deque() self._block_definition = None while self._lines: line = self._lines.popleft() if isinstance(line, TextBlock): self._output.append(line) continue while line.endswith('\\\n'): cont = self._lines.popleft().lstrip().lstrip('!').lstrip() line = line.rstrip('\\\n') + cont continue if self._block_types: self._parse_block_line(line) else: self._parse_line(line) if self._block_types: raise ForppException('Incomplete block %s found' % self._block_types[-1]) return self._output @property def macros(self): return self._macros #======================================================================================================================= class TextBlock(object): Type = 'TEXT' def __init__(self, lines=None, macros=None, parent=None, file_name=None): if macros is None: macros = {} if parent is not None and not isinstance(parent, TextBlock): raise ForppException('Invalid parent %s' % parent) if lines is None: lines = [] self._lines = lines self._macros = macros self._parent = parent self._parser = Parser(self) if file_name: self._macros['FILE'] = TextBlock([file_name]) def append_line(self, line): self._lines.append(line) def _parse(self): lines = self._parser.parse(self._lines) self._macros.update(self._parser.macros) return lines @property def macros(self): if self._parent: tmp = self._parent.macros.copy() else: tmp = {} tmp.update(self._macros) return tmp def expand(self): lines = self._parse() output = [] queue = deque(lines) if 'LINE' not in self.macros: self._macros['LINE'] = CountBlock() try: while True: line = queue.popleft() self.macros['LINE'].inc() if isinstance(line, TextBlock): for l in line.expand()[::-1]: queue.appendleft(l) self.macros['LINE'].dec() continue var_match = VAR_RE.search(line) #function_match = FUNCTION_RE.search(line) names = [name for name, block in self.macros.iteritems() if isinstance(block, FunctionBlock)] function_match = FunctionMatcher(names).search(line) if function_match: name = function_match.group('name') args = function_match.group('args') macro = self.macros[name] arg_list = parse_list(args) lines = macro.expand(arg_list) if lines: tmp = [] tmp.append(line[:function_match.start()] + lines[0]) tmp += lines[1:] tmp[-1] += line[function_match.end():] for l in tmp[::-1]: queue.appendleft(l) self.macros['LINE'].dec() elif var_match: name = var_match.group('name') if name in self.macros: if var_match.group('expr'): op = OP_MAP[var_match.group('op')] num = int(var_match.group('num')) macro = self.macros[name] lines = macro.expand() if len(lines) != 1: raise ForppException() lines = [str(op(int(lines[0]), num))] else: macro = self.macros[name] lines = macro.expand() if lines: tmp = [] tmp.append(line[:var_match.start()] + lines[0]) tmp += lines[1:] tmp[-1] += line[var_match.end():] for l in tmp[::-1]: queue.appendleft(l) self.macros['LINE'].dec() else: print >> sys.stderr, 'Unknown macro <%s>' % name output.append(line) else: output.append(line) except IndexError: pass return output def __repr__(self): return 'TextBlock(%s)' % self._lines #======================================================================================================================= class MacroBlock(TextBlock): Type = 'DEFINE' def __init__(self, name, **kwargs): TextBlock.__init__(self, **kwargs) self.name = name def __repr__(self): return 'MacroBlock(%s)' % (self.name) #======================================================================================================================= class CountBlock(TextBlock): Type = None def __init__(self, value=0): TextBlock.__init__(self) self.value = value def expand(self): return [str(self.value)] def __repr__(self): return 'Count(%d)' % self.value def inc(self): self.value += 1 def dec(self): self.value -= 1 def __repr__(self): return 'CountBlock(%d)' % self.value #======================================================================================================================= class ForBlock(TextBlock): Type = 'FOR' def __init__(self, var, for_list, **kwargs): TextBlock.__init__(self, **kwargs) self.var = var.strip() lines = TextBlock([for_list], parent=self).expand() if len(lines) != 1: raise ForppException('Invalid FOR list %s' % lst) self._list = parse_list(lines[0]) def expand(self): output = [] for val in self._list: self._macros[self.var] = TextBlock([val], parent=self) lines = self._parse() output += TextBlock.expand(self) return output def __repr__(self): return 'ForBlock(%s, %s)' % (self.var, self._list) #======================================================================================================================= class IfBlock(TextBlock): Type = 'IF' Comparators = { '==': lambda lhs, rhs: lhs == rhs, '!=': lambda lhs, rhs: lhs != rhs, '>' : lambda lhs, rhs: lhs > rhs, '>=': lambda lhs, rhs: lhs >= rhs, '<' : lambda lhs, rhs: lhs < rhs, '<=': lambda lhs, rhs: lhs <= rhs, } def __init__(self, tests, test_blocks, **kwargs): if len(tests) != len(test_blocks): raise ForppException('Invalid IF tests %s %s' % (tests, test_blocks)) TextBlock.__init__(self, **kwargs) self._tests = tests self._test_lines = {} for test, block in izip(tests, test_blocks): self._test_lines[test] = block def expand(self): for test in self._tests: if test is None or self.eval_test(test): lines = self._test_lines[test] return TextBlock(lines, parent=self).expand() def eval_test(self, test): lines = TextBlock([test], parent=self).expand() if len(lines) != 1: raise ForppException() test = lines[0] for comparator, func in IfBlock.Comparators.iteritems(): cmp_re = re.compile(r'^\s*(\d+)\s*%s\s*(\d+)\s*$' % comparator) match = cmp_re.match(test) if match: lhs = int(match.group(1)) rhs = int(match.group(2)) return func(lhs, rhs) raise ForppException(test) def __repr__(self): return 'IfBlock(%s, %s)' % (self._tests, [self._test_lines[test] for test in self._tests]) #======================================================================================================================= class FunctionBlock(TextBlock): Type = 'DEFINE' def __init__(self, name, args, **kwargs): TextBlock.__init__(self, **kwargs) self.name = name.strip() if args: self.args = [a.strip() for a in args] else: self.args = [] def expand(self, arg_vals): for name, val in izip_longest(self.args, arg_vals): self._macros[name] = MacroBlock(name, lines=[val], parent=self) return TextBlock.expand(self) def __repr__(self): return 'FunctionBlock(%s, %s)' % (self.name, self.args) #======================================================================================================================= if __name__ == '__main__': file_name = sys.argv[1] lines = open(file_name).readlines() block = TextBlock(lines, file_name=file_name) res = block.expand() for line in res: print line,
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # LCS(longest common subsequence) problem # see Introduction to Algorithms, p.350~355 # author: Forrest Y. Yu <forrest.yu@gmail.com>, http://forrestyu.net/ import sys class color(object): BLACK = "\033[0;30m" RED = "\033[0;31m" GREEN = "\033[0;32m" YELLOW = "\033[0;33m" BLUE = "\033[0;34m" MAGENTA = "\033[0;35m" CYAN = "\033[0;36m" WHITE = "\033[0;37m" BLACK_B = "\033[0;1;30m" RED_B = "\033[0;1;31m" GREEN_B = "\033[0;1;32m" YELLOW_B = "\033[0;1;33m" BLUE_B = "\033[0;1;34m" MAGENTA_B = "\033[0;1;35m" CYAN_B = "\033[0;1;36m" WHITE_B = "\033[0;1;37m" NOCOLOR = "\033[0m" @staticmethod def s(c, str): c = 'color.%s' % c return eval(c) + str + color.NOCOLOR @staticmethod def i(c, i): return color.s(c, str(i)) def LCS_recursive(X, Y): if len(X) == 0 or len(Y) == 0: return 0, [] elif X[-1] == Y[-1]: i, l = LCS_recursive(X[:-1], Y[:-1]) return i+1, l+[X[-1]] else: i1, l1 = LCS_recursive(X[:-1], Y) i2, l2 = LCS_recursive(X, Y[:-1]) if i1 > i2: return i1, l1 else: return i2, l2 class grid(object): def __init__(self): self.len = 0 self.dir = None def __repr__(self): if self.dir != None: return '%s %s ' % (color.s('GREEN', self.dir), color.i('RED', self.len)) else: return '%s %s ' % (' ', color.i('RED', self.len)) def matrix_print(func): def wrapper(X, Y): l = func(X, Y) m, n = len(X), len(Y) print ' ', for j in range(-1,m): print color.s('WHITE', '%11d' % j), print '\n' for i in range(-1,n): # -1..m-1 print color.s('WHITE', ' %2d ' % i), for j in range(-1,m): print l[i][j], print '\n' return l return wrapper def LCS(X, Y): m, n = len(X), len(Y) @matrix_print def LCS0(X, Y): # m # :::::::::::::::: # n :::::::::::::::: # :::::::::::::::: l = [ [grid() for i in range(m + 1) ] for j in range(n + 1) ] for i in range(-1,n): # -1..n-1 for j in range(-1,m): # -1..m-1 if i == -1 or j == -1: l[i][j].len = 0 elif X[j] == Y[i]: l[i][j].len = l[i-1][j-1].len + 1 l[i][j].dir = '↖' else: i1 = l[i-1][j].len i2 = l[i][j-1].len if (i2 > i1): l[i][j].len = l[i][j-1].len l[i][j].dir = '←' else: l[i][j].len = l[i-1][j].len l[i][j].dir = '↑' # print color.i('CYAN', l[i][j].len), # print return l def p_lcs(i, j): #print i, j, l[i][j] if l[i][j].len == 0: return elif l[i][j].dir == '↑': p_lcs(i-1, j) elif l[i][j].dir == '←': p_lcs(i, j-1) elif l[i][j].dir == '↖': p_lcs(i-1, j-1) assert X[j] == Y[i] print color.s('CYAN', X[j]), else: assert 0 l = LCS0(X, Y) p_lcs(n-1, m-1) if __name__ == '__main__': print sys.argv if 1: A,B,C,D = 'A','B','C','D' Y = [A, B, C, B, D, A, B] X = [B, D, C, A, B, A] else: # Introduction to Algorithm, Ex-15.4-1 @ p.355 X = ['1', '0', '0', '1', '0', '1', '0', '1'] Y = ['0', '1', '0', '1', '1', '0', '1', '1', '0'] print 'LCS of\n\t', X, '\nand\n\t', Y, '\n:' if len(sys.argv) == 1 or sys.argv[1] == '-r': print LCS_recursive(X, Y) elif sys.argv[1] == '-d': LCS(X, Y) else: print 'bad arg:', sys.argv[1:]
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # CLRS Problem 15-2 Printing neatly # author: Forrest Y. Yu <forrest.yu@gmail.com>, http://forrestyu.net/ import sys import re INFTY = float('inf') paragraph = ( """Python is a high-level, structured, open-source programming language that can be used for a wide variety of programming tasks. It is good for simple quick-and-dirty scripts, as well as complex and intricate applications. It is an interpreted programming language that is automatically compiled into bytecode before execution (the bytecode is then normally saved to disk, just as automatically, so that compilation need not happen again until and unless the source gets changed). It is also a dynamically typed language that includes (but does not require one to use) object oriented features and constructs. The most unusual aspect of Python is that whitespace is significant; instead of block delimiters (braces in the C family of languages), indentation is used to indicate where blocks begin and end.""", """Consider the problem of neatly printing a paragraph on a printer. The input text is a sequence of n words of lengths l1, l2, ..., ln, measured in characters. We want to print this paragraph neatly on a number of lines that hold a maximum of M characters each. Our criterion of "neatness" is as follows. If a given line contains words i through j, where i ≤ j, and we leave exactly one space between words, the number of extra space characters at the end of the line is M-j+i-∑lk, which must be nonnegative so that the words fit on the line. We wish to minimize the sum, over all lines except the last, of the cubes of the numbers of extra space characters at the ends of lines. Give a dynamic-programming algorithm to print a paragraph of n words neatly on a printer. Analyze the running time and space requirements of your algorithm.""", """Consider the problem of neatly printing a paragraph on a printer. Analyze the running time and space requirements of your algorithm.""") p_control = ("""Python is a high-level, structured, open-source programming language that can be used for a wide variety of programming tasks. It is good for simple quick-and-dirty scripts, as well as complex and intricate applications. It is an interpreted programming language that is automatically compiled into bytecode before execution (the bytecode is then normally saved to disk, just as automatically, so that compilation need not happen again until and unless the source gets changed). It is also a dynamically typed language that includes (but does not require one to use) object oriented features and constructs. The most unusual aspect of Python is that whitespace is significant; instead of block delimiters (braces in the C family of languages), indentation is used to indicate where blocks begin and end.""", """Consider the problem of neatly printing a paragraph on a printer. The input text is a sequence of n words of lengths l1, l2, ..., ln, measured in characters. We want to print this paragraph neatly on a number of lines that hold a maximum of M characters each. Our criterion of "neatness" is as follows. If a given line contains words i through j, where i ≤ j, and we leave exactly one space between words, the number of extra space characters at the end of the line is M-j+i-∑lk, which must be nonnegative so that the words fit on the line. We wish to minimize the sum, over all lines except the last, of the cubes of the numbers of extra space characters at the ends of lines. Give a dynamic-programming algorithm to print a paragraph of n words neatly on a printer. Analyze the running time and space requirements of your algorithm.""", """Consider the problem of neatly printing a paragraph on a printer. Analyze the running time and space requirements of your algorithm.""") colors = {'DEFAULT' : "", 'BLACK' : "\033[0;30m", 'RED' : "\033[0;31m", 'GREEN' : "\033[0;32m", 'YELLOW' : "\033[0;33m", 'BLUE' : "\033[0;34m", 'MAGENTA' : "\033[0;35m", 'CYAN' : "\033[0;36m", 'WHITE' : "\033[0;37m", 'GRAY' : "\033[0;37m", 'BLACK_B' : "\033[0;1;30m", 'RED_B' : "\033[0;1;31m", 'GREEN_B' : "\033[0;1;32m", 'YELLOW_B' : "\033[0;1;33m", 'BLUE_B' : "\033[0;1;34m", 'MAGENTA_B' : "\033[0;1;35m", 'CYAN_B' : "\033[0;1;36m", 'WHITE_B' : "\033[0;1;37m", 'NOCOLOR' : "\033[0m"} # def cprint(*args, **kwargs): # for c in kwargs.keys(): # sys.stdout.write(colors[c]) # for x in kwargs[c]: # sys.stdout.write(str(x)) # sys.stdout.write(colors['NOCOLOR']) def cprint(*args, **kwargs): for p in args: sys.stdout.write(colors[p[0]]) for x in p[1:]: sys.stdout.write(str(x)) sys.stdout.write(colors['NOCOLOR']) def space_sum(p, M): ssum = 0 lineno = 0 lines = p.split('\n') for l in lines: lineno += 1 spc_cnt = M - len(l) cprint(('WHITE', str(lineno).rjust(3), ' '), ('GREEN', l)) if l is lines[-1]: print else: cprint(('YELLOW', '~'*spc_cnt, '[', str(spc_cnt).rjust(2), ']\n')) ssum += spc_cnt**3 return ssum def build_metadata(p): rec = re.compile(r'(\S*) (.*)') w = [] l = [] n = 0 done = False while not done: m = rec.match(p) if m: s,p = m.groups() else: assert re.match(r'\S*', p) s = p done = True #print '%s__' % s w.append(s) l.append(len(s)) n += 1 return w,l,n def stupid_neat(p, M): w,l,n = build_metadata(p) #cprint(BLUE=(n,) , DEFAULT=(' words: ', l)) print '-'*M width = M formatted = '' for i in range(n): width += 1 + l[i] # a space and a word if width > M: width = l[i] formatted += '\n'+w[i] else: formatted += ' '+w[i] formatted = formatted[formatted.find('\n')+1:] print formatted cprint(('RED', 'space sum: ', space_sum(formatted, M), '\n')) # M - j + i - ∑ l_k # i<=k<=j def extras(l, i, j): s = 0 for x in l[i:j+1]: s += x return M - j + i - s # / ∞ if extras[i,j]<0 (i.e., words i..j don't fit) # lc[i,j] = | 0 if j==n and extras[i,j]>=0 (last line costs 0) # \ (extras[i,j])**3 otherwise def lc(l, n, i, j): ex = extras(l, i, j) if ex < 0: return INFTY elif j == n - 1: return 0 else: return ex**3 # / 0 if j==0 # c[j] = | # \ min (c[i-1] + lc[i,j]) if j>0 # 1<=i<=j # # To understand the solution, it helps to write down the simple cases: # j:0 '' # # j:1 foo # # j:2 min <1> foo bar # <2> foo # bar # # j:3 min <1> foo bar baz # <2> foo # bar baz # <3> min <1> foo bar # baz # <2> foo # bar # baz # # j:4 min <1> foo bar baz blah # <2> foo # bar baz blah # <3> min <1> foo bar # baz blah # <2> foo # bar # baz blah # <4> min <1> foo bar baz # blah # <2> foo # bar baz # blah # <3> min <1> foo bar # baz # blah # <2> foo # bar # baz # blah # # j:5 ... # # It's necessary to study a real sample. Say we have this paragraph: # Consider the problem of neatly printing a # paragraph on a printer. The input text is a # sequence of n words of lengths l1, l2, ..., ln, # measured in characters. We want to print this # paragraph neatly on a number of lines that hold a # maximum of M characters each. Our criterion of # "neatness" is as follows. If a given line contains # words i through j, where i ≤ j, and we leave # exactly one space between words, the number of # extra space characters at the end of the line is # M-j+i-∑lk, which must be nonnegative so that the # words fit on the line. We wish to minimize the # sum, over all lines except the last, of the cubes # of the numbers of extra space characters at the # ends of lines. Give a dynamic-programming # algorithm # and we're about to append the following stuff: # to print a paragraph of n words neatly # on a printer. Analyze the running time and space # requirements of your algorithm. # # M = 50 # j = index of the first word in the yet-to-append text (which is ``to'') # # The key point is to realize that we can group the possibilities of the # reformatted text (although there are a great number of them): # group 1: # C[j-1] <- words 1..j-1 # group 2: # C[j-2] <- words 1..j-2 # algorithm <- last line # group 3: # C[j-3] <- words 1..j-3 # dynamic-programming algorithm <- last line # group 4: # C[j-4] <- words 1..j-4 # a dynamic-programming algorithm <- last line # group 5: # C[j-5] <- words 1..j-5 # Give a dynamic-programming algorithm <- last line # group 6: # C[j-6] <- words 1..j-6 # lines. Give a dynamic-programming algorithm <- last line # group 7: # C[j-7] <- words 1..j-7 # of lines. Give a dynamic-programming algorithm <- last line # # There's no C[j-8], because if we put one more word, the line will exceed # the limit 50: "ends of lines. Give a dynamic-programming algorithm" # # Then a new word ``to'' is appended: # case 1: # C[j-1] <- words 1..j-1 # to <- last line # case 2: # C[j-2] <- words 1..j-2 # algorithm to <- last line # case 3: # C[j-3] <- words 1..j-3 # dynamic-programming algorithm to <- last line # case 4: # C[j-4] <- words 1..j-4 # a dynamic-programming algorithm to <- last line # case 5: # C[j-5] <- words 1..j-5 # Give a dynamic-programming algorithm to <- last line # case 6: # C[j-6] <- words 1..j-6 # lines. Give a dynamic-programming algorithm to <- last line # case 7: # C[j-7] <- words 1..j-7 # of lines. Give a dynamic-programming algorithm to <- last line # # These are the only cases we need to consider. # # Let's denote the cost of C[j] as c[j], then: # / c[j-1] + lc[j, j] # | c[j-2] + lc[j-1,j] # | c[j-3] + lc[j-2,j] # c[j] = min | c[j-4] + lc[j-3,j] # | c[j-5] + lc[j-4,j] # | c[j-6] + lc[j-5,j] # \ c[j-7] + lc[j-6,j] # # We don't care what c[j-1],...,c[j-7] are. They have been calculated # and, of course, stored into some table. # # We need not bother worrying about c[j-1],...,c[j-7] because they must # be optimal, or, in other words, we must have chosen the optimal one # from the numerous possibilities in group X (where 1<=X<=7). # # In the Instructor's Manual, c[j] is defined as # / 0 if j==0 # c[j] = | # \ min (c[i-1] + lc[i,j]) if j>0 # 1<=i<=j # this is smart, since lc[0],...,lc[j-7] are all ∞, according to the # definition of lc[i,j]. # def neat(p, M): w,l,n = build_metadata(p) # print w, l, n, M j = 0 c = [] d = [] for j in range(n+1): if j == 0: c.append(0) d.append(0) else: min_c = INFTY # Attention: c[0] is reserved, so we cannot use c[0] as the cost of # words[0] any more! Instead, cost(words[0]) is stored # in c[1], ..., cost(words[j]) is stored in c[j+1]. # Generally speaking, words[0..n-1] => c[1..n] # Therefore, always remember c[j] is the cost of words[j-1]: # c[j] = min (c[i-1] + lc[i-1,j-1]) # 1<=i<=j for i in range(j,0,-1): x = c[i-1] + lc(l, n, i-1, j-1) if x == INFTY: break if x < min_c: min_c = x if len(d) == j + 1: d[j] = i-1 else: assert(len(d) == j) d.append(i-1) c.append(min_c) cprint(('GRAY', j), ('YELLOW_B', c[j]), ('GREEN', p.split(' ')[j-1], ' ')) print d def print_neat(i): if i == 0: return '' elif i == -1: return print_neat(d[i]) + ' '.join(w[d[i]:]) else: return print_neat(d[i]) + ' '.join(w[d[i]:i]) + '\n' s = print_neat(-1) cprint(('GREEN', 'space sum: ', space_sum(s, M), '\n')) if __name__ == '__main__': M = 50 test_case = 1 print '-'*M, '\n' print paragraph[test_case] print stupid_neat(paragraph[test_case], M) cprint(('YELLOW', 'space sum: ', space_sum(p_control[test_case], M), '\n')) neat(paragraph[test_case], M) print
Python
#!/usr/bin/python # $Id: rst2html.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ A minimal front end to the Docutils Publisher, producing HTML. Hacked by Forrest Y. Yu <forrest.yu@gmail.com> @ Jun.2011 One more directive ``colorcode`` is added:: .. colorcode:: c int main() { printf("Hello world!\n"); return 0; } """ import sys print >> sys.stderr, '\033[32m' + 'hacked' + '\033[0;36m' + ' rst2html' + '\033[0m' ###################################################################### # Pygments support ###################################################################### # REF: http://docutils.sourceforge.net/docs/howto/rst-directives.html # Set to True if you want inline CSS styles instead of classes INLINESTYLES = True from pygments.formatters import HtmlFormatter # Add name -> formatter pairs for every variant you want to use # http://pygments.org/docs/formatters/ VARIANTS = { #'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos='inline', nobackground=True), } from docutils import nodes from docutils.parsers.rst import directives, Directive from pygments import highlight from pygments.lexers import get_lexer_by_name, TextLexer class Pygments(Directive): """ Source code syntax hightlighting. """ required_arguments = 1 optional_arguments = 0 final_argument_whitespace = True option_spec = {'linenos' : directives.flag, 'lineanchors' : lambda x: 'code-%s' % x #'lineanchors' : directives.unchanged_required, # see /usr/share/pyshared/docutils/parsers/rst/directives/__init__.py } has_content = True def run(self): self.assert_has_content() try: lexer = get_lexer_by_name(self.arguments[0]) except ValueError: # no lexer found - use the text one instead of an exception lexer = TextLexer() if self.options: if self.options.has_key('linenos'): if self.options.has_key('lineanchors'): formatter = HtmlFormatter(noclasses=INLINESTYLES, linenos='table', nobackground=True, anchorlinenos=True, lineanchors=self.options['lineanchors']) else: formatter = HtmlFormatter(noclasses=INLINESTYLES, linenos='table', nobackground=True) else: formatter = VARIANTS[self.options.keys()[0]] else: formatter = HtmlFormatter(noclasses=INLINESTYLES, nobackground=True) parsed = highlight(u'\n'.join(self.content), lexer, formatter) return [nodes.raw('', parsed, format='html')] directives.register_directive('colorcode', Pygments) ###################################################################### # original rst2html: ###################################################################### try: import locale locale.setlocale(locale.LC_ALL, '') except: pass from docutils.core import publish_cmdline, default_description description = ('Generates (X)HTML documents from standalone reStructuredText ' 'sources. ' + default_description) publish_cmdline(writer_name='html', description=description)
Python
#!/usr/bin/python # -*- coding: utf-8 -*- # Batch rename flac filenames. New filenames are based on CUE info. # author: Forrest Y. Yu <forrest.yu@gmail.com>, http://forrestyu.net/ import sys import os import subprocess import re def print_usage_and_exit(): print "Usage: "+sys.argv[0]+" cue_file flac_filename_prefix [-r]" sys.exit(10) def massage(filename): return re.sub(os.sep, ",", filename.strip()) if __name__ == '__main__': argc = len(sys.argv) - 1 if argc == 2: direction = 0 elif argc == 3: if sys.argv[3] == "-r": direction = 1 else: print_usage_and_exit() else: print_usage_and_exit() cuefile = sys.argv[1] prefix = sys.argv[2] cuetype = subprocess.Popen(["file", cuefile], stdout=subprocess.PIPE).communicate()[0].strip(" \n") # re_str = cuefile+": UTF-8 Unicode text.*" # doesn't work when cuefile contains `[' and `]', like this: 陈升.-.[鸦片玫瑰].专辑.(APE).cue re_str = ".*: UTF-8 Unicode text.*" m = re.match(re_str, cuetype) if not m: print "Please recode the CUE file to UTF8 first. Current character set:" print cuetype sys.exit(20) cuef = open(cuefile) current = "00" album = {} for line in cuef: m = re.match(r"\s*TRACK\s*([0-9]+)\s*AUDIO\s*", line) if m: current = m.group(1) m = re.match(r'\s*TITLE\s*"(.*)"\s*', line) if m: album[current] = m.group(1) root = "." if direction == 0: for item in os.listdir(root): if os.path.isfile(os.path.join(root, item)): re_str = prefix+"([0-9]+).flac" m = re.match(re_str, item) if m: n = m.group(1) print n+" <"+album[n]+">" newfile = n+" - "+massage(album[n])+".flac" print item, "->", newfile os.rename(item, newfile) elif direction == 1: for item in os.listdir(root): if os.path.isfile(os.path.join(root, item)): re_str = "([0-9]+) - (.*).flac" m = re.match(re_str, item) if m: n = m.group(1) if massage(album[n]) == m.group(2): newfile = prefix+n+".flac" print item, "->", newfile os.rename(item, newfile) else: print item, "and", cuefile, "do not match." else: assert 0 sys.exit(0)
Python
""" ReStructuredText Hack ===================== :author: Forrest Y. Yu <forrest.yu@gmail.com>, http://forrestyu.net/ directive ``colorcode`` ----------------------- .. colorcode:: c int main() { printf("Hello world!\n"); return 0; } role ``mil`` ------------ (``mil`` stands for math-inline) foo :mil:`W \approx \sum{f(x_k) \Delta x}` bar directive ``math`` ------------------ .. math:: \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\ldots} } } } .. math:: :number: 3 :label: fibo F_{n}=\begin{cases} 0 & n=0\\ 1 & n=1\\ F_{n-1}+F_{n-2} & n>1 \end{cases} Equation :eq:`fibo` is good. """ import re from docutils import nodes, utils from docutils.parsers.rst import directives, Directive, roles from docutils.core import publish_doctree, publish_from_doctree, Publisher from docutils.io import FileInput from docutils.writers.html4css1 import HTMLTranslator as translator from pygments.formatters import HtmlFormatter from pygments import highlight from pygments.lexers import get_lexer_by_name, TextLexer class_name = 'mathjaxlatex' # appears in <span class="mathjaxlatex"> and <div class="mathjaxlatex"> ###################################################################### # directive colorcode ###################################################################### # REF: http://docutils.sourceforge.net/docs/howto/rst-directives.html # Set to True if you want inline CSS styles instead of classes INLINESTYLES = True # Add name -> formatter pairs for every variant you want to use # http://pygments.org/docs/formatters/ VARIANTS = { #'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos='inline', nobackground=True), } class Pygments(Directive): """ Source code syntax hightlighting. """ required_arguments = 1 optional_arguments = 0 final_argument_whitespace = True option_spec = {'linenos' : directives.flag, 'lineanchors' : lambda x: 'code-%s' % x #'lineanchors' : directives.unchanged_required, # see /usr/share/pyshared/docutils/parsers/rst/directives/__init__.py } has_content = True def run(self): self.assert_has_content() try: lexer = get_lexer_by_name(self.arguments[0]) except ValueError: # no lexer found - use the text one instead of an exception lexer = TextLexer() if self.options: if self.options.has_key('linenos'): if self.options.has_key('lineanchors'): formatter = HtmlFormatter(noclasses=INLINESTYLES, linenos='table', nobackground=True, anchorlinenos=True, lineanchors=self.options['lineanchors']) else: formatter = HtmlFormatter(noclasses=INLINESTYLES, linenos='table', nobackground=True) else: formatter = VARIANTS[self.options.keys()[0]] else: formatter = HtmlFormatter(noclasses=INLINESTYLES, nobackground=True) parsed = highlight(u'\n'.join(self.content), lexer, formatter) return [nodes.raw('', parsed, format='html')] directives.register_directive('colorcode', Pygments) ###################################################################### # role mil ###################################################################### def MRole(role, rawtext, text, lineno, inliner, options={}, content=[]): assert role == 'mil' t = re.sub(':%s:' % role, '', rawtext) assert t[:1] == '`' and t[-1:] == '`' t = r'\(%s\)' % t[1:-1] # options are hard-coded, since there's nowhere to place them: options={'format': 'html', 'classes': [class_name]} node = nodes.raw(rawtext, t, **options) # this works too: # node = nodes.inline(rawtext, t, **options) return [node], [] roles.register_canonical_role('mil', MRole) ###################################################################### # role eq ###################################################################### # see: /usr/share/pyshared/sphinx/ext/mathbase.py class eqref(nodes.Inline, nodes.TextElement): pass def html_visit_eqref(self, node): self.body.append('<a href="#equation-%s">' % node['target']) def html_depart_eqref(self, node): self.body.append('</a>') def eq_role(role, rawtext, text, lineno, inliner, options={}, content=[]): text = utils.unescape(text) node = eqref('(?)', '(?)', target=text) return [node], [] roles.register_canonical_role('eq', eq_role) ###################################################################### # directive math ###################################################################### # see: # /usr/share/pyshared/sphinx/application.py # /usr/share/pyshared/sphinx/ext/mathbase.py # /usr/share/pyshared/sphinx/ext/jsmath.py # /usr/share/doc/python-sphinx/html/ext/math.html def massage_equations(doctree): num = 0 numbers = {} # generate the "label->number" map from directive ``math`` for node in doctree.traverse(displaymath): if node['number'] is None: continue numbers[node['label']] = node['number'] #print >> sys.stderr, 'label->number map: ', numbers # set eqno in references for node in doctree.traverse(eqref): if node['target'] not in numbers: continue num = '(%d)' % numbers[node['target']] node[0] = nodes.Text(num, num) def html_visit_displaymath(self, node): if node['nowrap']: self.body.append(self.starttag(node, 'div', CLASS=class_name)) self.body.append(node['latex']) self.body.append('</div>') raise nodes.SkipNode for i, part in enumerate(node['latex'].split('\n\n')): part = self.encode(part) if i == 0: # necessary to e.g. set the id property correctly if node['number'] is not None: self.body.append('<span class="eqno">(%s)</span>' % node['number']) self.body.append(self.starttag(node, 'div', CLASS=class_name)) else: # but only once! self.body.append('<div class="%s">' % class_name) if '&' in part or '\\\\' in part: self.body.append('\\[\\begin{align}\n' + part + '\n\\end{align}\\]') else: self.body.append('\\[' + part + '\\]') self.body.append('</div>\n') raise nodes.SkipNode def add_node(node, **kwds): nodes._add_node_class_names([node.__name__]) for key, val in kwds.iteritems(): try: visit, depart = val except ValueError: raise ExtensionError('Value for key %r must be a ' '(visit, depart) function tuple' % key) assert key == 'html', 'accept html only' setattr(translator, 'visit_'+node.__name__, visit) if depart: setattr(translator, 'depart_'+node.__name__, depart) class displaymath(nodes.Part, nodes.Element): pass # custom directive ``math`` class MathDisplay(Directive): has_content = True required_arguments = 0 optional_arguments = 1 final_argument_whitespace = True option_spec = { 'label': directives.unchanged, 'nowrap': directives.flag, 'number': directives.nonnegative_int, } def run(self): latex = '\n'.join(self.content) if self.arguments and self.arguments[0]: latex = self.arguments[0] + '\n\n' + latex node = displaymath() node['latex'] = latex node['number'] = self.options.get('number', None) node['label'] = self.options.get('label', node['number']) node['nowrap'] = 'nowrap' in self.options #print >> sys.stderr, 'number: ', node['number'], 'label: ', node['label'] ret = [node] if node['label']: tnode = nodes.target('', '', ids=['equation-' + node['label']]) self.state.document.note_explicit_target(tnode) ret.insert(0, tnode) return ret add_node(eqref, html=(html_visit_eqref, html_depart_eqref)) add_node(displaymath, html=(html_visit_displaymath, None)) directives.register_directive('math', MathDisplay)
Python
# # -*- coding: UTF-8 -*- from google.appengine.tools import bulkloader from google.appengine.ext import db #from fortune import Fortunes from datetime import datetime fmt="%Y-%m-%d %H:%M:%S" class Fortunes(db.Model): fortune = db.StringProperty(multiline=True) author = db.StringProperty() categories = db.ListProperty(db.Category) rating = db.RatingProperty() lastshown = db.DateTimeProperty(auto_now_add=True) count = db.IntegerProperty() def decatlist(input): ll=list() for l in input: ll.append('%s' % l.encode('utf8')) return "[u'%s']" % ("',u'".join(ll)) class FortuneExporter(bulkloader.Exporter): def __init__(self): bulkloader.Exporter.__init__(self,'Fortunes',[ ('fortune',lambda x: x.encode('utf8'),None), ('author',lambda x: x.encode('utf8'),None), ('categories',decatlist,None), ('rating',lambda x: x==None and '0' or x ,None), ('lastshown',lambda x: x.strftime(fmt),None), ('count',lambda x: x==None and '0' or x ,None) ]) exporters = [FortuneExporter] def catlist(input): input = input.decode('utf8') l = list() for c in eval(input): l.append(db.Category(c)) return l def loaddatetime(input): try: return datetime.fromtimestamp(float(input)) except ValueError: return datetime.strptime(input,fmt) class FortuneLoader(bulkloader.Loader): def __init__(self): bulkloader.Loader.__init__(self,'Fortunes',[ ('fortune',lambda x: x.decode('utf8')[:500]), ('author',lambda x: x.decode('utf8')[:500]), ('categories',catlist), ('rating',db.Rating), ('lastshown',loaddatetime), ('count',int) ]) loaders = [FortuneLoader]
Python
#!/usr/bin/env python # -*- coding: UTF-8 -*- # from google.appengine.ext import webapp from google.appengine.api import users from google.appengine.ext.webapp import util from google.appengine.ext import db from google.appengine.api import memcache import os.path from fortune import Fortunes import random import logging class FortuneHandler(webapp.RequestHandler): def get(self): r = "" f = "" ff = "" pp = self.request.path p = os.path.basename(pp) while p == '': pp = pp[:-1] p = os.path.basename(pp) #q = Fortunes.all() o = random.randint(0,9) l = 1 if p != 'fortune': q = db.GqlQuery("SELECT * FROM Fortunes WHERE categories = :1 ORDER BY lastshown ASC LIMIT %i OFFSET %i " % (l,o), p) else: q = db.GqlQuery("SELECT *FROM Fortunes ORDER BY lastshown ASC LIMIT %i OFFSET %i" % (l,o) ) #ffs = q.fetch(1000) #c = q.cursor() #ff += "<div>%r</div>" % c #q.with_cursor(c) #for ffs in Fortunes.all().filter('categories = ', os.path.basename(self.request.path)): #for ffs in q.with_cursor(c).fetch(1,1000): for ffs in q: ffs.count+=1 ffs.lastshown=ffs.lastshown.now() ffs.put() #ff += "<div>%s</div>" % (memcache.get('123')) ff += """%s""" % (ffs.fortune.encode('utf8')) #ff = "%s" % (Fortunes.all().fetch(10)) #q = db.GqlQuery("SELECT * From Fortunes") #for ffff in q: # ff += "%s" % ffff.rating r += """<html> <head> <title>just fortunes</title> <!-- <link rel="stylesheet" type="text/css" href="mystyles.css"> --> <style type="text/css"> body { font-family: helvetica; width: 600px; padding-left: 120px;} .fortune {} </style> </head> <body> <div class="fortune"> %s </div> </body> </html>""" % (ff) self.response.out.write(r) class MainHandler(webapp.RequestHandler): def get(self): r=""" """ self.response.out.write(r) class UserPrefs(db.Model): user = db.UserProperty() class AdminHandler(webapp.RequestHandler): def get(self): user = users.get_current_user() r = "" if user: q = db.GqlQuery("SELECT * FROM UserPrefs WHERE user = :1", user) userprefs = q.get() self.response.headers.add_header('Content-type','text/plain') #for f in Fortunes.all(): #for f in db.Query(Fortunes): # r+="dleting: %s\n" % (f.fortune) # #f.delete() self.response.out.write( r ) def main(): application = webapp.WSGIApplication([ ('/', MainHandler), ('/admin', AdminHandler), ('/fortune',FortuneHandler), ('/fortune/.*',FortuneHandler) ], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main()
Python
#!/usr/bin/env python # -*- coding: UTF-8 -*- from google.appengine.ext import db from datetime import datetime class Fortunes(db.Model): fortune = db.StringProperty(multiline=True) author = db.StringProperty() categories = db.ListProperty(db.Category) rating = db.RatingProperty() lastshown = db.DateTimeProperty(auto_now_add=True) count = db.IntegerProperty()
Python
#!/usr/bin/env python # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import time import webapp2 import jwt from google.appengine.ext.webapp import template import os from sellerinfo import SELLER_ID from sellerinfo import SELLER_SECRET class MainPage(webapp2.RequestHandler): def get(self): self.redirect('/iframer') class AjaxJWT(webapp2.RequestHandler): def get(self): now = int(time.time()) now_plus_one = now + 3600 self.request.get('subscribe', default_value='no') name = self.request.get('name', default_value='Awesome Item') desc = self.request.get('desc', default_value='Awesome Item is the coolest thing you can buy') price = self.request.get('price', default_value='1.00') jwt_token = jwt.encode( { 'iss' : SELLER_ID, 'aud' : 'Google', 'typ' : 'google/payments/inapp/item/v1', 'iat' : now, 'exp' : now_plus_one, 'request' : { 'name' : name, 'description' : desc, 'price' : price, 'currencyCode' : 'USD', 'sellerData' : 'fromDigitalGoodsHangoutApp' } }, SELLER_SECRET) self.response.headers['Content-Type'] = 'application/json' self.response.headers['Access-Control-Allow-Origin'] = '*' self.response.out.write(jwt_token) class WebappJWT(webapp2.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/html' path = os.path.join(os.path.dirname(__file__), 'hangoutapp.html') self.response.out.write( template.render(path, [])); app = webapp2.WSGIApplication([('/', MainPage), ('/ajax', AjaxJWT), ('/iframer', WebappJWT)], debug=True)
Python
""" JSON Web Token implementation Minimum implementation based on this spec: http://self-issued.info/docs/draft-jones-json-web-token-01.html """ import base64 import hashlib import hmac try: import json except ImportError: import simplejson as json __all__ = ['encode', 'decode', 'DecodeError'] class DecodeError(Exception): pass signing_methods = { 'HS256': lambda msg, key: hmac.new(key, msg, hashlib.sha256).digest(), 'HS384': lambda msg, key: hmac.new(key, msg, hashlib.sha384).digest(), 'HS512': lambda msg, key: hmac.new(key, msg, hashlib.sha512).digest(), } def base64url_decode(input): input += '=' * (4 - (len(input) % 4)) return base64.urlsafe_b64decode(input) def base64url_encode(input): return base64.urlsafe_b64encode(input).replace('=', '') def header(jwt): header_segment = jwt.split('.', 1)[0] try: return json.loads(base64url_decode(header_segment)) except (ValueError, TypeError): raise DecodeError("Invalid header encoding") def encode(payload, key, algorithm='HS256'): segments = [] header = {"typ": "JWT", "alg": algorithm} segments.append(base64url_encode(json.dumps(header))) segments.append(base64url_encode(json.dumps(payload))) signing_input = '.'.join(segments) try: if isinstance(key, unicode): key = key.encode('utf-8') signature = signing_methods[algorithm](signing_input, key) except KeyError: raise NotImplementedError("Algorithm not supported") segments.append(base64url_encode(signature)) return '.'.join(segments) def decode(jwt, key='', verify=True): try: signing_input, crypto_segment = jwt.rsplit('.', 1) header_segment, payload_segment = signing_input.split('.', 1) except ValueError: raise DecodeError("Not enough segments") try: header = json.loads(base64url_decode(header_segment)) payload = json.loads(base64url_decode(payload_segment)) signature = base64url_decode(crypto_segment) except (ValueError, TypeError): raise DecodeError("Invalid segment encoding") if verify: try: if isinstance(key, unicode): key = key.encode('utf-8') if not signature == signing_methods[header['alg']](signing_input, key): raise DecodeError("Signature verification failed") except KeyError: raise DecodeError("Algorithm not supported") return payload
Python
SELLER_ID = "BOGUS_SELLER_ID" SELLER_SECRET = "BOGUS_SELLER_SECRET"
Python
#!/usr/bin/env python # -*- encoding:utf8 -*- # protoc-gen-erl # Google's Protocol Buffers project, ported to lua. # https://code.google.com/p/protoc-gen-lua/ # # Copyright (c) 2010 , 林卓毅 (Zhuoyi Lin) netsnail@gmail.com # All rights reserved. # # Use, modification and distribution are subject to the "New BSD License" # as listed at <url: http://www.opensource.org/licenses/bsd-license.php >. import sys import os.path as path from cStringIO import StringIO import plugin_pb2 import google.protobuf.descriptor_pb2 as descriptor_pb2 _packages = {} _files = {} _message = {} FDP = plugin_pb2.descriptor_pb2.FieldDescriptorProto if sys.platform == "win32": import msvcrt, os msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) class CppType: CPPTYPE_INT32 = 1 CPPTYPE_INT64 = 2 CPPTYPE_UINT32 = 3 CPPTYPE_UINT64 = 4 CPPTYPE_DOUBLE = 5 CPPTYPE_FLOAT = 6 CPPTYPE_BOOL = 7 CPPTYPE_ENUM = 8 CPPTYPE_STRING = 9 CPPTYPE_MESSAGE = 10 CPP_TYPE ={ FDP.TYPE_DOUBLE : CppType.CPPTYPE_DOUBLE, FDP.TYPE_FLOAT : CppType.CPPTYPE_FLOAT, FDP.TYPE_INT64 : CppType.CPPTYPE_INT64, FDP.TYPE_UINT64 : CppType.CPPTYPE_UINT64, FDP.TYPE_INT32 : CppType.CPPTYPE_INT32, FDP.TYPE_FIXED64 : CppType.CPPTYPE_UINT64, FDP.TYPE_FIXED32 : CppType.CPPTYPE_UINT32, FDP.TYPE_BOOL : CppType.CPPTYPE_BOOL, FDP.TYPE_STRING : CppType.CPPTYPE_STRING, FDP.TYPE_MESSAGE : CppType.CPPTYPE_MESSAGE, FDP.TYPE_BYTES : CppType.CPPTYPE_STRING, FDP.TYPE_UINT32 : CppType.CPPTYPE_UINT32, FDP.TYPE_ENUM : CppType.CPPTYPE_ENUM, FDP.TYPE_SFIXED32 : CppType.CPPTYPE_INT32, FDP.TYPE_SFIXED64 : CppType.CPPTYPE_INT64, FDP.TYPE_SINT32 : CppType.CPPTYPE_INT32, FDP.TYPE_SINT64 : CppType.CPPTYPE_INT64 } def printerr(*args): sys.stderr.write(" ".join(args)) sys.stderr.write("\n") sys.stderr.flush() class TreeNode(object): def __init__(self, name, parent=None, filename=None, package=None): super(TreeNode, self).__init__() self.child = [] self.parent = parent self.filename = filename self.package = package if parent: self.parent.add_child(self) self.name = name def add_child(self, child): self.child.append(child) def find_child(self, child_names): if child_names: for i in self.child: if i.name == child_names[0]: return i.find_child(child_names[1:]) raise StandardError else: return self def get_child(self, child_name): for i in self.child: if i.name == child_name: return i return None def get_path(self, end = None): pos = self out = [] while pos and pos != end: out.append(pos.name) pos = pos.parent out.reverse() return '.'.join(out) def get_global_name(self): return self.get_path() def get_local_name(self): pos = self while pos.parent: pos = pos.parent if self.package and pos.name == self.package[-1]: break return self.get_path(pos) def __str__(self): return self.to_string(0) def __repr__(self): return str(self) def to_string(self, indent = 0): return ' '*indent + '<TreeNode ' + self.name + '(\n' + \ ','.join([i.to_string(indent + 4) for i in self.child]) + \ ' '*indent +')>\n' class Env(object): filename = None package = None extend = None descriptor = None message = None context = None register = None def __init__(self): self.message_tree = TreeNode('') self.scope = self.message_tree def get_global_name(self): return self.scope.get_global_name() def get_local_name(self): return self.scope.get_local_name() def get_ref_name(self, type_name): try: node = self.lookup_name(type_name) except: # if the child doesn't be founded, it must be in this file return type_name[len('.'.join(self.package)) + 2:] if node.filename != self.filename: return node.filename + '_pb.' + node.get_local_name() return node.get_local_name() def lookup_name(self, name): names = name.split('.') if names[0] == '': return self.message_tree.find_child(names[1:]) else: return self.scope.parent.find_child(names) def enter_package(self, package): if not package: return self.message_tree names = package.split('.') pos = self.message_tree for i, name in enumerate(names): new_pos = pos.get_child(name) if new_pos: pos = new_pos else: return self._build_nodes(pos, names[i:]) return pos def enter_file(self, filename, package): self.filename = filename self.package = package.split('.') self._init_field() self.scope = self.enter_package(package) def exit_file(self): self._init_field() self.filename = None self.package = [] self.scope = self.scope.parent def enter(self, message_name): self.scope = TreeNode(message_name, self.scope, self.filename, self.package) def exit(self): self.scope = self.scope.parent def _init_field(self): self.descriptor = [] self.context = [] self.message = [] self.register = [] def _build_nodes(self, node, names): parent = node for i in names: parent = TreeNode(i, parent, self.filename, self.package) return parent class Writer(object): def __init__(self, prefix=None): self.io = StringIO() self.__indent = '' self.__prefix = prefix def getvalue(self): return self.io.getvalue() def __enter__(self): self.__indent += ' ' return self def __exit__(self, type, value, trackback): self.__indent = self.__indent[:-4] def __call__(self, data): self.io.write(self.__indent) if self.__prefix: self.io.write(self.__prefix) self.io.write(data) DEFAULT_VALUE = { FDP.TYPE_DOUBLE : '0.0', FDP.TYPE_FLOAT : '0.0', FDP.TYPE_INT64 : '0', FDP.TYPE_UINT64 : '0', FDP.TYPE_INT32 : '0', FDP.TYPE_FIXED64 : '0', FDP.TYPE_FIXED32 : '0', FDP.TYPE_BOOL : 'false', FDP.TYPE_STRING : '""', FDP.TYPE_MESSAGE : 'nil', FDP.TYPE_BYTES : '""', FDP.TYPE_UINT32 : '0', FDP.TYPE_ENUM : '1', FDP.TYPE_SFIXED32 : '0', FDP.TYPE_SFIXED64 : '0', FDP.TYPE_SINT32 : '0', FDP.TYPE_SINT64 : '0', } def code_gen_enum_item(index, enum_value, env): full_name = env.get_local_name() + '.' + enum_value.name obj_name = full_name.upper().replace('.', '_') + '_ENUM' env.descriptor.append( "local %s = protobuf.EnumValueDescriptor();\n"% obj_name ) context = Writer(obj_name) context('.name = "%s"\n' % enum_value.name) context('.index = %d\n' % index) context('.number = %d\n' % enum_value.number) env.context.append(context.getvalue()) return obj_name def code_gen_enum(enum_desc, env): env.enter(enum_desc.name) full_name = env.get_local_name() obj_name = full_name.upper().replace('.', '_') env.descriptor.append( "local %s = protobuf.EnumDescriptor();\n"% obj_name ) context = Writer(obj_name) context('.name = "%s"\n' % enum_desc.name) context('.full_name = "%s"\n' % env.get_global_name()) values = [] for i, enum_value in enumerate(enum_desc.value): values.append(code_gen_enum_item(i, enum_value, env)) context('.values = {%s}\n' % ','.join(values)) env.context.append(context.getvalue()) env.exit() return obj_name def code_gen_field(index, field_desc, env): full_name = env.get_local_name() + '.' + field_desc.name obj_name = full_name.upper().replace('.', '_') + '_FIELD' env.descriptor.append( "local %s = protobuf.FieldDescriptor();\n"% obj_name ) context = Writer(obj_name) context('.name = "%s"\n' % field_desc.name) context('.full_name = "%s"\n' % ( env.get_global_name() + '.' + field_desc.name)) context('.number = %d\n' % field_desc.number) context('.index = %d\n' % index) context('.label = %d\n' % field_desc.label) if field_desc.HasField("default_value"): context('.has_default_value = true\n') value = field_desc.default_value if field_desc.type == FDP.TYPE_STRING: context('.default_value = "%s"\n'%value) else: context('.default_value = %s\n'%value) else: context('.has_default_value = false\n') if field_desc.label == FDP.LABEL_REPEATED: default_value = "{}" elif field_desc.HasField('type_name'): default_value = "nil" else: default_value = DEFAULT_VALUE[field_desc.type] context('.default_value = %s\n' % default_value) if field_desc.HasField('type_name'): type_name = env.get_ref_name(field_desc.type_name).upper().replace('.', '_') if field_desc.type == FDP.TYPE_MESSAGE: context('.message_type = %s\n' % type_name) else: context('.enum_type = %s\n' % type_name) if field_desc.HasField('extendee'): type_name = env.get_ref_name(field_desc.extendee) env.register.append( "%s.RegisterExtension(%s)\n" % (type_name, obj_name) ) context('.type = %d\n' % field_desc.type) context('.cpp_type = %d\n\n' % CPP_TYPE[field_desc.type]) env.context.append(context.getvalue()) return obj_name def code_gen_message(message_descriptor, env, containing_type = None): env.enter(message_descriptor.name) full_name = env.get_local_name() obj_name = full_name.upper().replace('.', '_') env.descriptor.append( "local %s = protobuf.Descriptor();\n"% obj_name ) context = Writer(obj_name) context('.name = "%s"\n' % message_descriptor.name) context('.full_name = "%s"\n' % env.get_global_name()) nested_types = [] for msg_desc in message_descriptor.nested_type: msg_name = code_gen_message(msg_desc, env, obj_name) nested_types.append(msg_name) context('.nested_types = {%s}\n' % ', '.join(nested_types)) enums = [] for enum_desc in message_descriptor.enum_type: enums.append(code_gen_enum(enum_desc, env)) context('.enum_types = {%s}\n' % ', '.join(enums)) fields = [] for i, field_desc in enumerate(message_descriptor.field): fields.append(code_gen_field(i, field_desc, env)) context('.fields = {%s}\n' % ', '.join(fields)) if len(message_descriptor.extension_range) > 0: context('.is_extendable = true\n') else: context('.is_extendable = false\n') extensions = [] for i, field_desc in enumerate(message_descriptor.extension): extensions.append(code_gen_field(i, field_desc, env)) context('.extensions = {%s}\n' % ', '.join(extensions)) if containing_type: context('.containing_type = %s\n' % containing_type) env.message.append('%s = protobuf.Message(%s)\n' % (full_name, obj_name)) env.context.append(context.getvalue()) env.exit() return obj_name def write_header(writer): writer("""-- Generated By protoc-gen-lua Do not Edit """) def code_gen_file(proto_file, env, is_gen): filename = path.splitext(proto_file.name)[0] env.enter_file(filename, proto_file.package) includes = [] for f in proto_file.dependency: inc_file = path.splitext(f)[0] includes.append(inc_file) # for field_desc in proto_file.extension: # code_gen_extensions(field_desc, field_desc.name, env) for enum_desc in proto_file.enum_type: code_gen_enum(enum_desc, env) for enum_value in enum_desc.value: env.message.append('%s = %d\n' % (enum_value.name, enum_value.number)) for msg_desc in proto_file.message_type: code_gen_message(msg_desc, env) if is_gen: lua = Writer() write_header(lua) lua('local protobuf = require "protobuf"\n') for i in includes: lua('local %s_pb = require("%s_pb")\n' % (i, i)) lua("module('%s_pb')\n" % env.filename) lua('\n\n') map(lua, env.descriptor) lua('\n') map(lua, env.context) lua('\n') env.message.sort() map(lua, env.message) lua('\n') map(lua, env.register) _files[env.filename+ '_pb.lua'] = lua.getvalue() env.exit_file() def main(): plugin_require_bin = sys.stdin.read() code_gen_req = plugin_pb2.CodeGeneratorRequest() code_gen_req.ParseFromString(plugin_require_bin) env = Env() for proto_file in code_gen_req.proto_file: code_gen_file(proto_file, env, proto_file.name in code_gen_req.file_to_generate) code_generated = plugin_pb2.CodeGeneratorResponse() for k in _files: file_desc = code_generated.file.add() file_desc.name = k file_desc.content = _files[k] sys.stdout.write(code_generated.SerializeToString()) if __name__ == "__main__": main()
Python
#!/usr/bin/env python # -*- encoding:utf8 -*- # protoc-gen-erl # Google's Protocol Buffers project, ported to lua. # https://code.google.com/p/protoc-gen-lua/ # # Copyright (c) 2010 , 林卓毅 (Zhuoyi Lin) netsnail@gmail.com # All rights reserved. # # Use, modification and distribution are subject to the "New BSD License" # as listed at <url: http://www.opensource.org/licenses/bsd-license.php >. import sys import os.path as path from cStringIO import StringIO import plugin_pb2 import google.protobuf.descriptor_pb2 as descriptor_pb2 _packages = {} _files = {} _message = {} FDP = plugin_pb2.descriptor_pb2.FieldDescriptorProto if sys.platform == "win32": import msvcrt, os msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) class CppType: CPPTYPE_INT32 = 1 CPPTYPE_INT64 = 2 CPPTYPE_UINT32 = 3 CPPTYPE_UINT64 = 4 CPPTYPE_DOUBLE = 5 CPPTYPE_FLOAT = 6 CPPTYPE_BOOL = 7 CPPTYPE_ENUM = 8 CPPTYPE_STRING = 9 CPPTYPE_MESSAGE = 10 CPP_TYPE ={ FDP.TYPE_DOUBLE : CppType.CPPTYPE_DOUBLE, FDP.TYPE_FLOAT : CppType.CPPTYPE_FLOAT, FDP.TYPE_INT64 : CppType.CPPTYPE_INT64, FDP.TYPE_UINT64 : CppType.CPPTYPE_UINT64, FDP.TYPE_INT32 : CppType.CPPTYPE_INT32, FDP.TYPE_FIXED64 : CppType.CPPTYPE_UINT64, FDP.TYPE_FIXED32 : CppType.CPPTYPE_UINT32, FDP.TYPE_BOOL : CppType.CPPTYPE_BOOL, FDP.TYPE_STRING : CppType.CPPTYPE_STRING, FDP.TYPE_MESSAGE : CppType.CPPTYPE_MESSAGE, FDP.TYPE_BYTES : CppType.CPPTYPE_STRING, FDP.TYPE_UINT32 : CppType.CPPTYPE_UINT32, FDP.TYPE_ENUM : CppType.CPPTYPE_ENUM, FDP.TYPE_SFIXED32 : CppType.CPPTYPE_INT32, FDP.TYPE_SFIXED64 : CppType.CPPTYPE_INT64, FDP.TYPE_SINT32 : CppType.CPPTYPE_INT32, FDP.TYPE_SINT64 : CppType.CPPTYPE_INT64 } def printerr(*args): sys.stderr.write(" ".join(args)) sys.stderr.write("\n") sys.stderr.flush() class TreeNode(object): def __init__(self, name, parent=None, filename=None, package=None): super(TreeNode, self).__init__() self.child = [] self.parent = parent self.filename = filename self.package = package if parent: self.parent.add_child(self) self.name = name def add_child(self, child): self.child.append(child) def find_child(self, child_names): if child_names: for i in self.child: if i.name == child_names[0]: return i.find_child(child_names[1:]) raise StandardError else: return self def get_child(self, child_name): for i in self.child: if i.name == child_name: return i return None def get_path(self, end = None): pos = self out = [] while pos and pos != end: out.append(pos.name) pos = pos.parent out.reverse() return '.'.join(out) def get_global_name(self): return self.get_path() def get_local_name(self): pos = self while pos.parent: pos = pos.parent if self.package and pos.name == self.package[-1]: break return self.get_path(pos) def __str__(self): return self.to_string(0) def __repr__(self): return str(self) def to_string(self, indent = 0): return ' '*indent + '<TreeNode ' + self.name + '(\n' + \ ','.join([i.to_string(indent + 4) for i in self.child]) + \ ' '*indent +')>\n' class Env(object): filename = None package = None extend = None descriptor = None message = None context = None register = None def __init__(self): self.message_tree = TreeNode('') self.scope = self.message_tree def get_global_name(self): return self.scope.get_global_name() def get_local_name(self): return self.scope.get_local_name() def get_ref_name(self, type_name): try: node = self.lookup_name(type_name) except: # if the child doesn't be founded, it must be in this file return type_name[len('.'.join(self.package)) + 2:] if node.filename != self.filename: return node.filename + '_pb.' + node.get_local_name() return node.get_local_name() def lookup_name(self, name): names = name.split('.') if names[0] == '': return self.message_tree.find_child(names[1:]) else: return self.scope.parent.find_child(names) def enter_package(self, package): if not package: return self.message_tree names = package.split('.') pos = self.message_tree for i, name in enumerate(names): new_pos = pos.get_child(name) if new_pos: pos = new_pos else: return self._build_nodes(pos, names[i:]) return pos def enter_file(self, filename, package): self.filename = filename self.package = package.split('.') self._init_field() self.scope = self.enter_package(package) def exit_file(self): self._init_field() self.filename = None self.package = [] self.scope = self.scope.parent def enter(self, message_name): self.scope = TreeNode(message_name, self.scope, self.filename, self.package) def exit(self): self.scope = self.scope.parent def _init_field(self): self.descriptor = [] self.context = [] self.message = [] self.register = [] def _build_nodes(self, node, names): parent = node for i in names: parent = TreeNode(i, parent, self.filename, self.package) return parent class Writer(object): def __init__(self, prefix=None): self.io = StringIO() self.__indent = '' self.__prefix = prefix def getvalue(self): return self.io.getvalue() def __enter__(self): self.__indent += ' ' return self def __exit__(self, type, value, trackback): self.__indent = self.__indent[:-4] def __call__(self, data): self.io.write(self.__indent) if self.__prefix: self.io.write(self.__prefix) self.io.write(data) DEFAULT_VALUE = { FDP.TYPE_DOUBLE : '0.0', FDP.TYPE_FLOAT : '0.0', FDP.TYPE_INT64 : '0', FDP.TYPE_UINT64 : '0', FDP.TYPE_INT32 : '0', FDP.TYPE_FIXED64 : '0', FDP.TYPE_FIXED32 : '0', FDP.TYPE_BOOL : 'false', FDP.TYPE_STRING : '""', FDP.TYPE_MESSAGE : 'nil', FDP.TYPE_BYTES : '""', FDP.TYPE_UINT32 : '0', FDP.TYPE_ENUM : '1', FDP.TYPE_SFIXED32 : '0', FDP.TYPE_SFIXED64 : '0', FDP.TYPE_SINT32 : '0', FDP.TYPE_SINT64 : '0', } def code_gen_enum_item(index, enum_value, env): full_name = env.get_local_name() + '.' + enum_value.name obj_name = full_name.upper().replace('.', '_') + '_ENUM' env.descriptor.append( "local %s = protobuf.EnumValueDescriptor();\n"% obj_name ) context = Writer(obj_name) context('.name = "%s"\n' % enum_value.name) context('.index = %d\n' % index) context('.number = %d\n' % enum_value.number) env.context.append(context.getvalue()) return obj_name def code_gen_enum(enum_desc, env): env.enter(enum_desc.name) full_name = env.get_local_name() obj_name = full_name.upper().replace('.', '_') env.descriptor.append( "local %s = protobuf.EnumDescriptor();\n"% obj_name ) context = Writer(obj_name) context('.name = "%s"\n' % enum_desc.name) context('.full_name = "%s"\n' % env.get_global_name()) values = [] for i, enum_value in enumerate(enum_desc.value): values.append(code_gen_enum_item(i, enum_value, env)) context('.values = {%s}\n' % ','.join(values)) env.context.append(context.getvalue()) env.exit() return obj_name def code_gen_field(index, field_desc, env): full_name = env.get_local_name() + '.' + field_desc.name obj_name = full_name.upper().replace('.', '_') + '_FIELD' env.descriptor.append( "local %s = protobuf.FieldDescriptor();\n"% obj_name ) context = Writer(obj_name) context('.name = "%s"\n' % field_desc.name) context('.full_name = "%s"\n' % ( env.get_global_name() + '.' + field_desc.name)) context('.number = %d\n' % field_desc.number) context('.index = %d\n' % index) context('.label = %d\n' % field_desc.label) if field_desc.HasField("default_value"): context('.has_default_value = true\n') value = field_desc.default_value if field_desc.type == FDP.TYPE_STRING: context('.default_value = "%s"\n'%value) else: context('.default_value = %s\n'%value) else: context('.has_default_value = false\n') if field_desc.label == FDP.LABEL_REPEATED: default_value = "{}" elif field_desc.HasField('type_name'): default_value = "nil" else: default_value = DEFAULT_VALUE[field_desc.type] context('.default_value = %s\n' % default_value) if field_desc.HasField('type_name'): type_name = env.get_ref_name(field_desc.type_name).upper().replace('.', '_') if field_desc.type == FDP.TYPE_MESSAGE: context('.message_type = %s\n' % type_name) else: context('.enum_type = %s\n' % type_name) if field_desc.HasField('extendee'): type_name = env.get_ref_name(field_desc.extendee) env.register.append( "%s.RegisterExtension(%s)\n" % (type_name, obj_name) ) context('.type = %d\n' % field_desc.type) context('.cpp_type = %d\n\n' % CPP_TYPE[field_desc.type]) env.context.append(context.getvalue()) return obj_name def code_gen_message(message_descriptor, env, containing_type = None): env.enter(message_descriptor.name) full_name = env.get_local_name() obj_name = full_name.upper().replace('.', '_') env.descriptor.append( "local %s = protobuf.Descriptor();\n"% obj_name ) context = Writer(obj_name) context('.name = "%s"\n' % message_descriptor.name) context('.full_name = "%s"\n' % env.get_global_name()) nested_types = [] for msg_desc in message_descriptor.nested_type: msg_name = code_gen_message(msg_desc, env, obj_name) nested_types.append(msg_name) context('.nested_types = {%s}\n' % ', '.join(nested_types)) enums = [] for enum_desc in message_descriptor.enum_type: enums.append(code_gen_enum(enum_desc, env)) context('.enum_types = {%s}\n' % ', '.join(enums)) fields = [] for i, field_desc in enumerate(message_descriptor.field): fields.append(code_gen_field(i, field_desc, env)) context('.fields = {%s}\n' % ', '.join(fields)) if len(message_descriptor.extension_range) > 0: context('.is_extendable = true\n') else: context('.is_extendable = false\n') extensions = [] for i, field_desc in enumerate(message_descriptor.extension): extensions.append(code_gen_field(i, field_desc, env)) context('.extensions = {%s}\n' % ', '.join(extensions)) if containing_type: context('.containing_type = %s\n' % containing_type) env.message.append('%s = protobuf.Message(%s)\n' % (full_name, obj_name)) env.context.append(context.getvalue()) env.exit() return obj_name def write_header(writer): writer("""-- Generated By protoc-gen-lua Do not Edit """) def code_gen_file(proto_file, env, is_gen): filename = path.splitext(proto_file.name)[0] env.enter_file(filename, proto_file.package) includes = [] for f in proto_file.dependency: inc_file = path.splitext(f)[0] includes.append(inc_file) # for field_desc in proto_file.extension: # code_gen_extensions(field_desc, field_desc.name, env) for enum_desc in proto_file.enum_type: code_gen_enum(enum_desc, env) for enum_value in enum_desc.value: env.message.append('%s = %d\n' % (enum_value.name, enum_value.number)) for msg_desc in proto_file.message_type: code_gen_message(msg_desc, env) if is_gen: lua = Writer() write_header(lua) lua('local protobuf = require "protobuf"\n') for i in includes: lua('local %s_pb = require("%s_pb")\n' % (i, i)) lua("module('%s_pb')\n" % env.filename) lua('\n\n') map(lua, env.descriptor) lua('\n') map(lua, env.context) lua('\n') env.message.sort() map(lua, env.message) lua('\n') map(lua, env.register) _files[env.filename+ '_pb.lua'] = lua.getvalue() env.exit_file() def main(): plugin_require_bin = sys.stdin.read() code_gen_req = plugin_pb2.CodeGeneratorRequest() code_gen_req.ParseFromString(plugin_require_bin) env = Env() for proto_file in code_gen_req.proto_file: code_gen_file(proto_file, env, proto_file.name in code_gen_req.file_to_generate) code_generated = plugin_pb2.CodeGeneratorResponse() for k in _files: file_desc = code_generated.file.add() file_desc.name = k file_desc.content = _files[k] sys.stdout.write(code_generated.SerializeToString()) if __name__ == "__main__": main()
Python
##-***************************************************************************** ## ## Copyright (c) 2009-2011, ## Sony Pictures Imageworks Inc. and ## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. ## ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are ## met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above ## copyright notice, this list of conditions and the following disclaimer ## in the documentation and/or other materials provided with the ## distribution. ## * Neither the name of Sony Pictures Imageworks, nor ## Industrial Light & Magic, nor the names of their contributors may be used ## to endorse or promote products derived from this software without specific ## prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ##-***************************************************************************** #!/usr/bin/env python sprops = \ """ IBoolProperty IUcharProperty ICharProperty IUInt16Property IInt16Property IUInt32Property IInt32Property IUInt64Property IInt64Property IHalfProperty IFloatProperty IDoubleProperty IStringProperty IWstringProperty IV2sProperty IV2iProperty IV2fProperty IV2dProperty IV3sProperty IV3iProperty IV3fProperty IV3dProperty IBox2sProperty IBox2iProperty IBox2fProperty IBox2dProperty IBox3sProperty IBox3iProperty IBox3fProperty IBox3dProperty IM33fProperty IM33dProperty IM44fProperty IM44dProperty IQuatfProperty IQuatdProperty IC3hProperty IC3fProperty IC3cProperty IC4hProperty IC4fProperty IC4cProperty IN3fProperty IN3dProperty """ def printdefs( p ): s = " //%s\n //\n" #s += 'bool\n( Abc::%s::*matchesMetaData )( const AbcA::MetaData&,\nAbc::SchemaInterpMatching ) = \\\n' #s += '&Abc::%s::matches;\n\n' #s += 'bool\n( Abc::%s::*matchesHeader )( const AbcA::PropertyHeader&,\nAbc::SchemaInterpMatching ) = \\\n' #s += '&Abc::%s::matches;\n\n' s += 'class_<Abc::%s>( "%s",\ninit<Abc::ICompoundProperty,\nconst std::string&>() )\n' s += '.def( init<>() )\n' s += '.def( "getName", &Abc::%s::getName,\nreturn_value_policy<copy_const_reference>() )\n' s += '.def( "getHeader", &Abc::%s::getHeader,\nreturn_internal_reference<1>() )\n' s += '.def( "isScalar", &Abc::%s::isScalar )\n' s += '.def( "isArray", &Abc::%s::isArray )\n' s += '.def( "isCompound", &Abc::%s::isCompound )\n' s += '.def( "isSimple", &Abc::%s::isSimple )\n' s += '.def( "getMetaData", &Abc::%s::getMetaData,\nreturn_internal_reference<1>() )\n' s += '.def( "getDataType", &Abc::%s::getDataType,\nreturn_internal_reference<1>() )\n' s += '.def( "getTimeSamplingType", &Abc::%s::getTimeSamplingType )\n' s += '.def( "getInterpretation", &Abc::%s::getInterpretation,\nreturn_value_policy<copy_const_reference>() )\n' #s += '.def( "matches", matchesMetaData )\n' #s += '.def( "matches", matchesHeader )\n' s += '.def( "getNumSamples", &Abc::%s::getNumSamples )\n' #s += '.def( "getValue", &Abc::%s::getValue, %s_overloads() )\n' s += '.def( "getObject", &Abc::%s::getObject,\nwith_custodian_and_ward_postcall<0,1>() )\n' s += '.def( "reset", &Abc::%s::reset )\n' s += '.def( "valid", &Abc::%s::valid )\n' s += '.def( "__str__", &Abc::%s::getName,\nreturn_value_policy<copy_const_reference>() )\n' s += '.def( "__nonzero__", &Abc::%s::valid )\n' s += ';' print s % eval( "%s" % ( 'p,' * s.count( r'%s' ) ) ) print return for i in sprops.split(): if i == "": pass else: printdefs( i )
Python
##-***************************************************************************** ## ## Copyright (c) 2009-2011, ## Sony Pictures Imageworks, Inc. and ## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. ## ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are ## met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above ## copyright notice, this list of conditions and the following disclaimer ## in the documentation and/or other materials provided with the ## distribution. ## * Neither the name of Sony Pictures Imageworks, nor ## Industrial Light & Magic nor the names of their contributors may be used ## to endorse or promote products derived from this software without specific ## prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ##-***************************************************************************** from maya import cmds as MayaCmds import maya.OpenMaya as OpenMaya import os import unittest import util def getObjFromName(nodeName): selectionList = OpenMaya.MSelectionList() selectionList.add(nodeName) obj = OpenMaya.MObject() selectionList.getDependNode(0, obj) return obj class PolyNormalsTest(unittest.TestCase): def setUp(self): MayaCmds.file(new=True, force=True) self.__files = [] def tearDown(self): for f in self.__files: os.remove(f) def testSet_noNormals_Attr(self): MayaCmds.polyCube(name='polyCube') # add the necessary props MayaCmds.select('polyCubeShape') MayaCmds.addAttr(longName='SubDivisionMesh', attributeType='bool', defaultValue=False) MayaCmds.addAttr(longName='interpolateBoundary', attributeType='bool', defaultValue=True) MayaCmds.addAttr(longName='noNormals', attributeType='bool', defaultValue=False) MayaCmds.addAttr(longName='flipNormals', attributeType='bool', defaultValue=False) MayaCmds.addAttr(longName='faceVaryingInterpolateBoundary', attributeType='bool', defaultValue=False) MayaCmds.polySphere(name='polySphere') # add the necessary props MayaCmds.select('polySphereShape') MayaCmds.addAttr(longName='SubDivisionMesh', attributeType='bool', defaultValue=False) MayaCmds.addAttr(longName='interpolateBoundary', attributeType='bool', defaultValue=True) MayaCmds.addAttr(longName='noNormals', attributeType='bool', defaultValue=True) MayaCmds.addAttr(longName='flipNormals', attributeType='bool', defaultValue=False) MayaCmds.addAttr(longName='faceVaryingInterpolateBoundary', attributeType='bool', defaultValue=False) #ignore facevaryingType, subdPaintLev MayaCmds.group('polyCube', 'polySphere', name='polygons') self.__files.append(util.expandFileName('staticPoly_noNormals_AttrTest.abc')) MayaCmds.AbcExport(j='-root polygons -f ' + self.__files[-1]) # reading test MayaCmds.AbcImport(self.__files[-1], mode='open', debug=False) # make sure the noNormal attribute is set correctly when the file is loaded self.failIf(MayaCmds.listAttr('polyCubeShape').count('noNormals') != 0) self.failUnless(MayaCmds.getAttr('polySphereShape.noNormals')) def testStaticMeshPolyNormals(self): # create a polygon cube polyName = 'polyCube' polyShapeName = 'polyCubeShape' MayaCmds.polyCube( sx=1, sy=1, sz=1, name=polyName, constructionHistory=False) # add the necessary props MayaCmds.select(polyShapeName) MayaCmds.addAttr(longName='SubDivisionMesh', attributeType='bool', defaultValue=False) MayaCmds.addAttr(longName='noNormals', attributeType='bool', defaultValue=False) MayaCmds.addAttr(longName='flipNormals', attributeType='bool', defaultValue=False) # tweek some normals MayaCmds.select(polyName+'.vtxFace[2][1]', replace=True) MayaCmds.polyNormalPerVertex(xyz=(0.707107, 0.707107, 0)) MayaCmds.select(polyName+'.vtxFace[7][4]', replace=True) MayaCmds.polyNormalPerVertex(xyz=(-0.707107, 0.707107, 0)) # write to file self.__files.append(util.expandFileName('staticPolyNormalsTest.abc')) MayaCmds.AbcExport(j='-root %s -f %s' % (polyName, self.__files[-1])) # read back from file MayaCmds.AbcImport(self.__files[-1], mode='import') self.failIf(MayaCmds.listAttr('polyCube1|polyCubeShape').count('noNormals') != 0) # make sure the normals are the same shapeObj = getObjFromName('polyCube1|polyCubeShape') fnMesh = OpenMaya.MFnMesh(shapeObj) numFaces = fnMesh.numPolygons() for faceIndex in range(0, numFaces): vertexList = OpenMaya.MIntArray() fnMesh.getPolygonVertices(faceIndex, vertexList) numVertices = vertexList.length() for v in range(0, numVertices): vertexIndex = vertexList[v] normal = OpenMaya.MVector() fnMesh.getFaceVertexNormal(faceIndex, vertexIndex, normal) vtxFaceAttrName = '.vtxFace[%d][%d]' % (vertexIndex, faceIndex) MayaCmds.select(polyName+vtxFaceAttrName, replace=True) oNormal = MayaCmds.polyNormalPerVertex( query=True, xyz=True) self.failUnlessAlmostEqual(normal[0], oNormal[0], 4) self.failUnlessAlmostEqual(normal[1], oNormal[1], 4) self.failUnlessAlmostEqual(normal[2], oNormal[2], 4) def testAnimatedMeshPolyNormals(self): # create a polygon cube polyName = 'polyCube' polyShapeName = 'polyCubeShape' MayaCmds.polyCube(sx=1, sy=1, sz=1, name=polyName, constructionHistory=False) # add the necessary props MayaCmds.select(polyShapeName) MayaCmds.addAttr(longName='SubDivisionMesh', attributeType='bool', defaultValue=False) MayaCmds.addAttr(longName='noNormals', attributeType='bool', defaultValue=False) MayaCmds.addAttr(longName='flipNormals', attributeType='bool', defaultValue=False) # tweek some normals MayaCmds.select(polyName+'.vtxFace[2][1]', replace=True) MayaCmds.polyNormalPerVertex(xyz=(0.707107, 0.707107, 0)) MayaCmds.select(polyName+'.vtxFace[7][4]', replace=True) MayaCmds.polyNormalPerVertex(xyz=(-0.707107, 0.707107, 0)) # set keyframes to make sure normals are written out as animated MayaCmds.setKeyframe(polyShapeName+'.vtx[0:7]', time=[1, 4]) MayaCmds.currentTime(2, update=True) MayaCmds.select(polyShapeName+'.vtx[0:3]') MayaCmds.move(0, 0.5, 1, relative=True) MayaCmds.setKeyframe(polyShapeName+'.vtx[0:7]', time=[2]) # write to file self.__files.append(util.expandFileName('animPolyNormalsTest.abc')) MayaCmds.AbcExport(j='-fr 1 4 -root %s -f %s' % (polyName, self.__files[-1])) # read back from file MayaCmds.AbcImport(self.__files[-1], mode='import') # make sure the noNormal attribute is set correctly when the file is # loaded self.failIf(MayaCmds.listAttr('polyCube1|polyCubeShape').count('noNormals') != 0) # make sure the normals are the same for time in range(1, 5): MayaCmds.currentTime(time, update=True) shapeObj = getObjFromName('polyCube1|polyCubeShape') fnMesh = OpenMaya.MFnMesh(shapeObj) numFaces = fnMesh.numPolygons() for faceIndex in range(0, numFaces): vertexList = OpenMaya.MIntArray() fnMesh.getPolygonVertices(faceIndex, vertexList) numVertices = vertexList.length() for v in range(0, numVertices): vertexIndex = vertexList[v] normal = OpenMaya.MVector() fnMesh.getFaceVertexNormal(faceIndex, vertexIndex, normal) vtxFaceAttrName = '.vtxFace[%d][%d]' % (vertexIndex, faceIndex) MayaCmds.select(polyName+vtxFaceAttrName, replace=True) oNormal = MayaCmds.polyNormalPerVertex(query=True, xyz=True) self.failUnlessAlmostEqual(normal[0], oNormal[0], 4) self.failUnlessAlmostEqual(normal[1], oNormal[1], 4) self.failUnlessAlmostEqual(normal[2], oNormal[2], 4)
Python
##-***************************************************************************** ## ## Copyright (c) 2009-2011, ## Sony Pictures Imageworks, Inc. and ## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. ## ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are ## met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above ## copyright notice, this list of conditions and the following disclaimer ## in the documentation and/or other materials provided with the ## distribution. ## * Neither the name of Sony Pictures Imageworks, nor ## Industrial Light & Magic nor the names of their contributors may be used ## to endorse or promote products derived from this software without specific ## prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ##-***************************************************************************** from maya import cmds as MayaCmds import os import unittest import util class staticPropTest(unittest.TestCase): def setUp(self): MayaCmds.file(new=True, force=True) self.__files = [] def tearDown(self): for f in self.__files : os.remove(f) def setProps(self, nodeName): MayaCmds.select(nodeName) MayaCmds.addAttr(longName='SPT_int8', defaultValue=8, attributeType='byte', keyable=True) MayaCmds.addAttr(longName='SPT_int16', defaultValue=16, attributeType='short', keyable=True) MayaCmds.addAttr(longName='SPT_int32', defaultValue=32, attributeType='long', keyable=True) MayaCmds.addAttr(longName='SPT_float', defaultValue=3.2654, attributeType='float', keyable=True) MayaCmds.addAttr(longName='SPT_double', defaultValue=0.15724757, attributeType='double', keyable=True) MayaCmds.addAttr(longName='SPT_double_AbcGeomScope', dataType="string") MayaCmds.setAttr(nodeName+'.SPT_double_AbcGeomScope', "vtx", type="string") MayaCmds.addAttr(longName='SPT_string', dataType="string") MayaCmds.setAttr(nodeName+'.SPT_string', "empty", type="string") MayaCmds.addAttr(longName='SPT_string_AbcGeomScope', dataType="string") MayaCmds.setAttr(nodeName+'.SPT_string_AbcGeomScope', "potato", type="string") MayaCmds.addAttr(longName='SPT_int32_array', dataType='Int32Array') MayaCmds.setAttr(nodeName+'.SPT_int32_array', [6, 7, 8, 9, 10], type='Int32Array') MayaCmds.addAttr(longName='SPT_vector_array', dataType='vectorArray') MayaCmds.setAttr(nodeName+'.SPT_vector_array', 3, (1,1,1), (2,2,2), (3,3,3), type='vectorArray') MayaCmds.addAttr(longName='SPT_vector_array_AbcType', dataType="string") MayaCmds.setAttr(nodeName+'.SPT_vector_array_AbcType', "normal2", type="string") MayaCmds.addAttr(longName='SPT_point_array', dataType='pointArray') MayaCmds.setAttr(nodeName+'.SPT_point_array', 2, (2,4,6,8), (20,40,60,80), type='pointArray') MayaCmds.addAttr(longName='SPT_double_array', dataType='doubleArray') MayaCmds.addAttr(longName='SPT_double_array_AbcGeomScope', dataType="string") MayaCmds.setAttr(nodeName+'.SPT_double_array', [1.1, 2.2, 3.3, 4.4, 5.5], type='doubleArray') MayaCmds.setAttr(nodeName+'.SPT_double_array_AbcGeomScope', "vtx", type="string") MayaCmds.addAttr(longName='SPT_string_array', dataType='stringArray') MayaCmds.setAttr(nodeName+'.SPT_string_array', 3, "string1", "string2", "string3", type='stringArray') def verifyProps(self, nodeName, fileName): MayaCmds.AbcImport(fileName, mode='open') self.failUnlessEqual(8, MayaCmds.getAttr(nodeName+'.SPT_int8')) self.failUnlessEqual(16, MayaCmds.getAttr(nodeName+'.SPT_int16')) self.failUnlessEqual(32, MayaCmds.getAttr(nodeName+'.SPT_int32')) self.failUnlessAlmostEqual(3.2654, MayaCmds.getAttr(nodeName+'.SPT_float'), 4) self.failUnlessAlmostEqual(0.15724757, MayaCmds.getAttr(nodeName+'.SPT_double'), 7) self.failUnlessEqual('vtx', MayaCmds.getAttr(nodeName+'.SPT_double_AbcGeomScope')) self.failUnlessEqual('empty', MayaCmds.getAttr(nodeName+'.SPT_string')) self.failUnlessEqual(0, MayaCmds.attributeQuery( 'SPT_string_AbcGeomScope', node=nodeName, exists=True)) self.failUnlessEqual([6, 7, 8, 9, 10], MayaCmds.getAttr(nodeName+'.SPT_int32_array')) self.failUnlessEqual(["string1", "string2", "string3"], MayaCmds.getAttr(nodeName+'.SPT_string_array')) self.failUnlessEqual([1.1, 2.2, 3.3, 4.4, 5.5], MayaCmds.getAttr(nodeName+'.SPT_double_array')) self.failUnlessEqual([(1.0, 1.0, 0.0), (2.0, 2.0, 0.0), (3.0, 3.0, 0.0)], MayaCmds.getAttr(nodeName+'.SPT_vector_array')) self.failUnlessEqual('normal2', MayaCmds.getAttr(nodeName+'.SPT_vector_array_AbcType')) self.failUnlessEqual([(2.0, 4.0, 6.0, 1.0), (20.0, 40.0, 60.0, 1.0)], MayaCmds.getAttr(nodeName+'.SPT_point_array')) def testStaticTransformPropReadWrite(self): nodeName = MayaCmds.createNode('transform') self.setProps(nodeName) self.__files.append(util.expandFileName('staticPropTransform.abc')) MayaCmds.AbcExport(j='-atp SPT_ -root %s -file %s' % (nodeName, self.__files[-1])) self.verifyProps(nodeName, self.__files[-1]) def testStaticCameraPropReadWrite(self): root = MayaCmds.camera() nodeName = root[0] shapeName = root[1] self.setProps(shapeName) self.__files.append(util.expandFileName('staticPropCamera.abc')) MayaCmds.AbcExport(j='-atp SPT_ -root %s -f %s' % (nodeName, self.__files[-1])) self.verifyProps(shapeName, self.__files[-1]) def testStaticParticlePropReadWrite(self): root = MayaCmds.particle(p=[(0, 0, 0), (1, 1, 1)]) nodeName = root[0] shapeName = root[1] self.setProps(shapeName) self.__files.append(util.expandFileName('staticPropParticles.abc')) MayaCmds.AbcExport(j='-atp -root %s -f %s' % (nodeName, self.__files[-1])) self.verifyProps(shapeName, self.__files[-1]) def testStaticMeshPropReadWrite(self): nodeName = 'polyCube' shapeName = 'polyCubeShape' MayaCmds.polyCube(name=nodeName) self.setProps(shapeName) self.__files.append(util.expandFileName('staticPropMesh.abc')) MayaCmds.AbcExport(j='-atp SPT_ -root %s -f %s' % (nodeName, self.__files[-1])) self.verifyProps(shapeName, self.__files[-1]) def testStaticNurbsCurvePropReadWrite(self): nodeName = 'nCurve' shapeName = 'curveShape1' MayaCmds.curve(p=[(0, 0, 0), (3, 5, 6), (5, 6, 7), (9, 9, 9)], name=nodeName) self.setProps(shapeName) self.__files.append(util.expandFileName('staticPropCurve.abc')) MayaCmds.AbcExport(j='-atp SPT_ -root %s -f %s' % (nodeName, self.__files[-1])) self.verifyProps(shapeName, self.__files[-1]) def testStaticNurbsSurfacePropReadWrite(self): nodeName = 'nSphere' shapeName = 'nSphereShape' MayaCmds.sphere(name=nodeName) self.setProps(shapeName) self.__files.append(util.expandFileName('staticPropNurbs.abc')) MayaCmds.AbcExport(j='-atp SPT_ -root %s -file %s' % (nodeName, self.__files[-1])) self.verifyProps(shapeName, self.__files[-1])
Python
##-***************************************************************************** ## ## Copyright (c) 2009-2011, ## Sony Pictures Imageworks, Inc. and ## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. ## ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are ## met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above ## copyright notice, this list of conditions and the following disclaimer ## in the documentation and/or other materials provided with the ## distribution. ## * Neither the name of Sony Pictures Imageworks, nor ## Industrial Light & Magic nor the names of their contributors may be used ## to endorse or promote products derived from this software without specific ## prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ##-***************************************************************************** from maya import cmds as MayaCmds import os import unittest import util class emptyMeshTest(unittest.TestCase): def setUp(self): MayaCmds.file(new=True, force=True) self.__files = [] def tearDown(self): for f in self.__files: os.remove(f) def testEmptyMeshFlag(self): MayaCmds.createNode('mesh', name='mesh') MayaCmds.rename('|polySurface1', 'trans') self.__files.append(util.expandFileName('emptyMeshTest.abc')) MayaCmds.AbcExport(j='-root trans -file ' + self.__files[-1]) MayaCmds.AbcImport(self.__files[-1], m='open') self.failUnless(MayaCmds.objExists("trans")) self.failIf(MayaCmds.objExists("head"))
Python
##-***************************************************************************** ## ## Copyright (c) 2009-2011, ## Sony Pictures Imageworks, Inc. and ## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. ## ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are ## met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above ## copyright notice, this list of conditions and the following disclaimer ## in the documentation and/or other materials provided with the ## distribution. ## * Neither the name of Sony Pictures Imageworks, nor ## Industrial Light & Magic nor the names of their contributors may be used ## to endorse or promote products derived from this software without specific ## prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ##-***************************************************************************** from maya import cmds as MayaCmds import maya.OpenMaya as OpenMaya import os import subprocess import unittest import util class AnimMeshTest(unittest.TestCase): def setUp(self): MayaCmds.file(new=True, force=True) self.__abcStitcher = [os.environ['AbcStitcher']] self.__files = [] def tearDown(self): for f in self.__files : os.remove(f) def testAnimSPT_HwColor_ReadWrite(self): numFaces = 6 numVertices = 8 numFaceConnects = 24 vtx_1 = OpenMaya.MFloatPoint(-0.5, -0.5, -0.5) vtx_2 = OpenMaya.MFloatPoint( 0.5, -0.5, -0.5) vtx_3 = OpenMaya.MFloatPoint( 0.5, -0.5, 0.5) vtx_4 = OpenMaya.MFloatPoint(-0.5, -0.5, 0.5) vtx_5 = OpenMaya.MFloatPoint(-0.5, 0.5, -0.5) vtx_6 = OpenMaya.MFloatPoint(-0.5, 0.5, 0.5) vtx_7 = OpenMaya.MFloatPoint( 0.5, 0.5, 0.5) vtx_8 = OpenMaya.MFloatPoint( 0.5, 0.5, -0.5) points = OpenMaya.MFloatPointArray() points.setLength(8) points.set(vtx_1, 0) points.set(vtx_2, 1) points.set(vtx_3, 2) points.set(vtx_4, 3) points.set(vtx_5, 4) points.set(vtx_6, 5) points.set(vtx_7, 6) points.set(vtx_8, 7) faceConnects = OpenMaya.MIntArray() faceConnects.setLength(numFaceConnects) faceConnects.set(0, 0) faceConnects.set(1, 1) faceConnects.set(2, 2) faceConnects.set(3, 3) faceConnects.set(4, 4) faceConnects.set(5, 5) faceConnects.set(6, 6) faceConnects.set(7, 7) faceConnects.set(3, 8) faceConnects.set(2, 9) faceConnects.set(6, 10) faceConnects.set(5, 11) faceConnects.set(0, 12) faceConnects.set(3, 13) faceConnects.set(5, 14) faceConnects.set(4, 15) faceConnects.set(0, 16) faceConnects.set(4, 17) faceConnects.set(7, 18) faceConnects.set(1, 19) faceConnects.set(1, 20) faceConnects.set(7, 21) faceConnects.set(6, 22) faceConnects.set(2, 23) faceCounts = OpenMaya.MIntArray() faceCounts.setLength(6) faceCounts.set(4, 0) faceCounts.set(4, 1) faceCounts.set(4, 2) faceCounts.set(4, 3) faceCounts.set(4, 4) faceCounts.set(4, 5) transFn = OpenMaya.MFnTransform() parent = transFn.create() transFn.setName('poly') meshFn = OpenMaya.MFnMesh() meshFn.create(numVertices, numFaces, points, faceCounts, faceConnects, parent) shapeName = 'polyShape' meshFn.setName(shapeName) # add SPT_HwColor attributes MayaCmds.select( shapeName ) MayaCmds.addAttr(longName='SPT_HwColor', usedAsColor=True, attributeType='float3') MayaCmds.addAttr(longName='SPT_HwColorR', attributeType='float', parent='SPT_HwColor') MayaCmds.addAttr(longName='SPT_HwColorG', attributeType='float', parent='SPT_HwColor') MayaCmds.addAttr(longName='SPT_HwColorB', attributeType='float', parent='SPT_HwColor') # set colors MayaCmds.setAttr(shapeName+'.SPT_HwColor', 0.50, 0.15, 0.75, type='float3') MayaCmds.currentTime(1, update=True) MayaCmds.setKeyframe('polyShape.vtx[0:7]') # colors MayaCmds.setKeyframe( shapeName+'.SPT_HwColor') MayaCmds.currentTime(24, update=True) MayaCmds.setKeyframe('polyShape.vtx[0:7]') # colors MayaCmds.setKeyframe( shapeName+'.SPT_HwColor') MayaCmds.currentTime(12, update=True) vtx_11 = OpenMaya.MFloatPoint(-1.0, -1.0, -1.0) vtx_22 = OpenMaya.MFloatPoint( 1.0, -1.0, -1.0) vtx_33 = OpenMaya.MFloatPoint( 1.0, -1.0, 1.0) vtx_44 = OpenMaya.MFloatPoint(-1.0, -1.0, 1.0) vtx_55 = OpenMaya.MFloatPoint(-1.0, 1.0, -1.0) vtx_66 = OpenMaya.MFloatPoint(-1.0, 1.0, 1.0) vtx_77 = OpenMaya.MFloatPoint( 1.0, 1.0, 1.0) vtx_88 = OpenMaya.MFloatPoint( 1.0, 1.0, -1.0) points.set(vtx_11, 0) points.set(vtx_22, 1) points.set(vtx_33, 2) points.set(vtx_44, 3) points.set(vtx_55, 4) points.set(vtx_66, 5) points.set(vtx_77, 6) points.set(vtx_88, 7) meshFn.setPoints(points) MayaCmds.setAttr( shapeName+'.SPT_HwColor', 0.15, 0.5, 0.15, type='float3') MayaCmds.setKeyframe('polyShape.vtx[0:7]') # colors MayaCmds.setKeyframe( shapeName+'.SPT_HwColor') self.__files.append(util.expandFileName('animSPT_HwColor.abc')) self.__files.append(util.expandFileName('animSPT_HwColor_01_14.abc')) self.__files.append(util.expandFileName('animSPT_HwColor_15_24.abc')) MayaCmds.AbcExport(j='-atp SPT_ -fr 1 14 -root poly -file ' + self.__files[-2]) MayaCmds.AbcExport(j='-atp SPT_ -fr 15 24 -root poly -file ' + self.__files[-1]) subprocess.call(self.__abcStitcher + self.__files[-3:]) # reading test MayaCmds.AbcImport(self.__files[-3], mode='open') places = 7 # check colors MayaCmds.currentTime(1, update=True) colorVec_1 = MayaCmds.getAttr(shapeName+'.SPT_HwColor')[0] self.failUnlessAlmostEqual(colorVec_1[0], 0.50, places) self.failUnlessAlmostEqual(colorVec_1[1], 0.15, places) self.failUnlessAlmostEqual(colorVec_1[2], 0.75, places) MayaCmds.currentTime(2, update=True) # only needed for interpolation test on frame 1.422 colorVec_2 = MayaCmds.getAttr(shapeName+'.SPT_HwColor')[0] setTime = MayaCmds.currentTime(1.422, update=True) alpha = (setTime - 1) / (2 - 1) colorVec = MayaCmds.getAttr(shapeName+'.SPT_HwColor')[0] self.failUnlessAlmostEqual(colorVec[0], (1-alpha)*colorVec_1[0]+alpha*colorVec_2[0], places) self.failUnlessAlmostEqual(colorVec[1], (1-alpha)*colorVec_1[1]+alpha*colorVec_2[1], places) self.failUnlessAlmostEqual(colorVec[2], (1-alpha)*colorVec_1[2]+alpha*colorVec_2[2], places) MayaCmds.currentTime(12, update=True) colorVec = MayaCmds.getAttr( shapeName+'.SPT_HwColor' )[0] self.failUnlessAlmostEqual( colorVec[0], 0.15, places) self.failUnlessAlmostEqual( colorVec[1], 0.50, places) self.failUnlessAlmostEqual( colorVec[2], 0.15, places) MayaCmds.currentTime(24, update=True) colorVec = MayaCmds.getAttr(shapeName+'.SPT_HwColor')[0] self.failUnlessAlmostEqual(colorVec[0], 0.50, places) self.failUnlessAlmostEqual(colorVec[1], 0.15, places) self.failUnlessAlmostEqual(colorVec[2], 0.75, places)
Python