Skip to content

Commit

Permalink
*Prepare New Quests for team testing + small change to Siege AI (rein…
Browse files Browse the repository at this point in the history
…forcement scripted destination)
  • Loading branch information
khamukkamu committed Oct 17, 2017
1 parent b5348e2 commit e4f5603
Show file tree
Hide file tree
Showing 25 changed files with 2,680 additions and 2,160 deletions.
13 changes: 7 additions & 6 deletions ModuleSystem/ID/ID_mission_templates.py
Expand Up @@ -52,9 +52,10 @@
mst_sorcerer_mission = 51
mst_battle_wall_mission = 52
mst_animal_ambush = 53
mst_intro_rohan = 54
mst_intro_gondor = 55
mst_intro_mordor = 56
mst_intro_joke = 57
mst_test_gandalf = 58
mst_conversation_cutscene = 59
mst_hunt_down_refugees = 54
mst_intro_rohan = 55
mst_intro_gondor = 56
mst_intro_mordor = 57
mst_intro_joke = 58
mst_test_gandalf = 59
mst_conversation_cutscene = 60
56 changes: 54 additions & 2 deletions ModuleSystem/module_dialogs.py
Expand Up @@ -2674,7 +2674,7 @@
(check_quest_failed, "qst_blank_quest_01"),],
"{playername}, I have received reports that the refugees were intercepted by raiders and were all slaughtered. This is very disappointing...", "lord_defend_refugees_failed", []],

[anyone|plyr,"lord_defend_refugees_failed", [],
[anyone|plyr,"lord_defend_refugees_failed", [(str_store_troop_name, s65, "$g_talk_troop")],
"Forgive me, {s65}, I was unable to defend them.", "lord_defend_refugees_failed_1a", []],

[anyone,"lord_defend_refugees_failed_1a", [],
Expand Down Expand Up @@ -2721,6 +2721,58 @@

## Defend Refugees Completion Dialogues END - Kham

## Hunt Down Refugees Completion Dialogues - Kham

[anyone,"lord_start", [(check_quest_active,"qst_blank_quest_02"),
(check_quest_succeeded, "qst_blank_quest_02")],
"I have received reports that the refugees were all killed, and that prisoner trains will be coming soon... You did well, {playername}. This is only the beginning, we shall rule over this land soon enough.", "lord_generic_mission_completed",
[(call_script, "script_finish_quest", "qst_blank_quest_02", 100),
(call_script, "script_cf_get_random_enemy_center_in_theater","p_main_party"),
(store_faction_of_party, ":faction", reg0),
(str_store_faction_name, s1, ":faction"),
(faction_get_slot,":enemy_strength",":faction",slot_faction_strength_tmp),
(val_sub, ":enemy_strength", 75), #75 Str Points reduction for completing the quest
(display_message, "@Killing the refugees from {s1} and enslaving the survivors have demoralized their people ({s1} has lost {reg19} faction strength).", color_good_news),
(faction_set_slot,":faction",slot_faction_strength_tmp,":enemy_strength"), ]],

[anyone,"lord_start", [ (check_quest_active,"qst_blank_quest_02"),
(check_quest_failed, "qst_blank_quest_02"),],
"{playername}, our spies tell us that you failed in intercepting all of the refugee trains. They are weak and slow, and still you fail. What use are you?", "lord_hunt_refugees_failed", []],

[anyone|plyr,"lord_hunt_refugees_failed", [(str_store_troop_name, s65, "$g_talk_troop")],
"They were slippery, {s65}. I was unable to track them down.", "lord_hunt_refugees_failed_1", []],

[anyone,"lord_hunt_refugees_failed_1", [],
"Maybe you are not good enough to command the armies that will bring this world to its heels if you cannot even defeat the wounded and the sick!^^ Begone, and pray I give you a second chance.", "lord_pretalk",
[(call_script, "script_change_player_relation_with_troop","$g_talk_troop",-1),
(call_script, "script_end_quest", "qst_blank_quest_02"),
(assign, reg18, "$qst_refugees_killed"),
(call_script, "script_cf_get_random_enemy_center_in_theater", "p_main_party"),
(store_faction_of_party, ":faction", reg0),
(str_store_faction_name, s1, ":faction"),
(faction_get_slot, ":enemy_strength", ":faction", slot_faction_strength_tmp),
(store_mul, ":reduction", 15, reg18), #15 victory points per refugee party killed
(assign, reg19, ":reduction"),
(assign, reg20, "$qst_refugees_escaped"),
(val_sub, ":enemy_strength", ":reduction"),
(try_begin),
(ge, "$qst_refugees_escaped",1),
(assign, ":vp", 20),
(else_try),
(assign, ":vp", 30),
(try_end),
(val_add, ":enemy_strength", ":vp"), #VP for enemy depends if there were refugees that escaped.
(assign, reg22, ":vp"),
(display_message, "@{reg20} refugee trains escaped and improved the enemy's morale ({s1} has gained {reg22} faction strength).", color_bad_news),
(try_begin),
(ge, "$qst_refugees_killed",1),
(display_message, "@You did, however, defeated {reg18} refugee trains, weakening the enemy's resolve ({s1} has lost {reg19} faction strength).", color_good_news),
(try_end),
(faction_set_slot, ":faction", slot_faction_strength_tmp, ":enemy_strength"), ]],


## Hunt Down Refugees Completion Dialogues END - Kham


[anyone,"lord_start", [(store_partner_quest,":lords_quest"),
(eq,":lords_quest","qst_bring_back_runaway_serfs"),
Expand Down Expand Up @@ -6569,7 +6621,7 @@
## Hunt Down Refugees INIT START
[anyone,"lord_tell_mission", [
(eq,"$random_quest_no","qst_blank_quest_02"),
(quest_get_slot, ":quest_target_center", "qst_blank_quest_01", slot_quest_target_center),
(quest_get_slot, ":quest_target_center", "qst_blank_quest_02", slot_quest_target_center),
(str_store_party_name, s6, ":quest_target_center")],
"Our spies tell us that there are refugees on their way to {s6}. They will be slow because of all the old, the sick, and the dying. Hunt them down, kill all the men, and take everyone else as slaves. Make sure none arrive at their destination!", "lord_mission_told",[
(quest_get_slot, ":quest_target_center", "$random_quest_no", slot_quest_target_center),
Expand Down
1 change: 1 addition & 0 deletions ModuleSystem/module_game_menus.py
Expand Up @@ -9722,6 +9722,7 @@
],
[("defend_refugees" ,[(check_quest_active, "qst_blank_quest_01")],"Keep your eye out for raiders...",[(change_screen_map)]),
("attack_refugees" ,[(check_quest_active, "qst_blank_quest_02")],"Attack the refugee train...",[(jump_to_menu, "mnu_simple_encounter")]),
("leave_refugees", [(check_quest_active, "qst_blank_quest_02")],"Leave them for now...", [(change_screen_map)]),
],
),
###################### Defend / Attack Refugees END (Kham) ##################################
Expand Down
191 changes: 191 additions & 0 deletions ModuleSystem/module_mission_templates.py
Expand Up @@ -3114,6 +3114,8 @@
(agent_get_team, ":reinforcement_team", ":agent_no"),
(try_begin),
(eq, "$gate_breached", 1),
(store_random_in_range, ":random", 0, 100),
(le, ":random", 75), #75% Chance troop is asked to go through the portal. Other than that, go to team destinations.
(entry_point_get_position, pos10, 42),
(agent_set_scripted_destination, ":agent_no", pos10),
] + (is_a_wb_mt==1 and [
Expand Down Expand Up @@ -5276,4 +5278,193 @@

]),

( "hunt_down_refugees",mtf_battle_mode,charge,
"You attack the refugee train.",
[(1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,18,[]),(0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
(4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,18,[]),(4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),
(5,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), # this needs be the 5th entry, for WARGS
(6,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), # this needs be the 6th entry, for WARGS
(7,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), # this needs be the 7th entry, for WARGS
(8,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), # this needs be the 8th entry, for WARGS
],
tld_common_wb_muddy_water +
formations_triggers + AI_triggers + common_deathcam_triggers + tld_common_battle_scripts + command_cursor_sub_mod + [
common_battle_tab_press,
common_music_situation_update,
(0,0,ti_once,[],[]),
common_battle_check_friendly_kills,
common_battle_check_victory_condition,
common_battle_victory_display,
common_battle_on_player_down,
common_battle_inventory,
(ti_question_answered, 0, 0, [],[
(store_trigger_param_1,":answer"),
(eq,":answer",0),
(assign, "$pin_player_fallen", 0),
(try_begin),
(store_mission_timer_a, ":elapsed_time"),
(gt, ":elapsed_time", 20),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 10, 20),
(try_end),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0)]),
(ti_before_mission_start, 0, 0, [],[(team_set_relation, 0, 2, 1),(team_set_relation, 1, 3, 1), (team_set_relation, 0,4,-1), (team_set_relation, 1,4,-1),(call_script, "script_place_player_banner_near_inventory_bms")]),
(0,0,ti_once,[],[
(assign,"$battle_won",0),
(assign,"$defender_reinforcement_stage",0),
(assign,"$attacker_reinforcement_stage",0),
(assign,"$g_presentation_battle_active", 0),
(call_script, "script_place_player_banner_near_inventory"),
(call_script, "script_combat_music_set_situation_with_culture"),
# ambience sounds
(try_begin),(is_currently_night),(play_sound, "$bs_night_sound", sf_looping),
(else_try), (play_sound, "$bs_day_sound", sf_looping),
(try_end),
(get_player_agent_no, "$current_player_agent"),
(agent_get_horse,"$horse_player","$current_player_agent"), #checks for horse lameness in mission
(troop_get_inventory_slot_modifier,"$horse_mod","trp_player",8),
]),
(1, 0, 5, [
(lt,"$defender_reinforcement_stage",8),
(store_mission_timer_a,":mission_time"),
(ge,":mission_time",10),
(store_normalized_team_count,":num_defenders", 0),
(lt,":num_defenders",10)
],[
(add_reinforcements_to_entry,0,10),
(val_add,"$defender_reinforcement_stage",1)]),
(1, 0, 5, [
(lt,"$attacker_reinforcement_stage",8),
(store_mission_timer_a,":mission_time"),
(ge,":mission_time",10),
(store_normalized_team_count,":num_attackers", 1),
(lt,":num_attackers",10)
],[
(add_reinforcements_to_entry,3,10),]),

(5, 0, ti_once, [
(store_mission_timer_a, ":mission_time_a"),
(store_random_in_range, ":ran_time", 45, 90),
(ge, ":mission_time_a", ":ran_time"), #Random time between 45 - 90 secs
],[

(call_script, "script_find_theater", "p_main_party"),

(assign, ":theater", reg0),
(assign, ":interloper", 0), #Interloper 0 = Default = Tribal Orcs
(assign, ":interloper_1", "trp_tribal_orc_warrior"),
(assign, ":interloper_2", "trp_tribal_orc"),

(store_random_in_range, ":random", 0, 100),

(try_begin),
(lt, ":random", 10), #10% Chance it is a troll!
(assign, ":interloper", 2), #Interloper 2 = Trolls
(assign, ":interloper_1", "trp_troll_of_moria"),
(assign, ":interloper_2", "trp_troll_of_moria"),
(else_try),
(is_between, ":random", 10, 36), #25% Chance it is an interloper from another Evil Faction
(assign, ":interloper", 1), #Interloper 1 = Evil Faction
(try_begin),
(eq, ":theater", theater_SE),
(assign, ":interloper_1", "trp_warg_rider_of_gorgoroth"),
(assign, ":interloper_2", "trp_orc_tracker_of_mordor"),
(str_store_faction_name, s31, "fac_mordor"),
(else_try),
(eq, ":theater", theater_SW),
(assign, ":interloper_1", "trp_warg_rider_of_isengard"),
(assign, ":interloper_2", "trp_large_uruk_hai_tracker"),
(str_store_faction_name, s31, "fac_isengard"),
(else_try),
(eq, ":theater", theater_C),
(assign, ":interloper_1", "trp_warg_rider_gundabad"),
(assign, ":interloper_2", "trp_keen_eyed_goblin_archer_gundabad"),
(str_store_faction_name, s31, "fac_gundabad"),
(else_try),
(assign, ":interloper_1", "trp_rhun_veteran_swift_horseman"),
(assign, ":interloper_2", "trp_rhun_veteran_horse_archer"),
(str_store_faction_name, s31, "fac_rhun"),
(try_end),
(else_try),
(is_between, ":random", 36, 61), #25% Chance it is good reinforcements
(assign, ":interloper", 3), #Interloper 3 = Good Faction
(try_begin),
(eq, ":theater", theater_SE),
(assign, ":interloper_1", "trp_squire_of_gondor"),
(assign, ":interloper_2", "trp_gondor_swordsmen"),
(str_store_faction_name, s31, "fac_gondor"),
(else_try),
(eq, ":theater", theater_SW),
(assign, ":interloper_1", "trp_veteran_skirmisher_of_rohan"),
(assign, ":interloper_2", "trp_squire_of_rohan"),
(str_store_faction_name, s31, "fac_rohan"),
(else_try),
(eq, ":theater", theater_C),
(assign, ":interloper_1", "trp_woodmen_skilled_forester"),
(assign, ":interloper_2", "trp_woodmen_scout"),
(str_store_faction_name, s31, "fac_beorn"),
(else_try),
(assign, ":interloper_1", "trp_laketown_scout"),
(assign, ":interloper_2", "trp_dale_pikeman"),
(str_store_faction_name, s31, "fac_dale"),
(try_end),
(try_end), #40% chance for tribal orcs

(try_begin),
(eq, ":interloper", 0),
(assign, ":range_end", 30),
(assign, ":team", 4),
(display_message, "@A band of tribal orcs have appeared!", color_bad_news),
(str_store_string, s30, "@Gaaaar!! We wants those human meat!"),
(call_script, "script_troop_talk_presentation", ":interloper_1", 7, 0),
(else_try),
(eq, ":interloper", 1),
(assign, ":range_end", 20),
(assign, ":team", 4),
(display_message, "@{s31} scouts have appeared!", color_bad_news),
(str_store_string, s30, "@Those are ours! We have been tracking them since they left! No one stands in our way!"),
(call_script, "script_troop_talk_presentation", ":interloper_1", 7, 0),
(else_try),
(eq, ":interloper", 2),
(assign, ":range_end", 3),
(assign, ":team", 4),
(display_message, "@Trolls appeared!"),
(str_store_string, s30, "@Gaaaar!!"),
(call_script, "script_troop_talk_presentation", ":interloper_1", 7, 0),
(else_try),
(eq, ":interloper", 3),
(assign, ":range_end", 20),
(assign, ":team", 1),
(display_message, "@{s31} scouts have appeared to aid the refugees!"),
(str_store_string, s30, "@Hurry, men! Help the refugees! Kill all the scum and do not let them escape!"),
(call_script, "script_troop_talk_presentation", ":interloper_1", 7, 0),
(try_end),

(get_player_agent_no, ":player"),
(call_script, "script_find_exit_position_at_pos4", ":player"),
(set_spawn_position, pos4),

(try_for_range, ":unused", 0, ":range_end"),
(store_random_in_range, ":rnd_troop", 0,100),
(le, ":rnd_troop", 50),
(spawn_agent, ":interloper_1"),
(agent_set_team, reg0, ":team"),
(else_try),
(spawn_agent, ":interloper_2"),
(agent_set_team, reg0, ":team"),
(try_end),

]),

#AI Triggers
(0, 0, ti_once,[(eq, "$tld_option_formations", 0),(store_mission_timer_a,":mission_time"),(ge,":mission_time",2)],[
(call_script, "script_select_battle_tactic"),
(call_script, "script_battle_tactic_init")]),
(5, 0, 0, [(eq, "$tld_option_formations", 0),(store_mission_timer_a,":mission_time"),(ge,":mission_time",3),(call_script, "script_battle_tactic_apply")], []),
common_battle_order_panel,
common_battle_order_panel_tick,

]),

] + mission_templates_cutscenes
19 changes: 17 additions & 2 deletions ModuleSystem/module_scripts.py
Expand Up @@ -11952,7 +11952,22 @@ def set_item_score():
(mission_tpl_entry_set_override_flags, "mt_lead_charge", 3, af_override_horse),
(try_end),
(set_party_battle_mode),
(set_jump_mission,"mt_lead_charge"),

(assign, ":mission", "mt_lead_charge"),

#Kham - Edited to accommodate new MTs for quests.
(try_begin),
(check_quest_active, "qst_blank_quest_02"),
(this_or_next|eq, "$g_encountered_party", "$qst_refugee_party_1"),
(this_or_next|eq, "$g_encountered_party", "$qst_refugee_party_2"),
( eq, "$g_encountered_party", "$qst_refugee_party_3"),
(assign, ":mission", "mt_hunt_down_refugees"),
(else_try),
(assign, ":mission", "mt_lead_charge"),
(try_end),
(set_jump_mission,":mission"),
#Kham - End

(call_script, "script_jump_to_random_scene","$current_player_region","$current_player_terrain","$current_player_landmark"),
(assign, "$g_next_menu", "mnu_simple_encounter"),
(jump_to_menu, "mnu_battle_debrief"),
Expand Down Expand Up @@ -22968,7 +22983,7 @@ def set_item_score():
(this_or_next|neq, ":center_faction", "fac_woodelf"),
( neq, ":center_faction", "fac_imladris"),
(call_script, "script_get_tld_distance", "p_main_party", ":cur_target_center"),
(le, reg0, 10),
(le, reg0, 20),
(neq, ":cur_target_center", ":giver_center_no"),#Skip current center

(assign, reg55, "pt_refugees"), #quest_target_party_template
Expand Down
1 change: 1 addition & 0 deletions ModuleSystem/module_scripts_morale.py
Expand Up @@ -223,6 +223,7 @@

(try_begin),
(agent_get_party_id, ":party_no", ":agent_no"),
(eq, ":party_no", "p_main_party"), #Only for Player Troops, so there are less AI routing.
(ge, ":party_no", 0),
(party_get_morale, ":map_morale", ":party_no"),
(try_begin),
Expand Down

0 comments on commit e4f5603

Please sign in to comment.