Skip to content

Commit

Permalink
*Add Horse Archer AI Horse Archery limit + fixes to Defend Refugee Qu…
Browse files Browse the repository at this point in the history
…est + Extend Scout Camp & Defend/Raid village quests

- Horse Archery has to be = or > to 4 for HA AI to work.
- Changed some troops to have horse archer 4 due to the above change (Some Rhun, Rohan, and Gundabad troops).
  • Loading branch information
khamukkamu committed Nov 9, 2017
1 parent 4372729 commit e191a69
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 56 deletions.
5 changes: 5 additions & 0 deletions ModuleSystem/module_mission_templates_TLD_wb.py
Expand Up @@ -1306,6 +1306,11 @@
(agent_is_alive, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_is_non_player, ":agent_no"),

(agent_get_troop_id, ":troop_id", ":agent_no"),
(store_skill_level, ":horse_archery_level", "skl_horse_archery", ":troop_id"),
(ge, ":horse_archery_level", 4),

(neg|agent_slot_eq, ":agent_no", 1003, 1),
(agent_get_horse, ":horse_no", ":agent_no"),
(assign, ":melee_weapon", -1),
Expand Down
38 changes: 25 additions & 13 deletions ModuleSystem/module_scripts.py
Expand Up @@ -6140,7 +6140,7 @@ def set_item_score():
(this_or_next|neq, ":giver_faction_no", "fac_woodelf"), #Woodelves don't help villagers
(neq, ":giver_faction_no", "fac_lorien"), #No villages near Lorien
(ge, "$g_talk_troop_faction_relation", 2),
(is_between, ":player_level", 3,16),
(is_between, ":player_level", 3,21),
(gt, ":giver_center_no", 0),#Skip if lord is outside the center
(assign, ":cur_object_center", ":giver_center_no"), #TLD: just start from the same town
(call_script, "script_cf_get_random_enemy_center_within_range", "p_main_party", tld_max_quest_distance),
Expand Down Expand Up @@ -6168,7 +6168,7 @@ def set_item_score():
(neg|check_quest_active,"qst_raid_village"),
(neg|faction_slot_eq, ":giver_faction_no", slot_faction_side, faction_side_good),
(ge, "$g_talk_troop_faction_relation", 2),
(is_between, ":player_level", 3,16),
(is_between, ":player_level", 3,21),
(gt, ":giver_center_no", 0),#Skip if lord is outside the center
(assign, ":cur_object_center", ":giver_center_no"), #TLD: just start from the same town
##Kham - lets force the faction
Expand Down Expand Up @@ -6270,7 +6270,7 @@ def set_item_score():
(neg|check_quest_active,"qst_destroy_scout_camp"),
(eq, "$tld_war_began", 1),
(ge, "$g_talk_troop_faction_relation", 1),
(is_between, ":player_level", 11,26),
(is_between, ":player_level", 11,31),
#(faction_get_slot, ":faction_side", ":giver_faction_no", slot_faction_side),
#(call_script, "script_force_faction_center_by_region", ":giver_party_no", ":faction_side"),
(call_script,"script_cf_get_random_enemy_center_in_theater",":giver_party_no"), # Gets a enemy center in the current theater
Expand All @@ -6288,6 +6288,12 @@ def set_item_score():
(assign, ":quest_xp_reward", 450),
(assign, ":quest_gold_reward", 700),
(assign, ":quest_rank_reward", 20),
(else_try),
(ge, ":player_level", 26), #levels 26 and greater
(assign, ":quest_target_party_template", "pt_scout_camp_large"),
(assign, ":quest_xp_reward", 500),
(assign, ":quest_gold_reward", 750),
(assign, ":quest_rank_reward", 26),
(try_end),
(call_script,"script_cf_spawn_around_party_on_walkable_terrain",":giver_party_no",":quest_target_party_template",15),
(assign,"$qst_destroy_scout_camp_party",reg0),
Expand Down Expand Up @@ -22861,7 +22867,7 @@ def set_item_score():
(this_or_next|neq, "$g_talk_troop_faction", "fac_lorien"), #Elves don't care about the refugees
( neq, "$g_talk_troop_faction", "fac_woodelf"), #Elves don't care about the refugees
(store_character_level, ":player_level", "trp_player"),
(is_between, ":player_level", 8, 21),
(is_between, ":player_level", 12, 21),
(assign, ":giver_center_no", -1),
(troop_get_slot, ":giver_party_no", "$g_talk_troop", slot_troop_leaded_party),
(try_begin),
Expand All @@ -22882,7 +22888,10 @@ def set_item_score():
(this_or_next|eq, ":center_faction", "fac_lorien"),
(this_or_next|eq, ":center_faction", "fac_woodelf"),
( eq, ":center_faction", "fac_imladris"),
(assign, ":cur_target_center", "p_town_woodsmen_village"),
(try_for_range, ":beorn_center", "p_town_woodsmen_village", "p_town_moria"),
(party_slot_eq, ":beorn_center", slot_center_destroyed, 0),
(assign, ":cur_target_center", ":beorn_center"),
(try_end),
(try_end),
(call_script, "script_get_tld_distance", "p_main_party", ":cur_target_center"),
(ge, reg0, 10),
Expand Down Expand Up @@ -22977,7 +22986,7 @@ def set_item_score():
(party_add_template, "$qst_raider_party_1", ":raiders"),
(party_add_template, "$qst_raider_party_1", ":raiders"),
(try_begin),
(is_between, ":level", 12,17),
(is_between, ":level", 14,17),
(party_add_template, "$qst_raider_party_1", ":raiders"),
(else_try),
(ge, ":level", 17),
Expand All @@ -22996,7 +23005,7 @@ def set_item_score():
(party_add_template, "$qst_raider_party_2", ":raiders"),
(party_add_template, "$qst_raider_party_2", ":raiders"),
(try_begin),
(is_between, ":level", 12,17),
(is_between, ":level", 14,17),
(party_add_template, "$qst_raider_party_2", ":raiders"),
(else_try),
(ge, ":level", 17),
Expand All @@ -23015,7 +23024,7 @@ def set_item_score():
(party_add_template, "$qst_raider_party_3", ":raiders"),
(party_add_template, "$qst_raider_party_3", ":raiders"),
(try_begin),
(is_between, ":level", 12,17),
(is_between, ":level", 14,17),
(party_add_template, "$qst_raider_party_3", ":raiders"),
(else_try),
(ge, ":level", 17),
Expand All @@ -23040,7 +23049,7 @@ def set_item_score():
(neq, ":side", faction_side_good),
(ge, "$g_talk_troop_faction_relation", 0),
(store_character_level, ":player_level", "trp_player"),
(is_between, ":player_level", 8, 21),
(is_between, ":player_level", 12, 21),
(assign, ":giver_center_no", -1),
(troop_get_slot, ":giver_party_no", "$g_talk_troop", slot_troop_leaded_party),
(try_begin),
Expand All @@ -23062,7 +23071,10 @@ def set_item_score():
(this_or_next|eq, ":center_faction", "fac_lorien"),
(this_or_next|eq, ":center_faction", "fac_woodelf"),
( eq, ":center_faction", "fac_imladris"),
(assign, ":cur_target_center", "p_town_woodsmen_village"),
(try_for_range, ":beorn_center", "p_town_woodsmen_village", "p_town_moria"),
(party_slot_eq, ":beorn_center", slot_center_destroyed, 0),
(assign, ":cur_target_center", ":beorn_center"),
(try_end),
(try_end),
(call_script, "script_get_tld_distance", "p_main_party", ":cur_target_center"),
#(display_log_message, "@DEBUG: Distance {reg0}", color_bad_news),
Expand Down Expand Up @@ -23128,7 +23140,7 @@ def set_item_score():
(party_add_template, "$qst_refugee_party_1", ":guards"),
(party_add_template, "$qst_refugee_party_1", ":guards"),
(try_begin),
(is_between, ":level", 12,17),
(is_between, ":level", 14,17),
(party_add_template, "$qst_refugee_party_1", ":guards"),
(else_try),
(ge, ":level", 17),
Expand All @@ -23144,7 +23156,7 @@ def set_item_score():
(party_add_template, "$qst_refugee_party_2", ":guards"),
(party_add_template, "$qst_refugee_party_2", ":guards"),
(try_begin),
(is_between, ":level", 12,17),
(is_between, ":level", 14,17),
(party_add_template, "$qst_refugee_party_2", ":guards"),
(else_try),
(ge, ":level", 17),
Expand All @@ -23160,7 +23172,7 @@ def set_item_score():
(party_add_template, "$qst_refugee_party_3", ":guards"),
(party_add_template, "$qst_refugee_party_3", ":guards"),
(try_begin),
(is_between, ":level", 12,17),
(is_between, ":level", 14,17),
(party_add_template, "$qst_refugee_party_3", ":guards"),
(else_try),
(ge, ":level", 17),
Expand Down
8 changes: 4 additions & 4 deletions ModuleSystem/module_troops.py
Expand Up @@ -1125,7 +1125,7 @@ def wp_melee(x):
attr_tier_3,wp_tier_3,knows_horse_archery_2|knows_riding_3|knows_power_draw_2|knows_power_throw_2,rohan_face_young_1,rohan_face_middle_2],
["veteran_skirmisher_of_rohan","Veteran_Skirmisher_of_Rohan","Veteran_Skirmishers_of_Rohan",tf_rohan| tfg_ranged| tf_mounted| tfg_armor| tfg_helm| tfg_horse| tfg_boots,0,0,fac_rohan,
[itm_rohan_light_greaves,itm_rohan_armor_j,itm_rohan_armor_k,itm_rohan_armor_l,itm_rohan_archer_helmet_a,itm_rohan_archer_helmet_b,itm_nomad_bow,itm_khergit_arrows,itm_rohirrim_long_hafted_axe,itm_rohan_sword_c,itm_rohirrim_long_hafted_axe,itm_rohan_shield_d,itm_rohan_shield_e,itm_rohan_shield_f,itm_rohirrim_courser,itm_rohirrim_courser2,],
attr_tier_4,wp_tier_4,knows_horse_archery_3|knows_riding_4|knows_power_draw_3|knows_power_strike_2|knows_ironflesh_1|knows_power_throw_3,rohan_face_middle_1,rohan_face_old_2],
attr_tier_4,wp_tier_4,knows_horse_archery_4|knows_riding_4|knows_power_draw_3|knows_power_strike_2|knows_ironflesh_1|knows_power_throw_3,rohan_face_middle_1,rohan_face_old_2],
["elite_skirmisher_of_rohan","Elite_Skirmisher_of_Rohan","Elite_Skirmishers_of_Rohan",tf_rohan| tfg_ranged| tf_mounted| tfg_shield| tfg_armor| tfg_helm| tfg_horse| tfg_boots,0,0,fac_rohan,
[itm_rohan_light_greaves,itm_rohan_armor_m,itm_rohan_armor_o,itm_rohan_archer_helmet_b,itm_rohan_archer_helmet_c,itm_strong_bow,itm_khergit_arrows,itm_rohan_sword_c,itm_rohan_shield_d,itm_rohan_shield_e,itm_rohan_shield_f,itm_rohan_warhorse,],
attr_tier_5,wp_tier_5,knows_horse_archery_5|knows_riding_6|knows_power_draw_4|knows_power_strike_2|knows_ironflesh_2|knows_power_throw_4,rohan_face_middle_1,rohan_face_old_2],
Expand Down Expand Up @@ -1218,7 +1218,7 @@ def wp_melee(x):
attr_evil_tier_3,wp_tier_3,knows_common|knows_horse_archery_2|knows_riding_3|knows_shield_1|knows_power_draw_2|knows_power_strike_2|knows_ironflesh_1,haradrim_face_1,haradrim_face_2],
["black_snake_horse_archer","Black_Snake_Horse_Archer","Black_Snake_Horse_Archers",tf_harad| tfg_ranged| tf_mounted| tfg_armor| tfg_helm| tfg_horse| tfg_boots,0,0,fac_harad,
[itm_harad_leather_greaves,itm_harad_archer,itm_harad_heavy_inf_helm,itm_nomad_bow,itm_harad_arrows,itm_harad_sabre,itm_harad_horse,],
attr_evil_tier_4,wp_tier_4,knows_common|knows_horse_archery_3|knows_riding_4|knows_power_draw_3|knows_power_strike_2|knows_ironflesh_1,haradrim_face_1,haradrim_face_2],
attr_evil_tier_4,wp_tier_4,knows_common|knows_horse_archery_4|knows_riding_4|knows_power_draw_3|knows_power_strike_2|knows_ironflesh_1,haradrim_face_1,haradrim_face_2],
["gold_serpent_horse_archer","Gold_Serpent_Horse_Archer","Gold_Serpent_Horse_Archers",tf_harad| tfg_ranged| tf_mounted| tfg_armor| tfg_helm| tfg_horse| tfg_boots,0,0,fac_harad,
[itm_harad_leather_greaves,itm_black_snake_armor,itm_black_snake_helm,itm_nomad_bow,itm_harad_arrows,itm_black_snake_sword,itm_harad_warhorse,],
attr_evil_tier_5,wp_tier_5,knows_common|knows_horse_archery_5|knows_riding_5|knows_power_strike_2|knows_ironflesh_3|knows_power_draw_3,haradrim_face_1,haradrim_face_2],
Expand Down Expand Up @@ -1625,10 +1625,10 @@ def wp_melee(x):
attr_orc_tier_2,wp_orc_tier_3,knows_riding_3|knows_horse_archery_2|knows_power_throw_2|knows_power_strike_2,orc_face9,orc_face8],
["warg_rider_gundabad","Gundabad_Warg_Rider","Gundabad_Warg_Riders",tf_orc| tf_mounted| tfg_armor| tfg_horse| tfg_boots| tf_no_capture_alive,0,0,fac_gundabad,
[itm_gundabad_armor_b,itm_gundabad_armor_b,itm_orc_machete,itm_orc_club_c,itm_orc_throwing_arrow,itm_orc_club_d,itm_orc_furboots,itm_orc_ragwrap,itm_warg_1c,itm_warg_1d,itm_warg_1b,itm_warg_1d,itm_orc_shield_b,],
attr_orc_tier_3,wp_orc_tier_4,knows_horse_archery_3|knows_riding_3|knows_power_throw_3|knows_power_strike_4,orc_face1,orc_face6],
attr_orc_tier_3,wp_orc_tier_4,knows_horse_archery_4|knows_riding_3|knows_power_throw_3|knows_power_strike_4,orc_face1,orc_face6],
["goblin_north_clan_rider","Goblin_North_Clan_Rider","Goblin_North_Clan_Riders",tf_orc| tf_mounted| tfg_armor| tfg_shield| tfg_helm| tfg_horse| tfg_boots|tfg_gloves| tf_no_capture_alive,0,0,fac_gundabad,
[itm_gundabad_helm_e,itm_gundabad_armor_b,itm_gundabad_armor_e,itm_orc_throwing_arrow,itm_orc_sabre,itm_orc_scimitar,itm_leather_gloves,itm_orc_furboots,itm_wargarmored_3a,itm_orc_shield_b,itm_orc_shield_a,],
str_11| agi_9| int_4| cha_4|level(20),wp_orc_tier_5,knows_horse_archery_4|knows_riding_5|knows_power_throw_4|knows_power_strike_4,orc_face3,orc_face6],
str_11| agi_9| int_4| cha_4|level(20),wp_orc_tier_5,knows_horse_archery_5|knows_riding_5|knows_power_throw_4|knows_power_strike_4,orc_face3,orc_face6],
["gundabad_items","BUG","_",tf_hero,0,0,fac_gundabad,
[itm_leather_boots,itm_metal_scraps_bad,itm_metal_scraps_medium,itm_metal_scraps_good,itm_leather_gloves,itm_warg_1b,itm_warg_1c,itm_warg_1d,itm_angmar_shield,itm_orc_bill,itm_orc_scimitar,itm_orc_machete,itm_orc_axe,itm_orc_two_handed_axe,itm_orc_greaves,],
0,0,0,0],
Expand Down

0 comments on commit e191a69

Please sign in to comment.