True true, i think a fix to that problem will be to store the values of the current scene weather that was set randomly and if its in the same terrain and a few hours didnt passed the weather will get the same first random values that stored and will be reseted to random each few hours(that enough time passed for weather to change) or if you go from snow to grassland so also depand on the terrain to set snow or rain, just a quick idea about that but it really dosent bother me personally, i even re-enter a scene(battle) few times just to get a weather im liking
("sort_party_members_stack_level",
[
(try_for_parties, ":party_no"),
(assign, ":continue", 0),
(try_begin),
(eq, ":party_no", "p_main_party"),
(party_is_active, ":party_no"),
(assign, ":continue", 1),
(try_begin),
(party_stack_get_troop_id, ":cur_troop", ":party_no", 0),
(this_or_next | troop_is_hero, ":cur_troop"),
(eq, ":cur_troop", "trp_caravan_master"),
(assign, ":first_stack", 1),
(else_try),
(assign, ":first_stack", 0),
(try_end),
(try_end),
(eq, ":continue", 1),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(gt, ":num_stacks", ":first_stack"),
(assign, ":last_stack", ":num_stacks"),
# start to sort
(store_sub, ":num_times", ":num_stacks", ":first_stack"),
(try_for_range, ":unused", 0, ":num_times"),
# find highest-level troop
(assign, ":best_stack", -1),
(assign, ":best_level", -1),
(try_for_range, ":cur_stack", ":first_stack", ":last_stack"),
(party_stack_get_troop_id, ":cur_troop", ":party_no", ":cur_stack"),
(store_character_level, ":troop_level", ":cur_troop"),
(gt, ":troop_level", ":best_level"),
(assign, ":best_level", ":troop_level"),
(assign, ":best_stack", ":cur_stack"),
(try_end),
# move to the end
(try_begin),
(gt, ":best_level", -1),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":best_stack"),
(party_stack_get_size, ":stack_size", ":party_no", ":best_stack"),
(party_stack_get_num_wounded, ":num_wounded", ":party_no", ":best_stack"),
(party_remove_members, ":party_no", ":stack_troop", ":stack_size"),
(party_add_members, ":party_no", ":stack_troop", ":stack_size"),
(party_wound_members, ":party_no", ":stack_troop", ":num_wounded"),
(val_sub, ":last_stack", 1),
(try_end),
(try_end),
(try_end),
]),
("action_sort_party_members", [], "Sort party members.",
[(jump_to_menu, "mnu_camp_action_sort_party"),
]
),
("camp_action_sort_party", 0,
"Choose what to sort by:^^(can be mixed sorting, for example, sorting stack level and then sorting party infantry to the top will make the infantry stacks to sort by level, same goes to stack amount)",
"none",
[
],
[
("sort_party_1",
[], "Sort party members by stack level.",
[
(call_script, "script_sort_party_members_stack_level"),
(display_message, "@Your party members is now sorted by stack level."),
],
),
("sort_party_2",
[], "Sort party members by stack amount.",
[
(call_script, "script_sort_party_members_stack_level"),
(try_for_parties, ":party_no"),
(assign, ":continue", 0),
(try_begin),
(eq, ":party_no", "p_main_party"),
(party_is_active, ":party_no"),
(assign, ":continue", 1),
(try_begin),
(party_stack_get_troop_id, ":cur_troop", ":party_no", 0),
(this_or_next | troop_is_hero, ":cur_troop"),
(eq, ":cur_troop", "trp_caravan_master"),
(assign, ":first_stack", 1),
(else_try),
(assign, ":first_stack", 0),
(try_end),
(try_end),
(eq, ":continue", 1),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(gt, ":num_stacks", ":first_stack"),
(assign, ":last_stack", ":num_stacks"),
# start to sort
(store_sub, ":num_times", ":num_stacks", ":first_stack"),
(try_for_range, ":unused", 0, ":num_times"),
# find highest-level troop
(assign, ":best_stack", -1),
(assign, ":best_level", -1),
(try_for_range, ":cur_stack", ":first_stack", ":last_stack"),
#(party_stack_get_troop_id, ":cur_troop", ":party_no", ":cur_stack"),
(party_stack_get_size, ":troop_level", "p_main_party", ":cur_stack"),
(gt, ":troop_level", ":best_level"),
(assign, ":best_level", ":troop_level"),
(assign, ":best_stack", ":cur_stack"),
(try_end),
# move to the end
(try_begin),
(gt, ":best_level", -1),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":best_stack"),
(party_stack_get_size, ":stack_size", ":party_no", ":best_stack"),
(party_stack_get_num_wounded, ":num_wounded", ":party_no", ":best_stack"),
(party_remove_members, ":party_no", ":stack_troop", ":stack_size"),
(party_add_members, ":party_no", ":stack_troop", ":stack_size"),
(party_wound_members, ":party_no", ":stack_troop", ":num_wounded"),
(val_sub, ":last_stack", 1),
(try_end),
(try_end),
(try_end),
(display_message, "@Your party members is now sorted by stack amount."),
]
),
("blank", [
],
"------------------------------",
[]),
("sort_party_3",
[], "Sort party infantry to the top.",
[
(try_for_parties, ":party_no"),
(assign, ":continue", 0),
(try_begin),
(eq, ":party_no", "p_main_party"),
(party_is_active, ":party_no"),
(assign, ":continue", 1),
(try_begin),
(party_stack_get_troop_id, ":cur_troop", ":party_no", 0),
(this_or_next | troop_is_hero, ":cur_troop"),
(eq, ":cur_troop", "trp_caravan_master"),
(assign, ":first_stack", 1),
(else_try),
(assign, ":first_stack", 0),
(try_end),
(try_end),
(eq, ":continue", 1),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(gt, ":num_stacks", ":first_stack"),
(assign, ":last_stack", ":num_stacks"),
# start to sort
(store_sub, ":num_times", ":num_stacks", ":first_stack"),
(try_for_range, ":unused", 0, ":num_times"),
# find highest-level troop
(assign, ":best_stack", -1),
(assign, ":best_level", -1),
(try_for_range, ":cur_stack", ":first_stack", ":last_stack"),
(party_stack_get_troop_id, ":cur_troop", ":party_no", ":cur_stack"),
(troop_get_class, ":troop_class", ":cur_troop"),
(neq, ":troop_class", 0),
#(store_character_level, ":troop_level", ":cur_troop"),
#(gt, ":troop_level", ":best_level"),
#(assign, ":best_level", ":troop_level"),
(assign, ":best_stack", ":cur_stack"),
(try_end),
# move to the end
(try_begin),
#(gt, ":best_level", -1),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":best_stack"),
(troop_get_class, ":troop_class", ":stack_troop"),
(neq, ":troop_class", 0),
(party_stack_get_size, ":stack_size", ":party_no", ":best_stack"),
(party_stack_get_num_wounded, ":num_wounded", ":party_no", ":best_stack"),
(party_remove_members, ":party_no", ":stack_troop", ":stack_size"),
(party_add_members, ":party_no", ":stack_troop", ":stack_size"),
(party_wound_members, ":party_no", ":stack_troop", ":num_wounded"),
(val_sub, ":last_stack", 1),
(try_end),
(try_end),
(try_end),
(display_message, "@Your party infantry is now sorted to the top."),
],
),
("sort_party_4",
[], "Sort party infantry to the buttom.",
[
(try_for_parties, ":party_no"),
(assign, ":continue", 0),
(try_begin),
(eq, ":party_no", "p_main_party"),
(party_is_active, ":party_no"),
(assign, ":continue", 1),
(try_begin),
(party_stack_get_troop_id, ":cur_troop", ":party_no", 0),
(this_or_next | troop_is_hero, ":cur_troop"),
(eq, ":cur_troop", "trp_caravan_master"),
(assign, ":first_stack", 1),
(else_try),
(assign, ":first_stack", 0),
(try_end),
(try_end),
(eq, ":continue", 1),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(gt, ":num_stacks", ":first_stack"),
(assign, ":last_stack", ":num_stacks"),
# start to sort
(store_sub, ":num_times", ":num_stacks", ":first_stack"),
(try_for_range, ":unused", 0, ":num_times"),
# find highest-level troop
(assign, ":best_stack", -1),
(assign, ":best_level", -1),
(try_for_range, ":cur_stack", ":first_stack", ":last_stack"),
(party_stack_get_troop_id, ":cur_troop", ":party_no", ":cur_stack"),
(troop_get_class, ":troop_class", ":cur_troop"),
(eq, ":troop_class", 0),
#(store_character_level, ":troop_level", ":cur_troop"),
#(gt, ":troop_level", ":best_level"),
#(assign, ":best_level", ":troop_level"),
(assign, ":best_stack", ":cur_stack"),
(try_end),
# move to the end
(try_begin),
#(gt, ":best_level", -1),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":best_stack"),
(troop_get_class, ":troop_class", ":stack_troop"),
(eq, ":troop_class", 0),
(party_stack_get_size, ":stack_size", ":party_no", ":best_stack"),
(party_stack_get_num_wounded, ":num_wounded", ":party_no", ":best_stack"),
(party_remove_members, ":party_no", ":stack_troop", ":stack_size"),
(party_add_members, ":party_no", ":stack_troop", ":stack_size"),
(party_wound_members, ":party_no", ":stack_troop", ":num_wounded"),
(val_sub, ":last_stack", 1),
(try_end),
(try_end),
(try_end),
(display_message, "@Your party infantry is now sorted to the buttom."),
],
),
("blank_1", [
],
"------------------------------",
[]),
("sort_party_5",
[], "Sort party archers to the top.",
[
(try_for_parties, ":party_no"),
(assign, ":continue", 0),
(try_begin),
(eq, ":party_no", "p_main_party"),
(party_is_active, ":party_no"),
(assign, ":continue", 1),
(try_begin),
(party_stack_get_troop_id, ":cur_troop", ":party_no", 0),
(this_or_next | troop_is_hero, ":cur_troop"),
(eq, ":cur_troop", "trp_caravan_master"),
(assign, ":first_stack", 1),
(else_try),
(assign, ":first_stack", 0),
(try_end),
(try_end),
(eq, ":continue", 1),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(gt, ":num_stacks", ":first_stack"),
(assign, ":last_stack", ":num_stacks"),
# start to sort
(store_sub, ":num_times", ":num_stacks", ":first_stack"),
(try_for_range, ":unused", 0, ":num_times"),
# find highest-level troop
(assign, ":best_stack", -1),
(assign, ":best_level", -1),
(try_for_range, ":cur_stack", ":first_stack", ":last_stack"),
(party_stack_get_troop_id, ":cur_troop", ":party_no", ":cur_stack"),
(troop_get_class, ":troop_class", ":cur_troop"),
(neq, ":troop_class", 1),
#(store_character_level, ":troop_level", ":cur_troop"),
#(gt, ":troop_level", ":best_level"),
#(assign, ":best_level", ":troop_level"),
(assign, ":best_stack", ":cur_stack"),
(try_end),
# move to the end
(try_begin),
#(gt, ":best_level", -1),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":best_stack"),
(troop_get_class, ":troop_class", ":stack_troop"),
(neq, ":troop_class", 1),
(party_stack_get_size, ":stack_size", ":party_no", ":best_stack"),
(party_stack_get_num_wounded, ":num_wounded", ":party_no", ":best_stack"),
(party_remove_members, ":party_no", ":stack_troop", ":stack_size"),
(party_add_members, ":party_no", ":stack_troop", ":stack_size"),
(party_wound_members, ":party_no", ":stack_troop", ":num_wounded"),
(val_sub, ":last_stack", 1),
(try_end),
(try_end),
(try_end),
(display_message, "@Your party archers is now sorted to the top."),
],
),
("sort_party_6",
[], "Sort party archers to the buttom.",
[
(try_for_parties, ":party_no"),
(assign, ":continue", 0),
(try_begin),
(eq, ":party_no", "p_main_party"),
(party_is_active, ":party_no"),
(assign, ":continue", 1),
(try_begin),
(party_stack_get_troop_id, ":cur_troop", ":party_no", 0),
(this_or_next | troop_is_hero, ":cur_troop"),
(eq, ":cur_troop", "trp_caravan_master"),
(assign, ":first_stack", 1),
(else_try),
(assign, ":first_stack", 0),
(try_end),
(try_end),
(eq, ":continue", 1),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(gt, ":num_stacks", ":first_stack"),
(assign, ":last_stack", ":num_stacks"),
# start to sort
(store_sub, ":num_times", ":num_stacks", ":first_stack"),
(try_for_range, ":unused", 0, ":num_times"),
# find highest-level troop
(assign, ":best_stack", -1),
(assign, ":best_level", -1),
(try_for_range, ":cur_stack", ":first_stack", ":last_stack"),
(party_stack_get_troop_id, ":cur_troop", ":party_no", ":cur_stack"),
(troop_get_class, ":troop_class", ":cur_troop"),
(eq, ":troop_class", 1),
#(store_character_level, ":troop_level", ":cur_troop"),
#(gt, ":troop_level", ":best_level"),
#(assign, ":best_level", ":troop_level"),
(assign, ":best_stack", ":cur_stack"),
(try_end),
# move to the end
(try_begin),
#(gt, ":best_level", -1),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":best_stack"),
(troop_get_class, ":troop_class", ":stack_troop"),
(eq, ":troop_class", 1),
(party_stack_get_size, ":stack_size", ":party_no", ":best_stack"),
(party_stack_get_num_wounded, ":num_wounded", ":party_no", ":best_stack"),
(party_remove_members, ":party_no", ":stack_troop", ":stack_size"),
(party_add_members, ":party_no", ":stack_troop", ":stack_size"),
(party_wound_members, ":party_no", ":stack_troop", ":num_wounded"),
(val_sub, ":last_stack", 1),
(try_end),
(try_end),
(try_end),
(display_message, "@Your party archers is now sorted to the buttom."),
],
),
("blank_2", [
],
"------------------------------",
[]),
("sort_party_7",
[], "Sort party cavalry to the top.",
[
(try_for_parties, ":party_no"),
(assign, ":continue", 0),
(try_begin),
(eq, ":party_no", "p_main_party"),
(party_is_active, ":party_no"),
(assign, ":continue", 1),
(try_begin),
(party_stack_get_troop_id, ":cur_troop", ":party_no", 0),
(this_or_next | troop_is_hero, ":cur_troop"),
(eq, ":cur_troop", "trp_caravan_master"),
(assign, ":first_stack", 1),
(else_try),
(assign, ":first_stack", 0),
(try_end),
(try_end),
(eq, ":continue", 1),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(gt, ":num_stacks", ":first_stack"),
(assign, ":last_stack", ":num_stacks"),
# start to sort
(store_sub, ":num_times", ":num_stacks", ":first_stack"),
(try_for_range, ":unused", 0, ":num_times"),
# find highest-level troop
(assign, ":best_stack", -1),
(assign, ":best_level", -1),
(try_for_range, ":cur_stack", ":first_stack", ":last_stack"),
(party_stack_get_troop_id, ":cur_troop", ":party_no", ":cur_stack"),
(troop_get_class, ":troop_class", ":cur_troop"),
(neq, ":troop_class", 2),
#(store_character_level, ":troop_level", ":cur_troop"),
#(gt, ":troop_level", ":best_level"),
#(assign, ":best_level", ":troop_level"),
(assign, ":best_stack", ":cur_stack"),
(try_end),
# move to the end
(try_begin),
#(gt, ":best_level", -1),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":best_stack"),
(troop_get_class, ":troop_class", ":stack_troop"),
(neq, ":troop_class", 2),
(party_stack_get_size, ":stack_size", ":party_no", ":best_stack"),
(party_stack_get_num_wounded, ":num_wounded", ":party_no", ":best_stack"),
(party_remove_members, ":party_no", ":stack_troop", ":stack_size"),
(party_add_members, ":party_no", ":stack_troop", ":stack_size"),
(party_wound_members, ":party_no", ":stack_troop", ":num_wounded"),
(val_sub, ":last_stack", 1),
(try_end),
(try_end),
(try_end),
(display_message, "@Your party cavalry is now sorted to the top."),
],
),
("sort_party_8",
[], "Sort party cavalry to the buttom.",
[
(try_for_parties, ":party_no"),
(assign, ":continue", 0),
(try_begin),
(eq, ":party_no", "p_main_party"),
(party_is_active, ":party_no"),
(assign, ":continue", 1),
(try_begin),
(party_stack_get_troop_id, ":cur_troop", ":party_no", 0),
(this_or_next | troop_is_hero, ":cur_troop"),
(eq, ":cur_troop", "trp_caravan_master"),
(assign, ":first_stack", 1),
(else_try),
(assign, ":first_stack", 0),
(try_end),
(try_end),
(eq, ":continue", 1),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(gt, ":num_stacks", ":first_stack"),
(assign, ":last_stack", ":num_stacks"),
# start to sort
(store_sub, ":num_times", ":num_stacks", ":first_stack"),
(try_for_range, ":unused", 0, ":num_times"),
# find highest-level troop
(assign, ":best_stack", -1),
(assign, ":best_level", -1),
(try_for_range, ":cur_stack", ":first_stack", ":last_stack"),
(party_stack_get_troop_id, ":cur_troop", ":party_no", ":cur_stack"),
(troop_get_class, ":troop_class", ":cur_troop"),
(eq, ":troop_class", 2),
#(store_character_level, ":troop_level", ":cur_troop"),
#(gt, ":troop_level", ":best_level"),
#(assign, ":best_level", ":troop_level"),
(assign, ":best_stack", ":cur_stack"),
(try_end),
# move to the end
(try_begin),
#(gt, ":best_level", -1),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":best_stack"),
(troop_get_class, ":troop_class", ":stack_troop"),
(eq, ":troop_class", 2),
(party_stack_get_size, ":stack_size", ":party_no", ":best_stack"),
(party_stack_get_num_wounded, ":num_wounded", ":party_no", ":best_stack"),
(party_remove_members, ":party_no", ":stack_troop", ":stack_size"),
(party_add_members, ":party_no", ":stack_troop", ":stack_size"),
(party_wound_members, ":party_no", ":stack_troop", ":num_wounded"),
(val_sub, ":last_stack", 1),
(try_end),
(try_end),
(try_end),
(display_message, "@Your party cavalry is now sorted to the buttom."),
],
),
("blank_3", [
],
"------------------------------",
[]),
("sort_party_9",
[], "Sort party companions to the top.",
[
(try_for_parties, ":party_no"),
(assign, ":continue", 0),
(try_begin),
(eq, ":party_no", "p_main_party"),
(party_is_active, ":party_no"),
(assign, ":continue", 1),
(try_begin),
(party_stack_get_troop_id, ":cur_troop", ":party_no", 0),
(this_or_next | troop_is_hero, ":cur_troop"),
(eq, ":cur_troop", "trp_caravan_master"),
(assign, ":first_stack", 1),
(else_try),
(assign, ":first_stack", 0),
(try_end),
(try_end),
(eq, ":continue", 1),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(gt, ":num_stacks", ":first_stack"),
(assign, ":last_stack", ":num_stacks"),
# start to sort
(store_sub, ":num_times", ":num_stacks", ":first_stack"),
(try_for_range, ":unused", 0, ":num_times"),
# find highest-level troop
(assign, ":best_stack", -1),
(assign, ":best_level", -1),
(try_for_range, ":cur_stack", ":first_stack", ":last_stack"),
(party_stack_get_troop_id, ":cur_troop", ":party_no", ":cur_stack"),
(neg | troop_is_hero, ":cur_troop"),
#(store_character_level, ":troop_level", ":cur_troop"),
#(gt, ":troop_level", ":best_level"),
#(assign, ":best_level", ":troop_level"),
(assign, ":best_stack", ":cur_stack"),
(try_end),
# move to the end
(try_begin),
#(gt, ":best_level", -1),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":best_stack"),
(neg | troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size", ":party_no", ":best_stack"),
(party_stack_get_num_wounded, ":num_wounded", ":party_no", ":best_stack"),
(party_remove_members, ":party_no", ":stack_troop", ":stack_size"),
(party_add_members, ":party_no", ":stack_troop", ":stack_size"),
(party_wound_members, ":party_no", ":stack_troop", ":num_wounded"),
(val_sub, ":last_stack", 1),
(try_end),
(try_end),
(try_end),
(display_message, "@Your party companions is now sorted to the top."),
],
),
("sort_party_10",
[], "Sort party companions to the buttom.",
[
(try_for_parties, ":party_no"),
(assign, ":continue", 0),
(try_begin),
(eq, ":party_no", "p_main_party"),
(party_is_active, ":party_no"),
(assign, ":continue", 1),
(try_begin),
(party_stack_get_troop_id, ":cur_troop", ":party_no", 0),
(this_or_next | troop_is_hero, ":cur_troop"),
(eq, ":cur_troop", "trp_caravan_master"),
(assign, ":first_stack", 1),
(else_try),
(assign, ":first_stack", 0),
(try_end),
(try_end),
(eq, ":continue", 1),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(gt, ":num_stacks", ":first_stack"),
(assign, ":last_stack", ":num_stacks"),
# start to sort
(store_sub, ":num_times", ":num_stacks", ":first_stack"),
(try_for_range, ":unused", 0, ":num_times"),
# find highest-level troop
(assign, ":best_stack", -1),
(assign, ":best_level", -1),
(try_for_range, ":cur_stack", ":first_stack", ":last_stack"),
(party_stack_get_troop_id, ":cur_troop", ":party_no", ":cur_stack"),
(troop_is_hero, ":cur_troop"),
#(store_character_level, ":troop_level", ":cur_troop"),
#(gt, ":troop_level", ":best_level"),
#(assign, ":best_level", ":troop_level"),
(assign, ":best_stack", ":cur_stack"),
(try_end),
# move to the end
(try_begin),
#(gt, ":best_level", -1),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":best_stack"),
(troop_is_hero, ":stack_troop"),
(party_stack_get_size, ":stack_size", ":party_no", ":best_stack"),
(party_stack_get_num_wounded, ":num_wounded", ":party_no", ":best_stack"),
(party_remove_members, ":party_no", ":stack_troop", ":stack_size"),
(party_add_members, ":party_no", ":stack_troop", ":stack_size"),
(party_wound_members, ":party_no", ":stack_troop", ":num_wounded"),
(val_sub, ":last_stack", 1),
(try_end),
(try_end),
(try_end),
(display_message, "@Your party companions is now sorted to the buttom."),
],
),
("camp_sort_leave_to_menu", [], "Back to camp menu.",
[(jump_to_menu, "mnu_camp_action"),
]
),
]
),
("set_player_name", 0, mesh_load_window, [
(ti_on_presentation_load,
[(set_fixed_point_multiplier, 1000),
(str_store_string, s1, "@What will be the name of your character?"),
(create_text_overlay, reg1, s1, tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 400),
(overlay_set_position, reg1, pos1),
(overlay_set_text, reg1, s1),
(create_simple_text_box_overlay, "$g_presentation_obj_set_player_name_1"),
(position_set_x, pos1, 400),
(position_set_y, pos1, 350),
(overlay_set_position, "$g_presentation_obj_set_player_name_1", pos1),
(create_button_overlay, "$g_presentation_obj_set_player_name_2", "@Randomize male name", tf_center_justify),
(position_set_x, pos1, 585),
(position_set_y, pos1, 325),
(overlay_set_position, "$g_presentation_obj_set_player_name_2", pos1),
(create_button_overlay, "$g_presentation_obj_set_player_name_3", "@Randomize female name",
tf_center_justify),
(position_set_x, pos1, 585),
(position_set_y, pos1, 285),
(overlay_set_position, "$g_presentation_obj_set_player_name_3", pos1),
(create_button_overlay, "$g_presentation_obj_set_player_name_4", "@Continue...", tf_center_justify),
(position_set_x, pos1, 500),
(position_set_y, pos1, 200),
(overlay_set_position, "$g_presentation_obj_set_player_name_4", pos1),
(presentation_set_duration, 999999),
]),
(ti_on_presentation_event_state_change,
[(store_trigger_param_1, ":object"),
(try_begin),
(eq, ":object", "$g_presentation_obj_set_player_name_2"),
(store_random_in_range, reg3, "str_male_name_001", "str_male_name_200"),
(str_store_string, s11, reg3),
(troop_set_name, "trp_player", s11),
(troop_set_plural_name, "trp_player", s11),
(overlay_set_text, "$g_presentation_obj_set_player_name_1", s11),
(str_store_string, s0, s11),
(else_try),
(eq, ":object", "$g_presentation_obj_set_player_name_3"),
(store_random_in_range, reg3, "str_female_name_001", "str_female_name_200"),
(str_store_string, s11, reg3),
(troop_set_name, "trp_player", s11),
(troop_set_plural_name, "trp_player", s11),
(overlay_set_text, "$g_presentation_obj_set_player_name_1", s11),
(str_store_string, s0, s11),
(else_try),
(eq, ":object", "$g_presentation_obj_set_player_name_4"),
(str_store_string, s7, s0),
(troop_set_name, "trp_player", s7),
(troop_set_plural_name, "trp_player", s7),
(jump_to_menu, "mnu_start_character_1"),
(try_end),
]),
]),
######TheSwan bodyguard troops
slot_faction_bodyguard_troop = 480
######TheSwan bodyguard troops
######TheSwan bodyguard troops
["swadian_bodyguard","Swadian Retainer","Swadian Retainers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_kingdom_1,
[itm_heavy_lance,itm_sword_two_handed_b,itm_sword_medieval_d_long,itm_morningstar,itm_morningstar,itm_sword_medieval_d_long,itm_tab_shield_heater_cav_b,
itm_coat_of_plates_red,itm_cuir_bouilli,itm_plate_boots,itm_guard_helmet,itm_great_helmet,itm_bascinet,itm_charger,itm_warhorse,itm_gauntlets,itm_mail_mittens],
def_attrib|level(28),wp_one_handed (150) | wp_two_handed (130) | wp_polearm (130) | wp_archery (75) | wp_crossbow (75) | wp_throwing (75),knows_common|knows_riding_5|knows_shield_5|knows_ironflesh_5|knows_power_strike_5,swadian_face_middle_1, swadian_face_older_2],
["vaegir_bodyguard","Vaegir Retainer","Vaegir Retainer",tf_mounted|tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_kingdom_2,
[itm_ashwood_pike,itm_fighting_axe,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_vaegir_war_helmet,itm_vaegir_war_helmet,itm_vaegir_lamellar_helmet,itm_leather_gloves],
def_attrib|level(24),wp_melee(130),knows_riding_2|knows_athletics_4|knows_shield_2|knows_ironflesh_3|knows_power_strike_4,vaegir_face_middle_1, vaegir_face_older_2],
["khergit_bodyguard","Khergit Retainer","Khergit Retainers",tf_mounted|tf_guarantee_all_wo_ranged,0,0,fac_kingdom_3,
[itm_sword_khergit_4,itm_spiked_mace,itm_one_handed_war_axe_b,itm_hafted_blade_a,itm_hafted_blade_b,itm_heavy_lance,itm_lance,
itm_khergit_guard_helmet,itm_khergit_cavalry_helmet,itm_khergit_war_helmet,itm_lamellar_vest_khergit,itm_lamellar_armor,itm_khergit_leather_boots,itm_splinted_leather_greaves,itm_leather_gloves,itm_scale_gauntlets,itm_tab_shield_small_round_b,itm_tab_shield_small_round_c,itm_courser,itm_warhorse_steppe,itm_warhorse_steppe,itm_warhorse_steppe],
def_attrib|level(23),wp_one_handed (110) | wp_two_handed (110) | wp_polearm (150) | wp_archery (110) | wp_crossbow (110) | wp_throwing (110),knows_riding_7|knows_power_strike_4|knows_power_draw_4|knows_power_throw_2|knows_ironflesh_4|knows_horse_archery_1|knows_shield_2,khergit_face_middle_1, khergit_face_older_2],
["nord_bodyguard","Nord Retainer","Nord Retainers",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_kingdom_4,
[itm_sword_viking_3,itm_sword_viking_3_small,itm_great_axe,itm_one_handed_battle_axe_c,itm_tab_shield_round_e,itm_throwing_spears,itm_heavy_throwing_axes,itm_heavy_throwing_axes,
itm_nordic_huscarl_helmet,itm_nordic_warlord_helmet,itm_banded_armor,itm_mail_boots,itm_mail_chausses,itm_mail_mittens],
def_attrib|level(28),wp(170),knows_ironflesh_7|knows_power_strike_7|knows_power_throw_5|knows_riding_2|knows_athletics_7|knows_shield_6,nord_face_middle_1, nord_face_older_2],
["rhodok_bodyguard","Rhodok Retainer","Rhodok Retainers",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_shield|tf_guarantee_gloves,0,0,fac_kingdom_5,
[itm_glaive,itm_military_hammer,itm_military_cleaver_c,itm_tab_shield_pavise_d,
itm_full_helm, itm_bascinet_3,itm_bascinet_2,itm_surcoat_over_mail,itm_surcoat_over_mail,itm_heraldic_mail_with_surcoat,itm_mail_chausses,itm_leather_gloves,itm_mail_mittens],
def_attrib|level(25),wp_one_handed (130) | wp_two_handed (115) | wp_polearm (155) | wp_archery (115) | wp_crossbow (115) | wp_throwing (115),knows_common|knows_ironflesh_6|knows_shield_5|knows_power_strike_5|knows_athletics_5,rhodok_face_middle_1, rhodok_face_older_2],
["sarranid_bodyguard","Sarranid Retainer","Sarranid Retainers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_kingdom_6,
[itm_heavy_lance,itm_scimitar_b,itm_sarranid_two_handed_mace_1,itm_sarranid_cavalry_sword,itm_tab_shield_small_round_c,
itm_mamluke_mail,itm_sarranid_boots_d,itm_sarranid_boots_c,itm_sarranid_veiled_helmet,itm_arabian_horse_b,itm_warhorse_sarranid,itm_scale_gauntlets,itm_mail_mittens],
def_attrib|level(27),wp_one_handed (150) | wp_two_handed (130) | wp_polearm (130) | wp_archery (75) | wp_crossbow (75) | wp_throwing (110),knows_common|knows_riding_6|knows_shield_5|knows_ironflesh_5|knows_power_strike_5,swadian_face_middle_1, swadian_face_older_2],
["player_faction_bodyguard","Retainer","Retainers",tf_mounted|tf_guarantee_helmet|tf_guarantee_armor|tf_guarantee_boots|tf_guarantee_shield|tf_guarantee_gloves|tf_guarantee_horse,0,0,fac_player_supporters_faction,[itm_heavy_lance, itm_bastard_sword_b, itm_sword_medieval_d_long, itm_tab_shield_heater_cav_b, itm_tab_shield_kite_cav_b, itm_tab_shield_small_round_c, itm_winged_great_helmet, itm_great_helmet, itm_heraldic_mail_with_tunic, itm_heraldic_mail_with_tunic_b, itm_plate_boots, itm_gauntlets, itm_charger, itm_warhorse],def_attrib|level(28),wp(150),knows_ironflesh_5|knows_power_strike_5|knows_shield_5|knows_riding_5|knows_athletics_2,mercenary_face_1, mercenary_face_2],
######TheSwan bodyguard troops
######TheSwan bodyguard troops
(faction_set_slot, "fac_kingdom_1", slot_faction_bodyguard_troop, "trp_swadian_bodyguard"),
(faction_set_slot, "fac_kingdom_2", slot_faction_bodyguard_troop, "trp_vaegir_bodyguard"),
(faction_set_slot, "fac_kingdom_3", slot_faction_bodyguard_troop, "trp_khergit_bodyguard"),
(faction_set_slot, "fac_kingdom_4", slot_faction_bodyguard_troop, "trp_nord_bodyguard"),
(faction_set_slot, "fac_kingdom_5", slot_faction_bodyguard_troop, "trp_rhodok_bodyguard"),
(faction_set_slot, "fac_kingdom_6", slot_faction_bodyguard_troop, "trp_sarranid_bodyguard"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_bodyguard_troop, "trp_player_faction_bodyguard"),
######TheSwan bodyguard troops
######TheSwan bodyguard troops
("theswan_bodyguard_troops",
[
(try_for_range, ":lord_no", active_npcs_begin, active_npcs_end),
(troop_slot_eq, ":lord_no", slot_troop_occupation, slto_kingdom_hero),
(neg|troop_slot_ge, ":lord_no", slot_troop_prisoner_of_party, 0),
(troop_get_slot, ":party", ":lord_no", slot_troop_leaded_party),
(party_is_active, ":party"),
(gt, ":party", 0),
(store_faction_of_party, ":cur_faction", ":party"),
(party_get_attached_to, ":lord_attachment", ":party"),
(is_between, ":lord_attachment", centers_begin, centers_end),
(faction_get_slot, ":troop_bodyguard", ":cur_faction", slot_faction_bodyguard_troop),
(party_count_members_of_type, ":count", ":party", ":troop_bodyguard"),
(faction_get_slot, ":aristocraty", ":cur_faction", dplmc_slot_faction_aristocracy),
(try_begin),
(assign, ":limit", 20,),
(eq, ":aristocraty", 3),
(val_add, ":limit", 12),
(lt, ":count", ":limit"),
(party_add_members, ":party", ":troop_bodyguard", 1),
(else_try),
(eq, ":aristocraty", 2),
(val_add, ":limit", 8),
(lt, ":count", ":limit"),
(party_add_members, ":party", ":troop_bodyguard", 1),
(else_try),
(eq, ":aristocraty", 1),
(val_add, ":limit", 4),
(lt, ":count", ":limit"),
(party_add_members, ":party", ":troop_bodyguard", 1),
(else_try),
(eq, ":aristocraty", 0),
(val_add, ":limit", 0),
(lt, ":count", ":limit"),
(party_add_members, ":party", ":troop_bodyguard", 1),
(else_try),
(eq, ":aristocraty", -1),
(val_sub, ":limit", 4),
(lt, ":count", ":limit"),
(party_add_members, ":party", ":troop_bodyguard", 1),
(else_try),
(eq, ":aristocraty", -2),
(val_sub, ":limit", 8),
(lt, ":count", ":limit"),
(party_add_members, ":party", ":troop_bodyguard", 1),
(else_try),
(eq, ":aristocraty", -3),
(val_sub, ":limit", 12),
(lt, ":count", ":limit"),
(party_add_members, ":party", ":troop_bodyguard", 1),
(try_end),
(try_end),
]
),
######TheSwan bodyguard troops
######TheSwan bodyguard troops
(24,
[
(call_script, "script_theswan_bodyguard_troops"),
]),
######TheSwan bodyguard troops
("order_arrow_fire", sf_2d | sf_priority_10 | sf_vol_10, ["Group_State_Flaming_On_2.wav"]),
("order_arrow_normal", sf_2d | sf_priority_10 | sf_vol_10, ["Group_State_Flaming_Off_1.wav"]),
#script_create_explosion
#Input: grenadier, damage min, damage max, explosion radius,
#Output: none
#NOTE: If creating an explosion outside of weapon triggers, store the location in pos1
("create_explosion", [
(store_script_param, ":grenadier", 1),
(store_script_param, ":damageMin", 2),
(store_script_param, ":damageMax", 3),
(store_script_param, ":radius", 4),
(particle_system_burst,"psys_pistol_smoke",pos1,5),
(particle_system_burst,"psys_fireplace_fire_small",pos1,60),
(try_for_agents,":target"),
(agent_is_alive, ":target"),
(agent_is_active, ":target"),
(agent_get_team, ":grenadiers_team", ":grenadier"),
(agent_get_team, ":targets_team", ":target"),
(teams_are_enemies, ":grenadiers_team", ":targets_team"),
(agent_get_position,pos2,":target"),
(get_distance_between_positions,":dist",pos1,pos2),
(try_begin),
(lt,":dist", ":radius"),
(store_agent_hit_points,":hp",":target",10),
(store_random_in_range,":dmg", ":damageMin", ":damageMax"),
(val_sub,":hp",":dmg"),
(try_begin),
(lt, ":hp", 0),
#if you want to play a custom animation for explosive deaths, put it here.
#(agent_set_animation, ":target", "anim_explosion_death"),
(try_end),
(agent_deliver_damage_to_agent,":grenadier",":target", ":dmg"),
(try_end),
(try_end)
]),
#(if you dont want them in the market just remove the "itp_merchandise")
#normal arrows.
["flaming_arrows", "Flaming Arrows", [("arrow", 0), ("huojian_fly", ixmesh_flying_ammo),("quiver", ixmesh_carry)],
itp_type_arrows | itp_merchandise | itp_default_ammo, itcf_carry_quiver_back, 72,
weight(4) | difficulty(0) | spd_rtng(85) | shoot_speed(30) | thrust_damage(1, blunt) | max_ammo(30) | weapon_length(
95), imodbits_missile, [(ti_on_missile_hit, [
(store_trigger_param_1, ":grenadier"),
# GRENADE STATS
(assign, ":damageMin", 60),
(assign, ":damageMax", 100),
(assign, ":radius", 125),
(call_script, "script_create_explosion", ":grenadier", ":damageMin", ":damageMax", ":radius"),])]],
#khergit arrows.
["flaming_khergit_arrows", "Flaming Khergit Arrows",
[("arrow_b", 0), ("huojian_fly", ixmesh_flying_ammo), ("quiver_b", ixmesh_carry)],itp_type_arrows | itp_merchandise | itp_default_ammo, itcf_carry_quiver_back_right, 410,weight(4) | difficulty(0) | spd_rtng(85) | shoot_speed(30) | thrust_damage(6, blunt) | max_ammo(34) | weapon_length(95), imodbits_missile, [(ti_on_missile_hit, [
(store_trigger_param_1, ":grenadier"),
# GRENADE STATS
(assign, ":damageMin", 60),
(assign, ":damageMax", 100),
(assign, ":radius", 125),
(call_script, "script_create_explosion", ":grenadier", ":damageMin", ":damageMax", ":radius"),
])]],
#barbed arrows.
["flaming_barbed_arrows", "Flaming Barbed Arrows",
[("barbed_arrow", 0), ("huojian_fly", ixmesh_flying_ammo), ("quiver_d", ixmesh_carry)],
itp_type_arrows | itp_merchandise | itp_default_ammo, itcf_carry_quiver_back_right, 72,
weight(4) | difficulty(0) | spd_rtng(85) | shoot_speed(30) | thrust_damage(1, blunt) | max_ammo(
30) | weapon_length(
95), imodbits_missile, [(ti_on_missile_hit, [
(store_trigger_param_1, ":grenadier"),
# GRENADE STATS
(assign, ":damageMin", 60),
(assign, ":damageMax", 100),
(assign, ":radius", 125),
(call_script, "script_create_explosion", ":grenadier", ":damageMin", ":damageMax", ":radius"),
])]],
#bodkin arrows.
["flaming_bodkin_arrows", "Flaming Bodkin Arrows", [("piercing_arrow", 0), ("huojian_fly", ixmesh_flying_ammo), ("quiver_c", ixmesh_carry)],
itp_type_arrows | itp_merchandise | itp_default_ammo, itcf_carry_quiver_back_right, 72,
weight(4) | difficulty(0) | spd_rtng(85) | shoot_speed(30) | thrust_damage(1, blunt) | max_ammo(
30) | weapon_length(
95), imodbits_missile, [(ti_on_missile_hit, [
(store_trigger_param_1, ":grenadier"),
# GRENADE STATS
(assign, ":damageMin", 60),
(assign, ":damageMax", 100),
(assign, ":radius", 125),
(call_script, "script_create_explosion", ":grenadier", ":damageMin", ":damageMax", ":radius"),
])]],
the_swan_flaming_arrows_use_fire = (
0.0, 0, 0, [], [
(try_begin),
(key_clicked, key_t), #change to any key you want
(try_for_agents, ":cur_agent"),
(get_player_agent_no, ":player"),
(agent_get_team, ":player_team", ":player"),
(agent_is_alive, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_is_non_player, ":cur_agent"),
(agent_get_team, ":cur_team", ":cur_agent"),
(eq, ":cur_team", ":player_team"),
(agent_get_ammo, ":destination", ":cur_agent", 1),
(try_begin),
(agent_has_item_equipped, ":cur_agent", "itm_arrows"),
(agent_unequip_item, ":cur_agent", "itm_arrows"),
(agent_equip_item, ":cur_agent", "itm_flaming_arrows"),
(agent_set_wielded_item, ":cur_agent", "itm_flaming_arrows"),
(agent_set_ammo, ":cur_agent", "itm_flaming_arrows",":destination"),
(else_try),
(agent_has_item_equipped, ":cur_agent", "itm_barbed_arrows"),
(agent_unequip_item, ":cur_agent", "itm_barbed_arrows"),
(agent_equip_item, ":cur_agent", "itm_flaming_barbed_arrows"),
(agent_set_wielded_item, ":cur_agent", "itm_flaming_barbed_arrows"),
(agent_set_ammo, ":cur_agent", "itm_flaming_barbed_arrows",":destination"),
(else_try),
(agent_has_item_equipped, ":cur_agent", "itm_bodkin_arrows"),
(agent_unequip_item, ":cur_agent", "itm_bodkin_arrows"),
(agent_equip_item, ":cur_agent", "itm_flaming_bodkin_arrows"),
(agent_set_wielded_item, ":cur_agent", "itm_flaming_bodkin_arrows"),
(agent_set_ammo, ":cur_agent", "itm_flaming_bodkin_arrows",":destination"),
(else_try),
(agent_has_item_equipped, ":cur_agent", "itm_khergit_arrows"),
(agent_unequip_item, ":cur_agent", "itm_khergit_arrows"),
(agent_equip_item, ":cur_agent", "itm_flaming_khergit_arrows"),
(agent_set_wielded_item, ":cur_agent", "itm_flaming_khergit_arrows"),
(agent_set_ammo, ":cur_agent", "itm_flaming_khergit_arrows",":destination"),
(end_try),
(agent_set_ranged_damage_modifier, ":cur_agent", 165), #adjust fire arrow wielding agent stats according to your liking
(agent_set_accuracy_modifier, ":cur_agent", 85), #adjust fire arrow wielding agent stats according to your liking
(agent_set_reload_speed_modifier, ":cur_agent", 70), #adjust fire arrow wielding agent stats according to your liking
(end_try),
(display_message, "@Units, use fire!"),
(agent_play_sound, ":player", "snd_order_arrow_fire"),
])
the_swan_flaming_arrows_extinguish_flames = (
0.0, 0, 0, [], [
(try_begin),
(key_clicked, key_u), #get clicked key to active
(try_for_agents, ":cur_agent"),
(get_player_agent_no, ":player"),
(agent_get_team, ":player_team", ":player"),
(agent_is_alive, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_is_non_player, ":cur_agent"),
(agent_get_class, ":agent_class", ":cur_agent"),
(neq, ":agent_class", grc_infantry), #not infnatry
(agent_get_team, ":cur_team", ":cur_agent"),
(eq, ":cur_team", ":player_team"),
# (agent_get_class, ":agent_class", ":cur_agent"),
(agent_get_ammo, ":destination", ":cur_agent", 1),
(try_begin),
(agent_has_item_equipped, ":cur_agent", "itm_flaming_arrows"),
(agent_unequip_item, ":cur_agent", "itm_flaming_arrows"),
(agent_equip_item, ":cur_agent", "itm_arrows"),
(agent_set_wielded_item, ":cur_agent", "itm_arrows"),
(agent_set_ammo, ":cur_agent", "itm_arrows", ":destination"),
(else_try),
(agent_has_item_equipped, ":cur_agent", "itm_flaming_barbed_arrows"),
(agent_unequip_item, ":cur_agent", "itm_flaming_barbed_arrows"),
(agent_equip_item, ":cur_agent", "itm_barbed_arrows"),
(agent_set_wielded_item, ":cur_agent", "itm_barbed_arrows"),
(agent_set_ammo, ":cur_agent", "itm_barbed_arrows", ":destination"),
(else_try),
(agent_has_item_equipped, ":cur_agent", "itm_flaming_bodkin_arrows"),
(agent_unequip_item, ":cur_agent", "itm_flaming_bodkin_arrows"),
(agent_equip_item, ":cur_agent", "itm_bodkin_arrows"),
(agent_set_wielded_item, ":cur_agent", "itm_bodkin_arrows"),
(agent_set_ammo, ":cur_agent", "itm_bodkin_arrows", ":destination"),
(else_try),
(agent_has_item_equipped, ":cur_agent", "itm_flaming_khergit_arrows"),
(agent_unequip_item, ":cur_agent", "itm_flaming_khergit_arrows"),
(agent_equip_item, ":cur_agent", "itm_khergit_arrows"),
(agent_set_wielded_item, ":cur_agent", "itm_khergit_arrows"),
(agent_set_ammo, ":cur_agent", "itm_khergit_arrows", ":destination"),
(end_try),
(agent_set_ranged_damage_modifier, ":cur_agent", 100),
(agent_set_accuracy_modifier, ":cur_agent", 100),
(agent_set_reload_speed_modifier, ":cur_agent", 100),
(end_try),
(display_message, "@Units, extinguish flames."),
(agent_play_sound, ":player", "snd_order_arrow_normal"),
])
the_swan_flaming_arrows_use_fire,
the_swan_flaming_arrows_extinguish_flames,
("camp_action",0,
"Choose an action:",
"none",
[
],
[
("camp_recruit_prisoners",
[(troops_can_join, 1),
(store_current_hours, ":cur_time"),
(val_sub, ":cur_time", 24),
(gt, ":cur_time", "$g_prisoner_recruit_last_time"),
(try_begin),
(gt, "$g_prisoner_recruit_last_time", 0),
(assign, "$g_prisoner_recruit_troop_id", 0),
(assign, "$g_prisoner_recruit_size", 0),
(assign, "$g_prisoner_recruit_last_time", 0),
(try_end),
], "Recruit some of your prisoners to your party.",
[(jump_to_menu, "mnu_camp_recruit_prisoners"),
],
),
("action_walk_around",[],"Walk around.",
[(set_jump_mission,"mt_ai_training"),
(call_script, "script_setup_random_scene"),
(change_screen_mission)
]
),
("action_lords_weekly_payment",[(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active)],"Set lords weekly payment.",
[(jump_to_menu, "mnu_lords_weekly_payment"),
]),
("lords_weekly_payment",0,
"Choose the weekly paymet of your lords.^{s24}^Current payment for each lord is {s2}",
"none",
[
(assign, ":num_lords", 0),
(try_for_parties, ":cur_party"),
(store_faction_of_party, ":cur_faction", ":cur_party"),
(eq, ":cur_faction", "fac_player_supporters_faction"),
(try_begin),
(party_slot_eq, ":cur_party", slot_party_type, spt_kingdom_hero_party),
(val_add, ":num_lords", 1),
(try_end),
(try_end),
(assign, reg60, ":num_lords"),
(str_store_string, s24, "@Our kingdom currently have ({reg60}) lords."),
(try_begin),
(eq, "$lord_payment", 1),
(str_store_string, s2, "@Very low(125 denars), -3 renown, -2 right to rule, -1 honor."),
(else_try),
(eq, "$lord_payment", 2),
(str_store_string, s2, "@Low(200 denars), -2 renown, -1 right to rule."),
(else_try),
(eq, "$lord_payment", 3),
(str_store_string, s2, "@Average(325 denars)."),
(else_try),
(eq, "$lord_payment", 4),
(str_store_string, s2, "@High(450 denars), +2 renown, +2 right to rule."),
(else_try),
(eq, "$lord_payment", 5),
(str_store_string, s2, "@Very high(600 denars), +2 renown, +2 right to rule, +1 honor."),
(try_end),
(try_end),
],
[
("lords_weekly_payment1",[],"Very low weekly payment.",
[
(assign, "$lord_payment", 1),
]),
("lords_weekly_payment2", [], "Low weekly payment.",
[
(assign, "$lord_payment", 2),
]),
("lords_weekly_payment3", [], "Average weekly payment.",
[
(assign, "$lord_payment", 3),
]),
("lords_weekly_payment4", [], "High weekly payment.",
[
(assign, "$lord_payment", 4),
]),
("lords_weekly_payment5", [], "Very high weekly payment.",
[
(assign, "$lord_payment", 5),
]),
("camp_action_4",[],"Back to camp menu.",
[(jump_to_menu, "mnu_camp"),
]
),
]
),
(assign, "$lord_payment", 3),
("lco_initialize_presentation",
[
(presentation_set_duration, 999999),
(try_begin),
(eq, "$g_lco_initialized", 0),
(assign, "$g_lco_activate_troop", 0), # By default, we do not make a particular troop active
(assign, "$g_lco_active_hero", 0), # We show the first hero by default
(assign, "$g_lco_page", 0), # We show the first page by default
(assign, "$g_lco_operation", 0), # No special action by default
(assign, "$g_lco_target", 0), # No action target by default
(assign, "$g_lco_auto_horses", 1), # Horses are auto-equipped by default
(assign, "$g_lco_auto_armors", 1), # Same
(assign, "$g_lco_auto_shields", 1), # Same
(assign, "$g_lco_include_companions", 1),
(assign, "$g_lco_include_lords", 0),
(assign, "$g_lco_include_regulars", 0),
# BugFix V1.1. Do not overwrite $g_lco_garbage_troop on first run if it's already initialized.
(try_begin),
(lt, "$g_lco_garbage_troop", 3),
(assign, "$g_lco_garbage_troop", lco_garbage), # This troop will be used for discarding items or looting, and it's inventory will be purged on exit
(try_end),
(assign, "$g_lco_initialized", 1),
# BugFix V1.2. Hardcoded xp-to-level conversion table has been removed
(try_end),
# GLOBAL VARIABLES INITIALIZATION
(assign, "$lord_payment", 0), ###########>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>add this
(assign, "$g_lco_heroes", 0), # Total number of heroes in the party, excluding player
(assign, "$g_lco_inv_slots", 0), # Total number of slots in the player's inventory
(assign, "$g_lco_dragging", 0), # Currently not dragging anything
(assign, "$g_lco_dragging_from", 0), # Troop ID of dragged item current owner
(assign, "$g_lco_dragging_from_slot", 0), # Slot ID of dragged item current owner
(assign, "$g_lco_drag_item", -1), # Item type currently being dragged
(assign, "$g_lco_drag_modifier", 0), # Modifier of item currently being dragged
(24 * 7, #lords_weekly_payment
[
#check if the player kingdom is active and get the total number of lords in the player kingdom.
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
(assign, ":num_lords", 0),
(try_for_parties, ":cur_party"),
(store_faction_of_party, ":cur_faction", ":cur_party"),
(try_begin),
(eq, ":cur_faction", "fac_player_supporters_faction"),
(party_slot_eq, ":cur_party", slot_party_type, spt_kingdom_hero_party),
(val_add, ":num_lords", 1),
(assign, reg60, ":num_lords"),
(try_end),
#check payment ranks that called from the camp action menu(default is 3, Average).
(try_begin), # Very low.
(eq, "$lord_payment", 1),
(assign, ":payment_very_low", 125),
(assign, reg61, ":payment_very_low"),
(else_try), # Low.
(eq, "$lord_payment", 2),
(assign, ":payment_low", 200),
(assign, reg61, ":payment_low"),
(else_try), # Average.
(eq, "$lord_payment", 3),
(assign, ":payment_average", 325),
(assign, reg61, ":payment_average"),
(else_try), # High.
(eq, "$lord_payment", 4),
(assign, ":payment_high", 450),
(assign, reg61, ":payment_high"),
(else_try), # Very High.
(eq, "$lord_payment", 5),
(assign, ":payment_very_high", 600),
(assign, reg61, ":payment_very_high"),
(try_end),
(try_end),
#set the checked variables to their values.
(try_begin),
(eq, "$lord_payment", 1),
(store_mul, ":payment_final", ":num_lords", ":payment_very_low"), # ":num_lords"= current faction lords, ":payment_very_low"(125), Current lords*125=":payment_final".
(assign, ":renown", -3),
(assign, ":right_to_rule", -2),
(assign, ":honor", -1),
(else_try),
(eq, "$lord_payment", 2),
(store_mul, ":payment_final", ":num_lords", ":payment_low"), # ":num_lords"= current faction lords, ":payment_low"(200), Current lords*200=":payment_final".
(assign, ":renown", -2),
(assign, ":right_to_rule", -1),
(assign, ":honor", 0),
(else_try),
(eq, "$lord_payment", 3),
(store_mul, ":payment_final", ":num_lords", ":payment_average"), # ":num_lords"= current faction lords, ":payment_average"(325), Current lords*325=":payment_final".
(assign, ":renown", 0),
(assign, ":right_to_rule", 0),
(assign, ":honor", 0),
(else_try),
(eq, "$lord_payment", 4),
(store_mul, ":payment_final", ":num_lords", ":payment_high"), # ":num_lords"= current faction lords, ":payment_high"(450), Current lords*450=":payment_final".
(assign, ":renown", 2),
(assign, ":right_to_rule", 2),
(else_try),
(eq, "$lord_payment", 5),
(store_mul, ":payment_final", ":num_lords", ":payment_very_high"), # ":num_lords"= current faction lords, ":payment_very_high"(600), Current lords*600=":payment_final".
(assign, ":renown", 3),
(assign, ":right_to_rule", 2),
(assign, ":honor", 1),
(try_end),
(try_end),
(assign, reg62, ":payment_final"),
#execute the values, first check the player treasury, if there is enough gold for the payment take from there(if not go to the next check) and the rank effects to the player(renown,right to rule,honor).
(try_begin),
(store_troop_gold, ":household_gold", "trp_household_possessions"),
(lt, ":payment_final", ":household_gold"),
(display_message,"@Our kingdom currently have ({reg60}) lords and each lord payment is ({reg61} denars) their weekly cost is ({reg62} denars).",0xFFD800),
(troop_remove_gold, "trp_household_possessions", ":payment_final"),
(call_script, "script_change_troop_renown", "trp_player", ":renown"),
(call_script, "script_change_player_right_to_rule", ":right_to_rule"),
(call_script, "script_change_player_honor", ":honor"),
#execute the values, second check the player personal gold, if there is enough gold for the payment take from there and the rank effects to the player(renown,right to rule,honor).
(else_try),
(store_troop_gold, ":player_gold", "trp_player"),
(lt, ":payment_final", ":player_gold"),
(display_message,"@Our kingdom currently have ({reg60}) lords and each lord payment is ({reg61} denars) their weekly cost is ({reg62} denars).",0xFFD800),
(troop_remove_gold, "trp_player", ":payment_final"),
(call_script, "script_change_troop_renown", "trp_player", ":renown"),
(call_script, "script_change_player_right_to_rule", ":right_to_rule"),
(call_script, "script_change_player_honor", ":honor"),
# execute the values, third check, in this point the treasury and the player dont have enough gold for the payment, not taking any gold from the player but decreasing the player relation with all his lords by 1.
(else_try),
(store_sub, ":difference", ":payment_final", ":player_gold"),
(assign, reg63, ":difference"),
(display_message,"@Our kingdom currently have ({reg60}) lords and each lord payment is ({reg61} denars) their weekly cost is ({reg62} denars), you needed more ({reg63} denars) to pay your lords.",0xFF0000),
(display_message,"@The relation with all your lords decreased by 1.",0xFF0000),
(try_for_range, ":lord", lords_begin, lords_end),
(troop_slot_eq, ":lord", slot_troop_occupation, slto_kingdom_hero),
(store_faction_of_troop, ":troop_faction", ":lord"),
(eq, ":troop_faction", "$players_kingdom"),
(set_show_messages, 0), # to avoid a lot of red lines in the left side of the screen.
(call_script, "script_troop_change_relation_with_troop", ":lord", "trp_player", -1),
(set_show_messages, 1),
(try_end),
(try_end),
]),
# TheSwan Thunder braves begin
[anyone|plyr,"regular_member_talk", [(player_has_item, "itm_arquebus"), (is_between,"$g_talk_troop",thunder_braves_begin, thunder_braves_end),], "I got some of those invaders fire thunders, take it, it will serve you well in battle.", "thunder_braves1",[]],
[anyone|plyr, "thunder_braves2", [], "Here you can have it.", "close_window", [(party_remove_members,"p_main_party","$g_talk_troop", 1), (party_add_members, "p_main_party", "trp_thunder_brave", 1), (troop_remove_item, "trp_player", "itm_arquebus")]],
[anyone|plyr, "thunder_braves2", [], "I change my mind.", "close_window", []],
[anyone, "thunder_braves1", [], "Thank you, {sir/madam}.", "thunder_braves2", []],
# TheSwan Thunder braves end