Skip to content

Commit

Permalink
*Bunch of quest or script related fixes: Scout camp failure; alternat…
Browse files Browse the repository at this point in the history
…e raise troops; berserk mode, Isengard guardian party quest, quest helper trigger (avoid party overflow)
  • Loading branch information
In-Vain committed Sep 2, 2020
1 parent 5eb9ee7 commit 5a43f25
Show file tree
Hide file tree
Showing 23 changed files with 1,233 additions and 1,222 deletions.
2 changes: 1 addition & 1 deletion ModuleSystem/module_constants.py
Expand Up @@ -1964,7 +1964,7 @@ def concatenate_scripts(block_list):
[(tableau_tld_tunic, [mesh_tableau_mesh_woodman_tunic]),],#fac_beorn = 20
]

## Reward items (rank number 0-9, item id, item modifier)
## Reward items (rank number 0-9, item id, item modifier); rank rewards; faction rewards
## TODO: fill out the list, these are test values
fac_reward_items_list = [
#fac_gondor
Expand Down
4 changes: 3 additions & 1 deletion ModuleSystem/module_dialogs.py
Expand Up @@ -2809,7 +2809,7 @@
(quest_get_slot, ":giver_troop", "qst_destroy_scout_camp", slot_quest_giver_troop),
(eq, "$g_talk_troop", ":giver_troop"),
(quest_get_slot, ":quest_target_center", "qst_destroy_scout_camp", slot_quest_target_center),
(str_store_faction_name,s12,":quest_target_center")],
(str_store_party_name,s12,":quest_target_center")],
"Our scouts near {s12}'s camp saw you and your men retreat. This is disappointing, {playername}. ^^Your failure resulted in the attack of vital supply lines. It will take some time to recover.", "destroy_scout_camp_failed",[
(call_script, "script_change_player_relation_with_troop", "$g_talk_troop", -2),

Expand Down Expand Up @@ -5123,6 +5123,7 @@
(eq, ":item_exists", 1),
(faction_get_slot, ":influence", "$g_talk_troop_faction", slot_faction_influence),
(store_mul, ":price", ":rank_index", 5), # reward item price = 5*rank
#(val_sub, ":price", 5),
(ge, ":influence", ":price"), # player has enough influence to buy?


Expand Down Expand Up @@ -5185,6 +5186,7 @@
(val_clamp, ":recent_events_morale", 0, 100), #GA overflow fixage
(party_set_morale, "p_main_party", ":recent_events_morale"), # update morale for cauldrons and such
(store_mul, ":price", ":rank_index", 5), # reward item price = 5*rank
#(val_sub, ":price", 5),
(call_script, "script_spend_influence_of", ":price", "$g_talk_troop_faction")
,]],

Expand Down
2 changes: 1 addition & 1 deletion ModuleSystem/module_game_menus.py
Expand Up @@ -11323,7 +11323,7 @@
(store_faction_of_party, ":town_faction", ":cur_town"),
(faction_get_slot, ":town_side", ":town_faction", slot_faction_side),
(eq, ":town_side", ":fac_side"),
(store_distance_to_party_from_party, ":dist", ":cur_town", "$g_talk_troop"),
(store_distance_to_party_from_party, ":dist", ":cur_town", "p_main_party"),
(lt, ":dist", ":minimum_dist"),
(assign, ":minimum_dist", ":dist"),
(assign, ":closest_town", ":cur_town"),
Expand Down
1 change: 1 addition & 0 deletions ModuleSystem/module_mission_templates_TLD.py
Expand Up @@ -1722,6 +1722,7 @@
(try_begin), # Player has berserker trait?
(troop_slot_eq, "trp_traits", slot_trait_berserker, 1),
(troop_get_inventory_slot, ":armor", "trp_player", ek_body),
(this_or_next|eq, ":armor", -1),
(item_slot_eq, ":armor", slot_item_light_armor, 1),
(display_message, "@You are filled with just rage as you set your eyes upon the enemy (Berserk active).", color_neutral_news),
(try_end),
Expand Down
2 changes: 1 addition & 1 deletion ModuleSystem/module_mission_templates_morale.py
Expand Up @@ -37,7 +37,7 @@
(call_script, "script_cf_agent_get_morale", ":agent"),
(agent_get_troop_id, ":troop", ":agent"),
(str_store_troop_name, s1, ":troop"),
(display_message, "@{s1}'s morale: {reg1}"),
#(display_message, "@{s1}'s morale: {reg1}"),
(try_end),
]),

Expand Down
1 change: 1 addition & 0 deletions ModuleSystem/module_scripts.py
Expand Up @@ -5242,6 +5242,7 @@ def set_item_score():
(store_troop_faction, ":lord_fac", ":lords"),
(eq, ":lord_fac", ":attacking_faction"),
(troop_get_slot, ":lord_party", ":lords", slot_troop_leaded_party),
(gt, ":lord_party", 0),
(party_set_slot, ":lord_party", slot_party_scripted_ai, 0),
(try_end),
(try_end),
Expand Down
9 changes: 9 additions & 0 deletions ModuleSystem/module_simple_triggers.py
Expand Up @@ -3800,6 +3800,9 @@
(neg|check_quest_concluded, "qst_eliminate_patrols"),
(quest_get_slot, ":target", "qst_eliminate_patrols", slot_quest_target_party_template),
(quest_get_slot, ":center", "qst_eliminate_patrols", slot_quest_target_center),
(quest_get_slot, ":target_amount", "qst_eliminate_patrols", slot_quest_target_amount),
(quest_get_slot, ":defeated", "qst_eliminate_patrols", slot_quest_current_state),
(lt, ":defeated", ":target_amount"), #Additional check. The above neg|check_quest_concluded doesn't seem to work, parties kept spawning.
(gt, ":center", 0),
(set_spawn_radius, 5),
(spawn_around_party, ":center", ":target"),
Expand All @@ -3818,6 +3821,9 @@
(neg|check_quest_concluded, "qst_deal_with_looters"),
(quest_get_slot, ":party_template", "qst_deal_with_looters", slot_quest_target_party_template),
(quest_get_slot, ":target_center", "qst_deal_with_looters", slot_quest_target_center),
(quest_get_slot, ":target_amount", "qst_deal_with_looters", slot_quest_target_amount),
(quest_get_slot, ":defeated", "qst_deal_with_looters", slot_quest_current_state),
(lt, ":defeated", ":target_amount"), #Additional check. The above neg|check_quest_concluded doesn't seem to work, parties kept spawning.
(gt, ":target_center", 0),
(store_distance_to_party_from_party, ":distance", "p_main_party", ":target_center"),
(le, ":distance", 20), #only spawn looters if the player is still in the area
Expand All @@ -3833,6 +3839,9 @@
(neg|check_quest_concluded, "qst_blank_quest_17"),
(quest_get_slot, ":target_template", "qst_blank_quest_17", slot_quest_target_party_template),
(quest_get_slot, ":target_troop", "qst_blank_quest_17", slot_quest_target_troop),
(quest_get_slot, ":target_amount", "qst_blank_quest_17", slot_quest_target_amount),
(quest_get_slot, ":defeated", "qst_blank_quest_17", slot_quest_current_state),
(lt, ":defeated", ":target_amount"), #Additional check. The above neg|check_quest_concluded doesn't seem to work, parties kept spawning.
(set_spawn_radius, 7),
(spawn_around_party, "p_main_party", ":target_template"),
(assign, ":spawned", reg0),
Expand Down
Binary file modified _wb/Resource/materials.brf
Binary file not shown.

0 comments on commit 5a43f25

Please sign in to comment.