Berserker Pride
Grandmaster Knight
Module_Constants [Search for kingdom_heroes_begin]
Module_Dialogues
Module_Scripts [Search for the Scripts in question then edit them]
#Module_Triggers New Triggers go at the bottom before the last ]
#Module_Simple_Triggers Edit the first trigger the next two are new. Again make sure you add a comma to the previous trigger at the end of the file if their isn't one #currently.
#module_troops this is a sample troop tree for your new culture (culture_6
module_factions
module_party_templates
module_game_menus two posts below due to character limit.
Credit must go to SPD_Phoenix, Ruthven, Cruger for assistance
and Highlander and Wicketshot for making their code open source so I could edit it.
The module system download is two posts below as well.
kingdom_heroes_begin = "trp_npc1"
kingdom_heroes_end = kingdom_ladies_begin
####I'm not sure where those values usually start but change kingdom_heroes_begin to = "trp_npc1"
####If you add any new companions to your module they must go just after the previous companions.
####Edit: I forgot one important piece. You need to add a new slot for faction color in your module_constants.py. I add it below the "slot_faction_leader"
slot_faction_color = 12
kingdom_heroes_end = kingdom_ladies_begin
####I'm not sure where those values usually start but change kingdom_heroes_begin to = "trp_npc1"
####If you add any new companions to your module they must go just after the previous companions.
####Edit: I forgot one important piece. You need to add a new slot for faction color in your module_constants.py. I add it below the "slot_faction_leader"
slot_faction_color = 12
[anyone,"view_member_char_requested", [], "All right, let me tell you...", "do_member_view_char",[(change_screen_view_character)]],####This is not ###new I simply put the dialogue after this line.
# Talk to any of your members with over 15 charisma.
#Kingdom Management
[anyone|plyr, "member_talk", [
# (eq, "$talk_array_no", -1),
(store_attribute_level,":companion_charisma","$g_talk_troop",3),
(ge,":companion_charisma",15),
(assign,":num_centers",0),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(party_get_slot, ":lord", ":center_no", slot_town_lord),
(eq,":lord","trp_player"),
(val_add,":num_centers",1),
(try_end),
(ge,":num_centers",1)],
"I have decided to promote you. You have shown enough leadership to be capable of managing your own Warband.",
"assign_fief_1",[
(troop_set_slot,"$g_talk_troop",slot_troop_change_to_faction,"fac_player_supporters_faction"),
(troop_set_slot,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(troop_set_slot, "$g_talk_troop", slot_troop_wealth, 4000),###The higher you set this number the more troops will be in your companions army
(try_begin),
(store_skill_level,":companion_leadership",skl_leadership,"$g_talk_troop"),
(ge,":companion_leadership",,
(troop_set_slot, "$g_talk_troop", slot_troop_renown, 500),###
(troop_set_slot, "$g_talk_troop", slot_troop_wealth, 6000),###Really big army if your companion has a lot of leadership
(try_end),
(try_begin),
(troop_set_slot, "$g_talk_troop", slot_troop_original_faction,"fac_kingdom_6"),###I preset the player faction with unique troops
(faction_set_slot, "fac_player_supporters_faction", slot_faction_culture, "fac_kingdom_6"),
(try_end),
(party_remove_members,"p_main_party","$g_talk_troop",1),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 40),
(troop_get_slot, ":player_banner", "trp_player", slot_troop_banner_scene_prop),#This assigns player kingdom lords your banner
(troop_set_slot, "$g_talk_troop", slot_troop_banner_scene_prop,":player_banner"),
]],
[anyone|plyr, "assign_fief_1", [
(assign,":num_centers",0),###All of this ensure that the player is lord of a castle he can give away.
(try_for_range, ":center_no", castles_begin, castles_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(party_get_slot, ":lord", ":center_no", slot_town_lord),
(eq,":lord","trp_player"),
(val_add,":num_centers",1),
(try_end),
(ge,":num_centers",1)],
"You are to become a vassal lord.",
"assign_fief_2",[]],
[anyone|plyr, "assign_fief_1", [
(assign,":num_centers",0),
(try_for_range, ":center_no", towns_begin, towns_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(party_get_slot, ":lord", ":center_no", slot_town_lord),
(eq,":lord","trp_player"),
(val_add,":num_centers",1),
(try_end),
(ge,":num_centers",1)],
"You might even become lord of a town if you can be trusted.",
"assign_fief_2",[]],
[anyone, "assign_fief_2", [],"I will not fail you {playername}. Should you need assistance on the battlefield call for me.","close_window",[
(jump_to_menu, "mnu_give_center_to_companion")]],
#Kingdom Management End
[anyone, "event_triggered",
[
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "$g_talk_troop"),
(neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),#Kingdom Management you don't want this coming up #for your kingdom
(ge, "$g_center_taken_by_player_faction", 0),
(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
],
"{s1} is not being managed by anyone. Whom shall I put in charge?", "center_captured_lord_advice",
[]],
#Installation: you can add these right after BPKM dialog in module_dialogs.py. However, if you want this option to be listed above the "*Leave*" option, then seerch #for the phrase "TODO: QUESTS COMMENT OUT END". Add these new dialogs above/below the 4th match.
#Dialog:
# (click to show/hide)
# Spd - New dialog option for BPKM
# Spd - add option to change kingdom setting
[anyone|plyr,"lord_talk", [(eq, "$g_talk_troop_faction", "$players_kingdom"), # Spd - Lord Kinlar tweak
#(eq, "$g_talk_troop_faction", "fac_player_supporters_faction"), # Spd - Original Native code
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
],
"I want to make some change to our kingdom.", "change_kingdom_settings",[]],
[anyone,"change_kingdom_settings", [],
"Sure. What would you like to change?", "close_window",
[
(jump_to_menu, "mnu_change_kingdom_setting"),
(leave_encounter),
]],
#KINGDOM MANAGEMENT #
[anyone|plyr,"lord_give_order", [
(assign,":num_centers",0),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(party_get_slot, ":lord", ":center_no", slot_town_lord),
(eq,":lord","$g_talk_troop"),
(val_add,":num_centers",1),
(try_end),
(ge,":num_centers",1)],
"The kingdom is running low on resources. I must disband your army and temporarily retake direct control of your territory",
"remove_vassal_1",
[]],
[anyone,"remove_vassal_1",[],"This would force me to disband all my troops to their homes are you sure you want to do that?",
"remove_vassal_2",[]],
[anyone|plyr,"remove_vassal_2",[],"Oh in that case never mind.",
"lord_talk",[]],
[anyone|plyr,"remove_vassal_2",[],"Unfortunately yes, disband your troops and rejoin my main party.",
"lord_talk",[
(try_for_range, ":center_no", castles_begin, castles_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(party_get_slot, ":lord", ":center_no", slot_town_lord),
(eq,":lord","$g_talk_troop"),
(call_script, "script_give_center_to_lord", ":center_no", "trp_player", 0),
(try_end),
(troop_get_slot,":companion_army","$g_talk_troop",slot_troop_leaded_party),
(remove_party,":companion_army"),
(troop_set_slot,"$g_talk_troop",slot_troop_occupation, slto_player_companion),
(party_force_add_members,"p_main_party","$g_talk_troop",1)]],
# Spd - add option to view lord stats#New script goes just below the script above.
# for BPKM
[anyone|plyr,"lord_talk", [
(eq, "$g_talk_troop_faction", "$players_kingdom"), # Spd - Lord Kinlar tweak
#(eq, "$g_talk_troop_faction", "fac_player_supporters_faction"), # Spd - Original Native code
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_marshall, "trp_player"),
(is_between, "$g_talk_troop", kingdom_heroes_begin, kingdom_heroes_end),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
],
"I want to see your skills.", "companion_lord_view_stats",[]],
[anyone,"companion_lord_view_stats", [],
"Well, of course.", "lord_pretalk",
[
(change_screen_view_character),
]],
#KINGDOM MANAGEMENT END #
[anyone|plyr,"lord_give_order", [],##The second kingdom management goes just above this line. This Dialogue lets you disband a lord. Eventually I ###want to #have it automatically go to the troop transfer screen first so you can fill your part with as many of your companions troops as possible.
###
# Talk to any of your members with over 15 charisma.
#Kingdom Management
[anyone|plyr, "member_talk", [
# (eq, "$talk_array_no", -1),
(store_attribute_level,":companion_charisma","$g_talk_troop",3),
(ge,":companion_charisma",15),
(assign,":num_centers",0),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(party_get_slot, ":lord", ":center_no", slot_town_lord),
(eq,":lord","trp_player"),
(val_add,":num_centers",1),
(try_end),
(ge,":num_centers",1)],
"I have decided to promote you. You have shown enough leadership to be capable of managing your own Warband.",
"assign_fief_1",[
(troop_set_slot,"$g_talk_troop",slot_troop_change_to_faction,"fac_player_supporters_faction"),
(troop_set_slot,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
(troop_set_slot, "$g_talk_troop", slot_troop_wealth, 4000),###The higher you set this number the more troops will be in your companions army
(try_begin),
(store_skill_level,":companion_leadership",skl_leadership,"$g_talk_troop"),
(ge,":companion_leadership",,
(troop_set_slot, "$g_talk_troop", slot_troop_renown, 500),###
(troop_set_slot, "$g_talk_troop", slot_troop_wealth, 6000),###Really big army if your companion has a lot of leadership
(try_end),
(try_begin),
(troop_set_slot, "$g_talk_troop", slot_troop_original_faction,"fac_kingdom_6"),###I preset the player faction with unique troops
(faction_set_slot, "fac_player_supporters_faction", slot_faction_culture, "fac_kingdom_6"),
(try_end),
(party_remove_members,"p_main_party","$g_talk_troop",1),
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 40),
(troop_get_slot, ":player_banner", "trp_player", slot_troop_banner_scene_prop),#This assigns player kingdom lords your banner
(troop_set_slot, "$g_talk_troop", slot_troop_banner_scene_prop,":player_banner"),
]],
[anyone|plyr, "assign_fief_1", [
(assign,":num_centers",0),###All of this ensure that the player is lord of a castle he can give away.
(try_for_range, ":center_no", castles_begin, castles_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(party_get_slot, ":lord", ":center_no", slot_town_lord),
(eq,":lord","trp_player"),
(val_add,":num_centers",1),
(try_end),
(ge,":num_centers",1)],
"You are to become a vassal lord.",
"assign_fief_2",[]],
[anyone|plyr, "assign_fief_1", [
(assign,":num_centers",0),
(try_for_range, ":center_no", towns_begin, towns_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(party_get_slot, ":lord", ":center_no", slot_town_lord),
(eq,":lord","trp_player"),
(val_add,":num_centers",1),
(try_end),
(ge,":num_centers",1)],
"You might even become lord of a town if you can be trusted.",
"assign_fief_2",[]],
[anyone, "assign_fief_2", [],"I will not fail you {playername}. Should you need assistance on the battlefield call for me.","close_window",[
(jump_to_menu, "mnu_give_center_to_companion")]],
#Kingdom Management End
[anyone, "event_triggered",
[
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "$g_talk_troop"),
(neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),#Kingdom Management you don't want this coming up #for your kingdom
(ge, "$g_center_taken_by_player_faction", 0),
(str_store_party_name, s1, "$g_center_taken_by_player_faction"),
],
"{s1} is not being managed by anyone. Whom shall I put in charge?", "center_captured_lord_advice",
[]],
#Installation: you can add these right after BPKM dialog in module_dialogs.py. However, if you want this option to be listed above the "*Leave*" option, then seerch #for the phrase "TODO: QUESTS COMMENT OUT END". Add these new dialogs above/below the 4th match.
#Dialog:
# (click to show/hide)
# Spd - New dialog option for BPKM
# Spd - add option to change kingdom setting
[anyone|plyr,"lord_talk", [(eq, "$g_talk_troop_faction", "$players_kingdom"), # Spd - Lord Kinlar tweak
#(eq, "$g_talk_troop_faction", "fac_player_supporters_faction"), # Spd - Original Native code
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
],
"I want to make some change to our kingdom.", "change_kingdom_settings",[]],
[anyone,"change_kingdom_settings", [],
"Sure. What would you like to change?", "close_window",
[
(jump_to_menu, "mnu_change_kingdom_setting"),
(leave_encounter),
]],
#KINGDOM MANAGEMENT #
[anyone|plyr,"lord_give_order", [
(assign,":num_centers",0),
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(party_get_slot, ":lord", ":center_no", slot_town_lord),
(eq,":lord","$g_talk_troop"),
(val_add,":num_centers",1),
(try_end),
(ge,":num_centers",1)],
"The kingdom is running low on resources. I must disband your army and temporarily retake direct control of your territory",
"remove_vassal_1",
[]],
[anyone,"remove_vassal_1",[],"This would force me to disband all my troops to their homes are you sure you want to do that?",
"remove_vassal_2",[]],
[anyone|plyr,"remove_vassal_2",[],"Oh in that case never mind.",
"lord_talk",[]],
[anyone|plyr,"remove_vassal_2",[],"Unfortunately yes, disband your troops and rejoin my main party.",
"lord_talk",[
(try_for_range, ":center_no", castles_begin, castles_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(party_get_slot, ":lord", ":center_no", slot_town_lord),
(eq,":lord","$g_talk_troop"),
(call_script, "script_give_center_to_lord", ":center_no", "trp_player", 0),
(try_end),
(troop_get_slot,":companion_army","$g_talk_troop",slot_troop_leaded_party),
(remove_party,":companion_army"),
(troop_set_slot,"$g_talk_troop",slot_troop_occupation, slto_player_companion),
(party_force_add_members,"p_main_party","$g_talk_troop",1)]],
# Spd - add option to view lord stats#New script goes just below the script above.
# for BPKM
[anyone|plyr,"lord_talk", [
(eq, "$g_talk_troop_faction", "$players_kingdom"), # Spd - Lord Kinlar tweak
#(eq, "$g_talk_troop_faction", "fac_player_supporters_faction"), # Spd - Original Native code
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_marshall, "trp_player"),
(is_between, "$g_talk_troop", kingdom_heroes_begin, kingdom_heroes_end),
(neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
],
"I want to see your skills.", "companion_lord_view_stats",[]],
[anyone,"companion_lord_view_stats", [],
"Well, of course.", "lord_pretalk",
[
(change_screen_view_character),
]],
#KINGDOM MANAGEMENT END #
[anyone|plyr,"lord_give_order", [],##The second kingdom management goes just above this line. This Dialogue lets you disband a lord. Eventually I ###want to #have it automatically go to the troop transfer screen first so you can fill your part with as many of your companions troops as possible.
###
###This one line goes just after the very beginning of the first script game_start put it just before this line.###
(faction_set_slot, "fac_player_supporters_faction", slot_faction_state, sfs_inactive),####
(faction_set_slot, "fac_kingdom_6", slot_faction_state, sfs_inactive),###Kingdom Management if you don't add this line your rebel kingdom will show up in the list.
("activate_deactivate_player_faction",###Replace this script with this new one. or just sub in the lines between Kingdom Management or with ### #beside them
[
(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", "@Kingdom of {playername}"),######New name for the kingdom
(faction_set_color, "fac_player_supporters_faction", 0xFFAAAAAA),###set your colour I will eventually make this a menu choice Kingdom #Management
(assign, "$players_kingdom", "fac_player_supporters_faction"),
(assign, "$g_player_banner_granted", 1),
(faction_set_slot,"fac_player_supporters_faction", slot_faction_marshall,"trp_player"),###Kingdom Management make the player marshall #automatically.
(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),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_culture, "fac_culture_6"),#Kingdom Management Begin
(faction_set_slot, "fac_player_supporters_faction", slot_faction_deserter_troop, "trp_rebel_swordsman"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_guard_troop, "trp_rebel_protector"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_messenger_troop, "trp_rebel_light_cavalry"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_prison_guard_troop, "trp_rebel_guardian"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_castle_guard_troop, "trp_rebel_protector"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_reinforcements_a, "pt_kingdom_6_reinforcements_a"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_reinforcements_b, "pt_kingdom_6_reinforcements_b"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_reinforcements_c, "pt_kingdom_6_reinforcements_c"),
(try_end),
]),
######Kingdom Management End
("cf_get_random_active_faction_except_player_faction_and_faction",###Now when a faction is defeated the lords have a chance of joining you
[
(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"),#Kingdom Management just tab this line out now they can join player 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"),#Kingdom Management just tab this line out now they can join player 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_village_recruit_volunteers_recruit#Kingdom Management search for this script. Replace the existing with this. #NOW EDITTED CHANGE IT!!!!!!!!!
# INPUT: none
# OUTPUT: none
("village_recruit_volunteers_recruit",#KKM RECRUIT special from whichever faction you are.
[(store_faction_of_party, ":center_faction", "$current_town"),
(try_begin),
(eq,":center_faction","fac_player_supporters_faction"),
(assign,":volunteer_troop","trp_rebel_recruit"),#had to directly assign what volunteer troop would be. But it now works.
#(faction_get_slot, ":volunteer_troop", "fac_player_supporters_faction", slot_faction_tier_1_troop),
(else_try),
(party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type),
(try_end),
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(store_skill_level, ":skill", "skl_persuasion", "trp_player"),#persuasion addition
(val_add, ":volunteer_amount", ":skill"),#persuasion addition
(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"),
]),
#NEW SCRIPT PUT AT THE END OF module_scripts
# Spd - find next/previous center that belongs to player
# Originally design to find next/previous village ID, but can be used for other center type.
# Input: arg1 = starting center ID belongs to player
# Input: arg2 = ending center ID belongs to player
# Input: arg3 = propagation direction (1 = forward, 2 = backward)
# Output: reg40 = next/previous ID found
("cf_find_next_party_id",
[
(store_script_param, ":start_center", 1),
(store_script_param, ":end_center", 2),
(store_script_param, ":propagation", 3),
(store_add, ":start_center_plus_one", ":start_center", 1),
(store_add, ":end_center_plus_one", ":end_center", 1),
(assign, ":counter", 0),
(try_begin),
(eq, ":propagation", 1),
(try_for_range, ":cur_center", ":start_center_plus_one", ":end_center_plus_one"),
(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(val_add, ":counter", 1),
(try_begin),
(eq, ":counter", 1),
(assign, reg40, ":cur_center"),
(try_end),
(try_end),
(else_try),
(eq, ":propagation", 2),
(try_for_range_backwards, ":cur_center", ":start_center", ":end_center"),
(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(val_add, ":counter", 1),
(try_begin),
(eq, ":counter", 1),
(assign, reg40, ":cur_center"),
(try_end),
(try_end),
(try_end),
]),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_state, sfs_inactive),####
(faction_set_slot, "fac_kingdom_6", slot_faction_state, sfs_inactive),###Kingdom Management if you don't add this line your rebel kingdom will show up in the list.
("activate_deactivate_player_faction",###Replace this script with this new one. or just sub in the lines between Kingdom Management or with ### #beside them
[
(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", "@Kingdom of {playername}"),######New name for the kingdom
(faction_set_color, "fac_player_supporters_faction", 0xFFAAAAAA),###set your colour I will eventually make this a menu choice Kingdom #Management
(assign, "$players_kingdom", "fac_player_supporters_faction"),
(assign, "$g_player_banner_granted", 1),
(faction_set_slot,"fac_player_supporters_faction", slot_faction_marshall,"trp_player"),###Kingdom Management make the player marshall #automatically.
(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),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_culture, "fac_culture_6"),#Kingdom Management Begin
(faction_set_slot, "fac_player_supporters_faction", slot_faction_deserter_troop, "trp_rebel_swordsman"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_guard_troop, "trp_rebel_protector"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_messenger_troop, "trp_rebel_light_cavalry"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_prison_guard_troop, "trp_rebel_guardian"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_castle_guard_troop, "trp_rebel_protector"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_reinforcements_a, "pt_kingdom_6_reinforcements_a"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_reinforcements_b, "pt_kingdom_6_reinforcements_b"),
(faction_set_slot, "fac_player_supporters_faction", slot_faction_reinforcements_c, "pt_kingdom_6_reinforcements_c"),
(try_end),
]),
######Kingdom Management End
("cf_get_random_active_faction_except_player_faction_and_faction",###Now when a faction is defeated the lords have a chance of joining you
[
(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"),#Kingdom Management just tab this line out now they can join player 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"),#Kingdom Management just tab this line out now they can join player 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_village_recruit_volunteers_recruit#Kingdom Management search for this script. Replace the existing with this. #NOW EDITTED CHANGE IT!!!!!!!!!
# INPUT: none
# OUTPUT: none
("village_recruit_volunteers_recruit",#KKM RECRUIT special from whichever faction you are.
[(store_faction_of_party, ":center_faction", "$current_town"),
(try_begin),
(eq,":center_faction","fac_player_supporters_faction"),
(assign,":volunteer_troop","trp_rebel_recruit"),#had to directly assign what volunteer troop would be. But it now works.
#(faction_get_slot, ":volunteer_troop", "fac_player_supporters_faction", slot_faction_tier_1_troop),
(else_try),
(party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type),
(try_end),
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(store_skill_level, ":skill", "skl_persuasion", "trp_player"),#persuasion addition
(val_add, ":volunteer_amount", ":skill"),#persuasion addition
(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"),
]),
#NEW SCRIPT PUT AT THE END OF module_scripts
# Spd - find next/previous center that belongs to player
# Originally design to find next/previous village ID, but can be used for other center type.
# Input: arg1 = starting center ID belongs to player
# Input: arg2 = ending center ID belongs to player
# Input: arg3 = propagation direction (1 = forward, 2 = backward)
# Output: reg40 = next/previous ID found
("cf_find_next_party_id",
[
(store_script_param, ":start_center", 1),
(store_script_param, ":end_center", 2),
(store_script_param, ":propagation", 3),
(store_add, ":start_center_plus_one", ":start_center", 1),
(store_add, ":end_center_plus_one", ":end_center", 1),
(assign, ":counter", 0),
(try_begin),
(eq, ":propagation", 1),
(try_for_range, ":cur_center", ":start_center_plus_one", ":end_center_plus_one"),
(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(val_add, ":counter", 1),
(try_begin),
(eq, ":counter", 1),
(assign, reg40, ":cur_center"),
(try_end),
(try_end),
(else_try),
(eq, ":propagation", 2),
(try_for_range_backwards, ":cur_center", ":start_center", ":end_center"),
(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
(val_add, ":counter", 1),
(try_begin),
(eq, ":counter", 1),
(assign, reg40, ":cur_center"),
(try_end),
(try_end),
(try_end),
]),
(24*7,0,0,[(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_inactive)],#Disable all lords if your faction is wiped out. Kingdom #Management
[(try_for_range, ":companion", "trp_npc1","trp_kingdom_heroes_including_player_begin"),
(troop_slot_eq,":companion",slot_troop_occupation, slto_kingdom_hero),#Companion needs to be a lord
(troop_get_slot,":companion_army",":companion",slot_troop_leaded_party),
(remove_party,":companion_army"),
(troop_set_slot,":companion",slot_troop_occupation, slto_player_companion),
(party_force_add_members,"p_main_party",":companion",1),
(display_message,"@Your faction has been eliminated. Any surviving leaders have disbanded their troops and rejoined your party.",0xFFFFFFAA),
(try_end),
]),
(24*7,0,0,[(assign,":num_centers",0),#Disband Centreless lords every week.
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(val_add,":num_centers",1),
(try_end),
(assign,":num_lords",0),
(try_for_range,":lord","trp_npc1","trp_kingdom_heroes_including_player_begin"),#Need to put all potential companions in a range.
(troop_slot_eq, ":lord", slot_troop_occupation, slto_kingdom_hero),
(val_add,":num_lords",1),
(try_end),
(lt,":num_centers",":num_lords"),
(display_message,"@One of your centres has fallen. Within the week one of your commanders will be forced to disband their forces.")],
[(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"), #Only centers owned by player faction
(try_for_range, ":companion", "trp_npc1","trp_kingdom_heroes_including_player_begin"),
(troop_slot_eq,":companion",slot_troop_occupation, slto_kingdom_hero),#Companion needs to be a lord
(try_begin),
(neg|party_slot_eq,":center_no",slot_town_lord,":companion"),#Make him rejoin if he don't have a castle/town from the player faction
(troop_get_slot,":companion_army",":companion",slot_troop_leaded_party),
(remove_party,":companion_army"),
(troop_set_slot,":companion",slot_troop_occupation, slto_player_companion),
(party_force_add_members,"p_main_party",":companion",1),
(display_message,"@The loss of their base of operations has forced one of your armies to disband.",0xFFFFFFAA),
(try_end),
(try_end),
(try_end),
]),
[(try_for_range, ":companion", "trp_npc1","trp_kingdom_heroes_including_player_begin"),
(troop_slot_eq,":companion",slot_troop_occupation, slto_kingdom_hero),#Companion needs to be a lord
(troop_get_slot,":companion_army",":companion",slot_troop_leaded_party),
(remove_party,":companion_army"),
(troop_set_slot,":companion",slot_troop_occupation, slto_player_companion),
(party_force_add_members,"p_main_party",":companion",1),
(display_message,"@Your faction has been eliminated. Any surviving leaders have disbanded their troops and rejoined your party.",0xFFFFFFAA),
(try_end),
]),
(24*7,0,0,[(assign,":num_centers",0),#Disband Centreless lords every week.
(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"),
(val_add,":num_centers",1),
(try_end),
(assign,":num_lords",0),
(try_for_range,":lord","trp_npc1","trp_kingdom_heroes_including_player_begin"),#Need to put all potential companions in a range.
(troop_slot_eq, ":lord", slot_troop_occupation, slto_kingdom_hero),
(val_add,":num_lords",1),
(try_end),
(lt,":num_centers",":num_lords"),
(display_message,"@One of your centres has fallen. Within the week one of your commanders will be forced to disband their forces.")],
[(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
(store_faction_of_party, ":center_faction", ":center_no"),
(eq, ":center_faction", "fac_player_supporters_faction"), #Only centers owned by player faction
(try_for_range, ":companion", "trp_npc1","trp_kingdom_heroes_including_player_begin"),
(troop_slot_eq,":companion",slot_troop_occupation, slto_kingdom_hero),#Companion needs to be a lord
(try_begin),
(neg|party_slot_eq,":center_no",slot_town_lord,":companion"),#Make him rejoin if he don't have a castle/town from the player faction
(troop_get_slot,":companion_army",":companion",slot_troop_leaded_party),
(remove_party,":companion_army"),
(troop_set_slot,":companion",slot_troop_occupation, slto_player_companion),
(party_force_add_members,"p_main_party",":companion",1),
(display_message,"@The loss of their base of operations has forced one of your armies to disband.",0xFFFFFFAA),
(try_end),
(try_end),
(try_end),
]),
# Asking the ownership of captured centers to the player
(3,
[(faction_get_slot, ":leader", "fac_player_supporters_faction", slot_faction_leader),#KINGDOM MANAGEMENT
(neq,":leader","trp_player"),#KINGDOM MANAGEMENT if you don't add these two lines random useless claimant conversations start with yourself
(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),
(start_map_conversation, ":leader"),
]),
(24*90,[#Every three months a massive campaign begins.
(try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end),##All this trigger does is make lords more likely to form armies
(troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_kingdom_hero), ##It also makes yours more obedient.
(troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_join_army, 90),##I will eventually make a feast event that costs you money but
(troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_follow_orders, 100),##Does this for just your lords
(try_end),
(display_message,"@A time of war is upon you. The lords have mobilized their forces!",0xFFFFFFAA),
]),
#Set flag trigger
(24,[##Updates your lords flags should you happen to change yours
(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"),
(troop_get_slot,":player_banner","trp_player",slot_troop_banner_scene_prop),
(troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":player_banner"),
(try_end),
]),
(3,
[(faction_get_slot, ":leader", "fac_player_supporters_faction", slot_faction_leader),#KINGDOM MANAGEMENT
(neq,":leader","trp_player"),#KINGDOM MANAGEMENT if you don't add these two lines random useless claimant conversations start with yourself
(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),
(start_map_conversation, ":leader"),
]),
(24*90,[#Every three months a massive campaign begins.
(try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end),##All this trigger does is make lords more likely to form armies
(troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_kingdom_hero), ##It also makes yours more obedient.
(troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_join_army, 90),##I will eventually make a feast event that costs you money but
(troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_follow_orders, 100),##Does this for just your lords
(try_end),
(display_message,"@A time of war is upon you. The lords have mobilized their forces!",0xFFFFFFAA),
]),
#Set flag trigger
(24,[##Updates your lords flags should you happen to change yours
(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"),
(troop_get_slot,":player_banner","trp_player",slot_troop_banner_scene_prop),
(troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":player_banner"),
(try_end),
]),
#Put these troops right after the last rhodok troop (rhodok_castle_guard)
["rebel_recruit","Recruit","Recruit",tf_guarantee_boots|tf_guarantee_armor,0, reserved, fac_commoners,[
itm_shirt,itm_steppe_armor,itm_robe,itm_nomad_boots,itm_leather_boots,itm_ankle_boots,itm_sword_medieval_a,
itm_sword_khergit_1,itm_spear,itm_fighting_axe,itm_sumpter_horse],
str_9|agi_6|int_4|cha_4|level(5),wp(70),knows_weapon_master_3|knows_power_strike_1|knows_athletics_2|knows_riding_1|
knows_tactics_1,
mercenary_face_1, mercenary_face_2],
#######2
["rebel_footman","Greenhorn","Greenhorns",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws,
[itm_one_handed_war_axe_a,itm_one_handed_battle_axe_b,itm_tab_shield_round_a,
itm_studded_leather_coat,itm_ragged_outfit,itm_leather_boots],
def_attrib|level(7),wp(90),knows_ironflesh_2|knows_power_strike_2|knows_power_throw_2|knows_riding_2|knows_athletics_4,nord_face_young_1, nord_face_old_2],
["rebel_militia","Militia","Militia",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral,
[itm_bolts,itm_light_crossbow,itm_hunting_crossbow,itm_axe,itm_sword_medieval_a,
itm_shirt,itm_leather_armor,itm_hide_boots,itm_ankle_boots,itm_kettle_hat],
def_attrib|level(19),wp_melee(80)|wp_crossbow(100),knows_common|knows_ironflesh_3,swadian_face_young_1, swadian_face_old_2],
########3
["rebel_swordsman","Swordsman","Swordsmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_neutral,
[itm_bastard_sword_a,itm_sword_medieval_c,itm_sword_medieval_a,itm_tab_shield_heater_b,
itm_red_gambeson,itm_blue_gambeson,itm_ankle_boots,itm_footman_helmet],
def_attrib|level(14),wp_melee(100),knows_common|knows_ironflesh_2|knows_power_strike_4|knows_athletics_5,swadian_face_young_1, swadian_face_old_2],
["rebel_light_cavalry","Light Cavalry","Light Cavalry",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_ranged|tf_guarantee_horse,0,0,fac_khergits,
[itm_javelin,itm_javelin,itm_sword_khergit_1,itm_sword_khergit_2,
itm_steppe_armor,itm_hide_boots,itm_steppe_horse],
def_attrib|level(14),wp(80)|wp_throwing(200),knows_riding_3|knows_ironflesh_2|knows_power_strike_2|knows_horse_archery_4|knows_power_throw_6,khergit_face_young_1, khergit_face_older_2],
["rebel_crossbowman","Crossbowman","Crossbowmen",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_neutral,
[itm_bolts,itm_crossbow,itm_fighting_pick,itm_sword_medieval_a,itm_tab_shield_heater_b,
itm_gambeson,itm_hide_boots,itm_ankle_boots,itm_kettle_hat],
def_attrib|level(19),wp_melee(100)|wp_crossbow(150),knows_common|knows_ironflesh_3,swadian_face_young_1, swadian_face_old_2],
["rebel_javelineer","Javelineer","Javelineers",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_ranged|tf_guarantee_shield,0,0,fac_khergits,
[itm_jarid,itm_jarid,itm_jarid,itm_sword_khergit_1,itm_sword_khergit_4,
itm_nomad_robe,itm_hide_boots],
def_attrib|level(14),wp(100)|wp_throwing(200),knows_riding_3|knows_ironflesh_2|knows_power_throw_6,khergit_face_young_1, khergit_face_older_2],
#######4
["rebel_protector","Protector","Protectors",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws,
[itm_military_hammer,itm_tab_shield_pavise_d,itm_jarid,itm_javelin,
itm_guard_helmet,itm_plate_armor,itm_iron_greaves,itm_gauntlets],
def_attrib|level(2,wp(80),knows_ironflesh_3|knows_power_strike_3|knows_power_throw_5|knows_athletics_2,nord_face_middle_1, nord_face_older_2],
["rebel_spearman","Quick Spearman","Quick Spearmen",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_pike,itm_tab_shield_heater_c,
itm_surcoat_over_mail,itm_hide_boots,itm_ankle_boots,itm_helmet_with_neckguard],
def_attrib|level(20),wp_melee(150),knows_common|knows_riding_3|knows_ironflesh_4|knows_power_strike_3|knows_athletics_4,swadian_face_middle_1, swadian_face_old_2],
["rebel_cavalry","War Hobilar","War Hobilars",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse,0,0,fac_neutral,
[itm_battle_axe,itm_sword_viking_2,itm_sword_khergit_4,itm_tab_shield_kite_c,
itm_mail_hauberk,itm_nomad_boots,itm_spiked_helmet,itm_hunter],
def_attrib|level(19),wp_melee(130),knows_ironflesh_4|knows_power_strike_4|knows_riding_1,vaegir_face_young_1, vaegir_face_older_2],
["rebel_raider","Raider","Raiders",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_khergits,
[itm_sword_khergit_4,itm_lance,itm_lance,itm_jarid,
itm_khergit_cavalry_helmet,itm_khergit_guard_boots,itm_leather_gloves,itm_steppe_horse],
def_attrib|level(1,wp(140),knows_riding_6|knows_power_strike_4|knows_power_throw_4|knows_ironflesh_3|knows_horse_archery_3,khergit_face_middle_1, khergit_face_older_2],
["rebel_armbruster","Armbruster","Armbrusters",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_ranged|tf_guarantee_helmet,0, reserved, fac_commoners,[itm_studded_leather_coat,
itm_mail_chausses,itm_iron_staff,itm_military_pick,itm_steel_shield,itm_guard_helmet,itm_skullcap,itm_mail_coif,itm_heavy_crossbow,itm_steel_bolts],
str_20|agi_20|int_20|cha_15|level(20),wp(100)|wp_crossbow(130),knows_weapon_master_3|knows_power_strike_3|knows_athletics_4|knows_riding_1|
knows_tactics_1|knows_ironflesh_3,
mercenary_face_1,mercenary_face_2],
["rebel_archer","Veteran Archer","Veteran Archers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_ranged,0,0,fac_khergits,
[itm_arrows,itm_sword_medieval_c,itm_strong_bow,itm_tab_shield_round_b,
itm_footman_helmet,itm_footman_helmet,itm_khergit_guard_armor,itm_mail_chausses],
def_attrib|level(15),wp(110)|wp_archery(150)|wp_throwing(80),knows_power_draw_3|knows_power_strike_4,khergit_face_younger_1, khergit_face_old_2],
["rebel_initiate","Clan Initiate","Clan Initiates",tf_mounted|tf_guarantee_armor,0,0,fac_khergits,
[itm_jarid,itm_rabati,itm_nomad_robe],
str_20|agi_30|int_30|cha_10|level(14),wp(150)|wp_throwing(200),knows_power_throw_5|knows_athletics_7|knows_power_strike_5,khergit_face_younger_1, khergit_face_old_2],
#######5
["rebel_guardian","Guardian","Guardians",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws,
[itm_polehammer,itm_jarid,itm_jarid,
itm_great_helmet,itm_plate_armor,itm_iron_greaves,itm_gauntlets],
def_attrib|level(25),wp(70),knows_ironflesh_10|knows_power_strike_8|knows_power_throw_5,nord_face_middle_1, nord_face_older_2],
["rebel_lancer","Heavy Lancer","Heavy Lancers",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_pike,itm_poleaxe,itm_tab_shield_kite_d,
itm_surcoat_over_mail,itm_hide_boots,itm_ankle_boots,itm_kettle_hat],
def_attrib|level(23),wp_melee(200),knows_common|knows_riding_3|knows_ironflesh_10|knows_power_strike_5|knows_athletics_4,swadian_face_middle_1, swadian_face_old_2],
["rebel_knight","Assault Knight","Assault Knights",tf_mounted|tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse,0,0,fac_neutral,
[itm_great_axe,itm_heavy_lance,itm_great_bardiche,
itm_banded_armor,itm_mail_chausses,itm_spiked_helmet,itm_warhorse,itm_charger],
def_attrib|level(23),wp_melee(140),knows_athletics_2|knows_ironflesh_4|knows_power_strike_4|knows_riding_7,vaegir_face_young_1, vaegir_face_older_2],
["rebel_handgonnemann","Mounted Crossbowman","Mounted Crossbowman",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_ranged|tf_guarantee_helmet|tf_guarantee_horse|tf_mounted,0, reserved, fac_commoners,[ itm_surcoat_over_mail,itm_mail_chausses,itm_battle_axe,itm_bastard_sword_b,itm_steel_shield,itm_guard_helmet,itm_skullcap,itm_mail_coif,itm_light_crossbow,
itm_steel_bolts,itm_warhorse],
def_attrib|level(23),wp(80)|wp_crossbow(300),knows_weapon_master_3|knows_power_strike_5|knows_athletics_4|knows_riding_1|
knows_tactics_1|knows_ironflesh_5|knows_horse_archery_6,
mercenary_face_1,mercenary_face_2],
["rebel_sniper","Ambusher","Ambushers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_ranged,0,0,fac_khergits,
[itm_arrows,itm_scimitar,itm_war_bow,itm_tab_shield_round_d,
itm_spiked_helmet,itm_studded_leather_coat,itm_tribal_warrior_outfit,itm_mail_chausses],
def_attrib|level(21),wp(110)|wp_archery(170)|wp_throwing(80),knows_power_draw_5|knows_power_strike_5,khergit_face_younger_1, khergit_face_old_2],
["rebel_clansman","Khergit Assassin","Khergit Assassins",tf_guarantee_shield|tf_guarantee_helmet,0, reserved, fac_commoners,[
itm_war_bow,itm_khergit_arrows,itm_jarid,itm_throwing_axes,itm_glaive,itm_tab_shield_round_e,itm_sword_khergit_4,itm_khergit_guard_helmet],
str_30|agi_30|int_20|cha_15|level(25),wp(300)|wp_throwing(300),knows_weapon_master_3|knows_power_strike_10|knows_athletics_10|knows_riding_1|
knows_tactics_1|knows_ironflesh_10|knows_power_throw_10|knows_surgery_10|knows_power_draw_8,
khergit_face_young_1,khergit_face_young_2],
###Put these upgrade lines at the bottom of the file after the others upgrade lines
upgrade2(troops,"rebel_recruit","rebel_footman","rebel_militia")
upgrade2(troops,"rebel_footman","rebel_light_cavalry","rebel_swordsman")
upgrade2(troops,"rebel_militia","rebel_javelineer","rebel_crossbowman")
upgrade2(troops,"rebel_swordsman","rebel_protector","rebel_spearman")
upgrade2(troops,"rebel_crossbowman","rebel_armbruster","rebel_archer")
upgrade(troops,"rebel_javelineer","rebel_initiate")
upgrade2(troops,"rebel_light_cavalry","rebel_cavalry","rebel_raider")
upgrade(troops,"rebel_protector","rebel_guardian")
upgrade(troops,"rebel_spearman","rebel_lancer")
upgrade(troops,"rebel_armbruster","rebel_handgonnemann")
upgrade(troops,"rebel_archer","rebel_sniper")
upgrade(troops,"rebel_cavalry","rebel_knight")
upgrade(troops,"rebel_initiate","rebel_clansman")
["rebel_recruit","Recruit","Recruit",tf_guarantee_boots|tf_guarantee_armor,0, reserved, fac_commoners,[
itm_shirt,itm_steppe_armor,itm_robe,itm_nomad_boots,itm_leather_boots,itm_ankle_boots,itm_sword_medieval_a,
itm_sword_khergit_1,itm_spear,itm_fighting_axe,itm_sumpter_horse],
str_9|agi_6|int_4|cha_4|level(5),wp(70),knows_weapon_master_3|knows_power_strike_1|knows_athletics_2|knows_riding_1|
knows_tactics_1,
mercenary_face_1, mercenary_face_2],
#######2
["rebel_footman","Greenhorn","Greenhorns",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws,
[itm_one_handed_war_axe_a,itm_one_handed_battle_axe_b,itm_tab_shield_round_a,
itm_studded_leather_coat,itm_ragged_outfit,itm_leather_boots],
def_attrib|level(7),wp(90),knows_ironflesh_2|knows_power_strike_2|knows_power_throw_2|knows_riding_2|knows_athletics_4,nord_face_young_1, nord_face_old_2],
["rebel_militia","Militia","Militia",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral,
[itm_bolts,itm_light_crossbow,itm_hunting_crossbow,itm_axe,itm_sword_medieval_a,
itm_shirt,itm_leather_armor,itm_hide_boots,itm_ankle_boots,itm_kettle_hat],
def_attrib|level(19),wp_melee(80)|wp_crossbow(100),knows_common|knows_ironflesh_3,swadian_face_young_1, swadian_face_old_2],
########3
["rebel_swordsman","Swordsman","Swordsmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_neutral,
[itm_bastard_sword_a,itm_sword_medieval_c,itm_sword_medieval_a,itm_tab_shield_heater_b,
itm_red_gambeson,itm_blue_gambeson,itm_ankle_boots,itm_footman_helmet],
def_attrib|level(14),wp_melee(100),knows_common|knows_ironflesh_2|knows_power_strike_4|knows_athletics_5,swadian_face_young_1, swadian_face_old_2],
["rebel_light_cavalry","Light Cavalry","Light Cavalry",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_ranged|tf_guarantee_horse,0,0,fac_khergits,
[itm_javelin,itm_javelin,itm_sword_khergit_1,itm_sword_khergit_2,
itm_steppe_armor,itm_hide_boots,itm_steppe_horse],
def_attrib|level(14),wp(80)|wp_throwing(200),knows_riding_3|knows_ironflesh_2|knows_power_strike_2|knows_horse_archery_4|knows_power_throw_6,khergit_face_young_1, khergit_face_older_2],
["rebel_crossbowman","Crossbowman","Crossbowmen",tf_guarantee_ranged|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_neutral,
[itm_bolts,itm_crossbow,itm_fighting_pick,itm_sword_medieval_a,itm_tab_shield_heater_b,
itm_gambeson,itm_hide_boots,itm_ankle_boots,itm_kettle_hat],
def_attrib|level(19),wp_melee(100)|wp_crossbow(150),knows_common|knows_ironflesh_3,swadian_face_young_1, swadian_face_old_2],
["rebel_javelineer","Javelineer","Javelineers",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_ranged|tf_guarantee_shield,0,0,fac_khergits,
[itm_jarid,itm_jarid,itm_jarid,itm_sword_khergit_1,itm_sword_khergit_4,
itm_nomad_robe,itm_hide_boots],
def_attrib|level(14),wp(100)|wp_throwing(200),knows_riding_3|knows_ironflesh_2|knows_power_throw_6,khergit_face_young_1, khergit_face_older_2],
#######4
["rebel_protector","Protector","Protectors",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws,
[itm_military_hammer,itm_tab_shield_pavise_d,itm_jarid,itm_javelin,
itm_guard_helmet,itm_plate_armor,itm_iron_greaves,itm_gauntlets],
def_attrib|level(2,wp(80),knows_ironflesh_3|knows_power_strike_3|knows_power_throw_5|knows_athletics_2,nord_face_middle_1, nord_face_older_2],
["rebel_spearman","Quick Spearman","Quick Spearmen",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_pike,itm_tab_shield_heater_c,
itm_surcoat_over_mail,itm_hide_boots,itm_ankle_boots,itm_helmet_with_neckguard],
def_attrib|level(20),wp_melee(150),knows_common|knows_riding_3|knows_ironflesh_4|knows_power_strike_3|knows_athletics_4,swadian_face_middle_1, swadian_face_old_2],
["rebel_cavalry","War Hobilar","War Hobilars",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse,0,0,fac_neutral,
[itm_battle_axe,itm_sword_viking_2,itm_sword_khergit_4,itm_tab_shield_kite_c,
itm_mail_hauberk,itm_nomad_boots,itm_spiked_helmet,itm_hunter],
def_attrib|level(19),wp_melee(130),knows_ironflesh_4|knows_power_strike_4|knows_riding_1,vaegir_face_young_1, vaegir_face_older_2],
["rebel_raider","Raider","Raiders",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse|tf_guarantee_shield,0,0,fac_khergits,
[itm_sword_khergit_4,itm_lance,itm_lance,itm_jarid,
itm_khergit_cavalry_helmet,itm_khergit_guard_boots,itm_leather_gloves,itm_steppe_horse],
def_attrib|level(1,wp(140),knows_riding_6|knows_power_strike_4|knows_power_throw_4|knows_ironflesh_3|knows_horse_archery_3,khergit_face_middle_1, khergit_face_older_2],
["rebel_armbruster","Armbruster","Armbrusters",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_ranged|tf_guarantee_helmet,0, reserved, fac_commoners,[itm_studded_leather_coat,
itm_mail_chausses,itm_iron_staff,itm_military_pick,itm_steel_shield,itm_guard_helmet,itm_skullcap,itm_mail_coif,itm_heavy_crossbow,itm_steel_bolts],
str_20|agi_20|int_20|cha_15|level(20),wp(100)|wp_crossbow(130),knows_weapon_master_3|knows_power_strike_3|knows_athletics_4|knows_riding_1|
knows_tactics_1|knows_ironflesh_3,
mercenary_face_1,mercenary_face_2],
["rebel_archer","Veteran Archer","Veteran Archers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_ranged,0,0,fac_khergits,
[itm_arrows,itm_sword_medieval_c,itm_strong_bow,itm_tab_shield_round_b,
itm_footman_helmet,itm_footman_helmet,itm_khergit_guard_armor,itm_mail_chausses],
def_attrib|level(15),wp(110)|wp_archery(150)|wp_throwing(80),knows_power_draw_3|knows_power_strike_4,khergit_face_younger_1, khergit_face_old_2],
["rebel_initiate","Clan Initiate","Clan Initiates",tf_mounted|tf_guarantee_armor,0,0,fac_khergits,
[itm_jarid,itm_rabati,itm_nomad_robe],
str_20|agi_30|int_30|cha_10|level(14),wp(150)|wp_throwing(200),knows_power_throw_5|knows_athletics_7|knows_power_strike_5,khergit_face_younger_1, khergit_face_old_2],
#######5
["rebel_guardian","Guardian","Guardians",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_outlaws,
[itm_polehammer,itm_jarid,itm_jarid,
itm_great_helmet,itm_plate_armor,itm_iron_greaves,itm_gauntlets],
def_attrib|level(25),wp(70),knows_ironflesh_10|knows_power_strike_8|knows_power_throw_5,nord_face_middle_1, nord_face_older_2],
["rebel_lancer","Heavy Lancer","Heavy Lancers",tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet,0,0,fac_neutral,
[itm_pike,itm_poleaxe,itm_tab_shield_kite_d,
itm_surcoat_over_mail,itm_hide_boots,itm_ankle_boots,itm_kettle_hat],
def_attrib|level(23),wp_melee(200),knows_common|knows_riding_3|knows_ironflesh_10|knows_power_strike_5|knows_athletics_4,swadian_face_middle_1, swadian_face_old_2],
["rebel_knight","Assault Knight","Assault Knights",tf_mounted|tf_guarantee_shield|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse,0,0,fac_neutral,
[itm_great_axe,itm_heavy_lance,itm_great_bardiche,
itm_banded_armor,itm_mail_chausses,itm_spiked_helmet,itm_warhorse,itm_charger],
def_attrib|level(23),wp_melee(140),knows_athletics_2|knows_ironflesh_4|knows_power_strike_4|knows_riding_7,vaegir_face_young_1, vaegir_face_older_2],
["rebel_handgonnemann","Mounted Crossbowman","Mounted Crossbowman",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_ranged|tf_guarantee_helmet|tf_guarantee_horse|tf_mounted,0, reserved, fac_commoners,[ itm_surcoat_over_mail,itm_mail_chausses,itm_battle_axe,itm_bastard_sword_b,itm_steel_shield,itm_guard_helmet,itm_skullcap,itm_mail_coif,itm_light_crossbow,
itm_steel_bolts,itm_warhorse],
def_attrib|level(23),wp(80)|wp_crossbow(300),knows_weapon_master_3|knows_power_strike_5|knows_athletics_4|knows_riding_1|
knows_tactics_1|knows_ironflesh_5|knows_horse_archery_6,
mercenary_face_1,mercenary_face_2],
["rebel_sniper","Ambusher","Ambushers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_ranged,0,0,fac_khergits,
[itm_arrows,itm_scimitar,itm_war_bow,itm_tab_shield_round_d,
itm_spiked_helmet,itm_studded_leather_coat,itm_tribal_warrior_outfit,itm_mail_chausses],
def_attrib|level(21),wp(110)|wp_archery(170)|wp_throwing(80),knows_power_draw_5|knows_power_strike_5,khergit_face_younger_1, khergit_face_old_2],
["rebel_clansman","Khergit Assassin","Khergit Assassins",tf_guarantee_shield|tf_guarantee_helmet,0, reserved, fac_commoners,[
itm_war_bow,itm_khergit_arrows,itm_jarid,itm_throwing_axes,itm_glaive,itm_tab_shield_round_e,itm_sword_khergit_4,itm_khergit_guard_helmet],
str_30|agi_30|int_20|cha_15|level(25),wp(300)|wp_throwing(300),knows_weapon_master_3|knows_power_strike_10|knows_athletics_10|knows_riding_1|
knows_tactics_1|knows_ironflesh_10|knows_power_throw_10|knows_surgery_10|knows_power_draw_8,
khergit_face_young_1,khergit_face_young_2],
###Put these upgrade lines at the bottom of the file after the others upgrade lines
upgrade2(troops,"rebel_recruit","rebel_footman","rebel_militia")
upgrade2(troops,"rebel_footman","rebel_light_cavalry","rebel_swordsman")
upgrade2(troops,"rebel_militia","rebel_javelineer","rebel_crossbowman")
upgrade2(troops,"rebel_swordsman","rebel_protector","rebel_spearman")
upgrade2(troops,"rebel_crossbowman","rebel_armbruster","rebel_archer")
upgrade(troops,"rebel_javelineer","rebel_initiate")
upgrade2(troops,"rebel_light_cavalry","rebel_cavalry","rebel_raider")
upgrade(troops,"rebel_protector","rebel_guardian")
upgrade(troops,"rebel_spearman","rebel_lancer")
upgrade(troops,"rebel_armbruster","rebel_handgonnemann")
upgrade(troops,"rebel_archer","rebel_sniper")
upgrade(troops,"rebel_cavalry","rebel_knight")
upgrade(troops,"rebel_initiate","rebel_clansman")
("culture_6", "culture_6", 0, 0.9, [], []),#put after culture_5
("kingdom_6", "Rebel Kingdom", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xFFFFFFFF),###put after kingdom_5
("kingdom_6", "Rebel Kingdom", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xFFFFFFFF),###put after kingdom_5
###put this after kingdom_5_reinforcements
("kingdom_6_reinforcements_a", "kingdom_6_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_rebel_light_cavalry,4,7),(trp_rebel_militia,4,7),(trp_rebel_swordsman,4,7),(trp_rebel_crossbowman,4,7),(trp_rebel_javelineer,4,7)]),
("kingdom_6_reinforcements_b", "kingdom_6_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_rebel_initiate,4,7),(trp_rebel_protector,3,7),(trp_rebel_cavalry,4,7),(trp_rebel_armbruster,4,7),(trp_rebel_archer,4,7),(trp_rebel_raider,4,7)]),
("kingdom_6_reinforcements_c", "kingdom_6_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_rebel_guardian,4,5),(trp_rebel_lancer,4,5),(trp_rebel_knight,4,5),(trp_rebel_handgonnemann,4,5),(trp_rebel_clansman,4,7)]),
("kingdom_6_reinforcements_a", "kingdom_6_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_rebel_light_cavalry,4,7),(trp_rebel_militia,4,7),(trp_rebel_swordsman,4,7),(trp_rebel_crossbowman,4,7),(trp_rebel_javelineer,4,7)]),
("kingdom_6_reinforcements_b", "kingdom_6_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_rebel_initiate,4,7),(trp_rebel_protector,3,7),(trp_rebel_cavalry,4,7),(trp_rebel_armbruster,4,7),(trp_rebel_archer,4,7),(trp_rebel_raider,4,7)]),
("kingdom_6_reinforcements_c", "kingdom_6_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_rebel_guardian,4,5),(trp_rebel_lancer,4,5),(trp_rebel_knight,4,5),(trp_rebel_handgonnemann,4,5),(trp_rebel_clansman,4,7)]),
Credit must go to SPD_Phoenix, Ruthven, Cruger for assistance
and Highlander and Wicketshot for making their code open source so I could edit it.
The module system download is two posts below as well.